Skip to content

Commit 2880ca3

Browse files
committed
Allow configuration of tag key name in profile.
1 parent 06fe587 commit 2880ca3

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

hub/src/main/java/cloud/katta/protocols/s3/STSChainedAssumeRoleRequestInterceptor.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
import ch.cyberduck.core.TemporaryAccessTokens;
1212
import ch.cyberduck.core.exception.BackgroundException;
1313
import ch.cyberduck.core.oauth.OAuth2RequestInterceptor;
14+
import ch.cyberduck.core.preferences.HostPreferencesFactory;
1415
import ch.cyberduck.core.preferences.PreferencesReader;
1516
import ch.cyberduck.core.preferences.ProxyPreferencesReader;
1617
import ch.cyberduck.core.ssl.X509KeyManager;
@@ -56,7 +57,8 @@ public TemporaryAccessTokens assumeRoleWithWebIdentity(final Credentials credent
5657
// Assume role with previously obtained temporary access token
5758
return super.assumeRole(credentials.withTokens(tokens)
5859
.withProperty(Profile.STS_ROLE_ARN_PROPERTY_KEY, settings.getProperty(S3AssumeRoleProtocol.S3_ASSUMEROLE_ROLEARN_TAG))
59-
.withProperty(Profile.STS_TAGS_PROPERTY_KEY, String.format("%s=%s", "Vault", settings.getProperty(S3AssumeRoleProtocol.OAUTH_TOKENEXCHANGE_VAULT)))
60+
.withProperty(Profile.STS_TAGS_PROPERTY_KEY, String.format("%s=%s", HostPreferencesFactory.get(bookmark).getProperty("s3.assumerole.rolearn.tag.vaultid.key"),
61+
settings.getProperty(S3AssumeRoleProtocol.OAUTH_TOKENEXCHANGE_VAULT)))
6062
);
6163
}
6264
return tokens;

hub/src/test/resources/Katta S3 Storage Configuration.cyberduckprofile

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,5 +34,10 @@
3434
<false/>
3535
<key>Authorization</key>
3636
<string>AuthorizationCode</string>
37+
<key>Properties</key>
38+
<dict>
39+
<key>s3.assumerole.rolearn.tag.vaultid.key</key>
40+
<string>Vault</string>
41+
</dict>
3742
</dict>
3843
</plist>

0 commit comments

Comments
 (0)