Skip to content

Commit

Permalink
feat: middleware changes (#1180)
Browse files Browse the repository at this point in the history
* Add signing properties customization hook implementation to sigv4 auth scheme, used via polymorphism in AuthSchemeMiddleware.

---------

Co-authored-by: Sichan Yoo <[email protected]>
  • Loading branch information
sichanyoo and Sichan Yoo authored Oct 25, 2023
1 parent 981f9f9 commit f18ac03
Showing 1 changed file with 7 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,11 @@ public struct SigV4AuthScheme: ClientRuntime.AuthScheme {
public let schemeID: String = "aws.auth#sigv4"
public let signer: ClientRuntime.Signer = AWSSigV4Signer()
public let idKind: ClientRuntime.IdentityKind = .aws

public func customizeSigningProperties(signingProperties: Attributes, context: HttpContext) -> Attributes {
var copy = signingProperties
copy.set(key: AttributeKeys.bidirectionalStreaming, value: context.isBidirectionalStreamingEnabled())
copy.set(key: AttributeKeys.signingRegion, value: context.getSigningRegion())
return copy
}
}

0 comments on commit f18ac03

Please sign in to comment.