@aws-sdk/client-sts 3.1172.0 → 3.1174.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 (35) hide show
  1. package/README.md +7 -0
  2. package/dist-cjs/index.js +154 -7
  3. package/dist-es/STS.js +2 -0
  4. package/dist-es/commands/GetScopedCredentialsCommand.js +4 -0
  5. package/dist-es/commands/index.js +1 -0
  6. package/dist-es/index.js +1 -0
  7. package/dist-es/models/enums.js +4 -0
  8. package/dist-es/models/errors.js +39 -0
  9. package/dist-es/schemas/schemas_0.js +91 -7
  10. package/dist-types/STS.d.ts +8 -0
  11. package/dist-types/STSClient.d.ts +3 -2
  12. package/dist-types/commands/AssumeRoleCommand.d.ts +12 -7
  13. package/dist-types/commands/AssumeRoleWithSAMLCommand.d.ts +20 -14
  14. package/dist-types/commands/AssumeRoleWithWebIdentityCommand.d.ts +20 -14
  15. package/dist-types/commands/GetDelegatedAccessTokenCommand.d.ts +7 -7
  16. package/dist-types/commands/GetFederationTokenCommand.d.ts +9 -8
  17. package/dist-types/commands/GetScopedCredentialsCommand.d.ts +160 -0
  18. package/dist-types/commands/GetSessionTokenCommand.d.ts +3 -1
  19. package/dist-types/commands/GetWebIdentityTokenCommand.d.ts +9 -2
  20. package/dist-types/commands/index.d.ts +1 -0
  21. package/dist-types/index.d.ts +1 -0
  22. package/dist-types/models/enums.d.ts +12 -0
  23. package/dist-types/models/errors.d.ts +54 -7
  24. package/dist-types/models/models_0.d.ts +363 -123
  25. package/dist-types/schemas/schemas_0.d.ts +10 -0
  26. package/dist-types/ts3.4/STS.d.ts +18 -0
  27. package/dist-types/ts3.4/STSClient.d.ts +6 -0
  28. package/dist-types/ts3.4/commands/GetScopedCredentialsCommand.d.ts +39 -0
  29. package/dist-types/ts3.4/commands/index.d.ts +1 -0
  30. package/dist-types/ts3.4/index.d.ts +1 -0
  31. package/dist-types/ts3.4/models/enums.d.ts +6 -0
  32. package/dist-types/ts3.4/models/errors.d.ts +18 -0
  33. package/dist-types/ts3.4/models/models_0.d.ts +36 -0
  34. package/dist-types/ts3.4/schemas/schemas_0.d.ts +10 -0
  35. package/package.json +1 -1
