Skip to content

Commit 5426503

Browse files
author
awstools
committed
feat(client-cognito-identity-provider): Add a new exception type, ForbiddenException, that is returned when request is not allowed
1 parent a38fd62 commit 5426503

File tree

7 files changed

+337
-132
lines changed

7 files changed

+337
-132
lines changed

clients/client-cognito-identity-provider/src/CognitoIdentityProvider.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1537,7 +1537,7 @@ export class CognitoIdentityProvider extends CognitoIdentityProviderClient {
15371537
}
15381538

15391539
/**
1540-
* <p>Begins setup of time-based one-time password multi-factor authentication (TOTP MFA)
1540+
* <p>Begins setup of time-based one-time password (TOTP) multi-factor authentication (MFA)
15411541
* for a user, with a unique private key that Amazon Cognito generates and returns in the API
15421542
* response. You can authorize an <code>AssociateSoftwareToken</code> request with either
15431543
* the user's access token, or a session string from a challenge response that you received

clients/client-cognito-identity-provider/src/commands/AssociateSoftwareTokenCommand.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ export interface AssociateSoftwareTokenCommandInput extends AssociateSoftwareTok
3333
export interface AssociateSoftwareTokenCommandOutput extends AssociateSoftwareTokenResponse, __MetadataBearer {}
3434

3535
/**
36-
* <p>Begins setup of time-based one-time password multi-factor authentication (TOTP MFA)
36+
* <p>Begins setup of time-based one-time password (TOTP) multi-factor authentication (MFA)
3737
* for a user, with a unique private key that Amazon Cognito generates and returns in the API
3838
* response. You can authorize an <code>AssociateSoftwareToken</code> request with either
3939
* the user's access token, or a session string from a challenge response that you received

clients/client-cognito-identity-provider/src/commands/SignUpCommand.ts

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,8 @@ import {
1717
ServiceInputTypes,
1818
ServiceOutputTypes,
1919
} from "../CognitoIdentityProviderClient";
20-
import {
21-
SignUpRequest,
22-
SignUpRequestFilterSensitiveLog,
23-
SignUpResponse,
24-
SignUpResponseFilterSensitiveLog,
25-
} from "../models/models_0";
20+
import { SignUpRequest, SignUpRequestFilterSensitiveLog } from "../models/models_0";
21+
import { SignUpResponse, SignUpResponseFilterSensitiveLog } from "../models/models_1";
2622
import { deserializeAws_json1_1SignUpCommand, serializeAws_json1_1SignUpCommand } from "../protocols/Aws_json1_1";
2723

2824
export interface SignUpCommandInput extends SignUpRequest {}

clients/client-cognito-identity-provider/src/models/models_0.ts

Lines changed: 84 additions & 94 deletions
Original file line numberDiff line numberDiff line change
@@ -937,7 +937,7 @@ export class InvalidSmsRoleAccessPolicyException extends __BaseException {
937937
/**
938938
* <p>This exception is thrown when the trust relationship is not valid for the role
939939
* provided for SMS configuration. This can happen if you don't trust
940-
* <code>cognito-idp.amazonaws.com</code> or the external ID provided in the role does
940+
* <code>cognito-idp.amazonaws.com</code> or the external ID provided in the role does
941941
* not match what is provided in the SMS configuration for the user pool.</p>
942942
*/
943943
export class InvalidSmsRoleTrustRelationshipException extends __BaseException {
@@ -3008,8 +3008,8 @@ export interface AssociateSoftwareTokenRequest {
30083008

30093009
export interface AssociateSoftwareTokenResponse {
30103010
/**
3011-
* <p>A unique generated shared secret code that is used in the time-based one-time password
3012-
* (TOTP) algorithm to generate a one-time code.</p>
3011+
* <p>A unique generated shared secret code that is used in the
3012+
* TOTP algorithm to generate a one-time code.</p>
30133013
*/
30143014
SecretCode?: string;
30153015

@@ -3040,6 +3040,25 @@ export class ConcurrentModificationException extends __BaseException {
30403040
}
30413041
}
30423042

3043+
/**
3044+
* <p>This exception is thrown when WAF doesn't allow your request based on a web ACL that's associated with your user pool.</p>
3045+
*/
3046+
export class ForbiddenException extends __BaseException {
3047+
readonly name: "ForbiddenException" = "ForbiddenException";
3048+
readonly $fault: "client" = "client";
3049+
/**
3050+
* @internal
3051+
*/
3052+
constructor(opts: __ExceptionOptionType<ForbiddenException, __BaseException>) {
3053+
super({
3054+
name: "ForbiddenException",
3055+
$fault: "client",
3056+
...opts,
3057+
});
3058+
Object.setPrototypeOf(this, ForbiddenException.prototype);
3059+
}
3060+
}
3061+
30433062
export enum VerifiedAttributeType {
30443063
EMAIL = "email",
30453064
PHONE_NUMBER = "phone_number",
@@ -3163,13 +3182,13 @@ export interface ConfirmForgotPasswordRequest {
31633182
Username: string | undefined;
31643183

31653184
/**
3166-
* <p>The confirmation code sent by a user's request to retrieve a forgotten password. For
3185+
* <p>The confirmation code from your user's request to reset their password. For
31673186
* more information, see <a href="https://docs.aws.amazon.com/cognito-user-identity-pools/latest/APIReference/API_ForgotPassword.html">ForgotPassword</a>.</p>
31683187
*/
31693188
ConfirmationCode: string | undefined;
31703189

31713190
/**
3172-
* <p>The password sent by a user's request to retrieve a forgotten password.</p>
3191+
* <p>The new password that your user wants to set.</p>
31733192
*/
31743193
Password: string | undefined;
31753194

@@ -3959,28 +3978,24 @@ export interface CreateUserImportJobResponse {
39593978
}
39603979

39613980
/**
3962-
* <p>The device tracking configuration for a user pool. A user pool with device tracking
3963-
* deactivated returns a null value.</p>
3964-
* <note>
3965-
* <p>When you provide values for any DeviceConfiguration field, you activate device
3966-
* tracking.</p>
3967-
* </note>
3981+
* <p>The device-remembering configuration for a user pool. A null value indicates that you have deactivated device remembering in your user pool.</p>
3982+
* <note>
3983+
* <p>When you provide a value for any <code>DeviceConfiguration</code> field, you activate the Amazon Cognito device-remembering feature.</p>
3984+
* </note>
39683985
*/
39693986
export interface DeviceConfigurationType {
39703987
/**
3971-
* <p>When true, device authentication can replace SMS and time-based one-time password
3972-
* (TOTP) factors for multi-factor authentication (MFA).</p>
3973-
* <note>
3974-
* <p>Users that sign in with devices that have not been confirmed or remembered will
3975-
* still have to provide a second factor, whether or not ChallengeRequiredOnNewDevice
3976-
* is true, when your user pool requires MFA.</p>
3977-
* </note>
3988+
* <p>When true, device authentication can replace SMS and time-based one-time password (TOTP) factors for multi-factor authentication (MFA).</p>
3989+
* <note>
3990+
* <p>Regardless of the value of this field, users that sign in with new devices that have not been confirmed or remembered must provide a second factor if your user pool requires MFA.</p>
3991+
* </note>
39783992
*/
39793993
ChallengeRequiredOnNewDevice?: boolean;
39803994

39813995
/**
3982-
* <p>When true, users can opt in to remembering their device. Your app code must use
3983-
* callback functions to return the user's choice.</p>
3996+
* <p>When true, Amazon Cognito doesn't remember newly-confirmed devices. Users who want to authenticate with their device
3997+
* can instead opt in to remembering their device. To collect a choice from your user, create an input prompt
3998+
* in your app and return the value that the user chooses in an <a href="https://docs.aws.amazon.com/cognito-user-identity-pools/latest/APIReference/API_UpdateDeviceStatus.html">UpdateDeviceStatus</a> API request.</p>
39843999
*/
39854000
DeviceOnlyRememberedOnUserPrompt?: boolean;
39864001
}
@@ -4324,7 +4339,7 @@ export interface SmsConfigurationType {
43244339
* <p>The settings for updates to user attributes. These settings include the property <code>AttributesRequireVerificationBeforeUpdate</code>,
43254340
* a user-pool setting that tells Amazon Cognito how to handle changes to the value of your users' email address and phone number attributes. For
43264341
* more information, see <a href="https://docs.aws.amazon.com/cognito/latest/developerguide/user-pool-settings-email-phone-verification.html#user-pool-settings-verifications-verify-attribute-updates">
4327-
* Verifying updates to to email addresses and phone numbers</a>.</p>
4342+
* Verifying updates to email addresses and phone numbers</a>.</p>
43284343
*/
43294344
export interface UserAttributeUpdateSettingsType {
43304345
/**
@@ -4488,14 +4503,14 @@ export interface CreateUserPoolRequest {
44884503
SmsVerificationMessage?: string;
44894504

44904505
/**
4491-
* <p>A string representing the email verification message. EmailVerificationMessage is
4492-
* allowed only if <a href="https://docs.aws.amazon.com/cognito-user-identity-pools/latest/APIReference/API_EmailConfigurationType.html#CognitoUserPools-Type-EmailConfigurationType-EmailSendingAccount">EmailSendingAccount</a> is DEVELOPER. </p>
4506+
* <p>A string representing the email verification message.
4507+
* <code>EmailVerificationMessage</code> is allowed only if <a href="https://docs.aws.amazon.com/cognito-user-identity-pools/latest/APIReference/API_EmailConfigurationType.html#CognitoUserPools-Type-EmailConfigurationType-EmailSendingAccount">EmailSendingAccount</a> is DEVELOPER. </p>
44934508
*/
44944509
EmailVerificationMessage?: string;
44954510

44964511
/**
4497-
* <p>A string representing the email verification subject. EmailVerificationSubject is
4498-
* allowed only if <a href="https://docs.aws.amazon.com/cognito-user-identity-pools/latest/APIReference/API_EmailConfigurationType.html#CognitoUserPools-Type-EmailConfigurationType-EmailSendingAccount">EmailSendingAccount</a> is DEVELOPER. </p>
4512+
* <p>A string representing the email verification subject.
4513+
* <code>EmailVerificationSubject</code> is allowed only if <a href="https://docs.aws.amazon.com/cognito-user-identity-pools/latest/APIReference/API_EmailConfigurationType.html#CognitoUserPools-Type-EmailConfigurationType-EmailSendingAccount">EmailSendingAccount</a> is DEVELOPER. </p>
44994514
*/
45004515
EmailVerificationSubject?: string;
45014516

@@ -4519,12 +4534,15 @@ export interface CreateUserPoolRequest {
45194534
* <p>The settings for updates to user attributes. These settings include the property <code>AttributesRequireVerificationBeforeUpdate</code>,
45204535
* a user-pool setting that tells Amazon Cognito how to handle changes to the value of your users' email address and phone number attributes. For
45214536
* more information, see <a href="https://docs.aws.amazon.com/cognito/latest/developerguide/user-pool-settings-email-phone-verification.html#user-pool-settings-verifications-verify-attribute-updates">
4522-
* Verifying updates to to email addresses and phone numbers</a>.</p>
4537+
* Verifying updates to email addresses and phone numbers</a>.</p>
45234538
*/
45244539
UserAttributeUpdateSettings?: UserAttributeUpdateSettingsType;
45254540

45264541
/**
4527-
* <p>The device configuration.</p>
4542+
* <p>The device-remembering configuration for a user pool. A null value indicates that you have deactivated device remembering in your user pool.</p>
4543+
* <note>
4544+
* <p>When you provide a value for any <code>DeviceConfiguration</code> field, you activate the Amazon Cognito device-remembering feature.</p>
4545+
* </note>
45284546
*/
45294547
DeviceConfiguration?: DeviceConfigurationType;
45304548

@@ -4680,7 +4698,7 @@ export interface UserPoolType {
46804698
* <p>The settings for updates to user attributes. These settings include the property <code>AttributesRequireVerificationBeforeUpdate</code>,
46814699
* a user-pool setting that tells Amazon Cognito how to handle changes to the value of your users' email address and phone number attributes. For
46824700
* more information, see <a href="https://docs.aws.amazon.com/cognito/latest/developerguide/user-pool-settings-email-phone-verification.html#user-pool-settings-verifications-verify-attribute-updates">
4683-
* Verifying updates to to email addresses and phone numbers</a>.</p>
4701+
* Verifying updates to email addresses and phone numbers</a>.</p>
46844702
*/
46854703
UserAttributeUpdateSettings?: UserAttributeUpdateSettingsType;
46864704

@@ -4707,7 +4725,10 @@ export interface UserPoolType {
47074725
MfaConfiguration?: UserPoolMfaType | string;
47084726

47094727
/**
4710-
* <p>The device configuration.</p>
4728+
* <p>The device-remembering configuration for a user pool. A null value indicates that you have deactivated device remembering in your user pool.</p>
4729+
* <note>
4730+
* <p>When you provide a value for any <code>DeviceConfiguration</code> field, you activate the Amazon Cognito device-remembering feature.</p>
4731+
* </note>
47114732
*/
47124733
DeviceConfiguration?: DeviceConfigurationType;
47134734

@@ -4993,46 +5014,45 @@ export interface CreateUserPoolClientRequest {
49935014
* <code>ALLOW_</code> prefix.</p>
49945015
* </note>
49955016
* <p>Valid values include:</p>
4996-
* <ul>
4997-
* <li>
4998-
* <p>
4999-
* <code>ALLOW_ADMIN_USER_PASSWORD_AUTH</code>: Enable admin based user password
5017+
* <dl>
5018+
* <dt>ALLOW_ADMIN_USER_PASSWORD_AUTH</dt>
5019+
* <dd>
5020+
* <p>Enable admin based user password
50005021
* authentication flow <code>ADMIN_USER_PASSWORD_AUTH</code>. This setting replaces
50015022
* the <code>ADMIN_NO_SRP_AUTH</code> setting. With this authentication flow, Amazon Cognito
50025023
* receives the password in the request instead of using the Secure Remote Password
50035024
* (SRP) protocol to verify passwords.</p>
5004-
* </li>
5005-
* <li>
5006-
* <p>
5007-
* <code>ALLOW_CUSTOM_AUTH</code>: Enable Lambda trigger based
5008-
* authentication.</p>
5009-
* </li>
5010-
* <li>
5011-
* <p>
5012-
* <code>ALLOW_USER_PASSWORD_AUTH</code>: Enable user password-based
5025+
* </dd>
5026+
* <dt>ALLOW_CUSTOM_AUTH</dt>
5027+
* <dd>
5028+
* <p>Enable Lambda trigger based authentication.</p>
5029+
* </dd>
5030+
* <dt>ALLOW_USER_PASSWORD_AUTH</dt>
5031+
* <dd>
5032+
* <p>Enable user password-based
50135033
* authentication. In this flow, Amazon Cognito receives the password in the request instead
50145034
* of using the SRP protocol to verify passwords.</p>
5015-
* </li>
5016-
* <li>
5017-
* <p>
5018-
* <code>ALLOW_USER_SRP_AUTH</code>: Enable SRP-based authentication.</p>
5019-
* </li>
5020-
* <li>
5021-
* <p>
5022-
* <code>ALLOW_REFRESH_TOKEN_AUTH</code>: Enable authflow to refresh
5023-
* tokens.</p>
5024-
* </li>
5025-
* </ul>
5026-
* <p>If you don't specify a value for <code>ExplicitAuthFlows</code>, your app client
5027-
* activates the <code>ALLOW_USER_SRP_AUTH</code> and <code>ALLOW_CUSTOM_AUTH</code>
5028-
* authentication flows.</p>
5035+
* </dd>
5036+
* <dt>ALLOW_USER_SRP_AUTH</dt>
5037+
* <dd>
5038+
* <p>Enable SRP-based authentication.</p>
5039+
* </dd>
5040+
* <dt>ALLOW_REFRESH_TOKEN_AUTH</dt>
5041+
* <dd>
5042+
* <p>Enable the authflow that refreshes tokens.</p>
5043+
* </dd>
5044+
* </dl>
5045+
* <p>If you don't specify a value for <code>ExplicitAuthFlows</code>, your user client
5046+
* supports <code>ALLOW_USER_SRP_AUTH</code> and <code>ALLOW_CUSTOM_AUTH</code>.</p>
50295047
*/
50305048
ExplicitAuthFlows?: (ExplicitAuthFlowsType | string)[];
50315049

50325050
/**
5033-
* <p>A list of provider names for the IdPs that this client supports. The following are
5034-
* supported: <code>COGNITO</code>, <code>Facebook</code>, <code>Google</code>
5035-
* <code>LoginWithAmazon</code>, and the names of your own SAML and OIDC providers.</p>
5051+
* <p>A list of provider names for the identity providers (IdPs) that are supported on this
5052+
* client. The following are supported: <code>COGNITO</code>, <code>Facebook</code>,
5053+
* <code>Google</code>, <code>SignInWithApple</code>, and <code>LoginWithAmazon</code>. You can also specify the names
5054+
* that you configured for the SAML and OIDC IdPs in your user pool, for example
5055+
* <code>MySAMLIdP</code> or <code>MyOIDCIdP</code>.</p>
50365056
*/
50375057
SupportedIdentityProviders?: string[];
50385058

@@ -5310,7 +5330,7 @@ export interface UserPoolClientType {
53105330

53115331
/**
53125332
* <p>A list of provider names for the IdPs that this client supports. The following are
5313-
* supported: <code>COGNITO</code>, <code>Facebook</code>, <code>Google</code>
5333+
* supported: <code>COGNITO</code>, <code>Facebook</code>, <code>Google</code>, <code>SignInWithApple</code>,
53145334
* <code>LoginWithAmazon</code>, and the names of your own SAML and OIDC providers.</p>
53155335
*/
53165336
SupportedIdentityProviders?: string[];
@@ -6427,17 +6447,17 @@ export interface SoftwareTokenMfaConfigType {
64276447

64286448
export interface GetUserPoolMfaConfigResponse {
64296449
/**
6430-
* <p>The SMS text message multi-factor (MFA) configuration.</p>
6450+
* <p>The SMS text message multi-factor authentication (MFA) configuration.</p>
64316451
*/
64326452
SmsMfaConfiguration?: SmsMfaConfigType;
64336453

64346454
/**
6435-
* <p>The software token multi-factor (MFA) configuration.</p>
6455+
* <p>The software token multi-factor authentication (MFA) configuration.</p>
64366456
*/
64376457
SoftwareTokenMfaConfiguration?: SoftwareTokenMfaConfigType;
64386458

64396459
/**
6440-
* <p>The multi-factor (MFA) configuration. Valid values include:</p>
6460+
* <p>The multi-factor authentication (MFA) configuration. Valid values include:</p>
64416461
* <ul>
64426462
* <li>
64436463
* <p>
@@ -7668,7 +7688,7 @@ export interface SetUserMFAPreferenceRequest {
76687688
SMSMfaSettings?: SMSMfaSettingsType;
76697689

76707690
/**
7671-
* <p>The time-based one-time password software token MFA settings.</p>
7691+
* <p>The time-based one-time password (TOTP) software token MFA settings.</p>
76727692
*/
76737693
SoftwareTokenMfaSettings?: SoftwareTokenMfaSettingsType;
76747694

@@ -7863,29 +7883,6 @@ export interface SignUpRequest {
78637883
ClientMetadata?: Record<string, string>;
78647884
}
78657885

7866-
/**
7867-
* <p>The response from the server for a registration request.</p>
7868-
*/
7869-
export interface SignUpResponse {
7870-
/**
7871-
* <p>A response from the server indicating that a user registration has been
7872-
* confirmed.</p>
7873-
*/
7874-
UserConfirmed: boolean | undefined;
7875-
7876-
/**
7877-
* <p>The code delivery details returned by the server response to the user registration
7878-
* request.</p>
7879-
*/
7880-
CodeDeliveryDetails?: CodeDeliveryDetailsType;
7881-
7882-
/**
7883-
* <p>The UUID of the authenticated user. This isn't the same as
7884-
* <code>username</code>.</p>
7885-
*/
7886-
UserSub: string | undefined;
7887-
}
7888-
78897886
/**
78907887
* @internal
78917888
*/
@@ -9615,10 +9612,3 @@ export const SignUpRequestFilterSensitiveLog = (obj: SignUpRequest): any => ({
96159612
ValidationData: obj.ValidationData.map((item) => AttributeTypeFilterSensitiveLog(item)),
96169613
}),
96179614
});
9618-
9619-
/**
9620-
* @internal
9621-
*/
9622-
export const SignUpResponseFilterSensitiveLog = (obj: SignUpResponse): any => ({
9623-
...obj,
9624-
});

0 commit comments

Comments
 (0)