Skip to content

Commit

Permalink
Review.
Browse files Browse the repository at this point in the history
  • Loading branch information
dkocher committed Sep 20, 2023
1 parent 6154ba9 commit 2f450cc
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 11 deletions.
9 changes: 5 additions & 4 deletions s3/src/main/java/ch/cyberduck/core/s3/S3Session.java
Original file line number Diff line number Diff line change
Expand Up @@ -194,10 +194,11 @@ protected RequestEntityRestStorageService connect(final Proxy proxy, final HostK
.withRedirectUri(host.getProtocol().getOAuthRedirectUrl())
.withFlowType(OAuth2AuthorizationService.FlowType.valueOf(host.getProtocol().getAuthorization()));
configuration.addInterceptorLast(oauth);
final STSAssumeRoleCredentialsRequestInterceptor sts = new STSAssumeRoleCredentialsRequestInterceptor(oauth, this, trust, key, prompt, cancel);
configuration.addInterceptorLast(sts);
configuration.setServiceUnavailableRetryStrategy(new S3AuthenticationResponseInterceptor(this, sts));
authentication = sts;
final STSAssumeRoleCredentialsRequestInterceptor interceptor
= new STSAssumeRoleCredentialsRequestInterceptor(oauth, this, trust, key, prompt);
configuration.addInterceptorLast(interceptor);
configuration.setServiceUnavailableRetryStrategy(new S3AuthenticationResponseInterceptor(this, interceptor));
authentication = interceptor;
}
else {
if(S3Session.isAwsHostname(host.getHostname())) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
*/

import ch.cyberduck.core.Credentials;
import ch.cyberduck.core.Host;
import ch.cyberduck.core.HostPasswordStore;
import ch.cyberduck.core.LoginCallback;
import ch.cyberduck.core.OAuthTokens;
Expand All @@ -29,7 +28,6 @@
import ch.cyberduck.core.s3.S3Session;
import ch.cyberduck.core.ssl.X509KeyManager;
import ch.cyberduck.core.ssl.X509TrustManager;
import ch.cyberduck.core.threading.CancelCallback;

import org.apache.http.HttpException;
import org.apache.http.HttpRequest;
Expand Down Expand Up @@ -61,17 +59,13 @@ public class STSAssumeRoleCredentialsRequestInterceptor extends STSAssumeRoleAut
*/
private final OAuth2RequestInterceptor oauth;
private final S3Session session;
private final Host host;
private final CancelCallback cancel;

public STSAssumeRoleCredentialsRequestInterceptor(final OAuth2RequestInterceptor oauth, final S3Session session,
final X509TrustManager trust, final X509KeyManager key,
final LoginCallback prompt, final CancelCallback cancel) {
final LoginCallback prompt) {
super(session.getHost(), trust, key, prompt);
this.oauth = oauth;
this.session = session;
this.host = session.getHost();
this.cancel = cancel;
}

public TemporaryAccessTokens refresh(final OAuthTokens oidc) throws BackgroundException {
Expand Down

0 comments on commit 2f450cc

Please sign in to comment.