@aws-sdk/client-sts 3.35.0 → 3.38.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.
Files changed (135) hide show
  1. package/CHANGELOG.md +47 -0
  2. package/dist-cjs/STS.js +0 -8
  3. package/dist-cjs/STSClient.js +0 -13
  4. package/dist-cjs/commands/AssumeRoleCommand.js +0 -108
  5. package/dist-cjs/commands/AssumeRoleWithSAMLCommand.js +0 -156
  6. package/dist-cjs/commands/AssumeRoleWithWebIdentityCommand.js +0 -160
  7. package/dist-cjs/commands/DecodeAuthorizationMessageCommand.js +0 -60
  8. package/dist-cjs/commands/GetAccessKeyInfoCommand.js +0 -42
  9. package/dist-cjs/commands/GetCallerIdentityCommand.js +0 -34
  10. package/dist-cjs/commands/GetFederationTokenCommand.js +0 -163
  11. package/dist-cjs/commands/GetSessionTokenCommand.js +0 -76
  12. package/dist-cjs/commands/index.js +11 -0
  13. package/dist-cjs/defaultRoleAssumers.js +0 -17
  14. package/dist-cjs/defaultStsRoleAssumers.js +0 -21
  15. package/dist-cjs/endpoints.js +1 -2
  16. package/dist-cjs/index.js +3 -11
  17. package/dist-cjs/models/index.js +0 -1
  18. package/dist-cjs/models/models_0.js +0 -88
  19. package/dist-cjs/protocols/Aws_query.js +0 -3
  20. package/dist-cjs/runtimeConfig.browser.js +1 -6
  21. package/dist-cjs/runtimeConfig.js +3 -8
  22. package/dist-cjs/runtimeConfig.native.js +0 -4
  23. package/dist-cjs/runtimeConfig.shared.js +0 -4
  24. package/dist-es/STS.js +0 -1
  25. package/dist-es/STSClient.js +0 -1
  26. package/dist-es/commands/AssumeRoleCommand.js +0 -1
  27. package/dist-es/commands/AssumeRoleWithSAMLCommand.js +0 -1
  28. package/dist-es/commands/AssumeRoleWithWebIdentityCommand.js +0 -1
  29. package/dist-es/commands/DecodeAuthorizationMessageCommand.js +0 -1
  30. package/dist-es/commands/GetAccessKeyInfoCommand.js +0 -1
  31. package/dist-es/commands/GetCallerIdentityCommand.js +0 -1
  32. package/dist-es/commands/GetFederationTokenCommand.js +0 -1
  33. package/dist-es/commands/GetSessionTokenCommand.js +0 -1
  34. package/dist-es/commands/index.js +8 -0
  35. package/dist-es/defaultRoleAssumers.js +0 -1
  36. package/dist-es/defaultStsRoleAssumers.js +0 -1
  37. package/dist-es/endpoints.js +1 -2
  38. package/dist-es/index.js +3 -11
  39. package/dist-es/models/index.js +0 -1
  40. package/dist-es/models/models_0.js +0 -1
  41. package/dist-es/protocols/Aws_query.js +0 -1
  42. package/dist-es/runtimeConfig.browser.js +1 -2
  43. package/dist-es/runtimeConfig.js +3 -4
  44. package/dist-es/runtimeConfig.native.js +0 -1
  45. package/dist-es/runtimeConfig.shared.js +0 -1
  46. package/dist-types/commands/index.d.ts +8 -0
  47. package/dist-types/index.d.ts +3 -10
  48. package/dist-types/ts3.4/STS.d.ts +9 -630
  49. package/dist-types/ts3.4/STSClient.d.ts +24 -93
  50. package/dist-types/ts3.4/commands/AssumeRoleCommand.d.ts +2 -103
  51. package/dist-types/ts3.4/commands/AssumeRoleWithSAMLCommand.d.ts +2 -151
  52. package/dist-types/ts3.4/commands/AssumeRoleWithWebIdentityCommand.d.ts +2 -155
  53. package/dist-types/ts3.4/commands/DecodeAuthorizationMessageCommand.d.ts +2 -55
  54. package/dist-types/ts3.4/commands/GetAccessKeyInfoCommand.d.ts +2 -37
  55. package/dist-types/ts3.4/commands/GetCallerIdentityCommand.d.ts +2 -29
  56. package/dist-types/ts3.4/commands/GetFederationTokenCommand.d.ts +2 -158
  57. package/dist-types/ts3.4/commands/GetSessionTokenCommand.d.ts +2 -71
  58. package/dist-types/ts3.4/commands/index.d.ts +8 -0
  59. package/dist-types/ts3.4/defaultRoleAssumers.d.ts +3 -14
  60. package/dist-types/ts3.4/defaultStsRoleAssumers.d.ts +6 -25
  61. package/dist-types/ts3.4/index.d.ts +3 -10
  62. package/dist-types/ts3.4/models/models_0.d.ts +123 -948
  63. package/dist-types/ts3.4/runtimeConfig.browser.d.ts +1 -3
  64. package/dist-types/ts3.4/runtimeConfig.d.ts +1 -3
  65. package/dist-types/ts3.4/runtimeConfig.native.d.ts +1 -3
  66. package/dist-types/ts3.4/runtimeConfig.shared.d.ts +1 -3
  67. package/package.json +33 -30
  68. package/dist-cjs/STS.js.map +0 -1
  69. package/dist-cjs/STSClient.js.map +0 -1
  70. package/dist-cjs/commands/AssumeRoleCommand.js.map +0 -1
  71. package/dist-cjs/commands/AssumeRoleWithSAMLCommand.js.map +0 -1
  72. package/dist-cjs/commands/AssumeRoleWithWebIdentityCommand.js.map +0 -1
  73. package/dist-cjs/commands/DecodeAuthorizationMessageCommand.js.map +0 -1
  74. package/dist-cjs/commands/GetAccessKeyInfoCommand.js.map +0 -1
  75. package/dist-cjs/commands/GetCallerIdentityCommand.js.map +0 -1
  76. package/dist-cjs/commands/GetFederationTokenCommand.js.map +0 -1
  77. package/dist-cjs/commands/GetSessionTokenCommand.js.map +0 -1
  78. package/dist-cjs/defaultRoleAssumers.js.map +0 -1
  79. package/dist-cjs/defaultStsRoleAssumers.js.map +0 -1
  80. package/dist-cjs/endpoints.js.map +0 -1
  81. package/dist-cjs/index.js.map +0 -1
  82. package/dist-cjs/models/index.js.map +0 -1
  83. package/dist-cjs/models/models_0.js.map +0 -1
  84. package/dist-cjs/protocols/Aws_query.js.map +0 -1
  85. package/dist-cjs/runtimeConfig.browser.js.map +0 -1
  86. package/dist-cjs/runtimeConfig.js.map +0 -1
  87. package/dist-cjs/runtimeConfig.native.js.map +0 -1
  88. package/dist-cjs/runtimeConfig.shared.js.map +0 -1
  89. package/dist-es/STS.js.map +0 -1
  90. package/dist-es/STSClient.js.map +0 -1
  91. package/dist-es/commands/AssumeRoleCommand.js.map +0 -1
  92. package/dist-es/commands/AssumeRoleWithSAMLCommand.js.map +0 -1
  93. package/dist-es/commands/AssumeRoleWithWebIdentityCommand.js.map +0 -1
  94. package/dist-es/commands/DecodeAuthorizationMessageCommand.js.map +0 -1
  95. package/dist-es/commands/GetAccessKeyInfoCommand.js.map +0 -1
  96. package/dist-es/commands/GetCallerIdentityCommand.js.map +0 -1
  97. package/dist-es/commands/GetFederationTokenCommand.js.map +0 -1
  98. package/dist-es/commands/GetSessionTokenCommand.js.map +0 -1
  99. package/dist-es/defaultRoleAssumers.js.map +0 -1
  100. package/dist-es/defaultStsRoleAssumers.js.map +0 -1
  101. package/dist-es/endpoints.js.map +0 -1
  102. package/dist-es/index.js.map +0 -1
  103. package/dist-es/models/index.js.map +0 -1
  104. package/dist-es/models/models_0.js.map +0 -1
  105. package/dist-es/protocols/Aws_query.js.map +0 -1
  106. package/dist-es/runtimeConfig.browser.js.map +0 -1
  107. package/dist-es/runtimeConfig.js.map +0 -1
  108. package/dist-es/runtimeConfig.native.js.map +0 -1
  109. package/dist-es/runtimeConfig.shared.js.map +0 -1
  110. package/jest.config.js +0 -4
  111. package/src/STS.ts +0 -897
  112. package/src/STSClient.ts +0 -264
  113. package/src/commands/AssumeRoleCommand.ts +0 -177
  114. package/src/commands/AssumeRoleWithSAMLCommand.ts +0 -226
  115. package/src/commands/AssumeRoleWithWebIdentityCommand.ts +0 -233
  116. package/src/commands/DecodeAuthorizationMessageCommand.ts +0 -135
  117. package/src/commands/GetAccessKeyInfoCommand.ts +0 -114
  118. package/src/commands/GetCallerIdentityCommand.ts +0 -106
  119. package/src/commands/GetFederationTokenCommand.ts +0 -235
  120. package/src/commands/GetSessionTokenCommand.ts +0 -148
  121. package/src/defaultRoleAssumers.ts +0 -41
  122. package/src/defaultStsRoleAssumers.ts +0 -126
  123. package/src/endpoints.ts +0 -91
  124. package/src/index.ts +0 -12
  125. package/src/models/index.ts +0 -1
  126. package/src/models/models_0.ts +0 -1361
  127. package/src/protocols/Aws_query.ts +0 -1514
  128. package/src/runtimeConfig.browser.ts +0 -41
  129. package/src/runtimeConfig.native.ts +0 -17
  130. package/src/runtimeConfig.shared.ts +0 -17
  131. package/src/runtimeConfig.ts +0 -46
  132. package/test/defaultRoleAssumers.spec.ts +0 -149
  133. package/tsconfig.es.json +0 -10
  134. package/tsconfig.json +0 -33
  135. package/tsconfig.types.json +0 -9
