Skip to content

Commit 58004ad

Browse files
author
awstools
committed
feat(client-cognito-identity-provider): This release adds a new "DeletionProtection" field to the UserPool in Cognito. Application admins can configure this value with either ACTIVE or INACTIVE value. Setting this field to ACTIVE will prevent a user pool from accidental deletion.
1 parent d7d3486 commit 58004ad

File tree

113 files changed

+4315
-1094
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

113 files changed

+4315
-1094
lines changed

clients/client-cognito-identity-provider/package.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
"@aws-sdk/hash-node": "*",
2727
"@aws-sdk/invalid-dependency": "*",
2828
"@aws-sdk/middleware-content-length": "*",
29+
"@aws-sdk/middleware-endpoint": "*",
2930
"@aws-sdk/middleware-host-header": "*",
3031
"@aws-sdk/middleware-logger": "*",
3132
"@aws-sdk/middleware-recursion-detection": "*",
@@ -46,6 +47,7 @@
4647
"@aws-sdk/util-body-length-node": "*",
4748
"@aws-sdk/util-defaults-mode-browser": "*",
4849
"@aws-sdk/util-defaults-mode-node": "*",
50+
"@aws-sdk/util-endpoints": "*",
4951
"@aws-sdk/util-user-agent-browser": "*",
5052
"@aws-sdk/util-user-agent-node": "*",
5153
"@aws-sdk/util-utf8-browser": "*",

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

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -753,8 +753,9 @@ export class CognitoIdentityProvider extends CognitoIdentityProviderClient {
753753
}
754754

