Skip to content

Commit

Permalink
feat(experimentalIdentityAndAuth): add more auth traits to generic cl…
Browse files Browse the repository at this point in the history
…ient tests
  • Loading branch information
Steven Yuan committed Aug 17, 2023
1 parent 55f2fc6 commit b019a46
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 1 deletion.
1 change: 1 addition & 0 deletions smithy-typescript-codegen-test/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -47,4 +47,5 @@ dependencies {
implementation(project(":smithy-typescript-ssdk-codegen-test-utils"))
implementation("software.amazon.smithy:smithy-waiters:$smithyVersion")
implementation("software.amazon.smithy:smithy-protocol-test-traits:$smithyVersion")
implementation("software.amazon.smithy:smithy-aws-traits:$smithyVersion")
}
38 changes: 37 additions & 1 deletion smithy-typescript-codegen-test/model/main.smithy
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,48 @@ use smithy.waiters#waitable
/// Provides weather forecasts.
@fakeProtocol
@httpApiKeyAuth(name: "X-Api-Key", in: "header")
@httpBearerAuth
@aws.auth#sigv4(name: "weather")
@auth([aws.auth#sigv4])
@paginated(inputToken: "nextToken", outputToken: "nextToken", pageSize: "pageSize")
service Weather {
version: "2006-03-01"
resources: [City]
operations: [GetCurrentTime, Invoke]
operations: [
GetCurrentTime
OnlyHttpApiKeyAuth
OnlyHttpBearerAuth
OnlyHttpApiKeyAndBearerAuth
OnlyHttpApiKeyAndBearerAuthReversed
OnlyHttpApiKeyAuthOptional
SameAsService
]
}

@http(method: "GET", uri: "/OnlyHttpApiKeyAuth")
@auth([httpApiKeyAuth])
operation OnlyHttpApiKeyAuth {}

@http(method: "GET", uri: "/OnlyHttpBearerAuth")
@auth([httpBearerAuth])
operation OnlyHttpBearerAuth {}

@http(method: "GET", uri: "/OnlyHttpApiKeyAndBearerAuth")
@auth([httpApiKeyAuth, httpBearerAuth])
operation OnlyHttpApiKeyAndBearerAuth {}

@http(method: "GET", uri: "/OnlyHttpApiKeyAndBearerAuthReversed")
@auth([httpBearerAuth, httpApiKeyAuth])
operation OnlyHttpApiKeyAndBearerAuthReversed {}

@http(method: "GET", uri: "/OnlyHttpApiKeyAuthOptional")
@auth([httpApiKeyAuth])
@optionalAuth
operation OnlyHttpApiKeyAuthOptional {}

@http(method: "GET", uri: "/SameAsService")
operation SameAsService {}

resource City {
identifiers: {cityId: CityId}
create: CreateCity
Expand Down Expand Up @@ -285,6 +320,7 @@ structure InvokeOutput {

@readonly
@http(method: "GET", uri: "/cities/{cityId}/forecast")
@auth([])
operation GetForecast {
input: GetForecastInput
output: GetForecastOutput
Expand Down

0 comments on commit b019a46

Please sign in to comment.