@@ -0,0 +1,160 @@
1
+ import type { MetadataBearer as __MetadataBearer } from "@smithy/types";
2
+ import type { GetScopedCredentialsRequest, GetScopedCredentialsResponse } from "../models/models_0";
3
+ /**
4
+ * @public
5
+ */
6
+ export type { __MetadataBearer };
7
+ /**
8
+ * @public
9
+ *
10
+ * The input for {@link GetScopedCredentialsCommand}.
11
+ */
12
+ export interface GetScopedCredentialsCommandInput extends GetScopedCredentialsRequest {
13
+ }
14
+ /**
15
+ * @public
16
+ *
17
+ * The output of {@link GetScopedCredentialsCommand}.
18
+ */
19
+ export interface GetScopedCredentialsCommandOutput extends GetScopedCredentialsResponse, __MetadataBearer {
20
+ }
21
+ declare const GetScopedCredentialsCommand_base: {
22
+ new (input: GetScopedCredentialsCommandInput): import("@smithy/core/client").CommandImpl<GetScopedCredentialsCommandInput, GetScopedCredentialsCommandOutput, import("..").STSClientResolvedConfig, import("..").ServiceInputTypes, import("..").ServiceOutputTypes>;
23
+ new (...[input]: [] | [GetScopedCredentialsCommandInput]): import("@smithy/core/client").CommandImpl<GetScopedCredentialsCommandInput, GetScopedCredentialsCommandOutput, import("..").STSClientResolvedConfig, import("..").ServiceInputTypes, import("..").ServiceOutputTypes>;
24
+ getEndpointParameterInstructions(): import("@smithy/types").EndpointParameterInstructions;
25
+ };
26
+ /**
27
+ * <p>Returns a set of temporary security credentials that are scoped down from the caller's
28
+ * existing temporary security credentials. <code>GetScopedCredentials</code> preserves the
29
+ * caller's identity while narrowing the permissions and optionally shortening the session
30
+ * lifetime.</p>
31
+ * <p>For a comparison of <code>GetScopedCredentials</code> with the other API operations that
32
+ * produce temporary security credentials, see <a href="https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_request.html">Requesting Temporary Security
33
+ * Credentials</a> and <a href="https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_sts-comparison.html">Compare STS
34
+ * credentials</a> in the IAM User Guide.</p>
35
+ * <p>
36
+ * <b>Credential requirements</b>
37
+ * </p>
38
+ * <p>You can only call <code>GetScopedCredentials</code> with temporary security credentials,
39
+ * for example, credentials from an assumed role or a federated session. You cannot call it
40
+ * with IAM user credentials or root credentials. If you want to scope down IAM user
41
+ * credentials, first call <code>GetSessionToken</code> to get temporary security credentials,
42
+ * and then call <code>GetScopedCredentials</code> with those credentials.</p>
43
+ * <note>
44
+ * <p>The <code>GetScopedCredentials</code> API is not available on the STS Global
45
+ * endpoint.</p>
46
+ * </note>
47
+ * @example
48
+ * Use a bare-bones client and the command you need to make an API call.
49
+ * ```javascript
50
+ * import { STSClient, GetScopedCredentialsCommand } from "@aws-sdk/client-sts"; // ES Modules import
51
+ * // const { STSClient, GetScopedCredentialsCommand } = require("@aws-sdk/client-sts"); // CommonJS import
52
+ * // import type { STSClientConfig } from "@aws-sdk/client-sts";
53
+ * const config = {}; // type is STSClientConfig
54
+ * const client = new STSClient(config);
55
+ * const input = { // GetScopedCredentialsRequest
56
+ * Policy: "STRING_VALUE",
57
+ * DurationSeconds: Number("int"),
58
+ * MinimumSessionTokenSize: Number("int"),
59
+ * ScopedSessionDescription: "STRING_VALUE",
60
+ * };
61
+ * const command = new GetScopedCredentialsCommand(input);
62
+ * const response = await client.send(command);
63
+ * // { // GetScopedCredentialsResponse
64
+ * // Credentials: { // Credentials
65
+ * // AccessKeyId: "STRING_VALUE", // required
66
+ * // SecretAccessKey: "STRING_VALUE", // required
67
+ * // SessionToken: "STRING_VALUE", // required
68
+ * // Expiration: new Date("TIMESTAMP"), // required
69
+ * // },
70
+ * // SessionInfo: { // ScopedSession
71
+ * // ScopedSessionId: "STRING_VALUE", // required
72
+ * // Arn: "STRING_VALUE", // required
73
+ * // },
74
+ * // SessionTokenUtilization: Number("int"),
75
+ * // SessionTokenSize: Number("int"),
76
+ * // ScopedPoliciesCount: Number("int"),
77
+ * // SourceIdentity: "STRING_VALUE",
78
+ * // };
79
+ *
80
+ * ```
81
+ *
82
+ * @param GetScopedCredentialsCommandInput - {@link GetScopedCredentialsCommandInput}
83
+ * @returns {@link GetScopedCredentialsCommandOutput}
84
+ * @see {@link GetScopedCredentialsCommandInput} for command's `input` shape.
85
+ * @see {@link GetScopedCredentialsCommandOutput} for command's `response` shape.
86
+ * @see {@link STSClientResolvedConfig | config} for STSClient's `config` shape.
87
+ *
88
+ * @throws {@link InsufficientSessionLifetimeException} (client fault)
89
+ * <p>The request was rejected because the requested <code>DurationSeconds</code> is greater
90
+ * than the remaining lifetime of the calling session. <code>GetScopedCredentials</code>
91
+ * cannot extend a session beyond its original expiration. Request a duration that is less
92
+ * than or equal to the calling session's remaining lifetime, or omit
93
+ * <code>DurationSeconds</code> to inherit it.</p>
94
+ *
95
+ * @throws {@link InvalidSubjectCredentialsException} (client fault)
96
+ * <p>The request was rejected because the session used to call
97
+ * <code>GetScopedCredentials</code> is not a valid session. The calling session's credentials
98
+ * could not be validated or resolved.</p>
99
+ *
100
+ * @throws {@link MalformedPolicyDocumentException} (client fault)
101
+ * <p>The request was rejected because the policy document was malformed. The error message
102
+ * describes the specific error.</p>
103
+ *
104
+ * @throws {@link PackedPolicyTooLargeException} (client fault)
105
+ * <p>The request was rejected because the session token exceeded the maximum allowed size.
106
+ * The error message reports the session token size and the maximum allowed size, both in
107
+ * bytes. Session policies and session tags add to the session token size. For more
108
+ * information, see <a href="https://docs.aws.amazon.com/IAM/latest/UserGuide/id_session-tags.html">Passing Session Tags in STS</a> in
109
+ * the <i>IAM User Guide</i>.</p>
110
+ * <p>You might receive this error even though you meet the individual session policy and
111
+ * session tag limits. Monitor <code>SessionTokenUtilization</code> to track how close the
112
+ * session token is to the maximum allowed size. For more information, see <a href="https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_iam-quotas.html#reference_iam-limits-entity-length">IAM and STS Entity Character Limits</a> in the <i>IAM User
113
+ * Guide</i>.</p>
114
+ *
115
+ * @throws {@link STSServiceException}
116
+ * <p>Base exception class for all service exceptions from STS service.</p>
117
+ *
118
+ *
119
+ * @example To scope down existing temporary credentials
120
+ * ```javascript
121
+ * //
122
+ * const input = {
123
+ * DurationSeconds: 3600,
124
+ * Policy: `{"Version":"2012-10-17","Statement":[{"Effect":"Allow","Action":"s3:GetObject","Resource":"arn:aws:s3:::example-bucket/*"}]}`
125
+ * };
126
+ * const command = new GetScopedCredentialsCommand(input);
127
+ * const response = await client.send(command);
128
+ * /* response is
129
+ * {
130
+ * Credentials: {
131
+ * AccessKeyId: "AKIAIOSFODNN7EXAMPLE",
132
+ * Expiration: "2011-07-15T23:28:33.359Z",
133
+ * SecretAccessKey: "wJalrXUtnFEMI/K7MDENG/bPxRfiCYzEXAMPLEKEY",
134
+ * SessionToken: "AQoEXAMPLEH4aoAH0gNCAPyJxz4BlCFFxWNE1OPTgk5TthT+FvwqnKwRcOIfrRh3c/LTo6UDdyJwOOvEVPvLXCrrrUtdnniCEXAMPLE/IvU1dYUg2RVAJBanLiHb4IgRmpRV3zrkuWJOgQs8IZZaIv2BXIa2R4OlgkBN9bkUDNCJiBeb/AXlzBBko7b15fjrBs2+cTQtpZ3CYWFXG8C5zqx37wnOE49mRl/+OtkIKGO7fAE"
135
+ * },
136
+ * ScopedPoliciesCount: 1,
137
+ * SessionInfo: {
138
+ * Arn: "arn:aws:sts::123456789012:assumed-role/example-role/example-session",
139
+ * ScopedSessionId: "AROAEXAMPLEID:example-session"
140
+ * },
141
+ * SourceIdentity: "example-source-identity"
142
+ * }
143
+ * *\/
144
+ * ```
145
+ *
146
+ * @public
147
+ */
148
+ export declare class GetScopedCredentialsCommand extends GetScopedCredentialsCommand_base {
149
+ /** @internal type navigation helper, not in runtime. */
150
+ protected static __types: {
151
+ api: {
152
+ input: GetScopedCredentialsRequest;
153
+ output: GetScopedCredentialsResponse;
154
+ };
155
+ sdk: {
156
+ input: GetScopedCredentialsCommandInput;
157
+ output: GetScopedCredentialsCommandOutput;
158
+ };
159
+ };
160
+ }
@@ -64,7 +64,9 @@ declare const GetSessionTokenCommand_base: {
64
64
  * </li>
65
65
  * <li>
66
66
  * <p>You cannot call any STS API <i>except</i>
67
- * <code>AssumeRole</code> or <code>GetCallerIdentity</code>.</p>
67
+ * <code>AssumeRole</code>, <code>GetCallerIdentity</code>,
68
+ * <code>GetScopedCredentials</code>, <code>GetWebIdentityToken</code>, or
69
+ * <code>GetDelegatedAccessToken</code>.</p>
68
70
  * </li>
69
71
  * </ul>
70
72
  * <p>The credentials that <code>GetSessionToken</code> returns are based on permissions
@@ -24,9 +24,14 @@ declare const GetWebIdentityTokenCommand_base: {
24
24
  getEndpointParameterInstructions(): import("@smithy/types").EndpointParameterInstructions;
25
25
  };
26
26
  /**
27
- * <p>Returns a signed JSON Web Token (JWT) that represents the calling Amazon Web Services identity.
28
- * The returned JWT can be used to authenticate with external services that support OIDC discovery.
27
+ * <p>Returns a signed JSON Web Token (JWT) that represents the calling Amazon Web Services identity or, if you set
28
+ * <code>SubjectMode</code> to <code>OriginIdentity</code>, the human user or workload on whose behalf the
29
+ * calling session acts. The returned JWT can be used to authenticate with external services that support OIDC discovery.
29
30
  * The token is signed by Amazon Web Services STS and can be publicly verified using the verification keys published at the issuer's JWKS endpoint.</p>
31
+ * <p>The <code>sub</code> (subject) claim contains the identity that <code>SubjectMode</code> selects. Whichever
32
+ * subject mode you use, the <code>principal_id</code> claim under the <code>https://sts.amazonaws.com/</code>
33
+ * namespace contains the ARN of the principal that requested the token, when that principal has an ARN. For a
34
+ * role session, this is the ARN of the role.</p>
30
35
  * <note>
31
36
  * <p>The <code>GetWebIdentityToken</code> API is not available on the STS Global endpoint.</p>
32
37
  * </note>
@@ -44,6 +49,8 @@ declare const GetWebIdentityTokenCommand_base: {
44
49
  * ],
45
50
  * DurationSeconds: Number("int"),
46
51
  * SigningAlgorithm: "STRING_VALUE", // required
52
+ * Scope: "STRING_VALUE",
53
+ * SubjectMode: "AWSIdentity" || "OriginIdentity",
47
54
  * Tags: [ // tagListType
48
55
  * { // Tag
49
56
  * Key: "STRING_VALUE", // required
@@ -7,5 +7,6 @@ export * from "./GetAccessKeyInfoCommand";
7
7
  export * from "./GetCallerIdentityCommand";
8
8
  export * from "./GetDelegatedAccessTokenCommand";
9
9
  export * from "./GetFederationTokenCommand";
10
+ export * from "./GetScopedCredentialsCommand";
10
11
  export * from "./GetSessionTokenCommand";
11
12
  export * from "./GetWebIdentityTokenCommand";
@@ -33,6 +33,7 @@ export type { STSExtensionConfiguration } from "./extensionConfiguration";
33
33
  export * from "./commands";
34
34
  export { Command as $Command } from "@smithy/core/client";
35
35
  export * from "./schemas/schemas_0";
36
+ export * from "./models/enums";
36
37
  export * from "./models/errors";
37
38
  export * from "./models/models_0";
38
39
  export * from "./defaultRoleAssumers";
@@ -0,0 +1,12 @@
1
+ /**
2
+ * @public
3
+ * @enum
4
+ */
5
+ export declare const WebIdentityTokenSubjectModeType: {
6
+ readonly AWS_IDENTITY: "AWSIdentity";
7
+ readonly ORIGIN_IDENTITY: "OriginIdentity";
8
+ };
9
+ /**
10
+ * @public
11
+ */
12
+ export type WebIdentityTokenSubjectModeType = (typeof WebIdentityTokenSubjectModeType)[keyof typeof WebIdentityTokenSubjectModeType];
@@ -14,6 +14,21 @@ export declare class ExpiredTokenException extends __BaseException {
14
14
  */
15
15
  constructor(opts: __ExceptionOptionType<ExpiredTokenException, __BaseException>);
16
16
  }
17
+ /**
18
+ * <p>The request was rejected because the context assertion that was provided is invalid.
19
+ * This can happen if the context assertion supplied in the <code>ProvidedContexts</code>
20
+ * parameter is malformed, has expired, or does not match a trusted context provider.</p>
21
+ * @public
22
+ */
23
+ export declare class InvalidContextAssertionException extends __BaseException {
24
+ static readonly shapeId: string;
25
+ readonly name: "InvalidContextAssertionException";
26
+ readonly $fault: "client";
27
+ /**
28
+ * @internal
29
+ */
30
+ constructor(opts: __ExceptionOptionType<InvalidContextAssertionException, __BaseException>);
31
+ }
17
32
  /**
18
33
  * <p>The request was rejected because the policy document was malformed. The error message
19
34
  * describes the specific error.</p>
@@ -29,14 +44,14 @@ export declare class MalformedPolicyDocumentException extends __BaseException {
29
44
  constructor(opts: __ExceptionOptionType<MalformedPolicyDocumentException, __BaseException>);
30
45
  }
31
46
  /**
32
- * <p>The request was rejected because the total packed size of the session policies and
33
- * session tags combined was too large. An Amazon Web Services conversion compresses the session policy
34
- * document, session policy ARNs, and session tags into a packed binary format that has a
35
- * separate limit. The error message indicates by percentage how close the policies and
36
- * tags are to the upper size limit. For more information, see <a href="https://docs.aws.amazon.com/IAM/latest/UserGuide/id_session-tags.html">Passing Session Tags in STS</a> in
47
+ * <p>The request was rejected because the session token exceeded the maximum allowed size.
48
+ * The error message reports the session token size and the maximum allowed size, both in
49
+ * bytes. Session policies and session tags add to the session token size. For more
50
+ * information, see <a href="https://docs.aws.amazon.com/IAM/latest/UserGuide/id_session-tags.html">Passing Session Tags in STS</a> in
37
51
  * the <i>IAM User Guide</i>.</p>
38
- * <p>You could receive this error even though you meet other defined session policy and
39
- * session tag limits. For more information, see <a href="https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_iam-quotas.html#reference_iam-limits-entity-length">IAM and STS Entity Character Limits</a> in the <i>IAM User
52
+ * <p>You might receive this error even though you meet the individual session policy and
53
+ * session tag limits. Monitor <code>SessionTokenUtilization</code> to track how close the
54
+ * session token is to the maximum allowed size. For more information, see <a href="https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_iam-quotas.html#reference_iam-limits-entity-length">IAM and STS Entity Character Limits</a> in the <i>IAM User
40
55
  * Guide</i>.</p>
41
56
  * @public
42
57
  */
@@ -142,6 +157,38 @@ export declare class ExpiredTradeInTokenException extends __BaseException {
142
157
  */
143
158
  constructor(opts: __ExceptionOptionType<ExpiredTradeInTokenException, __BaseException>);
144
159
  }
160
+ /**
161
+ * <p>The request was rejected because the requested <code>DurationSeconds</code> is greater
162
+ * than the remaining lifetime of the calling session. <code>GetScopedCredentials</code>
163
+ * cannot extend a session beyond its original expiration. Request a duration that is less
164
+ * than or equal to the calling session's remaining lifetime, or omit
165
+ * <code>DurationSeconds</code> to inherit it.</p>
166
+ * @public
167
+ */
168
+ export declare class InsufficientSessionLifetimeException extends __BaseException {
169
+ static readonly shapeId: string;
170
+ readonly name: "InsufficientSessionLifetimeException";
171
+ readonly $fault: "client";
172
+ /**
173
+ * @internal
174
+ */
175
+ constructor(opts: __ExceptionOptionType<InsufficientSessionLifetimeException, __BaseException>);
176
+ }
177
+ /**
178
+ * <p>The request was rejected because the session used to call
179
+ * <code>GetScopedCredentials</code> is not a valid session. The calling session's credentials
180
+ * could not be validated or resolved.</p>
181
+ * @public
182
+ */
183
+ export declare class InvalidSubjectCredentialsException extends __BaseException {
184
+ static readonly shapeId: string;
185
+ readonly name: "InvalidSubjectCredentialsException";
186
+ readonly $fault: "client";
187
+ /**
188
+ * @internal
189
+ */
190
+ constructor(opts: __ExceptionOptionType<InvalidSubjectCredentialsException, __BaseException>);
191
+ }
145
192
  /**
146
193
  * <p>The requested token payload size exceeds the maximum allowed size. Reduce the number of request tags included in the <code>GetWebIdentityToken</code> API call to reduce the token payload size.</p>
147
194
  * @public