aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJames Letendre <James.Letendre@gmail.com>2020-12-15 16:37:46 -0500
committerbackportbot[bot] <backportbot[bot]@users.noreply.github.com>2021-02-02 20:52:18 +0000
commitb65b2bbf550f3947620de6e33d5ca505b7be6414 (patch)
tree4a2c8e4cd8476361ae30e8d6f1497698505644e0
parent5750d79181885d24654dda4ecf81bedeaa6aeb34 (diff)
downloadnextcloud-server-b65b2bbf550f3947620de6e33d5ca505b7be6414.tar.gz
nextcloud-server-b65b2bbf550f3947620de6e33d5ca505b7be6414.zip
Add web identity provider to S3 connection chain
Signed-off-by: James Letendre <james.letendre@gmail.com>
-rw-r--r--lib/private/Files/ObjectStore/S3ConnectionTrait.php17
1 files changed, 4 insertions, 13 deletions
diff --git a/lib/private/Files/ObjectStore/S3ConnectionTrait.php b/lib/private/Files/ObjectStore/S3ConnectionTrait.php
index 1a36683a300..9261dd5d137 100644
--- a/lib/private/Files/ObjectStore/S3ConnectionTrait.php
+++ b/lib/private/Files/ObjectStore/S3ConnectionTrait.php
@@ -106,22 +106,13 @@ trait S3ConnectionTrait {
CredentialProvider::chain(
$this->paramCredentialProvider(),
CredentialProvider::env(),
- CredentialProvider::instanceProfile()
+ CredentialProvider::assumeRoleWithWebIdentityCredentialProvider()
+ !empty(getenv(EcsCredentialProvider::ENV_URI))
+ ? CredentialProvider::ecsCredentials()
+ : CredentialProvider::instanceProfile()
)
);
- // If running in an ECS environment, then also include the ECS task role in the chain
- if (!empty(getenv(EcsCredentialProvider::ENV_URI))) {
- $provider = CredentialProvider::memoize(
- CredentialProvider::chain(
- $this->paramCredentialProvider(),
- CredentialProvider::env(),
- CredentialProvider::ecsCredentials(),
- CredentialProvider::instanceProfile()
- )
- );
- }
-
$options = [
'version' => isset($this->params['version']) ? $this->params['version'] : 'latest',
'credentials' => $provider,