Skip to content

Commit 98a8e90

Browse files
Steven Yuansyall
authored andcommitted
feat(experimentalIdentityAndAuth): add @customAuth auth scheme to generic tests
1 parent 819fecf commit 98a8e90

File tree

2 files changed

+30
-0
lines changed

2 files changed

+30
-0
lines changed

smithy-typescript-codegen-test/model/main.smithy

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,16 @@ use smithy.test#httpRequestTests
77
use smithy.test#httpResponseTests
88
use smithy.waiters#waitable
99

10+
@authDefinition
11+
@trait
12+
structure customAuth {}
13+
1014
/// Provides weather forecasts.
1115
@fakeProtocol
1216
@httpApiKeyAuth(name: "X-Api-Key", in: "header")
1317
@httpBearerAuth
1418
@sigv4(name: "weather")
19+
@customAuth
1520
@auth([sigv4])
1621
@paginated(inputToken: "nextToken", outputToken: "nextToken", pageSize: "pageSize")
1722
service Weather {
@@ -30,6 +35,8 @@ service Weather {
3035
OnlyHttpApiKeyAndBearerAuthReversed
3136
OnlySigv4Auth
3237
OnlySigv4AuthOptional
38+
OnlyCustomAuth
39+
OnlyCustomAuthOptional
3340
SameAsService
3441
]
3542
}
@@ -69,6 +76,15 @@ operation OnlyHttpBearerAuthOptional {}
6976
@optionalAuth
7077
operation OnlySigv4AuthOptional {}
7178

79+
@http(method: "GET", uri: "/OnlyCustomAuth")
80+
@auth([customAuth])
81+
operation OnlyCustomAuth {}
82+
83+
@http(method: "GET", uri: "/OnlyCustomAuthOptional")
84+
@auth([customAuth])
85+
@optionalAuth
86+
operation OnlyCustomAuthOptional {}
87+
7288
@http(method: "GET", uri: "/SameAsService")
7389
operation SameAsService {}
7490

smithy-typescript-codegen-test/smithy-build.json

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,20 @@
3838
"experimentalIdentityAndAuth": true
3939
}
4040
}
41+
},
42+
"control-experimental-identity-and-auth": {
43+
"plugins": {
44+
"typescript-codegen": {
45+
"service": "example.weather#Weather",
46+
"targetNamespace": "Weather",
47+
"package": "weather",
48+
"packageVersion": "0.0.1",
49+
"packageJson": {
50+
"license": "Apache-2.0",
51+
"private": true
52+
}
53+
}
54+
}
4155
}
4256
},
4357
"plugins": {

0 commit comments

Comments
 (0)