From 4fa6b7afb6fa2d66b3620b18e16232cd9026d39b Mon Sep 17 00:00:00 2001 From: awstools Date: Fri, 22 Sep 2023 18:19:58 +0000 Subject: [PATCH] feat(client-cloudwatch-events): Adds sensitive trait to various shapes in Jetstream Connections API model. --- .../src/commands/CreateConnectionCommand.ts | 8 +- .../src/commands/DescribeConnectionCommand.ts | 8 +- .../src/commands/UpdateConnectionCommand.ts | 8 +- .../src/models/models_0.ts | 227 +++++++++++++++++- .../aws-models/cloudwatch-events.json | 59 ++++- 5 files changed, 293 insertions(+), 17 deletions(-) diff --git a/clients/client-cloudwatch-events/src/commands/CreateConnectionCommand.ts b/clients/client-cloudwatch-events/src/commands/CreateConnectionCommand.ts index 5a31d133f0b0..d2d6d0e7a758 100644 --- a/clients/client-cloudwatch-events/src/commands/CreateConnectionCommand.ts +++ b/clients/client-cloudwatch-events/src/commands/CreateConnectionCommand.ts @@ -15,7 +15,11 @@ import { } from "@smithy/types"; import { CloudWatchEventsClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../CloudWatchEventsClient"; -import { CreateConnectionRequest, CreateConnectionResponse } from "../models/models_0"; +import { + CreateConnectionRequest, + CreateConnectionRequestFilterSensitiveLog, + CreateConnectionResponse, +} from "../models/models_0"; import { de_CreateConnectionCommand, se_CreateConnectionCommand } from "../protocols/Aws_json1_1"; /** @@ -193,7 +197,7 @@ export class CreateConnectionCommand extends $Command< logger, clientName, commandName, - inputFilterSensitiveLog: (_: any) => _, + inputFilterSensitiveLog: CreateConnectionRequestFilterSensitiveLog, outputFilterSensitiveLog: (_: any) => _, [SMITHY_CONTEXT_KEY]: { service: "AWSEvents", diff --git a/clients/client-cloudwatch-events/src/commands/DescribeConnectionCommand.ts b/clients/client-cloudwatch-events/src/commands/DescribeConnectionCommand.ts index 52b1191385c4..7de64f972e5c 100644 --- a/clients/client-cloudwatch-events/src/commands/DescribeConnectionCommand.ts +++ b/clients/client-cloudwatch-events/src/commands/DescribeConnectionCommand.ts @@ -15,7 +15,11 @@ import { } from "@smithy/types"; import { CloudWatchEventsClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../CloudWatchEventsClient"; -import { DescribeConnectionRequest, DescribeConnectionResponse } from "../models/models_0"; +import { + DescribeConnectionRequest, + DescribeConnectionResponse, + DescribeConnectionResponseFilterSensitiveLog, +} from "../models/models_0"; import { de_DescribeConnectionCommand, se_DescribeConnectionCommand } from "../protocols/Aws_json1_1"; /** @@ -190,7 +194,7 @@ export class DescribeConnectionCommand extends $Command< clientName, commandName, inputFilterSensitiveLog: (_: any) => _, - outputFilterSensitiveLog: (_: any) => _, + outputFilterSensitiveLog: DescribeConnectionResponseFilterSensitiveLog, [SMITHY_CONTEXT_KEY]: { service: "AWSEvents", operation: "DescribeConnection", diff --git a/clients/client-cloudwatch-events/src/commands/UpdateConnectionCommand.ts b/clients/client-cloudwatch-events/src/commands/UpdateConnectionCommand.ts index 84b03410ebd4..e0219fc89c2f 100644 --- a/clients/client-cloudwatch-events/src/commands/UpdateConnectionCommand.ts +++ b/clients/client-cloudwatch-events/src/commands/UpdateConnectionCommand.ts @@ -15,7 +15,11 @@ import { } from "@smithy/types"; import { CloudWatchEventsClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../CloudWatchEventsClient"; -import { UpdateConnectionRequest, UpdateConnectionResponse } from "../models/models_0"; +import { + UpdateConnectionRequest, + UpdateConnectionRequestFilterSensitiveLog, + UpdateConnectionResponse, +} from "../models/models_0"; import { de_UpdateConnectionCommand, se_UpdateConnectionCommand } from "../protocols/Aws_json1_1"; /** @@ -196,7 +200,7 @@ export class UpdateConnectionCommand extends $Command< logger, clientName, commandName, - inputFilterSensitiveLog: (_: any) => _, + inputFilterSensitiveLog: UpdateConnectionRequestFilterSensitiveLog, outputFilterSensitiveLog: (_: any) => _, [SMITHY_CONTEXT_KEY]: { service: "AWSEvents", diff --git a/clients/client-cloudwatch-events/src/models/models_0.ts b/clients/client-cloudwatch-events/src/models/models_0.ts index 71a3342454cd..0b4ece57155c 100644 --- a/clients/client-cloudwatch-events/src/models/models_0.ts +++ b/clients/client-cloudwatch-events/src/models/models_0.ts @@ -1,5 +1,5 @@ // smithy-typescript generated code -import { ExceptionOptionType as __ExceptionOptionType } from "@smithy/smithy-client"; +import { ExceptionOptionType as __ExceptionOptionType, SENSITIVE_STRING } from "@smithy/smithy-client"; import { CloudWatchEventsServiceException as __BaseException } from "./CloudWatchEventsServiceException"; @@ -4652,3 +4652,228 @@ export interface UpdateConnectionResponse { */ LastAuthorizedTime?: Date; } + +/** + * @internal + */ +export const CreateConnectionApiKeyAuthRequestParametersFilterSensitiveLog = ( + obj: CreateConnectionApiKeyAuthRequestParameters +): any => ({ + ...obj, + ...(obj.ApiKeyValue && { ApiKeyValue: SENSITIVE_STRING }), +}); + +/** + * @internal + */ +export const CreateConnectionBasicAuthRequestParametersFilterSensitiveLog = ( + obj: CreateConnectionBasicAuthRequestParameters +): any => ({ + ...obj, + ...(obj.Password && { Password: SENSITIVE_STRING }), +}); + +/** + * @internal + */ +export const ConnectionBodyParameterFilterSensitiveLog = (obj: ConnectionBodyParameter): any => ({ + ...obj, + ...(obj.Value && { Value: SENSITIVE_STRING }), +}); + +/** + * @internal + */ +export const ConnectionHeaderParameterFilterSensitiveLog = (obj: ConnectionHeaderParameter): any => ({ + ...obj, + ...(obj.Value && { Value: SENSITIVE_STRING }), +}); + +/** + * @internal + */ +export const ConnectionQueryStringParameterFilterSensitiveLog = (obj: ConnectionQueryStringParameter): any => ({ + ...obj, + ...(obj.Value && { Value: SENSITIVE_STRING }), +}); + +/** + * @internal + */ +export const ConnectionHttpParametersFilterSensitiveLog = (obj: ConnectionHttpParameters): any => ({ + ...obj, + ...(obj.HeaderParameters && { + HeaderParameters: obj.HeaderParameters.map((item) => ConnectionHeaderParameterFilterSensitiveLog(item)), + }), + ...(obj.QueryStringParameters && { + QueryStringParameters: obj.QueryStringParameters.map((item) => + ConnectionQueryStringParameterFilterSensitiveLog(item) + ), + }), + ...(obj.BodyParameters && { + BodyParameters: obj.BodyParameters.map((item) => ConnectionBodyParameterFilterSensitiveLog(item)), + }), +}); + +/** + * @internal + */ +export const CreateConnectionOAuthClientRequestParametersFilterSensitiveLog = ( + obj: CreateConnectionOAuthClientRequestParameters +): any => ({ + ...obj, + ...(obj.ClientSecret && { ClientSecret: SENSITIVE_STRING }), +}); + +/** + * @internal + */ +export const CreateConnectionOAuthRequestParametersFilterSensitiveLog = ( + obj: CreateConnectionOAuthRequestParameters +): any => ({ + ...obj, + ...(obj.ClientParameters && { + ClientParameters: CreateConnectionOAuthClientRequestParametersFilterSensitiveLog(obj.ClientParameters), + }), + ...(obj.OAuthHttpParameters && { + OAuthHttpParameters: ConnectionHttpParametersFilterSensitiveLog(obj.OAuthHttpParameters), + }), +}); + +/** + * @internal + */ +export const CreateConnectionAuthRequestParametersFilterSensitiveLog = ( + obj: CreateConnectionAuthRequestParameters +): any => ({ + ...obj, + ...(obj.BasicAuthParameters && { + BasicAuthParameters: CreateConnectionBasicAuthRequestParametersFilterSensitiveLog(obj.BasicAuthParameters), + }), + ...(obj.OAuthParameters && { + OAuthParameters: CreateConnectionOAuthRequestParametersFilterSensitiveLog(obj.OAuthParameters), + }), + ...(obj.ApiKeyAuthParameters && { + ApiKeyAuthParameters: CreateConnectionApiKeyAuthRequestParametersFilterSensitiveLog(obj.ApiKeyAuthParameters), + }), + ...(obj.InvocationHttpParameters && { + InvocationHttpParameters: ConnectionHttpParametersFilterSensitiveLog(obj.InvocationHttpParameters), + }), +}); + +/** + * @internal + */ +export const CreateConnectionRequestFilterSensitiveLog = (obj: CreateConnectionRequest): any => ({ + ...obj, + ...(obj.AuthParameters && { + AuthParameters: CreateConnectionAuthRequestParametersFilterSensitiveLog(obj.AuthParameters), + }), +}); + +/** + * @internal + */ +export const ConnectionOAuthResponseParametersFilterSensitiveLog = (obj: ConnectionOAuthResponseParameters): any => ({ + ...obj, + ...(obj.OAuthHttpParameters && { + OAuthHttpParameters: ConnectionHttpParametersFilterSensitiveLog(obj.OAuthHttpParameters), + }), +}); + +/** + * @internal + */ +export const ConnectionAuthResponseParametersFilterSensitiveLog = (obj: ConnectionAuthResponseParameters): any => ({ + ...obj, + ...(obj.OAuthParameters && { + OAuthParameters: ConnectionOAuthResponseParametersFilterSensitiveLog(obj.OAuthParameters), + }), + ...(obj.InvocationHttpParameters && { + InvocationHttpParameters: ConnectionHttpParametersFilterSensitiveLog(obj.InvocationHttpParameters), + }), +}); + +/** + * @internal + */ +export const DescribeConnectionResponseFilterSensitiveLog = (obj: DescribeConnectionResponse): any => ({ + ...obj, + ...(obj.AuthParameters && { AuthParameters: ConnectionAuthResponseParametersFilterSensitiveLog(obj.AuthParameters) }), +}); + +/** + * @internal + */ +export const UpdateConnectionApiKeyAuthRequestParametersFilterSensitiveLog = ( + obj: UpdateConnectionApiKeyAuthRequestParameters +): any => ({ + ...obj, + ...(obj.ApiKeyValue && { ApiKeyValue: SENSITIVE_STRING }), +}); + +/** + * @internal + */ +export const UpdateConnectionBasicAuthRequestParametersFilterSensitiveLog = ( + obj: UpdateConnectionBasicAuthRequestParameters +): any => ({ + ...obj, + ...(obj.Password && { Password: SENSITIVE_STRING }), +}); + +/** + * @internal + */ +export const UpdateConnectionOAuthClientRequestParametersFilterSensitiveLog = ( + obj: UpdateConnectionOAuthClientRequestParameters +): any => ({ + ...obj, + ...(obj.ClientSecret && { ClientSecret: SENSITIVE_STRING }), +}); + +/** + * @internal + */ +export const UpdateConnectionOAuthRequestParametersFilterSensitiveLog = ( + obj: UpdateConnectionOAuthRequestParameters +): any => ({ + ...obj, + ...(obj.ClientParameters && { + ClientParameters: UpdateConnectionOAuthClientRequestParametersFilterSensitiveLog(obj.ClientParameters), + }), + ...(obj.OAuthHttpParameters && { + OAuthHttpParameters: ConnectionHttpParametersFilterSensitiveLog(obj.OAuthHttpParameters), + }), +}); + +/** + * @internal + */ +export const UpdateConnectionAuthRequestParametersFilterSensitiveLog = ( + obj: UpdateConnectionAuthRequestParameters +): any => ({ + ...obj, + ...(obj.BasicAuthParameters && { + BasicAuthParameters: UpdateConnectionBasicAuthRequestParametersFilterSensitiveLog(obj.BasicAuthParameters), + }), + ...(obj.OAuthParameters && { + OAuthParameters: UpdateConnectionOAuthRequestParametersFilterSensitiveLog(obj.OAuthParameters), + }), + ...(obj.ApiKeyAuthParameters && { + ApiKeyAuthParameters: UpdateConnectionApiKeyAuthRequestParametersFilterSensitiveLog(obj.ApiKeyAuthParameters), + }), + ...(obj.InvocationHttpParameters && { + InvocationHttpParameters: ConnectionHttpParametersFilterSensitiveLog(obj.InvocationHttpParameters), + }), +}); + +/** + * @internal + */ +export const UpdateConnectionRequestFilterSensitiveLog = (obj: UpdateConnectionRequest): any => ({ + ...obj, + ...(obj.AuthParameters && { + AuthParameters: UpdateConnectionAuthRequestParametersFilterSensitiveLog(obj.AuthParameters), + }), +}); diff --git a/codegen/sdk-codegen/aws-models/cloudwatch-events.json b/codegen/sdk-codegen/aws-models/cloudwatch-events.json index 2f7b563cf599..51fc58a5eb7e 100644 --- a/codegen/sdk-codegen/aws-models/cloudwatch-events.json +++ b/codegen/sdk-codegen/aws-models/cloudwatch-events.json @@ -1652,6 +1652,17 @@ "smithy.api#pattern": "^[ \\t]*[^\\x00-\\x1F:\\x7F]+([ \\t]+[^\\x00-\\x1F:\\x7F]+)*[ \\t]*$" } }, + "com.amazonaws.cloudwatchevents#AuthHeaderParametersSensitive": { + "type": "string", + "traits": { + "smithy.api#length": { + "min": 1, + "max": 512 + }, + "smithy.api#pattern": "^[ \\t]*[^\\x00-\\x1F:\\x7F]+([ \\t]+[^\\x00-\\x1F:\\x7F]+)*[ \\t]*$", + "smithy.api#sensitive": {} + } + }, "com.amazonaws.cloudwatchevents#AwsVpcConfiguration": { "type": "structure", "members": { @@ -2086,7 +2097,7 @@ } }, "Value": { - "target": "com.amazonaws.cloudwatchevents#String", + "target": "com.amazonaws.cloudwatchevents#SensitiveString", "traits": { "smithy.api#documentation": "

The value associated with the key.

" } @@ -2135,7 +2146,7 @@ } }, "Value": { - "target": "com.amazonaws.cloudwatchevents#HeaderValue", + "target": "com.amazonaws.cloudwatchevents#HeaderValueSensitive", "traits": { "smithy.api#documentation": "

The value associated with the key.

" } @@ -2279,7 +2290,7 @@ } }, "Value": { - "target": "com.amazonaws.cloudwatchevents#QueryStringValue", + "target": "com.amazonaws.cloudwatchevents#QueryStringValueSensitive", "traits": { "smithy.api#documentation": "

The value associated with the key for the query string parameter.

" } @@ -2615,7 +2626,7 @@ } }, "ApiKeyValue": { - "target": "com.amazonaws.cloudwatchevents#AuthHeaderParameters", + "target": "com.amazonaws.cloudwatchevents#AuthHeaderParametersSensitive", "traits": { "smithy.api#documentation": "

The value for the API key to use for authorization.

", "smithy.api#required": {} @@ -2669,7 +2680,7 @@ } }, "Password": { - "target": "com.amazonaws.cloudwatchevents#AuthHeaderParameters", + "target": "com.amazonaws.cloudwatchevents#AuthHeaderParametersSensitive", "traits": { "smithy.api#documentation": "

The password associated with the user name to use for Basic authorization.

", "smithy.api#required": {} @@ -2691,7 +2702,7 @@ } }, "ClientSecret": { - "target": "com.amazonaws.cloudwatchevents#AuthHeaderParameters", + "target": "com.amazonaws.cloudwatchevents#AuthHeaderParametersSensitive", "traits": { "smithy.api#documentation": "

The client secret associated with the client ID to use for OAuth authorization for the\n connection.

", "smithy.api#required": {} @@ -4543,6 +4554,17 @@ "smithy.api#pattern": "^[ \\t]*[\\x20-\\x7E]+([ \\t]+[\\x20-\\x7E]+)*[ \\t]*$" } }, + "com.amazonaws.cloudwatchevents#HeaderValueSensitive": { + "type": "string", + "traits": { + "smithy.api#length": { + "min": 0, + "max": 512 + }, + "smithy.api#pattern": "^[ \\t]*[\\x20-\\x7E]+([ \\t]+[\\x20-\\x7E]+)*[ \\t]*$", + "smithy.api#sensitive": {} + } + }, "com.amazonaws.cloudwatchevents#HttpParameters": { "type": "structure", "members": { @@ -6499,6 +6521,17 @@ "smithy.api#pattern": "^[^\\x00-\\x09\\x0B\\x0C\\x0E-\\x1F\\x7F]+$" } }, + "com.amazonaws.cloudwatchevents#QueryStringValueSensitive": { + "type": "string", + "traits": { + "smithy.api#length": { + "min": 0, + "max": 512 + }, + "smithy.api#pattern": "^[^\\x00-\\x09\\x0B\\x0C\\x0E-\\x1F\\x7F]+$", + "smithy.api#sensitive": {} + } + }, "com.amazonaws.cloudwatchevents#RedshiftDataParameters": { "type": "structure", "members": { @@ -7263,6 +7296,12 @@ "smithy.api#pattern": "^arn:aws([a-z]|\\-)*:secretsmanager:([a-z]|\\d|\\-)*:([0-9]{12})?:secret:[\\/_+=\\.@\\-A-Za-z0-9]+$" } }, + "com.amazonaws.cloudwatchevents#SensitiveString": { + "type": "string", + "traits": { + "smithy.api#sensitive": {} + } + }, "com.amazonaws.cloudwatchevents#Sql": { "type": "string", "traits": { @@ -8088,7 +8127,7 @@ } }, "ApiKeyValue": { - "target": "com.amazonaws.cloudwatchevents#AuthHeaderParameters", + "target": "com.amazonaws.cloudwatchevents#AuthHeaderParametersSensitive", "traits": { "smithy.api#documentation": "

The value associated with teh API key to use for authorization.

" } @@ -8140,7 +8179,7 @@ } }, "Password": { - "target": "com.amazonaws.cloudwatchevents#AuthHeaderParameters", + "target": "com.amazonaws.cloudwatchevents#AuthHeaderParametersSensitive", "traits": { "smithy.api#documentation": "

The password associated with the user name to use for Basic authorization.

" } @@ -8160,7 +8199,7 @@ } }, "ClientSecret": { - "target": "com.amazonaws.cloudwatchevents#AuthHeaderParameters", + "target": "com.amazonaws.cloudwatchevents#AuthHeaderParametersSensitive", "traits": { "smithy.api#documentation": "

The client secret assciated with the client ID to use for OAuth authorization.

" } @@ -8274,4 +8313,4 @@ } } } -} \ No newline at end of file +}