Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add log debug to signing stages to know approach #4524

Merged
merged 1 commit into from
Oct 3, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -47,11 +47,14 @@
import software.amazon.awssdk.http.auth.spi.signer.SignedRequest;
import software.amazon.awssdk.identity.spi.Identity;
import software.amazon.awssdk.metrics.MetricCollector;
import software.amazon.awssdk.utils.Logger;

@SdkInternalApi
public class AsyncSigningStage implements RequestPipeline<SdkHttpFullRequest,
CompletableFuture<SdkHttpFullRequest>> {

private static final Logger log = Logger.loggerFor(AsyncSigningStage.class);

private final HttpClientDependencies dependencies;

public AsyncSigningStage(HttpClientDependencies dependencies) {
Expand All @@ -67,6 +70,7 @@ public CompletableFuture<SdkHttpFullRequest> execute(SdkHttpFullRequest request,
SelectedAuthScheme<?> selectedAuthScheme =
context.executionAttributes().getAttribute(SdkInternalExecutionAttribute.SELECTED_AUTH_SCHEME);
if (shouldDoSraSigning(context, selectedAuthScheme)) {
log.debug(() -> String.format("Using SelectedAuthScheme: %s", selectedAuthScheme.authSchemeOption().schemeId()));
return sraSignRequest(request, context, selectedAuthScheme);
}
return signRequest(request, context);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@
import software.amazon.awssdk.identity.spi.Identity;
import software.amazon.awssdk.metrics.MetricCollector;
import software.amazon.awssdk.utils.CompletableFutureUtils;
import software.amazon.awssdk.utils.Logger;
import software.amazon.awssdk.utils.Pair;

/**
Expand All @@ -51,6 +52,8 @@
@SdkInternalApi
public class SigningStage implements RequestToRequestPipeline {

private static final Logger log = Logger.loggerFor(SigningStage.class);

private final HttpClientDependencies dependencies;

public SigningStage(HttpClientDependencies dependencies) {
Expand All @@ -67,6 +70,7 @@ public SdkHttpFullRequest execute(SdkHttpFullRequest request, RequestExecutionCo
SelectedAuthScheme<?> selectedAuthScheme =
context.executionAttributes().getAttribute(SdkInternalExecutionAttribute.SELECTED_AUTH_SCHEME);
if (shouldDoSraSigning(context, selectedAuthScheme)) {
log.debug(() -> String.format("Using SelectedAuthScheme: %s", selectedAuthScheme.authSchemeOption().schemeId()));
return sraSignRequest(request, context, selectedAuthScheme);
}
return signRequest(request, context);
Expand Down
Loading