Skip to content

Commit 3689bde

Browse files
committed
No longer required to register STS authenticator as interceptor.
1 parent 5393554 commit 3689bde

File tree

3 files changed

+4
-11
lines changed

3 files changed

+4
-11
lines changed

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

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
import ch.cyberduck.core.s3.S3Session;
1313
import ch.cyberduck.core.ssl.X509KeyManager;
1414
import ch.cyberduck.core.ssl.X509TrustManager;
15-
import ch.cyberduck.core.sts.STSRequestInterceptor;
1615

1716
import org.apache.http.impl.client.HttpClientBuilder;
1817
import org.apache.logging.log4j.LogManager;
@@ -52,10 +51,7 @@ protected S3CredentialsStrategy configureCredentialsStrategy(final HttpClientBui
5251
if(host.getProtocol().isOAuthConfigurable()) {
5352
log.debug("Register interceptor {}", oauth);
5453
configuration.addInterceptorLast(oauth);
55-
final STSRequestInterceptor sts = new STSChainedAssumeRoleRequestInterceptor(hub, oauth, vaultId, host, trust, key, prompt);
56-
log.debug("Register interceptor {}", sts);
57-
configuration.addInterceptorLast(sts);
58-
return sts;
54+
return new STSChainedAssumeRoleRequestInterceptor(hub, oauth, vaultId, host, trust, key, prompt);
5955
}
6056
return super.configureCredentialsStrategy(configuration, prompt);
6157
}

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
import ch.cyberduck.core.preferences.PreferencesReader;
1717
import ch.cyberduck.core.ssl.X509KeyManager;
1818
import ch.cyberduck.core.ssl.X509TrustManager;
19-
import ch.cyberduck.core.sts.STSAssumeRoleWithWebIdentityRequestInterceptor;
19+
import ch.cyberduck.core.sts.STSAssumeRoleWithWebIdentityCredentialsStrategy;
2020

2121
import org.apache.commons.lang3.StringUtils;
2222
import org.apache.logging.log4j.LogManager;
@@ -33,7 +33,7 @@
3333
/**
3434
* Assume role with temporary credentials obtained using OIDC token from security token service (STS)
3535
*/
36-
public class STSChainedAssumeRoleRequestInterceptor extends STSAssumeRoleWithWebIdentityRequestInterceptor {
36+
public class STSChainedAssumeRoleRequestInterceptor extends STSAssumeRoleWithWebIdentityCredentialsStrategy {
3737
private static final Logger log = LogManager.getLogger(STSChainedAssumeRoleRequestInterceptor.class);
3838

3939
/**
@@ -81,7 +81,7 @@ public TemporaryAccessTokens assumeRoleWithWebIdentity(final OAuthTokens oauth,
8181
if(null == key) {
8282
throw new InteroperabilityException("No vault tag key set");
8383
}
84-
return super.assumeRole(credentials.setTokens(tokens)
84+
return super.assumeRole(bookmark.getCredentials().setTokens(tokens)
8585
.setProperty(Profile.STS_TAGS_PROPERTY_KEY, String.format("%s=%s", key, vaultId)),
8686
settings.getProperty(S3AssumeRoleProtocol.S3_ASSUMEROLE_ROLEARN_TAG));
8787
}

hub/src/test/java/cloud/katta/workflows/AbstractHubSynchronizeTest.java

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111
import ch.cyberduck.core.DisabledLoginCallback;
1212
import ch.cyberduck.core.DisabledPasswordCallback;
1313
import ch.cyberduck.core.ListService;
14-
import ch.cyberduck.core.OAuthTokens;
1514
import ch.cyberduck.core.Path;
1615
import ch.cyberduck.core.SimplePathPredicate;
1716
import ch.cyberduck.core.UUIDRandomStringService;
@@ -338,8 +337,6 @@ void test03AddVault(final HubTestConfig config) throws Exception {
338337
@MethodSource("arguments")
339338
void test04SetupCode(final HubTestConfig config) throws Exception {
340339
final HubSession hubSession = setupConnection(config.setup);
341-
assertEquals(OAuthTokens.EMPTY, hubSession.getHost().getCredentials().getOauth());
342-
assertEquals(StringUtils.EMPTY, hubSession.getHost().getCredentials().getPassword());
343340
final ListService feature = hubSession.getFeature(ListService.class);
344341
final AttributedList<Path> vaults = feature.list(Home.root(), new DisabledListProgressListener());
345342
assertEquals(vaults, feature.list(Home.root(), new DisabledListProgressListener()));

0 commit comments

Comments
 (0)