755755
/**
756-
* <p>Disables the specified user.</p>
757-
* <p>Calling this action requires developer credentials.</p>
756+
* <p>Deactivates a user and revokes all access tokens for the user. A deactivated user can't sign in,
757+
* but still appears in the responses to <code>GetUser</code> and <code>ListUsers</code> API requests.</p>
758+
* <p>You must make this API request with Amazon Web Services credentials that have <code>cognito-idp:AdminDisableUser</code> permissions.</p>
758759
*/
759760
public adminDisableUser(
760761
args: AdminDisableUserCommandInput,
@@ -2625,7 +2626,9 @@ export class CognitoIdentityProvider extends CognitoIdentityProviderClient {
26252626
}
26262627

26272628
/**
2628-
* <p>This method takes a user pool ID, and returns the signing certificate.</p>
2629+
* <p>This method takes a user pool ID, and returns the signing certificate. The issued certificate is valid for 10 years from the date of issue.</p>
2630+
* <p>Amazon Cognito issues and assigns a new signing certificate annually. This process returns a new value in the response to <code>GetSigningCertificate</code>,
2631+
* but doesn't invalidate the original certificate.</p>
26292632
*/
26302633
public getSigningCertificate(
26312634
args: GetSigningCertificateCommandInput,
@@ -2804,10 +2807,8 @@ export class CognitoIdentityProvider extends CognitoIdentityProviderClient {
28042807

28052808
/**
28062809
* <p>Signs out users from all devices. It also invalidates all refresh tokens that Amazon Cognito
2807-
* has issued to a user. The user's current access and ID tokens remain valid until their
2808-
* expiry. By default, access and ID tokens expire one hour after Amazon Cognito issues them. A user
2809-
* can still use a hosted UI cookie to retrieve new tokens for the duration of the cookie
2810-
* validity period of 1 hour.</p>
2810+
* has issued to a user. A user can still use a hosted UI cookie to retrieve new tokens
2811+
* for the duration of the 1-hour cookie validity period.</p>
28112812
*/
28122813
public globalSignOut(
28132814
args: GlobalSignOutCommandInput,
@@ -3295,9 +3296,9 @@ export class CognitoIdentityProvider extends CognitoIdentityProviderClient {
32953296
}
32963297

32973298
/**
3298-
* <p>Revokes all of the access tokens generated by the specified refresh token. After the
3299-
* token is revoked, you can't use the revoked token to access Amazon Cognito authenticated
3300-
* APIs.</p>
3299+
* <p>Revokes all of the access tokens generated by, and at the same time as, the specified
3300+
* refresh token. After a token is revoked, you can't use the revoked token to access
3301+
* Amazon Cognito user APIs, or to authorize access to your resource server.</p>
33013302
*/
33023303
public revokeToken(args: RevokeTokenCommandInput, options?: __HttpHandlerOptions): Promise<RevokeTokenCommandOutput>;
33033304
public revokeToken(args: RevokeTokenCommandInput, cb: (err: any, data?: RevokeTokenCommandOutput) => void): void;

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

Lines changed: 24 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,7 @@
11
// smithy-typescript generated code
2-
import {
3-
EndpointsInputConfig,
4-
EndpointsResolvedConfig,
5-
RegionInputConfig,
6-
RegionResolvedConfig,
7-
resolveEndpointsConfig,
8-
resolveRegionConfig,
9-
} from "@aws-sdk/config-resolver";
2+
import { RegionInputConfig, RegionResolvedConfig, resolveRegionConfig } from "@aws-sdk/config-resolver";
103
import { getContentLengthPlugin } from "@aws-sdk/middleware-content-length";
4+
import { EndpointInputConfig, EndpointResolvedConfig, resolveEndpointConfig } from "@aws-sdk/middleware-endpoint";
115
import {
126
getHostHeaderPlugin,
137
HostHeaderInputConfig,
@@ -36,13 +30,13 @@ import {
3630
Credentials as __Credentials,
3731
Decoder as __Decoder,
3832
Encoder as __Encoder,
33+
EndpointV2 as __EndpointV2,
3934
Hash as __Hash,
4035
HashConstructor as __HashConstructor,
4136
HttpHandlerOptions as __HttpHandlerOptions,
4237
Logger as __Logger,
4338
Provider as __Provider,
4439
Provider,
45-
RegionInfoProvider,
4640
StreamCollector as __StreamCollector,
4741
UrlParser as __UrlParser,
4842
UserAgent as __UserAgent,
@@ -317,6 +311,12 @@ import {
317311
VerifyUserAttributeCommandInput,
318312
VerifyUserAttributeCommandOutput,
319313
} from "./commands/VerifyUserAttributeCommand";
314+
import {
315+
ClientInputEndpointParameters,
316+
ClientResolvedEndpointParameters,
317+
EndpointParameters,
318+
resolveClientEndpointParameters,
319+
} from "./endpoint/EndpointParameters";
320320
import { getRuntimeConfig as __getRuntimeConfig } from "./runtimeConfig";
321321

322322
export type ServiceInputTypes =
@@ -634,12 +634,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__
634634
*/
635635
credentialDefaultProvider?: (input: any) => __Provider<__Credentials>;
636636

637-
/**
638-
* Fetch related hostname, signing name or signing region with given region.
639-
* @internal
640-
*/
641-
regionInfoProvider?: RegionInfoProvider;
642-
643637
/**
644638
* The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header
645639
* @internal
@@ -655,11 +649,12 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__
655649
type CognitoIdentityProviderClientConfigType = Partial<__SmithyConfiguration<__HttpHandlerOptions>> &
656650
ClientDefaults &
657651
RegionInputConfig &
658-
EndpointsInputConfig &
652+
EndpointInputConfig<EndpointParameters> &
659653
RetryInputConfig &
660654
HostHeaderInputConfig &
661655
AwsAuthInputConfig &
662-
UserAgentInputConfig;
656+
UserAgentInputConfig &
657+
ClientInputEndpointParameters;
663658
/**
664659
* The configuration interface of CognitoIdentityProviderClient class constructor that set the region, credentials and other options.
665660
*/
@@ -668,11 +663,12 @@ export interface CognitoIdentityProviderClientConfig extends CognitoIdentityProv
668663
type CognitoIdentityProviderClientResolvedConfigType = __SmithyResolvedConfiguration<__HttpHandlerOptions> &
669664
Required<ClientDefaults> &
670665
RegionResolvedConfig &
671-
EndpointsResolvedConfig &
666+
EndpointResolvedConfig<EndpointParameters> &
672667
RetryResolvedConfig &
673668
HostHeaderResolvedConfig &
674669
AwsAuthResolvedConfig &
675-
UserAgentResolvedConfig;
670+
UserAgentResolvedConfig &
671+
ClientResolvedEndpointParameters;
676672
/**
677673
* The resolved configuration interface of CognitoIdentityProviderClient class. This is resolved and normalized from the {@link CognitoIdentityProviderClientConfig | constructor configuration interface}.
678674
*/
@@ -699,14 +695,15 @@ export class CognitoIdentityProviderClient extends __Client<
699695

700696
constructor(configuration: CognitoIdentityProviderClientConfig) {
701697
const _config_0 = __getRuntimeConfig(configuration);
702-
const _config_1 = resolveRegionConfig(_config_0);
703-
const _config_2 = resolveEndpointsConfig(_config_1);
704-
const _config_3 = resolveRetryConfig(_config_2);
705-
const _config_4 = resolveHostHeaderConfig(_config_3);
706-
const _config_5 = resolveAwsAuthConfig(_config_4);
707-
const _config_6 = resolveUserAgentConfig(_config_5);
708-
super(_config_6);
709-
this.config = _config_6;
698+
const _config_1 = resolveClientEndpointParameters(_config_0);
699+
const _config_2 = resolveRegionConfig(_config_1);
700+
const _config_3 = resolveEndpointConfig(_config_2);
701+
const _config_4 = resolveRetryConfig(_config_3);
702+
const _config_5 = resolveHostHeaderConfig(_config_4);
703+
const _config_6 = resolveAwsAuthConfig(_config_5);
704+
const _config_7 = resolveUserAgentConfig(_config_6);
705+
super(_config_7);
706+
this.config = _config_7;
710707
this.middlewareStack.use(getRetryPlugin(this.config));
711708
this.middlewareStack.use(getContentLengthPlugin(this.config));
712709
this.middlewareStack.use(getHostHeaderPlugin(this.config));

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

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
// smithy-typescript generated code
2+
import { EndpointParameterInstructions, getEndpointPlugin } from "@aws-sdk/middleware-endpoint";
23
import { getSerdePlugin } from "@aws-sdk/middleware-serde";
34
import { getAwsAuthPlugin } from "@aws-sdk/middleware-signing";
45
import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@aws-sdk/protocol-http";
@@ -57,6 +58,15 @@ export class AddCustomAttributesCommand extends $Command<
5758
// Start section: command_properties
5859
// End section: command_properties
5960

61+
public static getEndpointParameterInstructions(): EndpointParameterInstructions {
62+
return {
63+
UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" },
64+
Endpoint: { type: "builtInParams", name: "endpoint" },
65+
Region: { type: "builtInParams", name: "region" },
66+
UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" },
67+
};
68+
}
69+
6070
constructor(readonly input: AddCustomAttributesCommandInput) {
6171
// Start section: command_constructor
6272
super();
@@ -72,6 +82,9 @@ export class AddCustomAttributesCommand extends $Command<
7282
options?: __HttpHandlerOptions
7383
): Handler<AddCustomAttributesCommandInput, AddCustomAttributesCommandOutput> {
7484
this.middlewareStack.use(getSerdePlugin(configuration, this.serialize, this.deserialize));
85+
this.middlewareStack.use(
86+
getEndpointPlugin(configuration, AddCustomAttributesCommand.getEndpointParameterInstructions())
87+
);
7588
this.middlewareStack.use(getAwsAuthPlugin(configuration));
7689

7790
const stack = clientStack.concat(this.middlewareStack);

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

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
// smithy-typescript generated code
2+
import { EndpointParameterInstructions, getEndpointPlugin } from "@aws-sdk/middleware-endpoint";
23
import { getSerdePlugin } from "@aws-sdk/middleware-serde";
34
import { getAwsAuthPlugin } from "@aws-sdk/middleware-signing";
45
import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@aws-sdk/protocol-http";
@@ -53,6 +54,15 @@ export class AdminAddUserToGroupCommand extends $Command<
5354
// Start section: command_properties
5455
// End section: command_properties
5556

57+
public static getEndpointParameterInstructions(): EndpointParameterInstructions {
58+
return {
59+
UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" },
60+
Endpoint: { type: "builtInParams", name: "endpoint" },
61+
Region: { type: "builtInParams", name: "region" },
62+
UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" },
63+
};
64+
}
65+
5666
constructor(readonly input: AdminAddUserToGroupCommandInput) {
5767
// Start section: command_constructor
5868
super();
@@ -68,6 +78,9 @@ export class AdminAddUserToGroupCommand extends $Command<
6878
options?: __HttpHandlerOptions
6979
): Handler<AdminAddUserToGroupCommandInput, AdminAddUserToGroupCommandOutput> {
7080
this.middlewareStack.use(getSerdePlugin(configuration, this.serialize, this.deserialize));
81+
this.middlewareStack.use(
82+
getEndpointPlugin(configuration, AdminAddUserToGroupCommand.getEndpointParameterInstructions())
83+
);
7184
this.middlewareStack.use(getAwsAuthPlugin(configuration));
7285

7386
const stack = clientStack.concat(this.middlewareStack);

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

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
// smithy-typescript generated code
2+
import { EndpointParameterInstructions, getEndpointPlugin } from "@aws-sdk/middleware-endpoint";
23
import { getSerdePlugin } from "@aws-sdk/middleware-serde";
34
import { getAwsAuthPlugin } from "@aws-sdk/middleware-signing";
45
import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@aws-sdk/protocol-http";
@@ -59,6 +60,15 @@ export class AdminConfirmSignUpCommand extends $Command<
5960
// Start section: command_properties
6061
// End section: command_properties
6162

63+
public static getEndpointParameterInstructions(): EndpointParameterInstructions {
64+
return {
65+
UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" },
66+
Endpoint: { type: "builtInParams", name: "endpoint" },
67+
Region: { type: "builtInParams", name: "region" },
68+
UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" },
69+
};
70+
}
71+
6272
constructor(readonly input: AdminConfirmSignUpCommandInput) {
6373
// Start section: command_constructor
6474
super();
@@ -74,6 +84,9 @@ export class AdminConfirmSignUpCommand extends $Command<
7484
options?: __HttpHandlerOptions
7585
): Handler<AdminConfirmSignUpCommandInput, AdminConfirmSignUpCommandOutput> {
7686
this.middlewareStack.use(getSerdePlugin(configuration, this.serialize, this.deserialize));
87+
this.middlewareStack.use(
88+
getEndpointPlugin(configuration, AdminConfirmSignUpCommand.getEndpointParameterInstructions())
89+
);
7790
this.middlewareStack.use(getAwsAuthPlugin(configuration));
7891

7992
const stack = clientStack.concat(this.middlewareStack);

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

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
// smithy-typescript generated code
2+
import { EndpointParameterInstructions, getEndpointPlugin } from "@aws-sdk/middleware-endpoint";
23
import { getSerdePlugin } from "@aws-sdk/middleware-serde";
34
import { getAwsAuthPlugin } from "@aws-sdk/middleware-signing";
45
import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@aws-sdk/protocol-http";
@@ -87,6 +88,15 @@ export class AdminCreateUserCommand extends $Command<
8788
// Start section: command_properties
8889
// End section: command_properties
8990

91+
public static getEndpointParameterInstructions(): EndpointParameterInstructions {
92+
return {
93+
UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" },
94+
Endpoint: { type: "builtInParams", name: "endpoint" },
95+
Region: { type: "builtInParams", name: "region" },
96+
UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" },
97+
};
98+
}
99+
90100
constructor(readonly input: AdminCreateUserCommandInput) {
91101
// Start section: command_constructor
92102
super();
@@ -102,6 +112,9 @@ export class AdminCreateUserCommand extends $Command<
102112
options?: __HttpHandlerOptions
103113
): Handler<AdminCreateUserCommandInput, AdminCreateUserCommandOutput> {
104114
this.middlewareStack.use(getSerdePlugin(configuration, this.serialize, this.deserialize));
115+
this.middlewareStack.use(
116+
getEndpointPlugin(configuration, AdminCreateUserCommand.getEndpointParameterInstructions())
117+
);
105118
this.middlewareStack.use(getAwsAuthPlugin(configuration));
106119

107120
const stack = clientStack.concat(this.middlewareStack);

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

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
// smithy-typescript generated code
2+
import { EndpointParameterInstructions, getEndpointPlugin } from "@aws-sdk/middleware-endpoint";
23
import { getSerdePlugin } from "@aws-sdk/middleware-serde";
34
import { getAwsAuthPlugin } from "@aws-sdk/middleware-signing";
45
import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@aws-sdk/protocol-http";
@@ -59,6 +60,15 @@ export class AdminDeleteUserAttributesCommand extends $Command<
5960
// Start section: command_properties
6061
// End section: command_properties
6162

63+
public static getEndpointParameterInstructions(): EndpointParameterInstructions {
64+
return {
65+
UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" },
66+
Endpoint: { type: "builtInParams", name: "endpoint" },
67+
Region: { type: "builtInParams", name: "region" },
68+
UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" },
69+
};
70+
}
71+
6272
constructor(readonly input: AdminDeleteUserAttributesCommandInput) {
6373
// Start section: command_constructor
6474
super();
@@ -74,6 +84,9 @@ export class AdminDeleteUserAttributesCommand extends $Command<
7484
options?: __HttpHandlerOptions
7585
): Handler<AdminDeleteUserAttributesCommandInput, AdminDeleteUserAttributesCommandOutput> {
7686
this.middlewareStack.use(getSerdePlugin(configuration, this.serialize, this.deserialize));
87+
this.middlewareStack.use(
88+
getEndpointPlugin(configuration, AdminDeleteUserAttributesCommand.getEndpointParameterInstructions())
89+
);
7790
this.middlewareStack.use(getAwsAuthPlugin(configuration));
7891

7992
const stack = clientStack.concat(this.middlewareStack);

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

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
// smithy-typescript generated code
2+
import { EndpointParameterInstructions, getEndpointPlugin } from "@aws-sdk/middleware-endpoint";
23
import { getSerdePlugin } from "@aws-sdk/middleware-serde";
34
import { getAwsAuthPlugin } from "@aws-sdk/middleware-signing";
45
import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@aws-sdk/protocol-http";
@@ -53,6 +54,15 @@ export class AdminDeleteUserCommand extends $Command<
5354
// Start section: command_properties
5455
// End section: command_properties
5556

57+
public static getEndpointParameterInstructions(): EndpointParameterInstructions {
58+
return {
59+
UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" },
60+
Endpoint: { type: "builtInParams", name: "endpoint" },
61+
Region: { type: "builtInParams", name: "region" },
62+
UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" },
63+
};
64+
}
65+
5666
constructor(readonly input: AdminDeleteUserCommandInput) {
5767
// Start section: command_constructor
5868
super();
@@ -68,6 +78,9 @@ export class AdminDeleteUserCommand extends $Command<
6878
options?: __HttpHandlerOptions
6979
): Handler<AdminDeleteUserCommandInput, AdminDeleteUserCommandOutput> {
7080
this.middlewareStack.use(getSerdePlugin(configuration, this.serialize, this.deserialize));
81+
this.middlewareStack.use(
82+
getEndpointPlugin(configuration, AdminDeleteUserCommand.getEndpointParameterInstructions())
83+
);
7184
this.middlewareStack.use(getAwsAuthPlugin(configuration));
7285

7386
const stack = clientStack.concat(this.middlewareStack);

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

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
// smithy-typescript generated code
2+
import { EndpointParameterInstructions, getEndpointPlugin } from "@aws-sdk/middleware-endpoint";
23
import { getSerdePlugin } from "@aws-sdk/middleware-serde";
34
import { getAwsAuthPlugin } from "@aws-sdk/middleware-signing";
45
import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@aws-sdk/protocol-http";
@@ -86,6 +87,15 @@ export class AdminDisableProviderForUserCommand extends $Command<
8687
// Start section: command_properties
8788
// End section: command_properties
8889

90+
public static getEndpointParameterInstructions(): EndpointParameterInstructions {
91+
return {
92+
UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" },
93+
Endpoint: { type: "builtInParams", name: "endpoint" },
94+
Region: { type: "builtInParams", name: "region" },
95+
UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" },
96+
};
97+
}
98+
8999
constructor(readonly input: AdminDisableProviderForUserCommandInput) {
90100
// Start section: command_constructor
91101
super();
@@ -101,6 +111,9 @@ export class AdminDisableProviderForUserCommand extends $Command<
101111
options?: __HttpHandlerOptions
102112
): Handler<AdminDisableProviderForUserCommandInput, AdminDisableProviderForUserCommandOutput> {
103113
this.middlewareStack.use(getSerdePlugin(configuration, this.serialize, this.deserialize));
114+
this.middlewareStack.use(
115+
getEndpointPlugin(configuration, AdminDisableProviderForUserCommand.getEndpointParameterInstructions())
116+
);
104117
this.middlewareStack.use(getAwsAuthPlugin(configuration));
105118

106119
const stack = clientStack.concat(this.middlewareStack);

0 commit comments

Comments
 (0)