Skip to content

Commit 37a8855

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

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 Server.cyberduckprofile

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,5 +38,10 @@
3838
<false/>
3939
<key>Username Configurable</key>
4040
<false/>
41+
<key>Properties</key>
42+
<dict>
43+
<key>s3.assumerole.rolearn.tag.vaultid.key</key>
44+
<string>Vault</string>
45+
</dict>
4146
</dict>
4247
</plist>

0 commit comments

Comments
 (0)