Skip to content

Commit b01ad93

Browse files
author
awstools
committed
feat(client-sts): API updates for the AWS Security Token Service
1 parent e28d57d commit b01ad93

File tree

9 files changed

+248
-124
lines changed

9 files changed

+248
-124
lines changed

clients/client-sts/src/commands/AssumeRoleCommand.ts

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,8 +72,8 @@ export interface AssumeRoleCommandOutput extends AssumeRoleResponse, __MetadataB
7272
* created. That trust policy states which accounts are allowed to delegate that access to
7373
* users in the account. </p>
7474
* <p>A user who wants to access a role in a different account must also have permissions that
75-
* are delegated from the account administrator. The administrator must attach a policy
76-
* that allows the user to call <code>AssumeRole</code> for the ARN of the role in the other
75+
* are delegated from the account administrator. The administrator must attach a policy that
76+
* allows the user to call <code>AssumeRole</code> for the ARN of the role in the other
7777
* account.</p>
7878
* <p>To allow a user to assume a role in the same account, you can do either of the
7979
* following:</p>
@@ -154,6 +154,12 @@ export interface AssumeRoleCommandOutput extends AssumeRoleResponse, __MetadataB
154154
* SerialNumber: "STRING_VALUE",
155155
* TokenCode: "STRING_VALUE",
156156
* SourceIdentity: "STRING_VALUE",
157+
* ProvidedContexts: [ // ProvidedContextsListType
158+
* { // ProvidedContext
159+
* ProviderArn: "STRING_VALUE",
160+
* ContextAssertion: "STRING_VALUE",
161+
* },
162+
* ],
157163
* };
158164
* const command = new AssumeRoleCommand(input);
159165
* const response = await client.send(command);

