Skip to content

Commit 8090f76

Browse files
author
Steven Yuan
committed
feat(experimentalIdentityAndAuth): copy smithy-typescript generic auth tests
1 parent 47a5c61 commit 8090f76

File tree

3 files changed

+134
-0
lines changed

3 files changed

+134
-0
lines changed

codegen/generic-client-test-codegen/build.gradle.kts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ plugins {
3636

3737
dependencies {
3838
implementation("software.amazon.smithy:smithy-aws-protocol-tests:$smithyVersion")
39+
implementation("software.amazon.smithy:smithy-aws-traits:$smithyVersion")
3940
implementation(project(":smithy-aws-typescript-codegen"))
4041
}
4142

Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
$version: "2.0"
2+
3+
namespace example.weather
4+
5+
use aws.auth#sigv4
6+
7+
@authDefinition
8+
@trait
9+
structure customAuth {}
10+
11+
@trait
12+
@protocolDefinition
13+
structure fakeProtocol {}
14+
15+
@fakeProtocol
16+
@httpApiKeyAuth(name: "X-Api-Key", in: "header")
17+
@httpBearerAuth
18+
@sigv4(name: "weather")
19+
@customAuth
20+
@auth([sigv4])
21+
service Weather {
22+
version: "2006-03-01"
23+
operations: [
24+
// experimentalIdentityAndAuth
25+
OnlyHttpApiKeyAuth
26+
OnlyHttpApiKeyAuthOptional
27+
OnlyHttpBearerAuth
28+
OnlyHttpBearerAuthOptional
29+
OnlyHttpApiKeyAndBearerAuth
30+
OnlyHttpApiKeyAndBearerAuthReversed
31+
OnlySigv4Auth
32+
OnlySigv4AuthOptional
33+
OnlyCustomAuth
34+
OnlyCustomAuthOptional
35+
SameAsService
36+
]
37+
}
38+
39+
@http(method: "GET", uri: "/OnlyHttpApiKeyAuth")
40+
@auth([httpApiKeyAuth])
41+
operation OnlyHttpApiKeyAuth {}
42+
43+
@http(method: "GET", uri: "/OnlyHttpBearerAuth")
44+
@auth([httpBearerAuth])
45+
operation OnlyHttpBearerAuth {}
46+
47+
@http(method: "GET", uri: "/OnlySigv4Auth")
48+
@auth([sigv4])
49+
operation OnlySigv4Auth {}
50+
51+
@http(method: "GET", uri: "/OnlyHttpApiKeyAndBearerAuth")
52+
@auth([httpApiKeyAuth, httpBearerAuth])
53+
operation OnlyHttpApiKeyAndBearerAuth {}
54+
55+
@http(method: "GET", uri: "/OnlyHttpApiKeyAndBearerAuthReversed")
56+
@auth([httpBearerAuth, httpApiKeyAuth])
57+
operation OnlyHttpApiKeyAndBearerAuthReversed {}
58+
59+
@http(method: "GET", uri: "/OnlyHttpApiKeyAuthOptional")
60+
@auth([httpApiKeyAuth])
61+
@optionalAuth
62+
operation OnlyHttpApiKeyAuthOptional {}
63+
64+
@http(method: "GET", uri: "/OnlyHttpBearerAuthOptional")
65+
@auth([httpBearerAuth])
66+
@optionalAuth
67+
operation OnlyHttpBearerAuthOptional {}
68+
69+
@http(method: "GET", uri: "/OnlySigv4AuthOptional")
70+
@auth([sigv4])
71+
@optionalAuth
72+
operation OnlySigv4AuthOptional {}
73+
74+
@http(method: "GET", uri: "/OnlyCustomAuth")
75+
@auth([customAuth])
76+
operation OnlyCustomAuth {}
77+
78+
@http(method: "GET", uri: "/OnlyCustomAuthOptional")
79+
@auth([customAuth])
80+
@optionalAuth
81+
operation OnlyCustomAuthOptional {}
82+
83+
@http(method: "GET", uri: "/SameAsService")
84+
operation SameAsService {}

codegen/generic-client-test-codegen/smithy-build.json

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,55 @@
22
"version": "1.0",
33
"imports": ["model/echo.smithy"],
44
"projections": {
5+
"client-experimental-identity-and-auth": {
6+
"transforms": [
7+
{
8+
"name": "includeServices",
9+
"args": {
10+
"services": ["example.weather#Weather"]
11+
}
12+
}
13+
],
14+
"plugins": {
15+
"typescript-codegen": {
16+
"package": "@aws-sdk/weather",
17+
"packageVersion": "0.0.1",
18+
"packageJson": {
19+
"author": {
20+
"name": "AWS SDK for JavaScript Team",
21+
"url": "https://aws.amazon.com/javascript/"
22+
},
23+
"license": "Apache-2.0"
24+
},
25+
"private": true,
26+
"experimentalIdentityAndAuth": true
27+
}
28+
}
29+
},
30+
"control-experimental-identity-and-auth": {
31+
"transforms": [
32+
{
33+
"name": "includeServices",
34+
"args": {
35+
"services": ["example.weather#Weather"]
36+
}
37+
}
38+
],
39+
"plugins": {
40+
"typescript-codegen": {
41+
"package": "@aws-sdk/weather",
42+
"packageVersion": "0.0.1",
43+
"packageJson": {
44+
"author": {
45+
"name": "AWS SDK for JavaScript Team",
46+
"url": "https://aws.amazon.com/javascript/"
47+
},
48+
"license": "Apache-2.0"
49+
},
50+
"private": true
51+
}
52+
}
53+
},
554
"aws-echo-service": {
655
"transforms": [
756
{

0 commit comments

Comments
 (0)