Skip to content

Commit 03aa83f

Browse files
authored
feat: make user-supplied region available to credentials providers (#906)
1 parent 7c924ed commit 03aa83f

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

runtime/protocol/http-client/common/src/aws/smithy/kotlin/runtime/http/operation/SdkOperationExecution.kt

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ import aws.smithy.kotlin.runtime.http.response.HttpCall
2020
import aws.smithy.kotlin.runtime.http.response.HttpResponse
2121
import aws.smithy.kotlin.runtime.http.response.complete
2222
import aws.smithy.kotlin.runtime.http.response.dumpResponse
23-
import aws.smithy.kotlin.runtime.io.*
23+
import aws.smithy.kotlin.runtime.io.Handler
2424
import aws.smithy.kotlin.runtime.io.middleware.Middleware
2525
import aws.smithy.kotlin.runtime.io.middleware.Phase
2626
import aws.smithy.kotlin.runtime.operation.ExecutionContext
@@ -275,10 +275,13 @@ internal class AuthHandler<Input, Output>(
275275
"auth.scheme_id" to authScheme.schemeId.id
276276
}
277277

278+
// properties need to propagate from AuthOption to signer and identity provider
279+
request.context.merge(authOption.attributes)
280+
278281
// resolve identity from the selected auth scheme
279282
val identityProvider = authScheme.identityProvider(authConfig.identityProviderConfig)
280283
val identity = request.context.operationMetrics.resolveIdentityDuration.measureSeconds(schemeAttr) {
281-
identityProvider.resolve(authOption.attributes)
284+
identityProvider.resolve(request.context)
282285
}
283286

284287
val resolveEndpointReq = ResolveEndpointRequest(request.context, request.subject.immutableView(), identity)
@@ -296,8 +299,6 @@ internal class AuthHandler<Input, Output>(
296299

297300
interceptors.readBeforeSigning(modified.subject.immutableView())
298301

299-
// signing properties need to propagate from AuthOption to signer
300-
modified.context.merge(authOption.attributes)
301302
val signingRequest = SignHttpRequest(modified.subject, identity, modified.context)
302303

303304
request.context.operationMetrics.signingDuration.measureSeconds(schemeAttr) {

0 commit comments

Comments
 (0)