diff options
author | Stephen Cuppett <steve@cuppett.com> | 2021-06-13 07:12:43 -0400 |
---|---|---|
committer | Stephen Cuppett <steve@cuppett.com> | 2021-11-22 07:04:48 -0500 |
commit | 4a6a2c2b482e2b34d25d03c9e859078570717a39 (patch) | |
tree | ed0bdaa89253059b73ae91fa1367daa4d62efb7b /lib | |
parent | 68fecc1d9f6810e815c6a6ba80d4c13a0bde98b8 (diff) | |
download | nextcloud-server-4a6a2c2b482e2b34d25d03c9e859078570717a39.tar.gz nextcloud-server-4a6a2c2b482e2b34d25d03c9e859078570717a39.zip |
Simplify S3ConnectionTrait to defaultProvider plus option
When we initially added the EC2 and ECS IAM role support in #24700,
we had to use a workaround by explicitly ordering the various providers
due to an inconsistency in the AWS SDK for PHP. We submitted a PR there
to get that squared away. Now, we've consumed that version upstream
for the SDK and can update our code here to be the most concise version
as well as position ourselves to pick up new methods as those become
available and prevalent in AWS (for acquiring credentials).
See also: https://github.com/nextcloud/server/pull/24700#issuecomment-747650892
See also: https://github.com/aws/aws-sdk-php/pull/2172
Signed-off-by: Stephen Cuppett <steve@cuppett.com>
Diffstat (limited to 'lib')
-rw-r--r-- | lib/private/Files/ObjectStore/S3ConnectionTrait.php | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/lib/private/Files/ObjectStore/S3ConnectionTrait.php b/lib/private/Files/ObjectStore/S3ConnectionTrait.php index c99ebdbcd5c..6d6d8684153 100644 --- a/lib/private/Files/ObjectStore/S3ConnectionTrait.php +++ b/lib/private/Files/ObjectStore/S3ConnectionTrait.php @@ -109,15 +109,11 @@ trait S3ConnectionTrait { $base_url = $scheme . '://' . $this->params['hostname'] . ':' . $this->params['port'] . '/'; // Adding explicit credential provider to the beginning chain. - // Including environment variables and IAM instance profiles. + // Including default credential provider (skipping AWS shared config files). $provider = CredentialProvider::memoize( CredentialProvider::chain( $this->paramCredentialProvider(), - CredentialProvider::env(), - CredentialProvider::assumeRoleWithWebIdentityCredentialProvider(), - !empty(getenv(EcsCredentialProvider::ENV_URI)) - ? CredentialProvider::ecsCredentials() - : CredentialProvider::instanceProfile() + CredentialProvider::defaultProvider(['use_aws_shared_config_files' => false]) ) ); |