package/src/STSClient.ts DELETED
@@ -1,264 +0,0 @@
1
- import {
2
- EndpointsInputConfig,
3
- EndpointsResolvedConfig,
4
- RegionInputConfig,
5
- RegionResolvedConfig,
6
- resolveEndpointsConfig,
7
- resolveRegionConfig,
8
- } from "@aws-sdk/config-resolver";
9
- import { getContentLengthPlugin } from "@aws-sdk/middleware-content-length";
10
- import {
11
- getHostHeaderPlugin,
12
- HostHeaderInputConfig,
13
- HostHeaderResolvedConfig,
14
- resolveHostHeaderConfig,
15
- } from "@aws-sdk/middleware-host-header";
16
- import { getLoggerPlugin } from "@aws-sdk/middleware-logger";
17
- import { getRetryPlugin, resolveRetryConfig, RetryInputConfig, RetryResolvedConfig } from "@aws-sdk/middleware-retry";
18
- import { resolveStsAuthConfig, StsAuthInputConfig, StsAuthResolvedConfig } from "@aws-sdk/middleware-sdk-sts";
19
- import {
20
- getUserAgentPlugin,
21
- resolveUserAgentConfig,
22
- UserAgentInputConfig,
23
- UserAgentResolvedConfig,
24
- } from "@aws-sdk/middleware-user-agent";
25
- import { HttpHandler as __HttpHandler } from "@aws-sdk/protocol-http";
26
- import {
27
- Client as __Client,
28
- SmithyConfiguration as __SmithyConfiguration,
29
- SmithyResolvedConfiguration as __SmithyResolvedConfiguration,
30
- } from "@aws-sdk/smithy-client";
31
- import {
32
- Credentials as __Credentials,
33
- Decoder as __Decoder,
34
- Encoder as __Encoder,
35
- Hash as __Hash,
36
- HashConstructor as __HashConstructor,
37
- HttpHandlerOptions as __HttpHandlerOptions,
38
- Logger as __Logger,
39
- Provider as __Provider,
40
- Provider,
41
- RegionInfoProvider,
42
- StreamCollector as __StreamCollector,
43
- UrlParser as __UrlParser,
44
- UserAgent as __UserAgent,
45
- } from "@aws-sdk/types";
46
-
47
- import { AssumeRoleCommandInput, AssumeRoleCommandOutput } from "./commands/AssumeRoleCommand";
48
- import { AssumeRoleWithSAMLCommandInput, AssumeRoleWithSAMLCommandOutput } from "./commands/AssumeRoleWithSAMLCommand";
49
- import {
50
- AssumeRoleWithWebIdentityCommandInput,
51
- AssumeRoleWithWebIdentityCommandOutput,
52
- } from "./commands/AssumeRoleWithWebIdentityCommand";
53
- import {
54
- DecodeAuthorizationMessageCommandInput,
55
- DecodeAuthorizationMessageCommandOutput,
56
- } from "./commands/DecodeAuthorizationMessageCommand";
57
- import { GetAccessKeyInfoCommandInput, GetAccessKeyInfoCommandOutput } from "./commands/GetAccessKeyInfoCommand";
58
- import { GetCallerIdentityCommandInput, GetCallerIdentityCommandOutput } from "./commands/GetCallerIdentityCommand";
59
- import { GetFederationTokenCommandInput, GetFederationTokenCommandOutput } from "./commands/GetFederationTokenCommand";
60
- import { GetSessionTokenCommandInput, GetSessionTokenCommandOutput } from "./commands/GetSessionTokenCommand";
61
- import { getRuntimeConfig as __getRuntimeConfig } from "./runtimeConfig";
62
-
63
- export type ServiceInputTypes =
64
- | AssumeRoleCommandInput
65
- | AssumeRoleWithSAMLCommandInput
66
- | AssumeRoleWithWebIdentityCommandInput
67
- | DecodeAuthorizationMessageCommandInput
68
- | GetAccessKeyInfoCommandInput
69
- | GetCallerIdentityCommandInput
70
- | GetFederationTokenCommandInput
71
- | GetSessionTokenCommandInput;
72
-
73
- export type ServiceOutputTypes =
74
- | AssumeRoleCommandOutput
75
- | AssumeRoleWithSAMLCommandOutput
76
- | AssumeRoleWithWebIdentityCommandOutput
77
- | DecodeAuthorizationMessageCommandOutput
78
- | GetAccessKeyInfoCommandOutput
79
- | GetCallerIdentityCommandOutput
80
- | GetFederationTokenCommandOutput
81
- | GetSessionTokenCommandOutput;
82
-
83
- export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__HttpHandlerOptions>> {
84
- /**
85
- * The HTTP handler to use. Fetch in browser and Https in Nodejs.
86
- */
87
- requestHandler?: __HttpHandler;
88
-
89
- /**
90
- * A constructor for a class implementing the {@link __Hash} interface
91
- * that computes the SHA-256 HMAC or checksum of a string or binary buffer.
92
- * @internal
93
- */
94
- sha256?: __HashConstructor;
95
-
96
- /**
97
- * The function that will be used to convert strings into HTTP endpoints.
98
- * @internal
99
- */
100
- urlParser?: __UrlParser;
101
-
102
- /**
103
- * A function that can calculate the length of a request body.
104
- * @internal
105
- */
106
- bodyLengthChecker?: (body: any) => number | undefined;
107
-
108
- /**
109
- * A function that converts a stream into an array of bytes.
110
- * @internal
111
- */
112
- streamCollector?: __StreamCollector;
113
-
114
- /**
115
- * The function that will be used to convert a base64-encoded string to a byte array.
116
- * @internal
117
- */
118
- base64Decoder?: __Decoder;
119
-
120
- /**
121
- * The function that will be used to convert binary data to a base64-encoded string.
122
- * @internal
123
- */
124
- base64Encoder?: __Encoder;
125
-
126
- /**
127
- * The function that will be used to convert a UTF8-encoded string to a byte array.
128
- * @internal
129
- */
130
- utf8Decoder?: __Decoder;
131
-
132
- /**
133
- * The function that will be used to convert binary data to a UTF-8 encoded string.
134
- * @internal
135
- */
136
- utf8Encoder?: __Encoder;
137
-
138
- /**
139
- * The runtime environment.
140
- * @internal
141
- */
142
- runtime?: string;
143
-
144
- /**
145
- * Disable dyanamically changing the endpoint of the client based on the hostPrefix
146
- * trait of an operation.
147
- */
148
- disableHostPrefix?: boolean;
149
-
150
- /**
151
- * Value for how many times a request will be made at most in case of retry.
152
- */
153
- maxAttempts?: number | __Provider<number>;
154
-
155
- /**
156
- * Specifies which retry algorithm to use.
157
- */
158
- retryMode?: string | __Provider<string>;
159
-
160
- /**
161
- * Optional logger for logging debug/info/warn/error.
162
- */
163
- logger?: __Logger;
164
-
165
- /**
166
- * Unique service identifier.
167
- * @internal
168
- */
169
- serviceId?: string;
170
-
171
- /**
172
- * The AWS region to which this client will send requests
173
- */
174
- region?: string | __Provider<string>;
175
-
176
- /**
177
- * Default credentials provider; Not available in browser runtime.
178
- * @internal
179
- */
180
- credentialDefaultProvider?: (input: any) => __Provider<__Credentials>;
181
-
182
- /**
183
- * Fetch related hostname, signing name or signing region with given region.
184
- * @internal
185
- */
186
- regionInfoProvider?: RegionInfoProvider;
187
-
188
- /**
189
- * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header
190
- * @internal
191
- */
192
- defaultUserAgentProvider?: Provider<__UserAgent>;
193
- }
194
-
195
- type STSClientConfigType = Partial<__SmithyConfiguration<__HttpHandlerOptions>> &
196
- ClientDefaults &
197
- RegionInputConfig &
198
- EndpointsInputConfig &
199
- RetryInputConfig &
200
- HostHeaderInputConfig &
201
- StsAuthInputConfig &
202
- UserAgentInputConfig;
203
- /**
204
- * The configuration interface of STSClient class constructor that set the region, credentials and other options.
205
- */
206
- export interface STSClientConfig extends STSClientConfigType {}
207
-
208
- type STSClientResolvedConfigType = __SmithyResolvedConfiguration<__HttpHandlerOptions> &
209
- Required<ClientDefaults> &
210
- RegionResolvedConfig &
211
- EndpointsResolvedConfig &
212
- RetryResolvedConfig &
213
- HostHeaderResolvedConfig &
214
- StsAuthResolvedConfig &
215
- UserAgentResolvedConfig;
216
- /**
217
- * The resolved configuration interface of STSClient class. This is resolved and normalized from the {@link STSClientConfig | constructor configuration interface}.
218
- */
219
- export interface STSClientResolvedConfig extends STSClientResolvedConfigType {}
220
-
221
- /**
222
- * <fullname>Security Token Service</fullname>
223
- * <p>Security Token Service (STS) enables you to request temporary, limited-privilege
224
- * credentials for Identity and Access Management (IAM) users or for users that you
225
- * authenticate (federated users). This guide provides descriptions of the STS API. For
226
- * more information about using this service, see <a href="https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp.html">Temporary Security Credentials</a>.</p>
227
- */
228
- export class STSClient extends __Client<
229
- __HttpHandlerOptions,
230
- ServiceInputTypes,
231
- ServiceOutputTypes,
232
- STSClientResolvedConfig
233
- > {
234
- /**
235
- * The resolved configuration of STSClient class. This is resolved and normalized from the {@link STSClientConfig | constructor configuration interface}.
236
- */
237
- readonly config: STSClientResolvedConfig;
238
-
239
- constructor(configuration: STSClientConfig) {
240
- const _config_0 = __getRuntimeConfig(configuration);
241
- const _config_1 = resolveRegionConfig(_config_0);
242
- const _config_2 = resolveEndpointsConfig(_config_1);
243
- const _config_3 = resolveRetryConfig(_config_2);
244
- const _config_4 = resolveHostHeaderConfig(_config_3);
245
- const _config_5 = resolveStsAuthConfig(_config_4, { stsClientCtor: STSClient });
246
- const _config_6 = resolveUserAgentConfig(_config_5);
247
- super(_config_6);
248
- this.config = _config_6;
249
- this.middlewareStack.use(getRetryPlugin(this.config));
250
- this.middlewareStack.use(getContentLengthPlugin(this.config));
251
- this.middlewareStack.use(getHostHeaderPlugin(this.config));
252
- this.middlewareStack.use(getLoggerPlugin(this.config));
253
- this.middlewareStack.use(getUserAgentPlugin(this.config));
254
- }
255
-
256
- /**
257
- * Destroy underlying resources, like sockets. It's usually not necessary to do this.
258
- * However in Node.js, it's best to explicitly shut down the client's agent when it is no longer needed.
259
- * Otherwise, sockets might stay open for quite a long time before the server terminates them.
260
- */
261
- destroy(): void {
262
- super.destroy();
263
- }
264
- }
@@ -1,177 +0,0 @@
1
- import { getSerdePlugin } from "@aws-sdk/middleware-serde";
2
- import { getAwsAuthPlugin } from "@aws-sdk/middleware-signing";
3
- import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@aws-sdk/protocol-http";
4
- import { Command as $Command } from "@aws-sdk/smithy-client";
5
- import {
6
- FinalizeHandlerArguments,
7
- Handler,
8
- HandlerExecutionContext,
9
- HttpHandlerOptions as __HttpHandlerOptions,
10
- MetadataBearer as __MetadataBearer,
11
- MiddlewareStack,
12
- SerdeContext as __SerdeContext,
13
- } from "@aws-sdk/types";
14
-
15
- import { AssumeRoleRequest, AssumeRoleResponse } from "../models/models_0";
16
- import { deserializeAws_queryAssumeRoleCommand, serializeAws_queryAssumeRoleCommand } from "../protocols/Aws_query";
17
- import { ServiceInputTypes, ServiceOutputTypes, STSClientResolvedConfig } from "../STSClient";
18
-
19
- export interface AssumeRoleCommandInput extends AssumeRoleRequest {}
20
- export interface AssumeRoleCommandOutput extends AssumeRoleResponse, __MetadataBearer {}
21
-
22
- /**
23
- * <p>Returns a set of temporary security credentials that you can use to access Amazon Web Services
24
- * resources that you might not normally have access to. These temporary credentials
25
- * consist of an access key ID, a secret access key, and a security token. Typically, you
26
- * use <code>AssumeRole</code> within your account or for cross-account access. For a
27
- * comparison of <code>AssumeRole</code> with other API operations that produce temporary
28
- * credentials, see <a href="https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_request.html">Requesting Temporary Security
29
- * Credentials</a> and <a href="https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_request.html#stsapi_comparison">Comparing
30
- * the STS API operations</a> in the
31
- * <i>IAM User Guide</i>.</p>
32
- * <p>
33
- * <b>Permissions</b>
34
- * </p>
35
- * <p>The temporary security credentials created by <code>AssumeRole</code> can be used to
36
- * make API calls to any Amazon Web Services service with the following exception: You cannot call the
37
- * STS <code>GetFederationToken</code> or <code>GetSessionToken</code> API
38
- * operations.</p>
39
- * <p>(Optional) You can pass inline or managed <a href="https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies.html#policies_session">session policies</a> to
40
- * this operation. You can pass a single JSON policy document to use as an inline session
41
- * policy. You can also specify up to 10 managed policies to use as managed session policies.
42
- * The plaintext that you use for both inline and managed session policies can't exceed 2,048
43
- * characters. Passing policies to this operation returns new
44
- * temporary credentials. The resulting session's permissions are the intersection of the
45
- * role's identity-based policy and the session policies. You can use the role's temporary
46
- * credentials in subsequent Amazon Web Services API calls to access resources in the account that owns
47
- * the role. You cannot use session policies to grant more permissions than those allowed
48
- * by the identity-based policy of the role that is being assumed. For more information, see
49
- * <a href="https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies.html#policies_session">Session
50
- * Policies</a> in the <i>IAM User Guide</i>.</p>
51
- * <p>To assume a role from a different account, your account must be trusted by the
52
- * role. The trust relationship is defined in the role's trust policy when the role is
53
- * created. That trust policy states which accounts are allowed to delegate that access to
54
- * users in the account. </p>
55
- * <p>A user who wants to access a role in a different account must also have permissions that
56
- * are delegated from the user account administrator. The administrator must attach a policy
57
- * that allows the user to call <code>AssumeRole</code> for the ARN of the role in the other
58
- * account. If the user is in the same account as the role, then you can do either of the
59
- * following:</p>
60
- * <ul>
61
- * <li>
62
- * <p>Attach a policy to the user (identical to the previous user in a different
63
- * account).</p>
64
- * </li>
65
- * <li>
66
- * <p>Add the user as a principal directly in the role's trust policy.</p>
67
- * </li>
68
- * </ul>
69
- * <p>In this case, the trust policy acts as an IAM resource-based policy. Users in the same
70
- * account as the role do not need explicit permission to assume the role. For more
71
- * information about trust policies and resource-based policies, see <a href="https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies.html">IAM Policies</a> in
72
- * the <i>IAM User Guide</i>.</p>
73
- * <p>
74
- * <b>Tags</b>
75
- * </p>
76
- * <p>(Optional) You can pass tag key-value pairs to your session. These tags are called
77
- * session tags. For more information about session tags, see <a href="https://docs.aws.amazon.com/IAM/latest/UserGuide/id_session-tags.html">Passing Session Tags in STS</a> in the
78
- * <i>IAM User Guide</i>.</p>
79
- * <p>An administrator must grant you the permissions necessary to pass session tags. The
80
- * administrator can also create granular permissions to allow you to pass only specific
81
- * session tags. For more information, see <a href="https://docs.aws.amazon.com/IAM/latest/UserGuide/tutorial_attribute-based-access-control.html">Tutorial: Using Tags
82
- * for Attribute-Based Access Control</a> in the
83
- * <i>IAM User Guide</i>.</p>
84
- * <p>You can set the session tags as transitive. Transitive tags persist during role
85
- * chaining. For more information, see <a href="https://docs.aws.amazon.com/IAM/latest/UserGuide/id_session-tags.html#id_session-tags_role-chaining">Chaining Roles
86
- * with Session Tags</a> in the <i>IAM User Guide</i>.</p>
87
- * <p>
88
- * <b>Using MFA with AssumeRole</b>
89
- * </p>
90
- * <p>(Optional) You can include multi-factor authentication (MFA) information when you call
91
- * <code>AssumeRole</code>. This is useful for cross-account scenarios to ensure that the
92
- * user that assumes the role has been authenticated with an Amazon Web Services MFA device. In that
93
- * scenario, the trust policy of the role being assumed includes a condition that tests for
94
- * MFA authentication. If the caller does not include valid MFA information, the request to
95
- * assume the role is denied. The condition in a trust policy that tests for MFA
96
- * authentication might look like the following example.</p>
97
- * <p>
98
- * <code>"Condition": {"Bool": {"aws:MultiFactorAuthPresent": true}}</code>
99
- * </p>
100
- * <p>For more information, see <a href="https://docs.aws.amazon.com/IAM/latest/UserGuide/MFAProtectedAPI.html">Configuring MFA-Protected API Access</a>
101
- * in the <i>IAM User Guide</i> guide.</p>
102
- * <p>To use MFA with <code>AssumeRole</code>, you pass values for the
103
- * <code>SerialNumber</code> and <code>TokenCode</code> parameters. The
104
- * <code>SerialNumber</code> value identifies the user's hardware or virtual MFA device.
105
- * The <code>TokenCode</code> is the time-based one-time password (TOTP) that the MFA device
106
- * produces. </p>
107
- * @example
108
- * Use a bare-bones client and the command you need to make an API call.
109
- * ```javascript
110
- * import { STSClient, AssumeRoleCommand } from "@aws-sdk/client-sts"; // ES Modules import
111
- * // const { STSClient, AssumeRoleCommand } = require("@aws-sdk/client-sts"); // CommonJS import
112
- * const client = new STSClient(config);
113
- * const command = new AssumeRoleCommand(input);
114
- * const response = await client.send(command);
115
- * ```
116
- *
117
- * @see {@link AssumeRoleCommandInput} for command's `input` shape.
118
- * @see {@link AssumeRoleCommandOutput} for command's `response` shape.
119
- * @see {@link STSClientResolvedConfig | config} for command's `input` shape.
120
- *
121
- */
122
- export class AssumeRoleCommand extends $Command<
123
- AssumeRoleCommandInput,
124
- AssumeRoleCommandOutput,
125
- STSClientResolvedConfig
126
- > {
127
- // Start section: command_properties
128
- // End section: command_properties
129
-
130
- constructor(readonly input: AssumeRoleCommandInput) {
131
- // Start section: command_constructor
132
- super();
133
- // End section: command_constructor
134
- }
135
-
136
- /**
137
- * @internal
138
- */
139
- resolveMiddleware(
140
- clientStack: MiddlewareStack<ServiceInputTypes, ServiceOutputTypes>,
141
- configuration: STSClientResolvedConfig,
142
- options?: __HttpHandlerOptions
143
- ): Handler<AssumeRoleCommandInput, AssumeRoleCommandOutput> {
144
- this.middlewareStack.use(getSerdePlugin(configuration, this.serialize, this.deserialize));
145
- this.middlewareStack.use(getAwsAuthPlugin(configuration));
146
-
147
- const stack = clientStack.concat(this.middlewareStack);
148
-
149
- const { logger } = configuration;
150
- const clientName = "STSClient";
151
- const commandName = "AssumeRoleCommand";
152
- const handlerExecutionContext: HandlerExecutionContext = {
153
- logger,
154
- clientName,
155
- commandName,
156
- inputFilterSensitiveLog: AssumeRoleRequest.filterSensitiveLog,
157
- outputFilterSensitiveLog: AssumeRoleResponse.filterSensitiveLog,
158
- };
159
- const { requestHandler } = configuration;
160
- return stack.resolve(
161
- (request: FinalizeHandlerArguments<any>) =>
162
- requestHandler.handle(request.request as __HttpRequest, options || {}),
163
- handlerExecutionContext
164
- );
165
- }
166
-
167
- private serialize(input: AssumeRoleCommandInput, context: __SerdeContext): Promise<__HttpRequest> {
168
- return serializeAws_queryAssumeRoleCommand(input, context);
169
- }
170
-
171
- private deserialize(output: __HttpResponse, context: __SerdeContext): Promise<AssumeRoleCommandOutput> {
172
- return deserializeAws_queryAssumeRoleCommand(output, context);
173
- }
174
-
175
- // Start section: command_body_extra
176
- // End section: command_body_extra
177
- }
@@ -1,226 +0,0 @@
1
- import { getSerdePlugin } from "@aws-sdk/middleware-serde";
2
- import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@aws-sdk/protocol-http";
3
- import { Command as $Command } from "@aws-sdk/smithy-client";
4
- import {
5
- FinalizeHandlerArguments,
6
- Handler,
7
- HandlerExecutionContext,
8
- HttpHandlerOptions as __HttpHandlerOptions,
9
- MetadataBearer as __MetadataBearer,
10
- MiddlewareStack,
11
- SerdeContext as __SerdeContext,
12
- } from "@aws-sdk/types";
13
-
14
- import { AssumeRoleWithSAMLRequest, AssumeRoleWithSAMLResponse } from "../models/models_0";
15
- import {
16
- deserializeAws_queryAssumeRoleWithSAMLCommand,
17
- serializeAws_queryAssumeRoleWithSAMLCommand,
18
- } from "../protocols/Aws_query";
19
- import { ServiceInputTypes, ServiceOutputTypes, STSClientResolvedConfig } from "../STSClient";
20
-
21
- export interface AssumeRoleWithSAMLCommandInput extends AssumeRoleWithSAMLRequest {}
22
- export interface AssumeRoleWithSAMLCommandOutput extends AssumeRoleWithSAMLResponse, __MetadataBearer {}
23
-
24
- /**
25
- * <p>Returns a set of temporary security credentials for users who have been authenticated
26
- * via a SAML authentication response. This operation provides a mechanism for tying an
27
- * enterprise identity store or directory to role-based Amazon Web Services access without user-specific
28
- * credentials or configuration. For a comparison of <code>AssumeRoleWithSAML</code> with the
29
- * other API operations that produce temporary credentials, see <a href="https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_request.html">Requesting Temporary Security
30
- * Credentials</a> and <a href="https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_request.html#stsapi_comparison">Comparing the
31
- * STS API operations</a> in the <i>IAM User Guide</i>.</p>
32
- * <p>The temporary security credentials returned by this operation consist of an access key
33
- * ID, a secret access key, and a security token. Applications can use these temporary
34
- * security credentials to sign calls to Amazon Web Services services.</p>
35
- * <p>
36
- * <b>Session Duration</b>
37
- * </p>
38
- * <p>By default, the temporary security credentials created by
39
- * <code>AssumeRoleWithSAML</code> last for one hour. However, you can use the optional
40
- * <code>DurationSeconds</code> parameter to specify the duration of your session. Your
41
- * role session lasts for the duration that you specify, or until the time specified in the
42
- * SAML authentication response's <code>SessionNotOnOrAfter</code> value, whichever is
43
- * shorter. You can provide a <code>DurationSeconds</code> value from 900 seconds (15 minutes)
44
- * up to the maximum session duration setting for the role. This setting can have a value from
45
- * 1 hour to 12 hours. To learn how to view the maximum value for your role, see <a href="https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_use.html#id_roles_use_view-role-max-session">View the
46
- * Maximum Session Duration Setting for a Role</a> in the
47
- * <i>IAM User Guide</i>. The maximum session duration limit applies when
48
- * you use the <code>AssumeRole*</code> API operations or the <code>assume-role*</code> CLI
49
- * commands. However the limit does not apply when you use those operations to create a
50
- * console URL. For more information, see <a href="https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_use.html">Using IAM Roles</a> in the
51
- * <i>IAM User Guide</i>.</p>
52
- * <note>
53
- * <p>
54
- * <a href="https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_terms-and-concepts.html#iam-term-role-chaining">Role chaining</a> limits your CLI or Amazon Web Services API
55
- * role session to a maximum of one hour. When you use the <code>AssumeRole</code> API
56
- * operation to assume a role, you can specify the duration of your role session with
57
- * the <code>DurationSeconds</code> parameter. You can specify a parameter value of up
58
- * to 43200 seconds (12 hours), depending on the maximum session duration setting for
59
- * your role. However, if you assume a role using role chaining and provide a
60
- * <code>DurationSeconds</code> parameter value greater than one hour, the
61
- * operation fails.</p>
62
- * </note>
63
- * <p>
64
- * <b>Permissions</b>
65
- * </p>
66
- * <p>The temporary security credentials created by <code>AssumeRoleWithSAML</code> can be
67
- * used to make API calls to any Amazon Web Services service with the following exception: you cannot call
68
- * the STS <code>GetFederationToken</code> or <code>GetSessionToken</code> API
69
- * operations.</p>
70
- * <p>(Optional) You can pass inline or managed <a href="https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies.html#policies_session">session policies</a> to
71
- * this operation. You can pass a single JSON policy document to use as an inline session
72
- * policy. You can also specify up to 10 managed policies to use as managed session policies.
73
- * The plaintext that you use for both inline and managed session policies can't exceed 2,048
74
- * characters. Passing policies to this operation returns new
75
- * temporary credentials. The resulting session's permissions are the intersection of the
76
- * role's identity-based policy and the session policies. You can use the role's temporary
77
- * credentials in subsequent Amazon Web Services API calls to access resources in the account that owns
78
- * the role. You cannot use session policies to grant more permissions than those allowed
79
- * by the identity-based policy of the role that is being assumed. For more information, see
80
- * <a href="https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies.html#policies_session">Session
81
- * Policies</a> in the <i>IAM User Guide</i>.</p>
82
- * <p>Calling <code>AssumeRoleWithSAML</code> does not require the use of Amazon Web Services security
83
- * credentials. The identity of the caller is validated by using keys in the metadata document
84
- * that is uploaded for the SAML provider entity for your identity provider. </p>
85
- * <important>
86
- * <p>Calling <code>AssumeRoleWithSAML</code> can result in an entry in your CloudTrail logs.
87
- * The entry includes the value in the <code>NameID</code> element of the SAML assertion.
88
- * We recommend that you use a <code>NameIDType</code> that is not associated with any
89
- * personally identifiable information (PII). For example, you could instead use the
90
- * persistent identifier
91
- * (<code>urn:oasis:names:tc:SAML:2.0:nameid-format:persistent</code>).</p>
92
- * </important>
93
- * <p>
94
- * <b>Tags</b>
95
- * </p>
96
- * <p>(Optional) You can configure your IdP to pass attributes into your SAML assertion as
97
- * session tags. Each session tag consists of a key name and an associated value. For more
98
- * information about session tags, see <a href="https://docs.aws.amazon.com/IAM/latest/UserGuide/id_session-tags.html">Passing Session Tags in STS</a> in the
99
- * <i>IAM User Guide</i>.</p>
100
- * <p>You can pass up to 50 session tags. The plaintext session tag keys can’t exceed 128
101
- * characters and the values can’t exceed 256 characters. For these and additional limits, see
102
- * <a href="https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_iam-limits.html#reference_iam-limits-entity-length">IAM
103
- * and STS Character Limits</a> in the <i>IAM User Guide</i>.</p>
104
- *
105
- * <note>
106
- * <p>An Amazon Web Services conversion compresses the passed session policies and session tags into a
107
- * packed binary format that has a separate limit. Your request can fail for this limit
108
- * even if your plaintext meets the other requirements. The <code>PackedPolicySize</code>
109
- * response element indicates by percentage how close the policies and tags for your
110
- * request are to the upper size limit.
111
- * </p>
112
- * </note>
113
- * <p>You can pass a session tag with the same key as a tag that is
114
- * attached to the role. When you do, session tags override the role's tags with the same
115
- * key.</p>
116
- * <p>An administrator must grant you the permissions necessary to pass session tags. The
117
- * administrator can also create granular permissions to allow you to pass only specific
118
- * session tags. For more information, see <a href="https://docs.aws.amazon.com/IAM/latest/UserGuide/tutorial_attribute-based-access-control.html">Tutorial: Using Tags
119
- * for Attribute-Based Access Control</a> in the
120
- * <i>IAM User Guide</i>.</p>
121
- * <p>You can set the session tags as transitive. Transitive tags persist during role
122
- * chaining. For more information, see <a href="https://docs.aws.amazon.com/IAM/latest/UserGuide/id_session-tags.html#id_session-tags_role-chaining">Chaining Roles
123
- * with Session Tags</a> in the <i>IAM User Guide</i>.</p>
124
- * <p>
125
- * <b>SAML Configuration</b>
126
- * </p>
127
- * <p>Before your application can call <code>AssumeRoleWithSAML</code>, you must configure
128
- * your SAML identity provider (IdP) to issue the claims required by Amazon Web Services. Additionally, you
129
- * must use Identity and Access Management (IAM) to create a SAML provider entity in your Amazon Web Services account that
130
- * represents your identity provider. You must also create an IAM role that specifies this
131
- * SAML provider in its trust policy. </p>
132
- * <p>For more information, see the following resources:</p>
133
- * <ul>
134
- * <li>
135
- * <p>
136
- * <a href="https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_providers_saml.html">About
137
- * SAML 2.0-based Federation</a> in the <i>IAM User Guide</i>.
138
- * </p>
139
- * </li>
140
- * <li>
141
- * <p>
142
- * <a href="https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_providers_create_saml.html">Creating SAML Identity Providers</a> in the
143
- * <i>IAM User Guide</i>. </p>
144
- * </li>
145
- * <li>
146
- * <p>
147
- * <a href="https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_providers_create_saml_relying-party.html">Configuring
148
- * a Relying Party and Claims</a> in the <i>IAM User Guide</i>.
149
- * </p>
150
- * </li>
151
- * <li>
152
- * <p>
153
- * <a href="https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_create_for-idp_saml.html">Creating a Role for SAML 2.0 Federation</a> in the
154
- * <i>IAM User Guide</i>. </p>
155
- * </li>
156
- * </ul>
157
- * @example
158
- * Use a bare-bones client and the command you need to make an API call.
159
- * ```javascript
160
- * import { STSClient, AssumeRoleWithSAMLCommand } from "@aws-sdk/client-sts"; // ES Modules import
161
- * // const { STSClient, AssumeRoleWithSAMLCommand } = require("@aws-sdk/client-sts"); // CommonJS import
162
- * const client = new STSClient(config);
163
- * const command = new AssumeRoleWithSAMLCommand(input);
164
- * const response = await client.send(command);
165
- * ```
166
- *
167
- * @see {@link AssumeRoleWithSAMLCommandInput} for command's `input` shape.
168
- * @see {@link AssumeRoleWithSAMLCommandOutput} for command's `response` shape.
169
- * @see {@link STSClientResolvedConfig | config} for command's `input` shape.
170
- *
171
- */
172
- export class AssumeRoleWithSAMLCommand extends $Command<
173
- AssumeRoleWithSAMLCommandInput,
174
- AssumeRoleWithSAMLCommandOutput,
175
- STSClientResolvedConfig
176
- > {
177
- // Start section: command_properties
178
- // End section: command_properties
179
-
180
- constructor(readonly input: AssumeRoleWithSAMLCommandInput) {
181
- // Start section: command_constructor
182
- super();
183
- // End section: command_constructor
184
- }
185
-
186
- /**
187
- * @internal
188
- */
189
- resolveMiddleware(
190
- clientStack: MiddlewareStack<ServiceInputTypes, ServiceOutputTypes>,
191
- configuration: STSClientResolvedConfig,
192
- options?: __HttpHandlerOptions
193
- ): Handler<AssumeRoleWithSAMLCommandInput, AssumeRoleWithSAMLCommandOutput> {
194
- this.middlewareStack.use(getSerdePlugin(configuration, this.serialize, this.deserialize));
195
-
196
- const stack = clientStack.concat(this.middlewareStack);
197
-
198
- const { logger } = configuration;
199
- const clientName = "STSClient";
200
- const commandName = "AssumeRoleWithSAMLCommand";
201
- const handlerExecutionContext: HandlerExecutionContext = {
202
- logger,
203
- clientName,
204
- commandName,
205
- inputFilterSensitiveLog: AssumeRoleWithSAMLRequest.filterSensitiveLog,
206
- outputFilterSensitiveLog: AssumeRoleWithSAMLResponse.filterSensitiveLog,
207
- };
208
- const { requestHandler } = configuration;
209
- return stack.resolve(
210
- (request: FinalizeHandlerArguments<any>) =>
211
- requestHandler.handle(request.request as __HttpRequest, options || {}),
212
- handlerExecutionContext
213
- );
214
- }
215
-
216
- private serialize(input: AssumeRoleWithSAMLCommandInput, context: __SerdeContext): Promise<__HttpRequest> {
217
- return serializeAws_queryAssumeRoleWithSAMLCommand(input, context);
218
- }
219
-
220
- private deserialize(output: __HttpResponse, context: __SerdeContext): Promise<AssumeRoleWithSAMLCommandOutput> {
221
- return deserializeAws_queryAssumeRoleWithSAMLCommand(output, context);
222
- }
223
-
224
- // Start section: command_body_extra
225
- // End section: command_body_extra
226
- }