Skip to content

Commit

Permalink
feat(client-cognito-identity-provider): This release adds a new "Dele…
Browse files Browse the repository at this point in the history
…tionProtection" 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.
  • Loading branch information
awstools committed Oct 21, 2022
1 parent d7d3486 commit 58004ad
Show file tree
Hide file tree
Showing 113 changed files with 4,315 additions and 1,094 deletions.
2 changes: 2 additions & 0 deletions clients/client-cognito-identity-provider/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
"@aws-sdk/hash-node": "*",
"@aws-sdk/invalid-dependency": "*",
"@aws-sdk/middleware-content-length": "*",
"@aws-sdk/middleware-endpoint": "*",
"@aws-sdk/middleware-host-header": "*",
"@aws-sdk/middleware-logger": "*",
"@aws-sdk/middleware-recursion-detection": "*",
Expand All @@ -46,6 +47,7 @@
"@aws-sdk/util-body-length-node": "*",
"@aws-sdk/util-defaults-mode-browser": "*",
"@aws-sdk/util-defaults-mode-node": "*",
"@aws-sdk/util-endpoints": "*",
"@aws-sdk/util-user-agent-browser": "*",
"@aws-sdk/util-user-agent-node": "*",
"@aws-sdk/util-utf8-browser": "*",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -753,8 +753,9 @@ export class CognitoIdentityProvider extends CognitoIdentityProviderClient {
}

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