clients/client-sts/src/commands/AssumeRoleWithWebIdentityCommand.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,8 @@ export interface AssumeRoleWithWebIdentityCommandOutput extends AssumeRoleWithWe
5050
* <a href="http://aws.amazon.com/sdkforios/">Amazon Web Services SDK for iOS Developer Guide</a> and the <a href="http://aws.amazon.com/sdkforandroid/">Amazon Web Services SDK for Android Developer Guide</a> to uniquely
5151
* identify a user. You can also supply the user with a consistent identity throughout the
5252
* lifetime of an application.</p>
53-
* <p>To learn more about Amazon Cognito, see <a href="https://docs.aws.amazon.com/cognito/latest/developerguide/cognito-identity.html">Amazon Cognito identity pools</a> in
54-
* <i>Amazon Cognito Developer Guide</i>.</p>
53+
* <p>To learn more about Amazon Cognito, see <a href="https://docs.aws.amazon.com/cognito/latest/developerguide/cognito-identity.html">Amazon Cognito identity
54+
* pools</a> in <i>Amazon Cognito Developer Guide</i>.</p>
5555
* </note>
5656
* <p>Calling <code>AssumeRoleWithWebIdentity</code> does not require the use of Amazon Web Services
5757
* security credentials. Therefore, you can distribute an application (for example, on mobile

clients/client-sts/src/commands/GetAccessKeyInfoCommand.ts

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -45,13 +45,12 @@ export interface GetAccessKeyInfoCommandOutput extends GetAccessKeyInfoResponse,
4545
* Users</a> in the <i>IAM User Guide</i>.</p>
4646
* <p>When you pass an access key ID to this operation, it returns the ID of the Amazon Web Services account
4747
* to which the keys belong. Access key IDs beginning with <code>AKIA</code> are long-term
48-
* credentials for an IAM user or the Amazon Web Services account root user. Access key IDs beginning with
49-
* <code>ASIA</code> are temporary credentials that are created using STS operations. If
50-
* the account in the response belongs to you, you can sign in as the root user and review
51-
* your root user access keys. Then, you can pull a <a href="https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_getting-report.html">credentials report</a> to
52-
* learn which IAM user owns the keys. To learn who requested the temporary credentials for
53-
* an <code>ASIA</code> access key, view the STS events in your <a href="https://docs.aws.amazon.com/IAM/latest/UserGuide/cloudtrail-integration.html">CloudTrail logs</a> in the
54-
* <i>IAM User Guide</i>.</p>
48+
* credentials for an IAM user or the Amazon Web Services account root user. Access key IDs
49+
* beginning with <code>ASIA</code> are temporary credentials that are created using STS
50+
* operations. If the account in the response belongs to you, you can sign in as the root user and review your root user access keys. Then, you can pull a <a href="https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_getting-report.html">credentials
51+
* report</a> to learn which IAM user owns the keys. To learn who
52+
* requested the temporary credentials for an <code>ASIA</code> access key, view the STS
53+
* events in your <a href="https://docs.aws.amazon.com/IAM/latest/UserGuide/cloudtrail-integration.html">CloudTrail logs</a> in the <i>IAM User Guide</i>.</p>
5554
* <p>This operation does not indicate the state of the access key. The key might be active,
5655
* inactive, or deleted. Active keys might not have permissions to perform an operation.
5756
* Providing a deleted access key might return an error that the key doesn't exist.</p>

clients/client-sts/src/commands/GetCallerIdentityCommand.ts

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,12 +37,14 @@ export interface GetCallerIdentityCommandOutput extends GetCallerIdentityRespons
3737

3838
/**
3939
* @public
40-
* <p>Returns details about the IAM user or role whose credentials are used to call the operation.</p>
40+
* <p>Returns details about the IAM user or role whose credentials are used to
41+
* call the operation.</p>
4142
* <note>
42-
* <p>No permissions are required to perform this operation. If an administrator
43-
* attaches a policy to your identity that explicitly denies access to the
43+
* <p>No permissions are required to perform this operation. If an administrator attaches a
44+
* policy to your identity that explicitly denies access to the
4445
* <code>sts:GetCallerIdentity</code> action, you can still perform this operation.
45-
* Permissions are not required because the same information is returned when access is denied. To view an example response, see <a href="https://docs.aws.amazon.com/IAM/latest/UserGuide/troubleshoot_general.html#troubleshoot_general_access-denied-delete-mfa">I Am Not Authorized to Perform: iam:DeleteVirtualMFADevice</a> in the
46+
* Permissions are not required because the same information is returned when access is
47+
* denied. To view an example response, see <a href="https://docs.aws.amazon.com/IAM/latest/UserGuide/troubleshoot_general.html#troubleshoot_general_access-denied-delete-mfa">I Am Not Authorized to Perform: iam:DeleteVirtualMFADevice</a> in the
4648
* <i>IAM User Guide</i>.</p>
4749
* </note>
4850
* @example

clients/client-sts/src/commands/GetFederationTokenCommand.ts

Lines changed: 21 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -45,16 +45,18 @@ export interface GetFederationTokenCommandOutput extends GetFederationTokenRespo
4545
* secret access key, and a security token) for a user. A typical use is in a proxy
4646
* application that gets temporary security credentials on behalf of distributed applications
4747
* inside a corporate network.</p>
48-
* <p>You must call the <code>GetFederationToken</code> operation
49-
* using the long-term security credentials of an IAM user. As a result, this call is
50-
* appropriate in contexts where those credentials can be safeguarded, usually in a
51-
* server-based application. For a comparison of <code>GetFederationToken</code> with the
52-
* 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
48+
* <p>You must call the <code>GetFederationToken</code> operation using the long-term security
49+
* credentials of an IAM user. As a result, this call is appropriate in
50+
* contexts where those credentials can be safeguarded, usually in a server-based application.
51+
* For a comparison of <code>GetFederationToken</code> with the other API operations that
52+
* produce temporary credentials, see <a href="https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_request.html">Requesting Temporary Security
5353
* Credentials</a> and <a href="https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_request.html#stsapi_comparison">Comparing the
5454
* Amazon Web Services STS API operations</a> in the <i>IAM User Guide</i>.</p>
55-
* <p>Although it is possible to call <code>GetFederationToken</code> using the security credentials of an
56-
* Amazon Web Services account root user rather than an IAM user that you create for the purpose of a proxy application, we do not recommend it. For more information, see <a href="https://docs.aws.amazon.com/IAM/latest/UserGuide/best-practices.html#lock-away-credentials">Safeguard your root user credentials and don't use them for everyday tasks</a> in the
57-
* <i>IAM User Guide</i>. </p>
55+
* <p>Although it is possible to call <code>GetFederationToken</code> using the security
56+
* credentials of an Amazon Web Services account root user rather than an IAM user that you
57+
* create for the purpose of a proxy application, we do not recommend it. For more
58+
* information, see <a href="https://docs.aws.amazon.com/IAM/latest/UserGuide/best-practices.html#lock-away-credentials">Safeguard your root user credentials and don't use them for everyday tasks</a> in the
59+
* <i>IAM User Guide</i>. </p>
5860
* <note>
5961
* <p>You can create a mobile-based or browser-based app that can authenticate users using
6062
* a web identity provider like Login with Amazon, Facebook, Google, or an OpenID
@@ -67,15 +69,17 @@ export interface GetFederationTokenCommandOutput extends GetFederationTokenRespo
6769
* </p>
6870
* <p>The temporary credentials are valid for the specified duration, from 900 seconds (15
6971
* minutes) up to a maximum of 129,600 seconds (36 hours). The default session duration is
70-
* 43,200 seconds (12 hours). Temporary credentials obtained by using the root user credentials have a maximum duration of 3,600 seconds (1 hour).</p>
72+
* 43,200 seconds (12 hours). Temporary credentials obtained by using the root user
73+
* credentials have a maximum duration of 3,600 seconds (1 hour).</p>
7174
* <p>
7275
* <b>Permissions</b>
7376
* </p>
7477
* <p>You can use the temporary credentials created by <code>GetFederationToken</code> in any
7578
* Amazon Web Services service with the following exceptions:</p>
7679
* <ul>
7780
* <li>
78-
* <p>You cannot call any IAM operations using the CLI or the Amazon Web Services API. This limitation does not apply to console sessions.</p>
81+
* <p>You cannot call any IAM operations using the CLI or the Amazon Web Services API. This
82+
* limitation does not apply to console sessions.</p>
7983
* </li>
8084
* <li>
8185
* <p>You cannot call any STS operations except <code>GetCallerIdentity</code>.</p>
@@ -89,12 +93,13 @@ export interface GetFederationTokenCommandOutput extends GetFederationTokenRespo
8993
* policies can't exceed 2,048 characters.</p>
9094
* <p>Though the session policy parameters are optional, if you do not pass a policy, then the
9195
* resulting federated user session has no permissions. When you pass session policies, the
92-
* session permissions are the intersection of the IAM user policies and the session
93-
* policies that you pass. This gives you a way to further restrict the permissions for a
94-
* federated user. You cannot use session policies to grant more permissions than those that
95-
* are defined in the permissions policy of the IAM user. For more information, see <a href="https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies.html#policies_session">Session
96-
* Policies</a> in the <i>IAM User Guide</i>. For information about
97-
* using <code>GetFederationToken</code> to create temporary security credentials, see <a href="https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_request.html#api_getfederationtoken">GetFederationToken—Federation Through a Custom Identity Broker</a>. </p>
96+
* session permissions are the intersection of the IAM user policies and the
97+
* session policies that you pass. This gives you a way to further restrict the permissions
98+
* for a federated user. You cannot use session policies to grant more permissions than those
99+
* that are defined in the permissions policy of the IAM user. For more
100+
* information, see <a href="https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies.html#policies_session">Session Policies</a> in
101+
* the <i>IAM User Guide</i>. For information about using
102+
* <code>GetFederationToken</code> to create temporary security credentials, see <a href="https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_request.html#api_getfederationtoken">GetFederationToken—Federation Through a Custom Identity Broker</a>. </p>
98103
* <p>You can use the credentials to access a resource that has a resource-based policy. If
99104
* that policy specifically references the federated user session in the
100105
* <code>Principal</code> element of the policy, the session has the permissions allowed by

clients/client-sts/src/commands/GetSessionTokenCommand.ts

Lines changed: 20 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -41,15 +41,17 @@ export interface GetSessionTokenCommandOutput extends GetSessionTokenResponse, _
4141

4242
/**
4343
* @public
44-
* <p>Returns a set of temporary credentials for an Amazon Web Services account or IAM user. The
45-
* credentials consist of an access key ID, a secret access key, and a security token.
44+
* <p>Returns a set of temporary credentials for an Amazon Web Services account or IAM user.
45+
* The credentials consist of an access key ID, a secret access key, and a security token.
4646
* Typically, you use <code>GetSessionToken</code> if you want to use MFA to protect
47-
* programmatic calls to specific Amazon Web Services API operations like Amazon EC2 <code>StopInstances</code>.</p>
48-
* <p>MFA-enabled IAM users must call <code>GetSessionToken</code> and submit an MFA
49-
* code that is associated with their MFA device. Using the temporary security credentials
50-
* that the call returns, IAM users can then make programmatic calls to API
51-
* operations that require MFA authentication. An incorrect MFA code causes the API to return an access denied error. For a comparison of <code>GetSessionToken</code>
52-
* with the other API operations that produce temporary credentials, see <a href="https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_request.html">Requesting
47+
* programmatic calls to specific Amazon Web Services API operations like Amazon EC2
48+
* <code>StopInstances</code>.</p>
49+
* <p>MFA-enabled IAM users must call <code>GetSessionToken</code> and submit
50+
* an MFA code that is associated with their MFA device. Using the temporary security
51+
* credentials that the call returns, IAM users can then make programmatic
52+
* calls to API operations that require MFA authentication. An incorrect MFA code causes the
53+
* API to return an access denied error. For a comparison of <code>GetSessionToken</code> with
54+
* the other API operations that produce temporary credentials, see <a href="https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_request.html">Requesting
5355
* Temporary Security Credentials</a> and <a href="https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_request.html#stsapi_comparison">Comparing the
5456
* Amazon Web Services STS API operations</a> in the <i>IAM User Guide</i>.</p>
5557
* <note>
@@ -63,8 +65,7 @@ export interface GetSessionTokenCommandOutput extends GetSessionTokenResponse, _
6365
* <b>Session Duration</b>
6466
* </p>
6567
* <p>The <code>GetSessionToken</code> operation must be called by using the long-term Amazon Web Services
66-
* security credentials of an IAM user. Credentials that are
67-
* created by IAM users are valid for the duration that you specify. This duration can range
68+
* security credentials of an IAM user. Credentials that are created by IAM users are valid for the duration that you specify. This duration can range
6869
* from 900 seconds (15 minutes) up to a maximum of 129,600 seconds (36 hours), with a default
6970
* of 43,200 seconds (12 hours). Credentials based on account credentials can range from 900
7071
* seconds (15 minutes) up to 3,600 seconds (1 hour), with a default of 1 hour. </p>
@@ -83,15 +84,16 @@ export interface GetSessionTokenCommandOutput extends GetSessionTokenResponse, _
8384
* <code>AssumeRole</code> or <code>GetCallerIdentity</code>.</p>
8485
* </li>
8586
* </ul>
86-
* <p>The credentials that <code>GetSessionToken</code> returns are based on
87-
* permissions associated with the IAM user whose credentials were used to call the operation. The
88-
* temporary credentials have the same permissions as the IAM user.</p>
87+
* <p>The credentials that <code>GetSessionToken</code> returns are based on permissions
88+
* associated with the IAM user whose credentials were used to call the
89+
* operation. The temporary credentials have the same permissions as the IAM user.</p>
8990
* <note>
90-
* <p>Although it is possible to call <code>GetSessionToken</code> using the security credentials of an
91-
* Amazon Web Services account root user rather than an IAM user, we do not recommend it. If
92-
* <code>GetSessionToken</code> is called using root user credentials, the
93-
* temporary credentials have root user permissions. For more information, see <a href="https://docs.aws.amazon.com/IAM/latest/UserGuide/best-practices.html#lock-away-credentials">Safeguard your root user credentials and don't use them for everyday tasks</a> in the
94-
* <i>IAM User Guide</i>
91+
* <p>Although it is possible to call <code>GetSessionToken</code> using the security
92+
* credentials of an Amazon Web Services account root user rather than an IAM user, we do
93+
* not recommend it. If <code>GetSessionToken</code> is called using root user
94+
* credentials, the temporary credentials have root user permissions. For more
95+
* information, see <a href="https://docs.aws.amazon.com/IAM/latest/UserGuide/best-practices.html#lock-away-credentials">Safeguard your root user credentials and don't use them for everyday tasks</a> in the
96+
* <i>IAM User Guide</i>
9597
* </p>
9698
* </note>
9799
* <p>For more information about using <code>GetSessionToken</code> to create temporary

0 commit comments

Comments
 (0)