@aws-sdk/nested-clients 3.730.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +13 -0
- package/dist-cjs/index.js +2 -0
- package/dist-cjs/submodules/sso-oidc/auth/httpAuthSchemeProvider.js +56 -0
- package/dist-cjs/submodules/sso-oidc/endpoint/endpointResolver.js +18 -0
- package/dist-cjs/submodules/sso-oidc/endpoint/ruleset.js +106 -0
- package/dist-cjs/submodules/sso-oidc/index.js +804 -0
- package/dist-cjs/submodules/sso-oidc/runtimeConfig.browser.js +38 -0
- package/dist-cjs/submodules/sso-oidc/runtimeConfig.js +50 -0
- package/dist-cjs/submodules/sso-oidc/runtimeConfig.native.js +15 -0
- package/dist-cjs/submodules/sso-oidc/runtimeConfig.shared.js +40 -0
- package/dist-cjs/submodules/sts/STSClient.js +51 -0
- package/dist-cjs/submodules/sts/auth/httpAuthExtensionConfiguration.js +43 -0
- package/dist-cjs/submodules/sts/auth/httpAuthSchemeProvider.js +63 -0
- package/dist-cjs/submodules/sts/endpoint/EndpointParameters.js +20 -0
- package/dist-cjs/submodules/sts/endpoint/endpointResolver.js +18 -0
- package/dist-cjs/submodules/sts/endpoint/ruleset.js +145 -0
- package/dist-cjs/submodules/sts/index.js +950 -0
- package/dist-cjs/submodules/sts/runtimeConfig.browser.js +39 -0
- package/dist-cjs/submodules/sts/runtimeConfig.js +64 -0
- package/dist-cjs/submodules/sts/runtimeConfig.native.js +15 -0
- package/dist-cjs/submodules/sts/runtimeConfig.shared.js +40 -0
- package/dist-cjs/submodules/sts/runtimeExtensions.js +25 -0
- package/dist-es/index.js +1 -0
- package/dist-es/submodules/sso-oidc/SSOOIDC.js +9 -0
- package/dist-es/submodules/sso-oidc/SSOOIDCClient.js +47 -0
- package/dist-es/submodules/sso-oidc/auth/httpAuthExtensionConfiguration.js +38 -0
- package/dist-es/submodules/sso-oidc/auth/httpAuthSchemeProvider.js +50 -0
- package/dist-es/submodules/sso-oidc/commands/CreateTokenCommand.js +23 -0
- package/dist-es/submodules/sso-oidc/commands/index.js +1 -0
- package/dist-es/submodules/sso-oidc/endpoint/EndpointParameters.js +14 -0
- package/dist-es/submodules/sso-oidc/endpoint/endpointResolver.js +14 -0
- package/dist-es/submodules/sso-oidc/endpoint/ruleset.js +103 -0
- package/dist-es/submodules/sso-oidc/extensionConfiguration.js +1 -0
- package/dist-es/submodules/sso-oidc/index.js +5 -0
- package/dist-es/submodules/sso-oidc/models/SSOOIDCServiceException.js +8 -0
- package/dist-es/submodules/sso-oidc/models/index.js +1 -0
- package/dist-es/submodules/sso-oidc/models/models_0.js +190 -0
- package/dist-es/submodules/sso-oidc/protocols/Aws_restJson1.js +255 -0
- package/dist-es/submodules/sso-oidc/runtimeConfig.browser.js +33 -0
- package/dist-es/submodules/sso-oidc/runtimeConfig.js +45 -0
- package/dist-es/submodules/sso-oidc/runtimeConfig.native.js +11 -0
- package/dist-es/submodules/sso-oidc/runtimeConfig.shared.js +36 -0
- package/dist-es/submodules/sso-oidc/runtimeExtensions.js +21 -0
- package/dist-es/submodules/sts/STS.js +11 -0
- package/dist-es/submodules/sts/STSClient.js +47 -0
- package/dist-es/submodules/sts/auth/httpAuthExtensionConfiguration.js +38 -0
- package/dist-es/submodules/sts/auth/httpAuthSchemeProvider.js +56 -0
- package/dist-es/submodules/sts/commands/AssumeRoleCommand.js +23 -0
- package/dist-es/submodules/sts/commands/AssumeRoleWithWebIdentityCommand.js +23 -0
- package/dist-es/submodules/sts/commands/index.js +2 -0
- package/dist-es/submodules/sts/defaultRoleAssumers.js +22 -0
- package/dist-es/submodules/sts/defaultStsRoleAssumers.js +93 -0
- package/dist-es/submodules/sts/endpoint/EndpointParameters.js +16 -0
- package/dist-es/submodules/sts/endpoint/endpointResolver.js +14 -0
- package/dist-es/submodules/sts/endpoint/ruleset.js +142 -0
- package/dist-es/submodules/sts/extensionConfiguration.js +1 -0
- package/dist-es/submodules/sts/index.js +6 -0
- package/dist-es/submodules/sts/models/STSServiceException.js +8 -0
- package/dist-es/submodules/sts/models/index.js +1 -0
- package/dist-es/submodules/sts/models/models_0.js +102 -0
- package/dist-es/submodules/sts/protocols/Aws_query.js +528 -0
- package/dist-es/submodules/sts/runtimeConfig.browser.js +34 -0
- package/dist-es/submodules/sts/runtimeConfig.js +59 -0
- package/dist-es/submodules/sts/runtimeConfig.native.js +11 -0
- package/dist-es/submodules/sts/runtimeConfig.shared.js +36 -0
- package/dist-es/submodules/sts/runtimeExtensions.js +21 -0
- package/dist-types/index.d.ts +6 -0
- package/dist-types/submodules/sso-oidc/SSOOIDC.d.ts +54 -0
- package/dist-types/submodules/sso-oidc/SSOOIDCClient.d.ts +219 -0
- package/dist-types/submodules/sso-oidc/auth/httpAuthExtensionConfiguration.d.ts +29 -0
- package/dist-types/submodules/sso-oidc/auth/httpAuthSchemeProvider.d.ts +61 -0
- package/dist-types/submodules/sso-oidc/commands/CreateTokenCommand.d.ts +128 -0
- package/dist-types/submodules/sso-oidc/commands/index.d.ts +1 -0
- package/dist-types/submodules/sso-oidc/endpoint/EndpointParameters.d.ts +40 -0
- package/dist-types/submodules/sso-oidc/endpoint/endpointResolver.d.ts +5 -0
- package/dist-types/submodules/sso-oidc/endpoint/ruleset.d.ts +2 -0
- package/dist-types/submodules/sso-oidc/extensionConfiguration.d.ts +9 -0
- package/dist-types/submodules/sso-oidc/index.d.ts +50 -0
- package/dist-types/submodules/sso-oidc/models/SSOOIDCServiceException.d.ts +14 -0
- package/dist-types/submodules/sso-oidc/models/index.d.ts +1 -0
- package/dist-types/submodules/sso-oidc/models/models_0.d.ts +396 -0
- package/dist-types/submodules/sso-oidc/protocols/Aws_restJson1.d.ts +11 -0
- package/dist-types/submodules/sso-oidc/runtimeConfig.browser.d.ts +56 -0
- package/dist-types/submodules/sso-oidc/runtimeConfig.d.ts +56 -0
- package/dist-types/submodules/sso-oidc/runtimeConfig.native.d.ts +55 -0
- package/dist-types/submodules/sso-oidc/runtimeConfig.shared.d.ts +32 -0
- package/dist-types/submodules/sso-oidc/runtimeExtensions.d.ts +17 -0
- package/dist-types/submodules/sts/STS.d.ts +27 -0
- package/dist-types/submodules/sts/STSClient.d.ts +192 -0
- package/dist-types/submodules/sts/auth/httpAuthExtensionConfiguration.d.ts +29 -0
- package/dist-types/submodules/sts/auth/httpAuthSchemeProvider.d.ts +71 -0
- package/dist-types/submodules/sts/commands/AssumeRoleCommand.d.ts +222 -0
- package/dist-types/submodules/sts/commands/AssumeRoleWithWebIdentityCommand.d.ts +254 -0
- package/dist-types/submodules/sts/commands/index.d.ts +2 -0
- package/dist-types/submodules/sts/defaultRoleAssumers.d.ts +23 -0
- package/dist-types/submodules/sts/defaultStsRoleAssumers.d.ts +43 -0
- package/dist-types/submodules/sts/endpoint/EndpointParameters.d.ts +46 -0
- package/dist-types/submodules/sts/endpoint/endpointResolver.d.ts +5 -0
- package/dist-types/submodules/sts/endpoint/ruleset.d.ts +2 -0
- package/dist-types/submodules/sts/extensionConfiguration.d.ts +9 -0
- package/dist-types/submodules/sts/index.d.ts +17 -0
- package/dist-types/submodules/sts/models/STSServiceException.d.ts +14 -0
- package/dist-types/submodules/sts/models/index.d.ts +1 -0
- package/dist-types/submodules/sts/models/models_0.d.ts +712 -0
- package/dist-types/submodules/sts/protocols/Aws_query.d.ts +20 -0
- package/dist-types/submodules/sts/runtimeConfig.browser.d.ts +58 -0
- package/dist-types/submodules/sts/runtimeConfig.d.ts +56 -0
- package/dist-types/submodules/sts/runtimeConfig.native.d.ts +57 -0
- package/dist-types/submodules/sts/runtimeConfig.shared.d.ts +32 -0
- package/dist-types/submodules/sts/runtimeExtensions.d.ts +17 -0
- package/dist-types/ts3.4/index.d.ts +1 -0
- package/dist-types/ts3.4/submodules/sso-oidc/SSOOIDC.d.ts +22 -0
- package/dist-types/ts3.4/submodules/sso-oidc/SSOOIDCClient.d.ts +121 -0
- package/dist-types/ts3.4/submodules/sso-oidc/auth/httpAuthExtensionConfiguration.d.ts +32 -0
- package/dist-types/ts3.4/submodules/sso-oidc/auth/httpAuthSchemeProvider.d.ts +44 -0
- package/dist-types/ts3.4/submodules/sso-oidc/commands/CreateTokenCommand.d.ts +43 -0
- package/dist-types/ts3.4/submodules/sso-oidc/commands/index.d.ts +1 -0
- package/dist-types/ts3.4/submodules/sso-oidc/endpoint/EndpointParameters.d.ts +51 -0
- package/dist-types/ts3.4/submodules/sso-oidc/endpoint/endpointResolver.d.ts +8 -0
- package/dist-types/ts3.4/submodules/sso-oidc/endpoint/ruleset.d.ts +2 -0
- package/dist-types/ts3.4/submodules/sso-oidc/extensionConfiguration.d.ts +9 -0
- package/dist-types/ts3.4/submodules/sso-oidc/index.d.ts +8 -0
- package/dist-types/ts3.4/submodules/sso-oidc/models/SSOOIDCServiceException.d.ts +9 -0
- package/dist-types/ts3.4/submodules/sso-oidc/models/index.d.ts +1 -0
- package/dist-types/ts3.4/submodules/sso-oidc/models/models_0.d.ts +123 -0
- package/dist-types/ts3.4/submodules/sso-oidc/protocols/Aws_restJson1.d.ts +17 -0
- package/dist-types/ts3.4/submodules/sso-oidc/runtimeConfig.browser.d.ts +116 -0
- package/dist-types/ts3.4/submodules/sso-oidc/runtimeConfig.d.ts +113 -0
- package/dist-types/ts3.4/submodules/sso-oidc/runtimeConfig.native.d.ts +120 -0
- package/dist-types/ts3.4/submodules/sso-oidc/runtimeConfig.shared.d.ts +49 -0
- package/dist-types/ts3.4/submodules/sso-oidc/runtimeExtensions.d.ts +11 -0
- package/dist-types/ts3.4/submodules/sts/STS.d.ts +39 -0
- package/dist-types/ts3.4/submodules/sts/STSClient.d.ts +128 -0
- package/dist-types/ts3.4/submodules/sts/auth/httpAuthExtensionConfiguration.d.ts +32 -0
- package/dist-types/ts3.4/submodules/sts/auth/httpAuthSchemeProvider.d.ts +54 -0
- package/dist-types/ts3.4/submodules/sts/commands/AssumeRoleCommand.d.ts +47 -0
- package/dist-types/ts3.4/submodules/sts/commands/AssumeRoleWithWebIdentityCommand.d.ts +51 -0
- package/dist-types/ts3.4/submodules/sts/commands/index.d.ts +2 -0
- package/dist-types/ts3.4/submodules/sts/defaultRoleAssumers.d.ts +19 -0
- package/dist-types/ts3.4/submodules/sts/defaultStsRoleAssumers.d.ts +33 -0
- package/dist-types/ts3.4/submodules/sts/endpoint/EndpointParameters.d.ts +57 -0
- package/dist-types/ts3.4/submodules/sts/endpoint/endpointResolver.d.ts +8 -0
- package/dist-types/ts3.4/submodules/sts/endpoint/ruleset.d.ts +2 -0
- package/dist-types/ts3.4/submodules/sts/extensionConfiguration.d.ts +9 -0
- package/dist-types/ts3.4/submodules/sts/index.d.ts +9 -0
- package/dist-types/ts3.4/submodules/sts/models/STSServiceException.d.ts +9 -0
- package/dist-types/ts3.4/submodules/sts/models/index.d.ts +1 -0
- package/dist-types/ts3.4/submodules/sts/models/models_0.d.ts +123 -0
- package/dist-types/ts3.4/submodules/sts/protocols/Aws_query.d.ts +29 -0
- package/dist-types/ts3.4/submodules/sts/runtimeConfig.browser.d.ts +127 -0
- package/dist-types/ts3.4/submodules/sts/runtimeConfig.d.ts +111 -0
- package/dist-types/ts3.4/submodules/sts/runtimeConfig.native.d.ts +131 -0
- package/dist-types/ts3.4/submodules/sts/runtimeConfig.shared.d.ts +51 -0
- package/dist-types/ts3.4/submodules/sts/runtimeExtensions.d.ts +11 -0
- package/package.json +115 -0
- package/sso-oidc.d.ts +7 -0
- package/sso-oidc.js +5 -0
- package/sts.d.ts +7 -0
- package/sts.js +5 -0
|
@@ -0,0 +1,190 @@
|
|
|
1
|
+
import { SENSITIVE_STRING } from "@smithy/smithy-client";
|
|
2
|
+
import { SSOOIDCServiceException as __BaseException } from "./SSOOIDCServiceException";
|
|
3
|
+
export class AccessDeniedException extends __BaseException {
|
|
4
|
+
name = "AccessDeniedException";
|
|
5
|
+
$fault = "client";
|
|
6
|
+
error;
|
|
7
|
+
error_description;
|
|
8
|
+
constructor(opts) {
|
|
9
|
+
super({
|
|
10
|
+
name: "AccessDeniedException",
|
|
11
|
+
$fault: "client",
|
|
12
|
+
...opts,
|
|
13
|
+
});
|
|
14
|
+
Object.setPrototypeOf(this, AccessDeniedException.prototype);
|
|
15
|
+
this.error = opts.error;
|
|
16
|
+
this.error_description = opts.error_description;
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
export class AuthorizationPendingException extends __BaseException {
|
|
20
|
+
name = "AuthorizationPendingException";
|
|
21
|
+
$fault = "client";
|
|
22
|
+
error;
|
|
23
|
+
error_description;
|
|
24
|
+
constructor(opts) {
|
|
25
|
+
super({
|
|
26
|
+
name: "AuthorizationPendingException",
|
|
27
|
+
$fault: "client",
|
|
28
|
+
...opts,
|
|
29
|
+
});
|
|
30
|
+
Object.setPrototypeOf(this, AuthorizationPendingException.prototype);
|
|
31
|
+
this.error = opts.error;
|
|
32
|
+
this.error_description = opts.error_description;
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
export const CreateTokenRequestFilterSensitiveLog = (obj) => ({
|
|
36
|
+
...obj,
|
|
37
|
+
...(obj.clientSecret && { clientSecret: SENSITIVE_STRING }),
|
|
38
|
+
...(obj.refreshToken && { refreshToken: SENSITIVE_STRING }),
|
|
39
|
+
...(obj.codeVerifier && { codeVerifier: SENSITIVE_STRING }),
|
|
40
|
+
});
|
|
41
|
+
export const CreateTokenResponseFilterSensitiveLog = (obj) => ({
|
|
42
|
+
...obj,
|
|
43
|
+
...(obj.accessToken && { accessToken: SENSITIVE_STRING }),
|
|
44
|
+
...(obj.refreshToken && { refreshToken: SENSITIVE_STRING }),
|
|
45
|
+
...(obj.idToken && { idToken: SENSITIVE_STRING }),
|
|
46
|
+
});
|
|
47
|
+
export class ExpiredTokenException extends __BaseException {
|
|
48
|
+
name = "ExpiredTokenException";
|
|
49
|
+
$fault = "client";
|
|
50
|
+
error;
|
|
51
|
+
error_description;
|
|
52
|
+
constructor(opts) {
|
|
53
|
+
super({
|
|
54
|
+
name: "ExpiredTokenException",
|
|
55
|
+
$fault: "client",
|
|
56
|
+
...opts,
|
|
57
|
+
});
|
|
58
|
+
Object.setPrototypeOf(this, ExpiredTokenException.prototype);
|
|
59
|
+
this.error = opts.error;
|
|
60
|
+
this.error_description = opts.error_description;
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
export class InternalServerException extends __BaseException {
|
|
64
|
+
name = "InternalServerException";
|
|
65
|
+
$fault = "server";
|
|
66
|
+
error;
|
|
67
|
+
error_description;
|
|
68
|
+
constructor(opts) {
|
|
69
|
+
super({
|
|
70
|
+
name: "InternalServerException",
|
|
71
|
+
$fault: "server",
|
|
72
|
+
...opts,
|
|
73
|
+
});
|
|
74
|
+
Object.setPrototypeOf(this, InternalServerException.prototype);
|
|
75
|
+
this.error = opts.error;
|
|
76
|
+
this.error_description = opts.error_description;
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
export class InvalidClientException extends __BaseException {
|
|
80
|
+
name = "InvalidClientException";
|
|
81
|
+
$fault = "client";
|
|
82
|
+
error;
|
|
83
|
+
error_description;
|
|
84
|
+
constructor(opts) {
|
|
85
|
+
super({
|
|
86
|
+
name: "InvalidClientException",
|
|
87
|
+
$fault: "client",
|
|
88
|
+
...opts,
|
|
89
|
+
});
|
|
90
|
+
Object.setPrototypeOf(this, InvalidClientException.prototype);
|
|
91
|
+
this.error = opts.error;
|
|
92
|
+
this.error_description = opts.error_description;
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
export class InvalidGrantException extends __BaseException {
|
|
96
|
+
name = "InvalidGrantException";
|
|
97
|
+
$fault = "client";
|
|
98
|
+
error;
|
|
99
|
+
error_description;
|
|
100
|
+
constructor(opts) {
|
|
101
|
+
super({
|
|
102
|
+
name: "InvalidGrantException",
|
|
103
|
+
$fault: "client",
|
|
104
|
+
...opts,
|
|
105
|
+
});
|
|
106
|
+
Object.setPrototypeOf(this, InvalidGrantException.prototype);
|
|
107
|
+
this.error = opts.error;
|
|
108
|
+
this.error_description = opts.error_description;
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
export class InvalidRequestException extends __BaseException {
|
|
112
|
+
name = "InvalidRequestException";
|
|
113
|
+
$fault = "client";
|
|
114
|
+
error;
|
|
115
|
+
error_description;
|
|
116
|
+
constructor(opts) {
|
|
117
|
+
super({
|
|
118
|
+
name: "InvalidRequestException",
|
|
119
|
+
$fault: "client",
|
|
120
|
+
...opts,
|
|
121
|
+
});
|
|
122
|
+
Object.setPrototypeOf(this, InvalidRequestException.prototype);
|
|
123
|
+
this.error = opts.error;
|
|
124
|
+
this.error_description = opts.error_description;
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
export class InvalidScopeException extends __BaseException {
|
|
128
|
+
name = "InvalidScopeException";
|
|
129
|
+
$fault = "client";
|
|
130
|
+
error;
|
|
131
|
+
error_description;
|
|
132
|
+
constructor(opts) {
|
|
133
|
+
super({
|
|
134
|
+
name: "InvalidScopeException",
|
|
135
|
+
$fault: "client",
|
|
136
|
+
...opts,
|
|
137
|
+
});
|
|
138
|
+
Object.setPrototypeOf(this, InvalidScopeException.prototype);
|
|
139
|
+
this.error = opts.error;
|
|
140
|
+
this.error_description = opts.error_description;
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
export class SlowDownException extends __BaseException {
|
|
144
|
+
name = "SlowDownException";
|
|
145
|
+
$fault = "client";
|
|
146
|
+
error;
|
|
147
|
+
error_description;
|
|
148
|
+
constructor(opts) {
|
|
149
|
+
super({
|
|
150
|
+
name: "SlowDownException",
|
|
151
|
+
$fault: "client",
|
|
152
|
+
...opts,
|
|
153
|
+
});
|
|
154
|
+
Object.setPrototypeOf(this, SlowDownException.prototype);
|
|
155
|
+
this.error = opts.error;
|
|
156
|
+
this.error_description = opts.error_description;
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
export class UnauthorizedClientException extends __BaseException {
|
|
160
|
+
name = "UnauthorizedClientException";
|
|
161
|
+
$fault = "client";
|
|
162
|
+
error;
|
|
163
|
+
error_description;
|
|
164
|
+
constructor(opts) {
|
|
165
|
+
super({
|
|
166
|
+
name: "UnauthorizedClientException",
|
|
167
|
+
$fault: "client",
|
|
168
|
+
...opts,
|
|
169
|
+
});
|
|
170
|
+
Object.setPrototypeOf(this, UnauthorizedClientException.prototype);
|
|
171
|
+
this.error = opts.error;
|
|
172
|
+
this.error_description = opts.error_description;
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
export class UnsupportedGrantTypeException extends __BaseException {
|
|
176
|
+
name = "UnsupportedGrantTypeException";
|
|
177
|
+
$fault = "client";
|
|
178
|
+
error;
|
|
179
|
+
error_description;
|
|
180
|
+
constructor(opts) {
|
|
181
|
+
super({
|
|
182
|
+
name: "UnsupportedGrantTypeException",
|
|
183
|
+
$fault: "client",
|
|
184
|
+
...opts,
|
|
185
|
+
});
|
|
186
|
+
Object.setPrototypeOf(this, UnsupportedGrantTypeException.prototype);
|
|
187
|
+
this.error = opts.error;
|
|
188
|
+
this.error_description = opts.error_description;
|
|
189
|
+
}
|
|
190
|
+
}
|
|
@@ -0,0 +1,255 @@
|
|
|
1
|
+
import { loadRestJsonErrorCode, parseJsonBody as parseBody, parseJsonErrorBody as parseErrorBody } from "@aws-sdk/core";
|
|
2
|
+
import { requestBuilder as rb } from "@smithy/core";
|
|
3
|
+
import { _json, collectBody, decorateServiceException as __decorateServiceException, expectInt32 as __expectInt32, expectNonNull as __expectNonNull, expectObject as __expectObject, expectString as __expectString, map, take, withBaseException, } from "@smithy/smithy-client";
|
|
4
|
+
import { AccessDeniedException, AuthorizationPendingException, ExpiredTokenException, InternalServerException, InvalidClientException, InvalidGrantException, InvalidRequestException, InvalidScopeException, SlowDownException, UnauthorizedClientException, UnsupportedGrantTypeException, } from "../models/models_0";
|
|
5
|
+
import { SSOOIDCServiceException as __BaseException } from "../models/SSOOIDCServiceException";
|
|
6
|
+
export const se_CreateTokenCommand = async (input, context) => {
|
|
7
|
+
const b = rb(input, context);
|
|
8
|
+
const headers = {
|
|
9
|
+
"content-type": "application/json",
|
|
10
|
+
};
|
|
11
|
+
b.bp("/token");
|
|
12
|
+
let body;
|
|
13
|
+
body = JSON.stringify(take(input, {
|
|
14
|
+
clientId: [],
|
|
15
|
+
clientSecret: [],
|
|
16
|
+
code: [],
|
|
17
|
+
codeVerifier: [],
|
|
18
|
+
deviceCode: [],
|
|
19
|
+
grantType: [],
|
|
20
|
+
redirectUri: [],
|
|
21
|
+
refreshToken: [],
|
|
22
|
+
scope: (_) => _json(_),
|
|
23
|
+
}));
|
|
24
|
+
b.m("POST").h(headers).b(body);
|
|
25
|
+
return b.build();
|
|
26
|
+
};
|
|
27
|
+
export const de_CreateTokenCommand = async (output, context) => {
|
|
28
|
+
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
29
|
+
return de_CommandError(output, context);
|
|
30
|
+
}
|
|
31
|
+
const contents = map({
|
|
32
|
+
$metadata: deserializeMetadata(output),
|
|
33
|
+
});
|
|
34
|
+
const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
|
|
35
|
+
const doc = take(data, {
|
|
36
|
+
accessToken: __expectString,
|
|
37
|
+
expiresIn: __expectInt32,
|
|
38
|
+
idToken: __expectString,
|
|
39
|
+
refreshToken: __expectString,
|
|
40
|
+
tokenType: __expectString,
|
|
41
|
+
});
|
|
42
|
+
Object.assign(contents, doc);
|
|
43
|
+
return contents;
|
|
44
|
+
};
|
|
45
|
+
const de_CommandError = async (output, context) => {
|
|
46
|
+
const parsedOutput = {
|
|
47
|
+
...output,
|
|
48
|
+
body: await parseErrorBody(output.body, context),
|
|
49
|
+
};
|
|
50
|
+
const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
51
|
+
switch (errorCode) {
|
|
52
|
+
case "AccessDeniedException":
|
|
53
|
+
case "com.amazonaws.ssooidc#AccessDeniedException":
|
|
54
|
+
throw await de_AccessDeniedExceptionRes(parsedOutput, context);
|
|
55
|
+
case "AuthorizationPendingException":
|
|
56
|
+
case "com.amazonaws.ssooidc#AuthorizationPendingException":
|
|
57
|
+
throw await de_AuthorizationPendingExceptionRes(parsedOutput, context);
|
|
58
|
+
case "ExpiredTokenException":
|
|
59
|
+
case "com.amazonaws.ssooidc#ExpiredTokenException":
|
|
60
|
+
throw await de_ExpiredTokenExceptionRes(parsedOutput, context);
|
|
61
|
+
case "InternalServerException":
|
|
62
|
+
case "com.amazonaws.ssooidc#InternalServerException":
|
|
63
|
+
throw await de_InternalServerExceptionRes(parsedOutput, context);
|
|
64
|
+
case "InvalidClientException":
|
|
65
|
+
case "com.amazonaws.ssooidc#InvalidClientException":
|
|
66
|
+
throw await de_InvalidClientExceptionRes(parsedOutput, context);
|
|
67
|
+
case "InvalidGrantException":
|
|
68
|
+
case "com.amazonaws.ssooidc#InvalidGrantException":
|
|
69
|
+
throw await de_InvalidGrantExceptionRes(parsedOutput, context);
|
|
70
|
+
case "InvalidRequestException":
|
|
71
|
+
case "com.amazonaws.ssooidc#InvalidRequestException":
|
|
72
|
+
throw await de_InvalidRequestExceptionRes(parsedOutput, context);
|
|
73
|
+
case "InvalidScopeException":
|
|
74
|
+
case "com.amazonaws.ssooidc#InvalidScopeException":
|
|
75
|
+
throw await de_InvalidScopeExceptionRes(parsedOutput, context);
|
|
76
|
+
case "SlowDownException":
|
|
77
|
+
case "com.amazonaws.ssooidc#SlowDownException":
|
|
78
|
+
throw await de_SlowDownExceptionRes(parsedOutput, context);
|
|
79
|
+
case "UnauthorizedClientException":
|
|
80
|
+
case "com.amazonaws.ssooidc#UnauthorizedClientException":
|
|
81
|
+
throw await de_UnauthorizedClientExceptionRes(parsedOutput, context);
|
|
82
|
+
case "UnsupportedGrantTypeException":
|
|
83
|
+
case "com.amazonaws.ssooidc#UnsupportedGrantTypeException":
|
|
84
|
+
throw await de_UnsupportedGrantTypeExceptionRes(parsedOutput, context);
|
|
85
|
+
default:
|
|
86
|
+
const parsedBody = parsedOutput.body;
|
|
87
|
+
return throwDefaultError({
|
|
88
|
+
output,
|
|
89
|
+
parsedBody,
|
|
90
|
+
errorCode,
|
|
91
|
+
});
|
|
92
|
+
}
|
|
93
|
+
};
|
|
94
|
+
const throwDefaultError = withBaseException(__BaseException);
|
|
95
|
+
const de_AccessDeniedExceptionRes = async (parsedOutput, context) => {
|
|
96
|
+
const contents = map({});
|
|
97
|
+
const data = parsedOutput.body;
|
|
98
|
+
const doc = take(data, {
|
|
99
|
+
error: __expectString,
|
|
100
|
+
error_description: __expectString,
|
|
101
|
+
});
|
|
102
|
+
Object.assign(contents, doc);
|
|
103
|
+
const exception = new AccessDeniedException({
|
|
104
|
+
$metadata: deserializeMetadata(parsedOutput),
|
|
105
|
+
...contents,
|
|
106
|
+
});
|
|
107
|
+
return __decorateServiceException(exception, parsedOutput.body);
|
|
108
|
+
};
|
|
109
|
+
const de_AuthorizationPendingExceptionRes = async (parsedOutput, context) => {
|
|
110
|
+
const contents = map({});
|
|
111
|
+
const data = parsedOutput.body;
|
|
112
|
+
const doc = take(data, {
|
|
113
|
+
error: __expectString,
|
|
114
|
+
error_description: __expectString,
|
|
115
|
+
});
|
|
116
|
+
Object.assign(contents, doc);
|
|
117
|
+
const exception = new AuthorizationPendingException({
|
|
118
|
+
$metadata: deserializeMetadata(parsedOutput),
|
|
119
|
+
...contents,
|
|
120
|
+
});
|
|
121
|
+
return __decorateServiceException(exception, parsedOutput.body);
|
|
122
|
+
};
|
|
123
|
+
const de_ExpiredTokenExceptionRes = async (parsedOutput, context) => {
|
|
124
|
+
const contents = map({});
|
|
125
|
+
const data = parsedOutput.body;
|
|
126
|
+
const doc = take(data, {
|
|
127
|
+
error: __expectString,
|
|
128
|
+
error_description: __expectString,
|
|
129
|
+
});
|
|
130
|
+
Object.assign(contents, doc);
|
|
131
|
+
const exception = new ExpiredTokenException({
|
|
132
|
+
$metadata: deserializeMetadata(parsedOutput),
|
|
133
|
+
...contents,
|
|
134
|
+
});
|
|
135
|
+
return __decorateServiceException(exception, parsedOutput.body);
|
|
136
|
+
};
|
|
137
|
+
const de_InternalServerExceptionRes = async (parsedOutput, context) => {
|
|
138
|
+
const contents = map({});
|
|
139
|
+
const data = parsedOutput.body;
|
|
140
|
+
const doc = take(data, {
|
|
141
|
+
error: __expectString,
|
|
142
|
+
error_description: __expectString,
|
|
143
|
+
});
|
|
144
|
+
Object.assign(contents, doc);
|
|
145
|
+
const exception = new InternalServerException({
|
|
146
|
+
$metadata: deserializeMetadata(parsedOutput),
|
|
147
|
+
...contents,
|
|
148
|
+
});
|
|
149
|
+
return __decorateServiceException(exception, parsedOutput.body);
|
|
150
|
+
};
|
|
151
|
+
const de_InvalidClientExceptionRes = async (parsedOutput, context) => {
|
|
152
|
+
const contents = map({});
|
|
153
|
+
const data = parsedOutput.body;
|
|
154
|
+
const doc = take(data, {
|
|
155
|
+
error: __expectString,
|
|
156
|
+
error_description: __expectString,
|
|
157
|
+
});
|
|
158
|
+
Object.assign(contents, doc);
|
|
159
|
+
const exception = new InvalidClientException({
|
|
160
|
+
$metadata: deserializeMetadata(parsedOutput),
|
|
161
|
+
...contents,
|
|
162
|
+
});
|
|
163
|
+
return __decorateServiceException(exception, parsedOutput.body);
|
|
164
|
+
};
|
|
165
|
+
const de_InvalidGrantExceptionRes = async (parsedOutput, context) => {
|
|
166
|
+
const contents = map({});
|
|
167
|
+
const data = parsedOutput.body;
|
|
168
|
+
const doc = take(data, {
|
|
169
|
+
error: __expectString,
|
|
170
|
+
error_description: __expectString,
|
|
171
|
+
});
|
|
172
|
+
Object.assign(contents, doc);
|
|
173
|
+
const exception = new InvalidGrantException({
|
|
174
|
+
$metadata: deserializeMetadata(parsedOutput),
|
|
175
|
+
...contents,
|
|
176
|
+
});
|
|
177
|
+
return __decorateServiceException(exception, parsedOutput.body);
|
|
178
|
+
};
|
|
179
|
+
const de_InvalidRequestExceptionRes = async (parsedOutput, context) => {
|
|
180
|
+
const contents = map({});
|
|
181
|
+
const data = parsedOutput.body;
|
|
182
|
+
const doc = take(data, {
|
|
183
|
+
error: __expectString,
|
|
184
|
+
error_description: __expectString,
|
|
185
|
+
});
|
|
186
|
+
Object.assign(contents, doc);
|
|
187
|
+
const exception = new InvalidRequestException({
|
|
188
|
+
$metadata: deserializeMetadata(parsedOutput),
|
|
189
|
+
...contents,
|
|
190
|
+
});
|
|
191
|
+
return __decorateServiceException(exception, parsedOutput.body);
|
|
192
|
+
};
|
|
193
|
+
const de_InvalidScopeExceptionRes = async (parsedOutput, context) => {
|
|
194
|
+
const contents = map({});
|
|
195
|
+
const data = parsedOutput.body;
|
|
196
|
+
const doc = take(data, {
|
|
197
|
+
error: __expectString,
|
|
198
|
+
error_description: __expectString,
|
|
199
|
+
});
|
|
200
|
+
Object.assign(contents, doc);
|
|
201
|
+
const exception = new InvalidScopeException({
|
|
202
|
+
$metadata: deserializeMetadata(parsedOutput),
|
|
203
|
+
...contents,
|
|
204
|
+
});
|
|
205
|
+
return __decorateServiceException(exception, parsedOutput.body);
|
|
206
|
+
};
|
|
207
|
+
const de_SlowDownExceptionRes = async (parsedOutput, context) => {
|
|
208
|
+
const contents = map({});
|
|
209
|
+
const data = parsedOutput.body;
|
|
210
|
+
const doc = take(data, {
|
|
211
|
+
error: __expectString,
|
|
212
|
+
error_description: __expectString,
|
|
213
|
+
});
|
|
214
|
+
Object.assign(contents, doc);
|
|
215
|
+
const exception = new SlowDownException({
|
|
216
|
+
$metadata: deserializeMetadata(parsedOutput),
|
|
217
|
+
...contents,
|
|
218
|
+
});
|
|
219
|
+
return __decorateServiceException(exception, parsedOutput.body);
|
|
220
|
+
};
|
|
221
|
+
const de_UnauthorizedClientExceptionRes = async (parsedOutput, context) => {
|
|
222
|
+
const contents = map({});
|
|
223
|
+
const data = parsedOutput.body;
|
|
224
|
+
const doc = take(data, {
|
|
225
|
+
error: __expectString,
|
|
226
|
+
error_description: __expectString,
|
|
227
|
+
});
|
|
228
|
+
Object.assign(contents, doc);
|
|
229
|
+
const exception = new UnauthorizedClientException({
|
|
230
|
+
$metadata: deserializeMetadata(parsedOutput),
|
|
231
|
+
...contents,
|
|
232
|
+
});
|
|
233
|
+
return __decorateServiceException(exception, parsedOutput.body);
|
|
234
|
+
};
|
|
235
|
+
const de_UnsupportedGrantTypeExceptionRes = async (parsedOutput, context) => {
|
|
236
|
+
const contents = map({});
|
|
237
|
+
const data = parsedOutput.body;
|
|
238
|
+
const doc = take(data, {
|
|
239
|
+
error: __expectString,
|
|
240
|
+
error_description: __expectString,
|
|
241
|
+
});
|
|
242
|
+
Object.assign(contents, doc);
|
|
243
|
+
const exception = new UnsupportedGrantTypeException({
|
|
244
|
+
$metadata: deserializeMetadata(parsedOutput),
|
|
245
|
+
...contents,
|
|
246
|
+
});
|
|
247
|
+
return __decorateServiceException(exception, parsedOutput.body);
|
|
248
|
+
};
|
|
249
|
+
const deserializeMetadata = (output) => ({
|
|
250
|
+
httpStatusCode: output.statusCode,
|
|
251
|
+
requestId: output.headers["x-amzn-requestid"] ?? output.headers["x-amzn-request-id"] ?? output.headers["x-amz-request-id"],
|
|
252
|
+
extendedRequestId: output.headers["x-amz-id-2"],
|
|
253
|
+
cfId: output.headers["x-amz-cf-id"],
|
|
254
|
+
});
|
|
255
|
+
const collectBodyString = (streamBody, context) => collectBody(streamBody, context).then((body) => context.utf8Encoder(body));
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import packageInfo from "../../../package.json";
|
|
2
|
+
import { Sha256 } from "@aws-crypto/sha256-browser";
|
|
3
|
+
import { createDefaultUserAgentProvider } from "@aws-sdk/util-user-agent-browser";
|
|
4
|
+
import { DEFAULT_USE_DUALSTACK_ENDPOINT, DEFAULT_USE_FIPS_ENDPOINT } from "@smithy/config-resolver";
|
|
5
|
+
import { FetchHttpHandler as RequestHandler, streamCollector } from "@smithy/fetch-http-handler";
|
|
6
|
+
import { invalidProvider } from "@smithy/invalid-dependency";
|
|
7
|
+
import { calculateBodyLength } from "@smithy/util-body-length-browser";
|
|
8
|
+
import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@smithy/util-retry";
|
|
9
|
+
import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared";
|
|
10
|
+
import { loadConfigsForDefaultMode } from "@smithy/smithy-client";
|
|
11
|
+
import { resolveDefaultsModeConfig } from "@smithy/util-defaults-mode-browser";
|
|
12
|
+
export const getRuntimeConfig = (config) => {
|
|
13
|
+
const defaultsMode = resolveDefaultsModeConfig(config);
|
|
14
|
+
const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode);
|
|
15
|
+
const clientSharedValues = getSharedRuntimeConfig(config);
|
|
16
|
+
return {
|
|
17
|
+
...clientSharedValues,
|
|
18
|
+
...config,
|
|
19
|
+
runtime: "browser",
|
|
20
|
+
defaultsMode,
|
|
21
|
+
bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength,
|
|
22
|
+
defaultUserAgentProvider: config?.defaultUserAgentProvider ??
|
|
23
|
+
createDefaultUserAgentProvider({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }),
|
|
24
|
+
maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS,
|
|
25
|
+
region: config?.region ?? invalidProvider("Region is missing"),
|
|
26
|
+
requestHandler: RequestHandler.create(config?.requestHandler ?? defaultConfigProvider),
|
|
27
|
+
retryMode: config?.retryMode ?? (async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE),
|
|
28
|
+
sha256: config?.sha256 ?? Sha256,
|
|
29
|
+
streamCollector: config?.streamCollector ?? streamCollector,
|
|
30
|
+
useDualstackEndpoint: config?.useDualstackEndpoint ?? (() => Promise.resolve(DEFAULT_USE_DUALSTACK_ENDPOINT)),
|
|
31
|
+
useFipsEndpoint: config?.useFipsEndpoint ?? (() => Promise.resolve(DEFAULT_USE_FIPS_ENDPOINT)),
|
|
32
|
+
};
|
|
33
|
+
};
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import packageInfo from "../../../package.json";
|
|
2
|
+
import { emitWarningIfUnsupportedVersion as awsCheckVersion } from "@aws-sdk/core";
|
|
3
|
+
import { NODE_APP_ID_CONFIG_OPTIONS, createDefaultUserAgentProvider } from "@aws-sdk/util-user-agent-node";
|
|
4
|
+
import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS, NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, } from "@smithy/config-resolver";
|
|
5
|
+
import { Hash } from "@smithy/hash-node";
|
|
6
|
+
import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@smithy/middleware-retry";
|
|
7
|
+
import { loadConfig as loadNodeConfig } from "@smithy/node-config-provider";
|
|
8
|
+
import { NodeHttpHandler as RequestHandler, streamCollector } from "@smithy/node-http-handler";
|
|
9
|
+
import { calculateBodyLength } from "@smithy/util-body-length-node";
|
|
10
|
+
import { DEFAULT_RETRY_MODE } from "@smithy/util-retry";
|
|
11
|
+
import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared";
|
|
12
|
+
import { loadConfigsForDefaultMode } from "@smithy/smithy-client";
|
|
13
|
+
import { resolveDefaultsModeConfig } from "@smithy/util-defaults-mode-node";
|
|
14
|
+
import { emitWarningIfUnsupportedVersion } from "@smithy/smithy-client";
|
|
15
|
+
export const getRuntimeConfig = (config) => {
|
|
16
|
+
emitWarningIfUnsupportedVersion(process.version);
|
|
17
|
+
const defaultsMode = resolveDefaultsModeConfig(config);
|
|
18
|
+
const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode);
|
|
19
|
+
const clientSharedValues = getSharedRuntimeConfig(config);
|
|
20
|
+
awsCheckVersion(process.version);
|
|
21
|
+
const profileConfig = { profile: config?.profile };
|
|
22
|
+
return {
|
|
23
|
+
...clientSharedValues,
|
|
24
|
+
...config,
|
|
25
|
+
runtime: "node",
|
|
26
|
+
defaultsMode,
|
|
27
|
+
bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength,
|
|
28
|
+
defaultUserAgentProvider: config?.defaultUserAgentProvider ??
|
|
29
|
+
createDefaultUserAgentProvider({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }),
|
|
30
|
+
maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS, config),
|
|
31
|
+
region: config?.region ??
|
|
32
|
+
loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, { ...NODE_REGION_CONFIG_FILE_OPTIONS, ...profileConfig }),
|
|
33
|
+
requestHandler: RequestHandler.create(config?.requestHandler ?? defaultConfigProvider),
|
|
34
|
+
retryMode: config?.retryMode ??
|
|
35
|
+
loadNodeConfig({
|
|
36
|
+
...NODE_RETRY_MODE_CONFIG_OPTIONS,
|
|
37
|
+
default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE,
|
|
38
|
+
}, config),
|
|
39
|
+
sha256: config?.sha256 ?? Hash.bind(null, "sha256"),
|
|
40
|
+
streamCollector: config?.streamCollector ?? streamCollector,
|
|
41
|
+
useDualstackEndpoint: config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, profileConfig),
|
|
42
|
+
useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, profileConfig),
|
|
43
|
+
userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS, profileConfig),
|
|
44
|
+
};
|
|
45
|
+
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { Sha256 } from "@aws-crypto/sha256-js";
|
|
2
|
+
import { getRuntimeConfig as getBrowserRuntimeConfig } from "./runtimeConfig.browser";
|
|
3
|
+
export const getRuntimeConfig = (config) => {
|
|
4
|
+
const browserDefaults = getBrowserRuntimeConfig(config);
|
|
5
|
+
return {
|
|
6
|
+
...browserDefaults,
|
|
7
|
+
...config,
|
|
8
|
+
runtime: "react-native",
|
|
9
|
+
sha256: config?.sha256 ?? Sha256,
|
|
10
|
+
};
|
|
11
|
+
};
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { AwsSdkSigV4Signer } from "@aws-sdk/core";
|
|
2
|
+
import { NoAuthSigner } from "@smithy/core";
|
|
3
|
+
import { NoOpLogger } from "@smithy/smithy-client";
|
|
4
|
+
import { parseUrl } from "@smithy/url-parser";
|
|
5
|
+
import { fromBase64, toBase64 } from "@smithy/util-base64";
|
|
6
|
+
import { fromUtf8, toUtf8 } from "@smithy/util-utf8";
|
|
7
|
+
import { defaultSSOOIDCHttpAuthSchemeProvider } from "./auth/httpAuthSchemeProvider";
|
|
8
|
+
import { defaultEndpointResolver } from "./endpoint/endpointResolver";
|
|
9
|
+
export const getRuntimeConfig = (config) => {
|
|
10
|
+
return {
|
|
11
|
+
apiVersion: "2019-06-10",
|
|
12
|
+
base64Decoder: config?.base64Decoder ?? fromBase64,
|
|
13
|
+
base64Encoder: config?.base64Encoder ?? toBase64,
|
|
14
|
+
disableHostPrefix: config?.disableHostPrefix ?? false,
|
|
15
|
+
endpointProvider: config?.endpointProvider ?? defaultEndpointResolver,
|
|
16
|
+
extensions: config?.extensions ?? [],
|
|
17
|
+
httpAuthSchemeProvider: config?.httpAuthSchemeProvider ?? defaultSSOOIDCHttpAuthSchemeProvider,
|
|
18
|
+
httpAuthSchemes: config?.httpAuthSchemes ?? [
|
|
19
|
+
{
|
|
20
|
+
schemeId: "aws.auth#sigv4",
|
|
21
|
+
identityProvider: (ipc) => ipc.getIdentityProvider("aws.auth#sigv4"),
|
|
22
|
+
signer: new AwsSdkSigV4Signer(),
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
schemeId: "smithy.api#noAuth",
|
|
26
|
+
identityProvider: (ipc) => ipc.getIdentityProvider("smithy.api#noAuth") || (async () => ({})),
|
|
27
|
+
signer: new NoAuthSigner(),
|
|
28
|
+
},
|
|
29
|
+
],
|
|
30
|
+
logger: config?.logger ?? new NoOpLogger(),
|
|
31
|
+
serviceId: config?.serviceId ?? "SSO OIDC",
|
|
32
|
+
urlParser: config?.urlParser ?? parseUrl,
|
|
33
|
+
utf8Decoder: config?.utf8Decoder ?? fromUtf8,
|
|
34
|
+
utf8Encoder: config?.utf8Encoder ?? toUtf8,
|
|
35
|
+
};
|
|
36
|
+
};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { getAwsRegionExtensionConfiguration, resolveAwsRegionExtensionConfiguration, } from "@aws-sdk/region-config-resolver";
|
|
2
|
+
import { getHttpHandlerExtensionConfiguration, resolveHttpHandlerRuntimeConfig } from "@smithy/protocol-http";
|
|
3
|
+
import { getDefaultExtensionConfiguration, resolveDefaultRuntimeConfig } from "@smithy/smithy-client";
|
|
4
|
+
import { getHttpAuthExtensionConfiguration, resolveHttpAuthRuntimeConfig } from "./auth/httpAuthExtensionConfiguration";
|
|
5
|
+
const asPartial = (t) => t;
|
|
6
|
+
export const resolveRuntimeExtensions = (runtimeConfig, extensions) => {
|
|
7
|
+
const extensionConfiguration = {
|
|
8
|
+
...asPartial(getAwsRegionExtensionConfiguration(runtimeConfig)),
|
|
9
|
+
...asPartial(getDefaultExtensionConfiguration(runtimeConfig)),
|
|
10
|
+
...asPartial(getHttpHandlerExtensionConfiguration(runtimeConfig)),
|
|
11
|
+
...asPartial(getHttpAuthExtensionConfiguration(runtimeConfig)),
|
|
12
|
+
};
|
|
13
|
+
extensions.forEach((extension) => extension.configure(extensionConfiguration));
|
|
14
|
+
return {
|
|
15
|
+
...runtimeConfig,
|
|
16
|
+
...resolveAwsRegionExtensionConfiguration(extensionConfiguration),
|
|
17
|
+
...resolveDefaultRuntimeConfig(extensionConfiguration),
|
|
18
|
+
...resolveHttpHandlerRuntimeConfig(extensionConfiguration),
|
|
19
|
+
...resolveHttpAuthRuntimeConfig(extensionConfiguration),
|
|
20
|
+
};
|
|
21
|
+
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { createAggregatedClient } from "@smithy/smithy-client";
|
|
2
|
+
import { AssumeRoleCommand } from "./commands/AssumeRoleCommand";
|
|
3
|
+
import { AssumeRoleWithWebIdentityCommand, } from "./commands/AssumeRoleWithWebIdentityCommand";
|
|
4
|
+
import { STSClient } from "./STSClient";
|
|
5
|
+
const commands = {
|
|
6
|
+
AssumeRoleCommand,
|
|
7
|
+
AssumeRoleWithWebIdentityCommand,
|
|
8
|
+
};
|
|
9
|
+
export class STS extends STSClient {
|
|
10
|
+
}
|
|
11
|
+
createAggregatedClient(commands, STS);
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { getHostHeaderPlugin, resolveHostHeaderConfig, } from "@aws-sdk/middleware-host-header";
|
|
2
|
+
import { getLoggerPlugin } from "@aws-sdk/middleware-logger";
|
|
3
|
+
import { getRecursionDetectionPlugin } from "@aws-sdk/middleware-recursion-detection";
|
|
4
|
+
import { getUserAgentPlugin, resolveUserAgentConfig, } from "@aws-sdk/middleware-user-agent";
|
|
5
|
+
import { resolveRegionConfig } from "@smithy/config-resolver";
|
|
6
|
+
import { DefaultIdentityProviderConfig, getHttpAuthSchemeEndpointRuleSetPlugin, getHttpSigningPlugin, } from "@smithy/core";
|
|
7
|
+
import { getContentLengthPlugin } from "@smithy/middleware-content-length";
|
|
8
|
+
import { resolveEndpointConfig } from "@smithy/middleware-endpoint";
|
|
9
|
+
import { getRetryPlugin, resolveRetryConfig } from "@smithy/middleware-retry";
|
|
10
|
+
import { Client as __Client, } from "@smithy/smithy-client";
|
|
11
|
+
import { defaultSTSHttpAuthSchemeParametersProvider, resolveHttpAuthSchemeConfig, } from "./auth/httpAuthSchemeProvider";
|
|
12
|
+
import { resolveClientEndpointParameters, } from "./endpoint/EndpointParameters";
|
|
13
|
+
import { getRuntimeConfig as __getRuntimeConfig } from "./runtimeConfig";
|
|
14
|
+
import { resolveRuntimeExtensions } from "./runtimeExtensions";
|
|
15
|
+
export { __Client };
|
|
16
|
+
export class STSClient extends __Client {
|
|
17
|
+
config;
|
|
18
|
+
constructor(...[configuration]) {
|
|
19
|
+
const _config_0 = __getRuntimeConfig(configuration || {});
|
|
20
|
+
const _config_1 = resolveClientEndpointParameters(_config_0);
|
|
21
|
+
const _config_2 = resolveUserAgentConfig(_config_1);
|
|
22
|
+
const _config_3 = resolveRetryConfig(_config_2);
|
|
23
|
+
const _config_4 = resolveRegionConfig(_config_3);
|
|
24
|
+
const _config_5 = resolveHostHeaderConfig(_config_4);
|
|
25
|
+
const _config_6 = resolveEndpointConfig(_config_5);
|
|
26
|
+
const _config_7 = resolveHttpAuthSchemeConfig(_config_6);
|
|
27
|
+
const _config_8 = resolveRuntimeExtensions(_config_7, configuration?.extensions || []);
|
|
28
|
+
super(_config_8);
|
|
29
|
+
this.config = _config_8;
|
|
30
|
+
this.middlewareStack.use(getUserAgentPlugin(this.config));
|
|
31
|
+
this.middlewareStack.use(getRetryPlugin(this.config));
|
|
32
|
+
this.middlewareStack.use(getContentLengthPlugin(this.config));
|
|
33
|
+
this.middlewareStack.use(getHostHeaderPlugin(this.config));
|
|
34
|
+
this.middlewareStack.use(getLoggerPlugin(this.config));
|
|
35
|
+
this.middlewareStack.use(getRecursionDetectionPlugin(this.config));
|
|
36
|
+
this.middlewareStack.use(getHttpAuthSchemeEndpointRuleSetPlugin(this.config, {
|
|
37
|
+
httpAuthSchemeParametersProvider: defaultSTSHttpAuthSchemeParametersProvider,
|
|
38
|
+
identityProviderConfigProvider: async (config) => new DefaultIdentityProviderConfig({
|
|
39
|
+
"aws.auth#sigv4": config.credentials,
|
|
40
|
+
}),
|
|
41
|
+
}));
|
|
42
|
+
this.middlewareStack.use(getHttpSigningPlugin(this.config));
|
|
43
|
+
}
|
|
44
|
+
destroy() {
|
|
45
|
+
super.destroy();
|
|
46
|
+
}
|
|
47
|
+
}
|