@aws-sdk/client-sts 3.33.0 → 3.36.1

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 (189) hide show
  1. package/CHANGELOG.md +47 -0
  2. package/{dist/cjs → dist-cjs}/STS.js +1 -9
  3. package/dist-cjs/STSClient.js +34 -0
  4. package/dist-cjs/commands/AssumeRoleCommand.js +38 -0
  5. package/dist-cjs/commands/AssumeRoleWithSAMLCommand.js +36 -0
  6. package/dist-cjs/commands/AssumeRoleWithWebIdentityCommand.js +36 -0
  7. package/dist-cjs/commands/DecodeAuthorizationMessageCommand.js +38 -0
  8. package/dist-cjs/commands/GetAccessKeyInfoCommand.js +38 -0
  9. package/dist-cjs/commands/GetCallerIdentityCommand.js +38 -0
  10. package/dist-cjs/commands/GetFederationTokenCommand.js +38 -0
  11. package/dist-cjs/commands/GetSessionTokenCommand.js +38 -0
  12. package/{dist/cjs → dist-cjs}/defaultRoleAssumers.js +0 -17
  13. package/{dist/cjs → dist-cjs}/defaultStsRoleAssumers.js +0 -21
  14. package/{dist/cjs → dist-cjs}/endpoints.js +0 -1
  15. package/{dist/cjs → dist-cjs}/index.js +0 -1
  16. package/{dist/cjs → dist-cjs}/models/index.js +0 -1
  17. package/{dist/cjs → dist-cjs}/models/models_0.js +0 -88
  18. package/{dist/cjs → dist-cjs}/protocols/Aws_query.js +22 -25
  19. package/{dist/cjs → dist-cjs}/runtimeConfig.browser.js +1 -5
  20. package/{dist/cjs → dist-cjs}/runtimeConfig.js +1 -5
  21. package/{dist/cjs → dist-cjs}/runtimeConfig.native.js +0 -4
  22. package/{dist/cjs → dist-cjs}/runtimeConfig.shared.js +1 -5
  23. package/{dist/es → dist-es}/STS.js +2 -10
  24. package/{dist/es → dist-es}/STSClient.js +2 -15
  25. package/dist-es/commands/AssumeRoleCommand.js +41 -0
  26. package/dist-es/commands/AssumeRoleWithSAMLCommand.js +39 -0
  27. package/dist-es/commands/AssumeRoleWithWebIdentityCommand.js +39 -0
  28. package/dist-es/commands/DecodeAuthorizationMessageCommand.js +41 -0
  29. package/dist-es/commands/GetAccessKeyInfoCommand.js +41 -0
  30. package/{dist/es → dist-es}/commands/GetCallerIdentityCommand.js +4 -39
  31. package/dist-es/commands/GetFederationTokenCommand.js +41 -0
  32. package/dist-es/commands/GetSessionTokenCommand.js +41 -0
  33. package/dist-es/defaultRoleAssumers.js +16 -0
  34. package/{dist/es → dist-es}/defaultStsRoleAssumers.js +10 -32
  35. package/{dist/es → dist-es}/endpoints.js +1 -2
  36. package/{dist/types/index.d.ts → dist-es/index.js} +0 -0
  37. package/{dist/types/models/index.d.ts → dist-es/models/index.js} +0 -0
  38. package/{dist/es → dist-es}/models/models_0.js +0 -88
  39. package/{dist/es → dist-es}/protocols/Aws_query.js +152 -155
  40. package/{dist/es → dist-es}/runtimeConfig.browser.js +1 -5
  41. package/{dist/es → dist-es}/runtimeConfig.js +1 -5
  42. package/{dist/es → dist-es}/runtimeConfig.native.js +0 -4
  43. package/{dist/es → dist-es}/runtimeConfig.shared.js +1 -5
  44. package/{dist/types → dist-types}/STS.d.ts +2 -2
  45. package/{dist/types → dist-types}/STSClient.d.ts +8 -8
  46. package/{dist/types → dist-types}/commands/AssumeRoleCommand.d.ts +3 -3
  47. package/{dist/types → dist-types}/commands/AssumeRoleWithSAMLCommand.d.ts +3 -3
  48. package/{dist/types → dist-types}/commands/AssumeRoleWithWebIdentityCommand.d.ts +3 -3
  49. package/{dist/types → dist-types}/commands/DecodeAuthorizationMessageCommand.d.ts +3 -3
  50. package/{dist/types → dist-types}/commands/GetAccessKeyInfoCommand.d.ts +3 -3
  51. package/{dist/types → dist-types}/commands/GetCallerIdentityCommand.d.ts +3 -3
  52. package/{dist/types → dist-types}/commands/GetFederationTokenCommand.d.ts +3 -3
  53. package/{dist/types → dist-types}/commands/GetSessionTokenCommand.d.ts +3 -3
  54. package/{dist/types → dist-types}/defaultRoleAssumers.d.ts +0 -0
  55. package/{dist/types → dist-types}/defaultStsRoleAssumers.d.ts +0 -0
  56. package/{dist/types → dist-types}/endpoints.d.ts +0 -0
  57. package/{index.ts → dist-types/index.d.ts} +0 -0
  58. package/{models/index.ts → dist-types/models/index.d.ts} +0 -0
  59. package/{dist/types → dist-types}/models/models_0.d.ts +0 -0
  60. package/{dist/types → dist-types}/protocols/Aws_query.d.ts +2 -2
  61. package/{dist/types → dist-types}/runtimeConfig.browser.d.ts +0 -0
  62. package/{dist/types → dist-types}/runtimeConfig.d.ts +0 -0
  63. package/{dist/types → dist-types}/runtimeConfig.native.d.ts +0 -0
  64. package/{dist/types → dist-types}/runtimeConfig.shared.d.ts +0 -0
  65. package/dist-types/ts3.4/STS.d.ts +45 -0
  66. package/{dist/types → dist-types}/ts3.4/STSClient.d.ts +32 -101
  67. package/dist-types/ts3.4/commands/AssumeRoleCommand.d.ts +17 -0
  68. package/dist-types/ts3.4/commands/AssumeRoleWithSAMLCommand.d.ts +17 -0
  69. package/dist-types/ts3.4/commands/AssumeRoleWithWebIdentityCommand.d.ts +17 -0
  70. package/dist-types/ts3.4/commands/DecodeAuthorizationMessageCommand.d.ts +17 -0
  71. package/dist-types/ts3.4/commands/GetAccessKeyInfoCommand.d.ts +17 -0
  72. package/dist-types/ts3.4/commands/GetCallerIdentityCommand.d.ts +17 -0
  73. package/dist-types/ts3.4/commands/GetFederationTokenCommand.d.ts +17 -0
  74. package/dist-types/ts3.4/commands/GetSessionTokenCommand.d.ts +17 -0
  75. package/dist-types/ts3.4/defaultRoleAssumers.d.ts +8 -0
  76. package/{dist/types → dist-types}/ts3.4/defaultStsRoleAssumers.d.ts +6 -25
  77. package/{dist/types → dist-types}/ts3.4/endpoints.d.ts +0 -0
  78. package/{dist/types → dist-types}/ts3.4/index.d.ts +0 -0
  79. package/{dist/types → dist-types}/ts3.4/models/index.d.ts +0 -0
  80. package/dist-types/ts3.4/models/models_0.d.ts +367 -0
  81. package/{dist/types → dist-types}/ts3.4/protocols/Aws_query.d.ts +2 -2
  82. package/{dist/types → dist-types}/ts3.4/runtimeConfig.browser.d.ts +1 -3
  83. package/{dist/types → dist-types}/ts3.4/runtimeConfig.d.ts +1 -3
  84. package/{dist/types → dist-types}/ts3.4/runtimeConfig.native.d.ts +1 -3
  85. package/{dist/types → dist-types}/ts3.4/runtimeConfig.shared.d.ts +1 -3
  86. package/package.json +52 -49
  87. package/STS.ts +0 -896
  88. package/STSClient.ts +0 -263
  89. package/commands/AssumeRoleCommand.ts +0 -176
  90. package/commands/AssumeRoleWithSAMLCommand.ts +0 -225
  91. package/commands/AssumeRoleWithWebIdentityCommand.ts +0 -232
  92. package/commands/DecodeAuthorizationMessageCommand.ts +0 -134
  93. package/commands/GetAccessKeyInfoCommand.ts +0 -113
  94. package/commands/GetCallerIdentityCommand.ts +0 -105
  95. package/commands/GetFederationTokenCommand.ts +0 -234
  96. package/commands/GetSessionTokenCommand.ts +0 -147
  97. package/defaultRoleAssumers.spec.ts +0 -148
  98. package/defaultRoleAssumers.ts +0 -41
  99. package/defaultStsRoleAssumers.ts +0 -126
  100. package/dist/cjs/STS.js.map +0 -1
  101. package/dist/cjs/STSClient.js +0 -47
  102. package/dist/cjs/STSClient.js.map +0 -1
  103. package/dist/cjs/commands/AssumeRoleCommand.js +0 -146
  104. package/dist/cjs/commands/AssumeRoleCommand.js.map +0 -1
  105. package/dist/cjs/commands/AssumeRoleWithSAMLCommand.js +0 -192
  106. package/dist/cjs/commands/AssumeRoleWithSAMLCommand.js.map +0 -1
  107. package/dist/cjs/commands/AssumeRoleWithWebIdentityCommand.js +0 -196
  108. package/dist/cjs/commands/AssumeRoleWithWebIdentityCommand.js.map +0 -1
  109. package/dist/cjs/commands/DecodeAuthorizationMessageCommand.js +0 -98
  110. package/dist/cjs/commands/DecodeAuthorizationMessageCommand.js.map +0 -1
  111. package/dist/cjs/commands/GetAccessKeyInfoCommand.js +0 -80
  112. package/dist/cjs/commands/GetAccessKeyInfoCommand.js.map +0 -1
  113. package/dist/cjs/commands/GetCallerIdentityCommand.js +0 -72
  114. package/dist/cjs/commands/GetCallerIdentityCommand.js.map +0 -1
  115. package/dist/cjs/commands/GetFederationTokenCommand.js +0 -201
  116. package/dist/cjs/commands/GetFederationTokenCommand.js.map +0 -1
  117. package/dist/cjs/commands/GetSessionTokenCommand.js +0 -114
  118. package/dist/cjs/commands/GetSessionTokenCommand.js.map +0 -1
  119. package/dist/cjs/defaultRoleAssumers.js.map +0 -1
  120. package/dist/cjs/defaultRoleAssumers.spec.js +0 -135
  121. package/dist/cjs/defaultRoleAssumers.spec.js.map +0 -1
  122. package/dist/cjs/defaultStsRoleAssumers.js.map +0 -1
  123. package/dist/cjs/endpoints.js.map +0 -1
  124. package/dist/cjs/index.js.map +0 -1
  125. package/dist/cjs/models/index.js.map +0 -1
  126. package/dist/cjs/models/models_0.js.map +0 -1
  127. package/dist/cjs/package.json +0 -93
  128. package/dist/cjs/protocols/Aws_query.js.map +0 -1
  129. package/dist/cjs/runtimeConfig.browser.js.map +0 -1
  130. package/dist/cjs/runtimeConfig.js.map +0 -1
  131. package/dist/cjs/runtimeConfig.native.js.map +0 -1
  132. package/dist/cjs/runtimeConfig.shared.js.map +0 -1
  133. package/dist/es/STS.js.map +0 -1
  134. package/dist/es/STSClient.js.map +0 -1
  135. package/dist/es/commands/AssumeRoleCommand.js +0 -150
  136. package/dist/es/commands/AssumeRoleCommand.js.map +0 -1
  137. package/dist/es/commands/AssumeRoleWithSAMLCommand.js +0 -196
  138. package/dist/es/commands/AssumeRoleWithSAMLCommand.js.map +0 -1
  139. package/dist/es/commands/AssumeRoleWithWebIdentityCommand.js +0 -200
  140. package/dist/es/commands/AssumeRoleWithWebIdentityCommand.js.map +0 -1
  141. package/dist/es/commands/DecodeAuthorizationMessageCommand.js +0 -102
  142. package/dist/es/commands/DecodeAuthorizationMessageCommand.js.map +0 -1
  143. package/dist/es/commands/GetAccessKeyInfoCommand.js +0 -84
  144. package/dist/es/commands/GetAccessKeyInfoCommand.js.map +0 -1
  145. package/dist/es/commands/GetCallerIdentityCommand.js.map +0 -1
  146. package/dist/es/commands/GetFederationTokenCommand.js +0 -205
  147. package/dist/es/commands/GetFederationTokenCommand.js.map +0 -1
  148. package/dist/es/commands/GetSessionTokenCommand.js +0 -118
  149. package/dist/es/commands/GetSessionTokenCommand.js.map +0 -1
  150. package/dist/es/defaultRoleAssumers.js +0 -33
  151. package/dist/es/defaultRoleAssumers.js.map +0 -1
  152. package/dist/es/defaultRoleAssumers.spec.js +0 -142
  153. package/dist/es/defaultRoleAssumers.spec.js.map +0 -1
  154. package/dist/es/defaultStsRoleAssumers.js.map +0 -1
  155. package/dist/es/endpoints.js.map +0 -1
  156. package/dist/es/index.js +0 -13
  157. package/dist/es/index.js.map +0 -1
  158. package/dist/es/models/index.js +0 -2
  159. package/dist/es/models/index.js.map +0 -1
  160. package/dist/es/models/models_0.js.map +0 -1
  161. package/dist/es/package.json +0 -93
  162. package/dist/es/protocols/Aws_query.js.map +0 -1
  163. package/dist/es/runtimeConfig.browser.js.map +0 -1
  164. package/dist/es/runtimeConfig.js.map +0 -1
  165. package/dist/es/runtimeConfig.native.js.map +0 -1
  166. package/dist/es/runtimeConfig.shared.js.map +0 -1
  167. package/dist/types/defaultRoleAssumers.spec.d.ts +0 -1
  168. package/dist/types/ts3.4/STS.d.ts +0 -666
  169. package/dist/types/ts3.4/commands/AssumeRoleCommand.d.ts +0 -118
  170. package/dist/types/ts3.4/commands/AssumeRoleWithSAMLCommand.d.ts +0 -166
  171. package/dist/types/ts3.4/commands/AssumeRoleWithWebIdentityCommand.d.ts +0 -170
  172. package/dist/types/ts3.4/commands/DecodeAuthorizationMessageCommand.d.ts +0 -70
  173. package/dist/types/ts3.4/commands/GetAccessKeyInfoCommand.d.ts +0 -52
  174. package/dist/types/ts3.4/commands/GetCallerIdentityCommand.d.ts +0 -44
  175. package/dist/types/ts3.4/commands/GetFederationTokenCommand.d.ts +0 -173
  176. package/dist/types/ts3.4/commands/GetSessionTokenCommand.d.ts +0 -86
  177. package/dist/types/ts3.4/defaultRoleAssumers.d.ts +0 -19
  178. package/dist/types/ts3.4/defaultRoleAssumers.spec.d.ts +0 -1
  179. package/dist/types/ts3.4/models/models_0.d.ts +0 -1192
  180. package/endpoints.ts +0 -91
  181. package/jest.config.js +0 -4
  182. package/models/models_0.ts +0 -1361
  183. package/protocols/Aws_query.ts +0 -1513
  184. package/runtimeConfig.browser.ts +0 -40
  185. package/runtimeConfig.native.ts +0 -16
  186. package/runtimeConfig.shared.ts +0 -16
  187. package/runtimeConfig.ts +0 -45
  188. package/tsconfig.es.json +0 -12
  189. package/tsconfig.json +0 -32
