-
Notifications
You must be signed in to change notification settings - Fork 81
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: tie up some loose ends (#1300)
* Add S3 control to list of services that use signed body & fix wrong method name in SigV4Util. --------- Co-authored-by: Sichan Yoo <chanyoo@amazon.com>
- Loading branch information
Showing
1,888 changed files
with
115,124 additions
and
357,655 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
// Code generated by smithy-swift-codegen. DO NOT EDIT! | ||
|
||
import ClientRuntime | ||
|
||
public struct ACMAuthSchemeResolverParameters: ClientRuntime.AuthSchemeResolverParameters { | ||
public let operation: String | ||
// Region is used for SigV4 auth scheme | ||
public let region: String? | ||
} | ||
|
||
public protocol ACMAuthSchemeResolver: ClientRuntime.AuthSchemeResolver { | ||
// Intentionally empty. | ||
// This is the parent protocol that all auth scheme resolver implementations of | ||
// the service ACM must conform to. | ||
} | ||
|
||
public struct DefaultACMAuthSchemeResolver: ACMAuthSchemeResolver { | ||
public func resolveAuthScheme(params: ClientRuntime.AuthSchemeResolverParameters) throws -> [AuthOption] { | ||
var validAuthOptions = [AuthOption]() | ||
guard let serviceParams = params as? ACMAuthSchemeResolverParameters else { | ||
throw ClientError.authError("Service specific auth scheme parameters type must be passed to auth scheme resolver.") | ||
} | ||
switch serviceParams.operation { | ||
default: | ||
var sigV4Option = AuthOption(schemeID: "aws.auth#sigv4") | ||
sigV4Option.signingProperties.set(key: AttributeKeys.signingName, value: "acm") | ||
guard let region = serviceParams.region else { | ||
throw ClientError.authError("Missing region in auth scheme parameters for SigV4 auth scheme.") | ||
} | ||
sigV4Option.signingProperties.set(key: AttributeKeys.signingRegion, value: region) | ||
validAuthOptions.append(sigV4Option) | ||
} | ||
return validAuthOptions | ||
} | ||
|
||
public func constructParameters(context: HttpContext) throws -> ClientRuntime.AuthSchemeResolverParameters { | ||
guard let opName = context.getOperation() else { | ||
throw ClientError.dataNotFound("Operation name not configured in middleware context for auth scheme resolver params construction.") | ||
} | ||
let opRegion = context.getRegion() | ||
return ACMAuthSchemeResolverParameters(operation: opName, region: opRegion) | ||
} | ||
} |
Oops, something went wrong.