summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorRoeland Jago Douma <rullzer@users.noreply.github.com>2021-02-02 21:48:22 +0100
committerGitHub <noreply@github.com>2021-02-02 21:48:22 +0100
commit137636b651168712ee88beaa8ac0483e38bf42b4 (patch)
treed526dcd766a884376a39d8e71d90fc9ad1f24473 /lib
parent5c6d24566181c6327f266b467396172fd08e7d95 (diff)
parent45a02ee30cced137fad421e47d30e07b0d292015 (diff)
downloadnextcloud-server-137636b651168712ee88beaa8ac0483e38bf42b4.tar.gz
nextcloud-server-137636b651168712ee88beaa8ac0483e38bf42b4.zip
Merge pull request #24700 from Imajie/s3-creds
Resolves #24699, Support ES2 and ECS instance providers for S3 buckets
Diffstat (limited to 'lib')
-rw-r--r--lib/private/Files/ObjectStore/S3ConnectionTrait.php6
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/private/Files/ObjectStore/S3ConnectionTrait.php b/lib/private/Files/ObjectStore/S3ConnectionTrait.php
index 6b469860de5..d88ef0ac8e7 100644
--- a/lib/private/Files/ObjectStore/S3ConnectionTrait.php
+++ b/lib/private/Files/ObjectStore/S3ConnectionTrait.php
@@ -32,6 +32,7 @@ namespace OC\Files\ObjectStore;
use Aws\ClientResolver;
use Aws\Credentials\CredentialProvider;
+use Aws\Credentials\EcsCredentialProvider;
use Aws\Credentials\Credentials;
use Aws\Exception\CredentialsException;
use Aws\S3\Exception\S3Exception;
@@ -105,7 +106,10 @@ trait S3ConnectionTrait {
CredentialProvider::chain(
$this->paramCredentialProvider(),
CredentialProvider::env(),
- CredentialProvider::instanceProfile()
+ CredentialProvider::assumeRoleWithWebIdentityCredentialProvider(),
+ !empty(getenv(EcsCredentialProvider::ENV_URI))
+ ? CredentialProvider::ecsCredentials()
+ : CredentialProvider::instanceProfile()
)
);