@@ -1,126 +0,0 @@
1
- // Please do not touch this file. It's generated from template in:
2
- // https://github.com/aws/aws-sdk-js-v3/blob/main/codegen/smithy-aws-typescript-codegen/src/main/resources/software/amazon/smithy/aws/typescript/codegen/sts-client-defaultStsRoleAssumers.ts
3
- import { Credentials, Provider } from "@aws-sdk/types";
4
-
5
- import { AssumeRoleCommand, AssumeRoleCommandInput } from "./commands/AssumeRoleCommand";
6
- import {
7
- AssumeRoleWithWebIdentityCommand,
8
- AssumeRoleWithWebIdentityCommandInput,
9
- } from "./commands/AssumeRoleWithWebIdentityCommand";
10
- import type { STSClient, STSClientConfig, STSClientResolvedConfig } from "./STSClient";
11
-
12
- /**
13
- * @internal
14
- */
15
- export type RoleAssumer = (sourceCreds: Credentials, params: AssumeRoleCommandInput) => Promise<Credentials>;
16
-
17
- const ASSUME_ROLE_DEFAULT_REGION = "us-east-1";
18
-
19
- /**
20
- * Inject the fallback STS region of us-east-1.
21
- */
22
- const decorateDefaultRegion = (region: string | Provider<string> | undefined): string | Provider<string> => {
23
- if (typeof region !== "function") {
24
- return region === undefined ? ASSUME_ROLE_DEFAULT_REGION : region;
25
- }
26
- return async () => {
27
- try {
28
- return await region();
29
- } catch (e) {
30
- return ASSUME_ROLE_DEFAULT_REGION;
31
- }
32
- };
33
- };
34
-
35
- /**
36
- * The default role assumer that used by credential providers when sts:AssumeRole API is needed.
37
- * @internal
38
- */
39
- export const getDefaultRoleAssumer = (
40
- stsOptions: Pick<STSClientConfig, "logger" | "region" | "requestHandler">,
41
- stsClientCtor: new (options: STSClientConfig) => STSClient
42
- ): RoleAssumer => {
43
- let stsClient: STSClient;
44
- let closureSourceCreds: Credentials;
45
- return async (sourceCreds, params) => {
46
- closureSourceCreds = sourceCreds;
47
- if (!stsClient) {
48
- const { logger, region, requestHandler } = stsOptions;
49
- stsClient = new stsClientCtor({
50
- logger,
51
- // A hack to make sts client uses the credential in current closure.
52
- credentialDefaultProvider: () => async () => closureSourceCreds,
53
- region: decorateDefaultRegion(region || stsOptions.region),
54
- ...(requestHandler ? { requestHandler } : {}),
55
- });
56
- }
57
- const { Credentials } = await stsClient.send(new AssumeRoleCommand(params));
58
- if (!Credentials || !Credentials.AccessKeyId || !Credentials.SecretAccessKey) {
59
- throw new Error(`Invalid response from STS.assumeRole call with role ${params.RoleArn}`);
60
- }
61
- return {
62
- accessKeyId: Credentials.AccessKeyId,
63
- secretAccessKey: Credentials.SecretAccessKey,
64
- sessionToken: Credentials.SessionToken,
65
- expiration: Credentials.Expiration,
66
- };
67
- };
68
- };
69
-
70
- /**
71
- * @internal
72
- */
73
- export type RoleAssumerWithWebIdentity = (params: AssumeRoleWithWebIdentityCommandInput) => Promise<Credentials>;
74
-
75
- /**
76
- * The default role assumer that used by credential providers when sts:AssumeRoleWithWebIdentity API is needed.
77
- * @internal
78
- */
79
- export const getDefaultRoleAssumerWithWebIdentity = (
80
- stsOptions: Pick<STSClientConfig, "logger" | "region" | "requestHandler">,
81
- stsClientCtor: new (options: STSClientConfig) => STSClient
82
- ): RoleAssumerWithWebIdentity => {
83
- let stsClient: STSClient;
84
- return async (params) => {
85
- if (!stsClient) {
86
- const { logger, region, requestHandler } = stsOptions;
87
- stsClient = new stsClientCtor({
88
- logger,
89
- region: decorateDefaultRegion(region || stsOptions.region),
90
- ...(requestHandler ? { requestHandler } : {}),
91
- });
92
- }
93
- const { Credentials } = await stsClient.send(new AssumeRoleWithWebIdentityCommand(params));
94
- if (!Credentials || !Credentials.AccessKeyId || !Credentials.SecretAccessKey) {
95
- throw new Error(`Invalid response from STS.assumeRoleWithWebIdentity call with role ${params.RoleArn}`);
96
- }
97
- return {
98
- accessKeyId: Credentials.AccessKeyId,
99
- secretAccessKey: Credentials.SecretAccessKey,
100
- sessionToken: Credentials.SessionToken,
101
- expiration: Credentials.Expiration,
102
- };
103
- };
104
- };
105
-
106
- /**
107
- * @internal
108
- */
109
- export type DefaultCredentialProvider = (input: any) => Provider<Credentials>;
110
-
111
- /**
112
- * The default credential providers depend STS client to assume role with desired API: sts:assumeRole,
113
- * sts:assumeRoleWithWebIdentity, etc. This function decorates the default credential provider with role assumers which
114
- * encapsulates the process of calling STS commands. This can only be imported by AWS client packages to avoid circular
115
- * dependencies.
116
- *
117
- * @internal
118
- */
119
- export const decorateDefaultCredentialProvider =
120
- (provider: DefaultCredentialProvider): DefaultCredentialProvider =>
121
- (input: STSClientResolvedConfig) =>
122
- provider({
123
- roleAssumer: getDefaultRoleAssumer(input, input.stsClientCtor),
124
- roleAssumerWithWebIdentity: getDefaultRoleAssumerWithWebIdentity(input, input.stsClientCtor),
125
- ...input,
126
- });
@@ -1 +0,0 @@
1
- {"version":3,"file":"STS.js","sourceRoot":"","sources":["../../STS.ts"],"names":[],"mappings":";;;AAAA,2CAAwC;AACxC,oEAAkH;AAClH,oFAI8C;AAC9C,kGAIqD;AACrD,oGAIsD;AACtD,gFAI4C;AAC5C,kFAI6C;AAC7C,oFAI8C;AAC9C,8EAI2C;AAG3C;;;;;;GAMG;AACH,MAAa,GAAI,SAAQ,qBAAS;IA8FzB,UAAU,CACf,IAA4B,EAC5B,WAAyF,EACzF,EAAuD;QAEvD,MAAM,OAAO,GAAG,IAAI,qCAAiB,CAAC,IAAI,CAAC,CAAC;QAC5C,IAAI,OAAO,WAAW,KAAK,UAAU,EAAE;YACrC,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE,WAAW,CAAC,CAA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eAAe,CACpB,IAAiC,EACjC,WAA8F,EAC9F,EAA4D;QAE5D,MAAM,OAAO,GAAG,IAAI,+CAAsB,CAAC,IAAI,CAAC,CAAC;QACjD,IAAI,OAAO,WAAW,KAAK,UAAU,EAAE;YACrC,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE,WAAW,CAAC,CAAC;SACjC;aAAM,IAAI,OAAO,EAAE,KAAK,UAAU,EAAE;YACnC,IAAI,OAAO,WAAW,KAAK,QAAQ;gBAAE,MAAM,IAAI,KAAK,CAAC,+BAA+B,OAAO,WAAW,EAAE,CAAC,CAAC;YAC1G,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE,WAAW,IAAI,EAAE,EAAE,EAAE,CAAC,CAAC;SAC3C;aAAM;YACL,OAAO,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE,WAAW,CAAC,CAAC;SACxC;IACH,CAAC;CACF;AAj1BD,kBAi1BC"}
@@ -1,47 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.STSClient = void 0;
4
- const runtimeConfig_1 = require("./runtimeConfig");
5
- const config_resolver_1 = require("@aws-sdk/config-resolver");
6
- const middleware_content_length_1 = require("@aws-sdk/middleware-content-length");
7
- const middleware_host_header_1 = require("@aws-sdk/middleware-host-header");
8
- const middleware_logger_1 = require("@aws-sdk/middleware-logger");
9
- const middleware_retry_1 = require("@aws-sdk/middleware-retry");
10
- const middleware_sdk_sts_1 = require("@aws-sdk/middleware-sdk-sts");
11
- const middleware_user_agent_1 = require("@aws-sdk/middleware-user-agent");
12
- const smithy_client_1 = require("@aws-sdk/smithy-client");
13
- /**
14
- * <fullname>Security Token Service</fullname>
15
- * <p>Security Token Service (STS) enables you to request temporary, limited-privilege
16
- * credentials for Identity and Access Management (IAM) users or for users that you
17
- * authenticate (federated users). This guide provides descriptions of the STS API. For
18
- * 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>
19
- */
20
- class STSClient extends smithy_client_1.Client {
21
- constructor(configuration) {
22
- let _config_0 = runtimeConfig_1.getRuntimeConfig(configuration);
23
- let _config_1 = config_resolver_1.resolveRegionConfig(_config_0);
24
- let _config_2 = config_resolver_1.resolveEndpointsConfig(_config_1);
25
- let _config_3 = middleware_retry_1.resolveRetryConfig(_config_2);
26
- let _config_4 = middleware_host_header_1.resolveHostHeaderConfig(_config_3);
27
- let _config_5 = middleware_sdk_sts_1.resolveStsAuthConfig(_config_4, { stsClientCtor: STSClient });
28
- let _config_6 = middleware_user_agent_1.resolveUserAgentConfig(_config_5);
29
- super(_config_6);
30
- this.config = _config_6;
31
- this.middlewareStack.use(middleware_retry_1.getRetryPlugin(this.config));
32
- this.middlewareStack.use(middleware_content_length_1.getContentLengthPlugin(this.config));
33
- this.middlewareStack.use(middleware_host_header_1.getHostHeaderPlugin(this.config));
34
- this.middlewareStack.use(middleware_logger_1.getLoggerPlugin(this.config));
35
- this.middlewareStack.use(middleware_user_agent_1.getUserAgentPlugin(this.config));
36
- }
37
- /**
38
- * Destroy underlying resources, like sockets. It's usually not necessary to do this.
39
- * However in Node.js, it's best to explicitly shut down the client's agent when it is no longer needed.
40
- * Otherwise, sockets might stay open for quite a long time before the server terminates them.
41
- */
42
- destroy() {
43
- super.destroy();
44
- }
45
- }
46
- exports.STSClient = STSClient;
47
- //# sourceMappingURL=STSClient.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"STSClient.js","sourceRoot":"","sources":["../../STSClient.ts"],"names":[],"mappings":";;;AAcA,mDAAyE;AACzE,8DAOkC;AAClC,kFAA4E;AAC5E,4EAKyC;AACzC,kEAA6D;AAC7D,gEAAsH;AACtH,oEAA8G;AAC9G,0EAKwC;AAExC,0DAIgC;AA+KhC;;;;;;GAMG;AACH,MAAa,SAAU,SAAQ,sBAK9B;IAMC,YAAY,aAA8B;QACxC,IAAI,SAAS,GAAG,gCAAkB,CAAC,aAAa,CAAC,CAAC;QAClD,IAAI,SAAS,GAAG,qCAAmB,CAAC,SAAS,CAAC,CAAC;QAC/C,IAAI,SAAS,GAAG,wCAAsB,CAAC,SAAS,CAAC,CAAC;QAClD,IAAI,SAAS,GAAG,qCAAkB,CAAC,SAAS,CAAC,CAAC;QAC9C,IAAI,SAAS,GAAG,gDAAuB,CAAC,SAAS,CAAC,CAAC;QACnD,IAAI,SAAS,GAAG,yCAAoB,CAAC,SAAS,EAAE,EAAE,aAAa,EAAE,SAAS,EAAE,CAAC,CAAC;QAC9E,IAAI,SAAS,GAAG,8CAAsB,CAAC,SAAS,CAAC,CAAC;QAClD,KAAK,CAAC,SAAS,CAAC,CAAC;QACjB,IAAI,CAAC,MAAM,GAAG,SAAS,CAAC;QACxB,IAAI,CAAC,eAAe,CAAC,GAAG,CAAC,iCAAc,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC;QACtD,IAAI,CAAC,eAAe,CAAC,GAAG,CAAC,kDAAsB,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC;QAC9D,IAAI,CAAC,eAAe,CAAC,GAAG,CAAC,4CAAmB,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC;QAC3D,IAAI,CAAC,eAAe,CAAC,GAAG,CAAC,mCAAe,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC;QACvD,IAAI,CAAC,eAAe,CAAC,GAAG,CAAC,0CAAkB,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC;IAC5D,CAAC;IAED;;;;OAIG;IACH,OAAO;QACL,KAAK,CAAC,OAAO,EAAE,CAAC;IAClB,CAAC;CACF;AApCD,8BAoCC"}
@@ -1,146 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.AssumeRoleCommand = void 0;
4
- const models_0_1 = require("../models/models_0");
5
- const Aws_query_1 = require("../protocols/Aws_query");
6
- const middleware_serde_1 = require("@aws-sdk/middleware-serde");
7
- const middleware_signing_1 = require("@aws-sdk/middleware-signing");
8
- const smithy_client_1 = require("@aws-sdk/smithy-client");
9
- /**
10
- * <p>Returns a set of temporary security credentials that you can use to access Amazon Web Services
11
- * resources that you might not normally have access to. These temporary credentials
12
- * consist of an access key ID, a secret access key, and a security token. Typically, you
13
- * use <code>AssumeRole</code> within your account or for cross-account access. For a
14
- * comparison of <code>AssumeRole</code> with other API operations that produce temporary
15
- * credentials, see <a href="https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_request.html">Requesting Temporary Security
16
- * Credentials</a> and <a href="https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_request.html#stsapi_comparison">Comparing
17
- * the STS API operations</a> in the
18
- * <i>IAM User Guide</i>.</p>
19
- * <p>
20
- * <b>Permissions</b>
21
- * </p>
22
- * <p>The temporary security credentials created by <code>AssumeRole</code> can be used to
23
- * make API calls to any Amazon Web Services service with the following exception: You cannot call the
24
- * STS <code>GetFederationToken</code> or <code>GetSessionToken</code> API
25
- * operations.</p>
26
- * <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
27
- * this operation. You can pass a single JSON policy document to use as an inline session
28
- * policy. You can also specify up to 10 managed policies to use as managed session policies.
29
- * The plaintext that you use for both inline and managed session policies can't exceed 2,048
30
- * characters. Passing policies to this operation returns new
31
- * temporary credentials. The resulting session's permissions are the intersection of the
32
- * role's identity-based policy and the session policies. You can use the role's temporary
33
- * credentials in subsequent Amazon Web Services API calls to access resources in the account that owns
34
- * the role. You cannot use session policies to grant more permissions than those allowed
35
- * by the identity-based policy of the role that is being assumed. For more information, see
36
- * <a href="https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies.html#policies_session">Session
37
- * Policies</a> in the <i>IAM User Guide</i>.</p>
38
- * <p>To assume a role from a different account, your account must be trusted by the
39
- * role. The trust relationship is defined in the role's trust policy when the role is
40
- * created. That trust policy states which accounts are allowed to delegate that access to
41
- * users in the account. </p>
42
- * <p>A user who wants to access a role in a different account must also have permissions that
43
- * are delegated from the user account administrator. The administrator must attach a policy
44
- * that allows the user to call <code>AssumeRole</code> for the ARN of the role in the other
45
- * account. If the user is in the same account as the role, then you can do either of the
46
- * following:</p>
47
- * <ul>
48
- * <li>
49
- * <p>Attach a policy to the user (identical to the previous user in a different
50
- * account).</p>
51
- * </li>
52
- * <li>
53
- * <p>Add the user as a principal directly in the role's trust policy.</p>
54
- * </li>
55
- * </ul>
56
- * <p>In this case, the trust policy acts as an IAM resource-based policy. Users in the same
57
- * account as the role do not need explicit permission to assume the role. For more
58
- * 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
59
- * the <i>IAM User Guide</i>.</p>
60
- * <p>
61
- * <b>Tags</b>
62
- * </p>
63
- * <p>(Optional) You can pass tag key-value pairs to your session. These tags are called
64
- * 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
65
- * <i>IAM User Guide</i>.</p>
66
- * <p>An administrator must grant you the permissions necessary to pass session tags. The
67
- * administrator can also create granular permissions to allow you to pass only specific
68
- * 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
69
- * for Attribute-Based Access Control</a> in the
70
- * <i>IAM User Guide</i>.</p>
71
- * <p>You can set the session tags as transitive. Transitive tags persist during role
72
- * 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
73
- * with Session Tags</a> in the <i>IAM User Guide</i>.</p>
74
- * <p>
75
- * <b>Using MFA with AssumeRole</b>
76
- * </p>
77
- * <p>(Optional) You can include multi-factor authentication (MFA) information when you call
78
- * <code>AssumeRole</code>. This is useful for cross-account scenarios to ensure that the
79
- * user that assumes the role has been authenticated with an Amazon Web Services MFA device. In that
80
- * scenario, the trust policy of the role being assumed includes a condition that tests for
81
- * MFA authentication. If the caller does not include valid MFA information, the request to
82
- * assume the role is denied. The condition in a trust policy that tests for MFA
83
- * authentication might look like the following example.</p>
84
- * <p>
85
- * <code>"Condition": {"Bool": {"aws:MultiFactorAuthPresent": true}}</code>
86
- * </p>
87
- * <p>For more information, see <a href="https://docs.aws.amazon.com/IAM/latest/UserGuide/MFAProtectedAPI.html">Configuring MFA-Protected API Access</a>
88
- * in the <i>IAM User Guide</i> guide.</p>
89
- * <p>To use MFA with <code>AssumeRole</code>, you pass values for the
90
- * <code>SerialNumber</code> and <code>TokenCode</code> parameters. The
91
- * <code>SerialNumber</code> value identifies the user's hardware or virtual MFA device.
92
- * The <code>TokenCode</code> is the time-based one-time password (TOTP) that the MFA device
93
- * produces. </p>
94
- * @example
95
- * Use a bare-bones client and the command you need to make an API call.
96
- * ```javascript
97
- * import { STSClient, AssumeRoleCommand } from "@aws-sdk/client-sts"; // ES Modules import
98
- * // const { STSClient, AssumeRoleCommand } = require("@aws-sdk/client-sts"); // CommonJS import
99
- * const client = new STSClient(config);
100
- * const command = new AssumeRoleCommand(input);
101
- * const response = await client.send(command);
102
- * ```
103
- *
104
- * @see {@link AssumeRoleCommandInput} for command's `input` shape.
105
- * @see {@link AssumeRoleCommandOutput} for command's `response` shape.
106
- * @see {@link STSClientResolvedConfig | config} for command's `input` shape.
107
- *
108
- */
109
- class AssumeRoleCommand extends smithy_client_1.Command {
110
- // Start section: command_properties
111
- // End section: command_properties
112
- constructor(input) {
113
- // Start section: command_constructor
114
- super();
115
- this.input = input;
116
- // End section: command_constructor
117
- }
118
- /**
119
- * @internal
120
- */
121
- resolveMiddleware(clientStack, configuration, options) {
122
- this.middlewareStack.use(middleware_serde_1.getSerdePlugin(configuration, this.serialize, this.deserialize));
123
- this.middlewareStack.use(middleware_signing_1.getAwsAuthPlugin(configuration));
124
- const stack = clientStack.concat(this.middlewareStack);
125
- const { logger } = configuration;
126
- const clientName = "STSClient";
127
- const commandName = "AssumeRoleCommand";
128
- const handlerExecutionContext = {
129
- logger,
130
- clientName,
131
- commandName,
132
- inputFilterSensitiveLog: models_0_1.AssumeRoleRequest.filterSensitiveLog,
133
- outputFilterSensitiveLog: models_0_1.AssumeRoleResponse.filterSensitiveLog,
134
- };
135
- const { requestHandler } = configuration;
136
- return stack.resolve((request) => requestHandler.handle(request.request, options || {}), handlerExecutionContext);
137
- }
138
- serialize(input, context) {
139
- return Aws_query_1.serializeAws_queryAssumeRoleCommand(input, context);
140
- }
141
- deserialize(output, context) {
142
- return Aws_query_1.deserializeAws_queryAssumeRoleCommand(output, context);
143
- }
144
- }
145
- exports.AssumeRoleCommand = AssumeRoleCommand;
146
- //# sourceMappingURL=AssumeRoleCommand.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"AssumeRoleCommand.js","sourceRoot":"","sources":["../../../commands/AssumeRoleCommand.ts"],"names":[],"mappings":";;;AACA,iDAA2E;AAC3E,sDAAoH;AACpH,gEAA2D;AAC3D,oEAA+D;AAE/D,0DAA6D;AAc7D;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmGG;AACH,MAAa,iBAAkB,SAAQ,uBAItC;IACC,oCAAoC;IACpC,kCAAkC;IAElC,YAAqB,KAA6B;QAChD,qCAAqC;QACrC,KAAK,EAAE,CAAC;QAFW,UAAK,GAAL,KAAK,CAAwB;QAGhD,mCAAmC;IACrC,CAAC;IAED;;OAEG;IACH,iBAAiB,CACf,WAAmE,EACnE,aAAsC,EACtC,OAA8B;QAE9B,IAAI,CAAC,eAAe,CAAC,GAAG,CAAC,iCAAc,CAAC,aAAa,EAAE,IAAI,CAAC,SAAS,EAAE,IAAI,CAAC,WAAW,CAAC,CAAC,CAAC;QAC1F,IAAI,CAAC,eAAe,CAAC,GAAG,CAAC,qCAAgB,CAAC,aAAa,CAAC,CAAC,CAAC;QAE1D,MAAM,KAAK,GAAG,WAAW,CAAC,MAAM,CAAC,IAAI,CAAC,eAAe,CAAC,CAAC;QAEvD,MAAM,EAAE,MAAM,EAAE,GAAG,aAAa,CAAC;QACjC,MAAM,UAAU,GAAG,WAAW,CAAC;QAC/B,MAAM,WAAW,GAAG,mBAAmB,CAAC;QACxC,MAAM,uBAAuB,GAA4B;YACvD,MAAM;YACN,UAAU;YACV,WAAW;YACX,uBAAuB,EAAE,4BAAiB,CAAC,kBAAkB;YAC7D,wBAAwB,EAAE,6BAAkB,CAAC,kBAAkB;SAChE,CAAC;QACF,MAAM,EAAE,cAAc,EAAE,GAAG,aAAa,CAAC;QACzC,OAAO,KAAK,CAAC,OAAO,CAClB,CAAC,OAAsC,EAAE,EAAE,CACzC,cAAc,CAAC,MAAM,CAAC,OAAO,CAAC,OAAwB,EAAE,OAAO,IAAI,EAAE,CAAC,EACxE,uBAAuB,CACxB,CAAC;IACJ,CAAC;IAEO,SAAS,CAAC,KAA6B,EAAE,OAAuB;QACtE,OAAO,+CAAmC,CAAC,KAAK,EAAE,OAAO,CAAC,CAAC;IAC7D,CAAC;IAEO,WAAW,CAAC,MAAsB,EAAE,OAAuB;QACjE,OAAO,iDAAqC,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAChE,CAAC;CAIF;AAvDD,8CAuDC"}
@@ -1,192 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.AssumeRoleWithSAMLCommand = void 0;
4
- const models_0_1 = require("../models/models_0");
5
- const Aws_query_1 = require("../protocols/Aws_query");
6
- const middleware_serde_1 = require("@aws-sdk/middleware-serde");
7
- const smithy_client_1 = require("@aws-sdk/smithy-client");
8
- /**
9
- * <p>Returns a set of temporary security credentials for users who have been authenticated
10
- * via a SAML authentication response. This operation provides a mechanism for tying an
11
- * enterprise identity store or directory to role-based Amazon Web Services access without user-specific
12
- * credentials or configuration. For a comparison of <code>AssumeRoleWithSAML</code> with the
13
- * 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
14
- * Credentials</a> and <a href="https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_request.html#stsapi_comparison">Comparing the
15
- * STS API operations</a> in the <i>IAM User Guide</i>.</p>
16
- * <p>The temporary security credentials returned by this operation consist of an access key
17
- * ID, a secret access key, and a security token. Applications can use these temporary
18
- * security credentials to sign calls to Amazon Web Services services.</p>
19
- * <p>
20
- * <b>Session Duration</b>
21
- * </p>
22
- * <p>By default, the temporary security credentials created by
23
- * <code>AssumeRoleWithSAML</code> last for one hour. However, you can use the optional
24
- * <code>DurationSeconds</code> parameter to specify the duration of your session. Your
25
- * role session lasts for the duration that you specify, or until the time specified in the
26
- * SAML authentication response's <code>SessionNotOnOrAfter</code> value, whichever is
27
- * shorter. You can provide a <code>DurationSeconds</code> value from 900 seconds (15 minutes)
28
- * up to the maximum session duration setting for the role. This setting can have a value from
29
- * 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
30
- * Maximum Session Duration Setting for a Role</a> in the
31
- * <i>IAM User Guide</i>. The maximum session duration limit applies when
32
- * you use the <code>AssumeRole*</code> API operations or the <code>assume-role*</code> CLI
33
- * commands. However the limit does not apply when you use those operations to create a
34
- * 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
35
- * <i>IAM User Guide</i>.</p>
36
- * <note>
37
- * <p>
38
- * <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
39
- * role session to a maximum of one hour. When you use the <code>AssumeRole</code> API
40
- * operation to assume a role, you can specify the duration of your role session with
41
- * the <code>DurationSeconds</code> parameter. You can specify a parameter value of up
42
- * to 43200 seconds (12 hours), depending on the maximum session duration setting for
43
- * your role. However, if you assume a role using role chaining and provide a
44
- * <code>DurationSeconds</code> parameter value greater than one hour, the
45
- * operation fails.</p>
46
- * </note>
47
- * <p>
48
- * <b>Permissions</b>
49
- * </p>
50
- * <p>The temporary security credentials created by <code>AssumeRoleWithSAML</code> can be
51
- * used to make API calls to any Amazon Web Services service with the following exception: you cannot call
52
- * the STS <code>GetFederationToken</code> or <code>GetSessionToken</code> API
53
- * operations.</p>
54
- * <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
55
- * this operation. You can pass a single JSON policy document to use as an inline session
56
- * policy. You can also specify up to 10 managed policies to use as managed session policies.
57
- * The plaintext that you use for both inline and managed session policies can't exceed 2,048
58
- * characters. Passing policies to this operation returns new
59
- * temporary credentials. The resulting session's permissions are the intersection of the
60
- * role's identity-based policy and the session policies. You can use the role's temporary
61
- * credentials in subsequent Amazon Web Services API calls to access resources in the account that owns
62
- * the role. You cannot use session policies to grant more permissions than those allowed
63
- * by the identity-based policy of the role that is being assumed. For more information, see
64
- * <a href="https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies.html#policies_session">Session
65
- * Policies</a> in the <i>IAM User Guide</i>.</p>
66
- * <p>Calling <code>AssumeRoleWithSAML</code> does not require the use of Amazon Web Services security
67
- * credentials. The identity of the caller is validated by using keys in the metadata document
68
- * that is uploaded for the SAML provider entity for your identity provider. </p>
69
- * <important>
70
- * <p>Calling <code>AssumeRoleWithSAML</code> can result in an entry in your CloudTrail logs.
71
- * The entry includes the value in the <code>NameID</code> element of the SAML assertion.
72
- * We recommend that you use a <code>NameIDType</code> that is not associated with any
73
- * personally identifiable information (PII). For example, you could instead use the
74
- * persistent identifier
75
- * (<code>urn:oasis:names:tc:SAML:2.0:nameid-format:persistent</code>).</p>
76
- * </important>
77
- * <p>
78
- * <b>Tags</b>
79
- * </p>
80
- * <p>(Optional) You can configure your IdP to pass attributes into your SAML assertion as
81
- * session tags. Each session tag consists of a key name and an associated value. For more
82
- * 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
83
- * <i>IAM User Guide</i>.</p>
84
- * <p>You can pass up to 50 session tags. The plaintext session tag keys can’t exceed 128
85
- * characters and the values can’t exceed 256 characters. For these and additional limits, see
86
- * <a href="https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_iam-limits.html#reference_iam-limits-entity-length">IAM
87
- * and STS Character Limits</a> in the <i>IAM User Guide</i>.</p>
88
- *
89
- * <note>
90
- * <p>An Amazon Web Services conversion compresses the passed session policies and session tags into a
91
- * packed binary format that has a separate limit. Your request can fail for this limit
92
- * even if your plaintext meets the other requirements. The <code>PackedPolicySize</code>
93
- * response element indicates by percentage how close the policies and tags for your
94
- * request are to the upper size limit.
95
- * </p>
96
- * </note>
97
- * <p>You can pass a session tag with the same key as a tag that is
98
- * attached to the role. When you do, session tags override the role's tags with the same
99
- * key.</p>
100
- * <p>An administrator must grant you the permissions necessary to pass session tags. The
101
- * administrator can also create granular permissions to allow you to pass only specific
102
- * 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
103
- * for Attribute-Based Access Control</a> in the
104
- * <i>IAM User Guide</i>.</p>
105
- * <p>You can set the session tags as transitive. Transitive tags persist during role
106
- * 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
107
- * with Session Tags</a> in the <i>IAM User Guide</i>.</p>
108
- * <p>
109
- * <b>SAML Configuration</b>
110
- * </p>
111
- * <p>Before your application can call <code>AssumeRoleWithSAML</code>, you must configure
112
- * your SAML identity provider (IdP) to issue the claims required by Amazon Web Services. Additionally, you
113
- * must use Identity and Access Management (IAM) to create a SAML provider entity in your Amazon Web Services account that
114
- * represents your identity provider. You must also create an IAM role that specifies this
115
- * SAML provider in its trust policy. </p>
116
- * <p>For more information, see the following resources:</p>
117
- * <ul>
118
- * <li>
119
- * <p>
120
- * <a href="https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_providers_saml.html">About
121
- * SAML 2.0-based Federation</a> in the <i>IAM User Guide</i>.
122
- * </p>
123
- * </li>
124
- * <li>
125
- * <p>
126
- * <a href="https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_providers_create_saml.html">Creating SAML Identity Providers</a> in the
127
- * <i>IAM User Guide</i>. </p>
128
- * </li>
129
- * <li>
130
- * <p>
131
- * <a href="https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_providers_create_saml_relying-party.html">Configuring
132
- * a Relying Party and Claims</a> in the <i>IAM User Guide</i>.
133
- * </p>
134
- * </li>
135
- * <li>
136
- * <p>
137
- * <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
138
- * <i>IAM User Guide</i>. </p>
139
- * </li>
140
- * </ul>
141
- * @example
142
- * Use a bare-bones client and the command you need to make an API call.
143
- * ```javascript
144
- * import { STSClient, AssumeRoleWithSAMLCommand } from "@aws-sdk/client-sts"; // ES Modules import
145
- * // const { STSClient, AssumeRoleWithSAMLCommand } = require("@aws-sdk/client-sts"); // CommonJS import
146
- * const client = new STSClient(config);
147
- * const command = new AssumeRoleWithSAMLCommand(input);
148
- * const response = await client.send(command);
149
- * ```
150
- *
151
- * @see {@link AssumeRoleWithSAMLCommandInput} for command's `input` shape.
152
- * @see {@link AssumeRoleWithSAMLCommandOutput} for command's `response` shape.
153
- * @see {@link STSClientResolvedConfig | config} for command's `input` shape.
154
- *
155
- */
156
- class AssumeRoleWithSAMLCommand extends smithy_client_1.Command {
157
- // Start section: command_properties
158
- // End section: command_properties
159
- constructor(input) {
160
- // Start section: command_constructor
161
- super();
162
- this.input = input;
163
- // End section: command_constructor
164
- }
165
- /**
166
- * @internal
167
- */
168
- resolveMiddleware(clientStack, configuration, options) {
169
- this.middlewareStack.use(middleware_serde_1.getSerdePlugin(configuration, this.serialize, this.deserialize));
170
- const stack = clientStack.concat(this.middlewareStack);
171
- const { logger } = configuration;
172
- const clientName = "STSClient";
173
- const commandName = "AssumeRoleWithSAMLCommand";
174
- const handlerExecutionContext = {
175
- logger,
176
- clientName,
177
- commandName,
178
- inputFilterSensitiveLog: models_0_1.AssumeRoleWithSAMLRequest.filterSensitiveLog,
179
- outputFilterSensitiveLog: models_0_1.AssumeRoleWithSAMLResponse.filterSensitiveLog,
180
- };
181
- const { requestHandler } = configuration;
182
- return stack.resolve((request) => requestHandler.handle(request.request, options || {}), handlerExecutionContext);
183
- }
184
- serialize(input, context) {
185
- return Aws_query_1.serializeAws_queryAssumeRoleWithSAMLCommand(input, context);
186
- }
187
- deserialize(output, context) {
188
- return Aws_query_1.deserializeAws_queryAssumeRoleWithSAMLCommand(output, context);
189
- }
190
- }
191
- exports.AssumeRoleWithSAMLCommand = AssumeRoleWithSAMLCommand;
192
- //# sourceMappingURL=AssumeRoleWithSAMLCommand.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"AssumeRoleWithSAMLCommand.js","sourceRoot":"","sources":["../../../commands/AssumeRoleWithSAMLCommand.ts"],"names":[],"mappings":";;;AACA,iDAA2F;AAC3F,sDAGgC;AAChC,gEAA2D;AAE3D,0DAA6D;AAc7D;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmJG;AACH,MAAa,yBAA0B,SAAQ,uBAI9C;IACC,oCAAoC;IACpC,kCAAkC;IAElC,YAAqB,KAAqC;QACxD,qCAAqC;QACrC,KAAK,EAAE,CAAC;QAFW,UAAK,GAAL,KAAK,CAAgC;QAGxD,mCAAmC;IACrC,CAAC;IAED;;OAEG;IACH,iBAAiB,CACf,WAAmE,EACnE,aAAs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