/**
* <p>This method takes a user pool ID, and returns the signing certificate.</p>
* <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>
* <p>Amazon Cognito issues and assigns a new signing certificate annually. This process returns a new value in the response to <code>GetSigningCertificate</code>,
* but doesn't invalidate the original certificate.</p>
*/
public getSigningCertificate(
args: GetSigningCertificateCommandInput,
Expand Down Expand Up @@ -2804,10 +2807,8 @@ export class CognitoIdentityProvider extends CognitoIdentityProviderClient {

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

/**
* <p>Revokes all of the access tokens generated by the specified refresh token. After the
* token is revoked, you can't use the revoked token to access Amazon Cognito authenticated
* APIs.</p>
* <p>Revokes all of the access tokens generated by, and at the same time as, the specified
* refresh token. After a token is revoked, you can't use the revoked token to access
* Amazon Cognito user APIs, or to authorize access to your resource server.</p>
*/
public revokeToken(args: RevokeTokenCommandInput, options?: __HttpHandlerOptions): Promise<RevokeTokenCommandOutput>;
public revokeToken(args: RevokeTokenCommandInput, cb: (err: any, data?: RevokeTokenCommandOutput) => void): void;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,7 @@
// smithy-typescript generated code
import {
EndpointsInputConfig,
EndpointsResolvedConfig,
RegionInputConfig,
RegionResolvedConfig,
resolveEndpointsConfig,
resolveRegionConfig,
} from "@aws-sdk/config-resolver";
import { RegionInputConfig, RegionResolvedConfig, resolveRegionConfig } from "@aws-sdk/config-resolver";
import { getContentLengthPlugin } from "@aws-sdk/middleware-content-length";
import { EndpointInputConfig, EndpointResolvedConfig, resolveEndpointConfig } from "@aws-sdk/middleware-endpoint";
import {
getHostHeaderPlugin,
HostHeaderInputConfig,
Expand Down Expand Up @@ -36,13 +30,13 @@ import {
Credentials as __Credentials,
Decoder as __Decoder,
Encoder as __Encoder,
EndpointV2 as __EndpointV2,
Hash as __Hash,
HashConstructor as __HashConstructor,
HttpHandlerOptions as __HttpHandlerOptions,
Logger as __Logger,
Provider as __Provider,
Provider,
RegionInfoProvider,
StreamCollector as __StreamCollector,
UrlParser as __UrlParser,
UserAgent as __UserAgent,
Expand Down Expand Up @@ -317,6 +311,12 @@ import {
VerifyUserAttributeCommandInput,
VerifyUserAttributeCommandOutput,
} from "./commands/VerifyUserAttributeCommand";
import {
ClientInputEndpointParameters,
ClientResolvedEndpointParameters,
EndpointParameters,
resolveClientEndpointParameters,
} from "./endpoint/EndpointParameters";
import { getRuntimeConfig as __getRuntimeConfig } from "./runtimeConfig";

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

/**
* Fetch related hostname, signing name or signing region with given region.
* @internal
*/
regionInfoProvider?: RegionInfoProvider;

/**
* The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header
* @internal
Expand All @@ -655,11 +649,12 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__
type CognitoIdentityProviderClientConfigType = Partial<__SmithyConfiguration<__HttpHandlerOptions>> &
ClientDefaults &
RegionInputConfig &
EndpointsInputConfig &
EndpointInputConfig<EndpointParameters> &
RetryInputConfig &
HostHeaderInputConfig &
AwsAuthInputConfig &
UserAgentInputConfig;
UserAgentInputConfig &
ClientInputEndpointParameters;
/**
* The configuration interface of CognitoIdentityProviderClient class constructor that set the region, credentials and other options.
*/
Expand All @@ -668,11 +663,12 @@ export interface CognitoIdentityProviderClientConfig extends CognitoIdentityProv
type CognitoIdentityProviderClientResolvedConfigType = __SmithyResolvedConfiguration<__HttpHandlerOptions> &
Required<ClientDefaults> &
RegionResolvedConfig &
EndpointsResolvedConfig &
EndpointResolvedConfig<EndpointParameters> &
RetryResolvedConfig &
HostHeaderResolvedConfig &
AwsAuthResolvedConfig &
UserAgentResolvedConfig;
UserAgentResolvedConfig &
ClientResolvedEndpointParameters;
/**
* The resolved configuration interface of CognitoIdentityProviderClient class. This is resolved and normalized from the {@link CognitoIdentityProviderClientConfig | constructor configuration interface}.
*/
Expand All @@ -699,14 +695,15 @@ export class CognitoIdentityProviderClient extends __Client<

constructor(configuration: CognitoIdentityProviderClientConfig) {
const _config_0 = __getRuntimeConfig(configuration);
const _config_1 = resolveRegionConfig(_config_0);
const _config_2 = resolveEndpointsConfig(_config_1);
const _config_3 = resolveRetryConfig(_config_2);
const _config_4 = resolveHostHeaderConfig(_config_3);
const _config_5 = resolveAwsAuthConfig(_config_4);
const _config_6 = resolveUserAgentConfig(_config_5);
super(_config_6);
this.config = _config_6;
const _config_1 = resolveClientEndpointParameters(_config_0);
const _config_2 = resolveRegionConfig(_config_1);
const _config_3 = resolveEndpointConfig(_config_2);
const _config_4 = resolveRetryConfig(_config_3);
const _config_5 = resolveHostHeaderConfig(_config_4);
const _config_6 = resolveAwsAuthConfig(_config_5);
const _config_7 = resolveUserAgentConfig(_config_6);
super(_config_7);
this.config = _config_7;
this.middlewareStack.use(getRetryPlugin(this.config));
this.middlewareStack.use(getContentLengthPlugin(this.config));
this.middlewareStack.use(getHostHeaderPlugin(this.config));
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
// smithy-typescript generated code
import { EndpointParameterInstructions, getEndpointPlugin } from "@aws-sdk/middleware-endpoint";
import { getSerdePlugin } from "@aws-sdk/middleware-serde";
import { getAwsAuthPlugin } from "@aws-sdk/middleware-signing";
import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@aws-sdk/protocol-http";
Expand Down Expand Up @@ -57,6 +58,15 @@ export class AddCustomAttributesCommand extends $Command<
// Start section: command_properties
// End section: command_properties

public static getEndpointParameterInstructions(): EndpointParameterInstructions {
return {
UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" },
Endpoint: { type: "builtInParams", name: "endpoint" },
Region: { type: "builtInParams", name: "region" },
UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" },
};
}

constructor(readonly input: AddCustomAttributesCommandInput) {
// Start section: command_constructor
super();
Expand All @@ -72,6 +82,9 @@ export class AddCustomAttributesCommand extends $Command<
options?: __HttpHandlerOptions
): Handler<AddCustomAttributesCommandInput, AddCustomAttributesCommandOutput> {
this.middlewareStack.use(getSerdePlugin(configuration, this.serialize, this.deserialize));
this.middlewareStack.use(
getEndpointPlugin(configuration, AddCustomAttributesCommand.getEndpointParameterInstructions())
);
this.middlewareStack.use(getAwsAuthPlugin(configuration));

const stack = clientStack.concat(this.middlewareStack);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
// smithy-typescript generated code
import { EndpointParameterInstructions, getEndpointPlugin } from "@aws-sdk/middleware-endpoint";
import { getSerdePlugin } from "@aws-sdk/middleware-serde";
import { getAwsAuthPlugin } from "@aws-sdk/middleware-signing";
import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@aws-sdk/protocol-http";
Expand Down Expand Up @@ -53,6 +54,15 @@ export class AdminAddUserToGroupCommand extends $Command<
// Start section: command_properties
// End section: command_properties

public static getEndpointParameterInstructions(): EndpointParameterInstructions {
return {
UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" },
Endpoint: { type: "builtInParams", name: "endpoint" },
Region: { type: "builtInParams", name: "region" },
UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" },
};
}

constructor(readonly input: AdminAddUserToGroupCommandInput) {
// Start section: command_constructor
super();
Expand All @@ -68,6 +78,9 @@ export class AdminAddUserToGroupCommand extends $Command<
options?: __HttpHandlerOptions
): Handler<AdminAddUserToGroupCommandInput, AdminAddUserToGroupCommandOutput> {
this.middlewareStack.use(getSerdePlugin(configuration, this.serialize, this.deserialize));
this.middlewareStack.use(
getEndpointPlugin(configuration, AdminAddUserToGroupCommand.getEndpointParameterInstructions())
);
this.middlewareStack.use(getAwsAuthPlugin(configuration));

const stack = clientStack.concat(this.middlewareStack);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
// smithy-typescript generated code
import { EndpointParameterInstructions, getEndpointPlugin } from "@aws-sdk/middleware-endpoint";
import { getSerdePlugin } from "@aws-sdk/middleware-serde";
import { getAwsAuthPlugin } from "@aws-sdk/middleware-signing";
import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@aws-sdk/protocol-http";
Expand Down Expand Up @@ -59,6 +60,15 @@ export class AdminConfirmSignUpCommand extends $Command<
// Start section: command_properties
// End section: command_properties

public static getEndpointParameterInstructions(): EndpointParameterInstructions {
return {
UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" },
Endpoint: { type: "builtInParams", name: "endpoint" },
Region: { type: "builtInParams", name: "region" },
UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" },
};
}

constructor(readonly input: AdminConfirmSignUpCommandInput) {
// Start section: command_constructor
super();
Expand All @@ -74,6 +84,9 @@ export class AdminConfirmSignUpCommand extends $Command<
options?: __HttpHandlerOptions
): Handler<AdminConfirmSignUpCommandInput, AdminConfirmSignUpCommandOutput> {
this.middlewareStack.use(getSerdePlugin(configuration, this.serialize, this.deserialize));
this.middlewareStack.use(
getEndpointPlugin(configuration, AdminConfirmSignUpCommand.getEndpointParameterInstructions())
);
this.middlewareStack.use(getAwsAuthPlugin(configuration));

const stack = clientStack.concat(this.middlewareStack);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
// smithy-typescript generated code
import { EndpointParameterInstructions, getEndpointPlugin } from "@aws-sdk/middleware-endpoint";
import { getSerdePlugin } from "@aws-sdk/middleware-serde";
import { getAwsAuthPlugin } from "@aws-sdk/middleware-signing";
import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@aws-sdk/protocol-http";
Expand Down Expand Up @@ -87,6 +88,15 @@ export class AdminCreateUserCommand extends $Command<
// Start section: command_properties
// End section: command_properties

public static getEndpointParameterInstructions(): EndpointParameterInstructions {
return {
UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" },
Endpoint: { type: "builtInParams", name: "endpoint" },
Region: { type: "builtInParams", name: "region" },
UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" },
};
}

constructor(readonly input: AdminCreateUserCommandInput) {
// Start section: command_constructor
super();
Expand All @@ -102,6 +112,9 @@ export class AdminCreateUserCommand extends $Command<
options?: __HttpHandlerOptions
): Handler<AdminCreateUserCommandInput, AdminCreateUserCommandOutput> {
this.middlewareStack.use(getSerdePlugin(configuration, this.serialize, this.deserialize));
this.middlewareStack.use(
getEndpointPlugin(configuration, AdminCreateUserCommand.getEndpointParameterInstructions())
);
this.middlewareStack.use(getAwsAuthPlugin(configuration));

const stack = clientStack.concat(this.middlewareStack);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
// smithy-typescript generated code
import { EndpointParameterInstructions, getEndpointPlugin } from "@aws-sdk/middleware-endpoint";
import { getSerdePlugin } from "@aws-sdk/middleware-serde";
import { getAwsAuthPlugin } from "@aws-sdk/middleware-signing";
import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@aws-sdk/protocol-http";
Expand Down Expand Up @@ -59,6 +60,15 @@ export class AdminDeleteUserAttributesCommand extends $Command<
// Start section: command_properties
// End section: command_properties

public static getEndpointParameterInstructions(): EndpointParameterInstructions {
return {
UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" },
Endpoint: { type: "builtInParams", name: "endpoint" },
Region: { type: "builtInParams", name: "region" },
UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" },
};
}

constructor(readonly input: AdminDeleteUserAttributesCommandInput) {
// Start section: command_constructor
super();
Expand All @@ -74,6 +84,9 @@ export class AdminDeleteUserAttributesCommand extends $Command<
options?: __HttpHandlerOptions
): Handler<AdminDeleteUserAttributesCommandInput, AdminDeleteUserAttributesCommandOutput> {
this.middlewareStack.use(getSerdePlugin(configuration, this.serialize, this.deserialize));
this.middlewareStack.use(
getEndpointPlugin(configuration, AdminDeleteUserAttributesCommand.getEndpointParameterInstructions())
);
this.middlewareStack.use(getAwsAuthPlugin(configuration));

const stack = clientStack.concat(this.middlewareStack);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
// smithy-typescript generated code
import { EndpointParameterInstructions, getEndpointPlugin } from "@aws-sdk/middleware-endpoint";
import { getSerdePlugin } from "@aws-sdk/middleware-serde";
import { getAwsAuthPlugin } from "@aws-sdk/middleware-signing";
import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@aws-sdk/protocol-http";
Expand Down Expand Up @@ -53,6 +54,15 @@ export class AdminDeleteUserCommand extends $Command<
// Start section: command_properties
// End section: command_properties

public static getEndpointParameterInstructions(): EndpointParameterInstructions {
return {
UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" },
Endpoint: { type: "builtInParams", name: "endpoint" },
Region: { type: "builtInParams", name: "region" },
UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" },
};
}

constructor(readonly input: AdminDeleteUserCommandInput) {
// Start section: command_constructor
super();
Expand All @@ -68,6 +78,9 @@ export class AdminDeleteUserCommand extends $Command<
options?: __HttpHandlerOptions
): Handler<AdminDeleteUserCommandInput, AdminDeleteUserCommandOutput> {
this.middlewareStack.use(getSerdePlugin(configuration, this.serialize, this.deserialize));
this.middlewareStack.use(
getEndpointPlugin(configuration, AdminDeleteUserCommand.getEndpointParameterInstructions())
);
this.middlewareStack.use(getAwsAuthPlugin(configuration));

const stack = clientStack.concat(this.middlewareStack);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
// smithy-typescript generated code
import { EndpointParameterInstructions, getEndpointPlugin } from "@aws-sdk/middleware-endpoint";
import { getSerdePlugin } from "@aws-sdk/middleware-serde";
import { getAwsAuthPlugin } from "@aws-sdk/middleware-signing";
import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@aws-sdk/protocol-http";
Expand Down Expand Up @@ -86,6 +87,15 @@ export class AdminDisableProviderForUserCommand extends $Command<
// Start section: command_properties
// End section: command_properties

public static getEndpointParameterInstructions(): EndpointParameterInstructions {
return {
UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" },
Endpoint: { type: "builtInParams", name: "endpoint" },
Region: { type: "builtInParams", name: "region" },
UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" },
};
}

constructor(readonly input: AdminDisableProviderForUserCommandInput) {
// Start section: command_constructor
super();
Expand All @@ -101,6 +111,9 @@ export class AdminDisableProviderForUserCommand extends $Command<
options?: __HttpHandlerOptions
): Handler<AdminDisableProviderForUserCommandInput, AdminDisableProviderForUserCommandOutput> {
this.middlewareStack.use(getSerdePlugin(configuration, this.serialize, this.deserialize));
this.middlewareStack.use(
getEndpointPlugin(configuration, AdminDisableProviderForUserCommand.getEndpointParameterInstructions())
);
this.middlewareStack.use(getAwsAuthPlugin(configuration));

const stack = clientStack.concat(this.middlewareStack);
Expand Down
Loading

0 comments on commit 58004ad

Please sign in to comment.