summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRoeland Jago Douma <rullzer@users.noreply.github.com>2021-02-05 11:21:20 +0100
committerGitHub <noreply@github.com>2021-02-05 11:21:20 +0100
commitf24ce39733f9eaef0c58e3272319951589ab580f (patch)
tree50f42342876b1f9275c932e32450263a56b2fee0
parentba63f588e7912a9953650a9231b1729f9c3cce49 (diff)
parent74d90d01654171fbc085216180da378327d64b7b (diff)
downloadnextcloud-server-f24ce39733f9eaef0c58e3272319951589ab580f.tar.gz
nextcloud-server-f24ce39733f9eaef0c58e3272319951589ab580f.zip
Merge pull request #25451 from nextcloud/backport/24700/stable21
[stable21] Resolves #24699, Support ES2 and ECS instance providers for S3 buckets
-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()
)
);