Skip to content

Commit

Permalink
feat(client-cognito-identity): This release adds sensitive trait to s…
Browse files Browse the repository at this point in the history
…ome required shapes.
  • Loading branch information
awstools committed Sep 10, 2024
1 parent e6cba69 commit 28a1dee
Show file tree
Hide file tree
Showing 7 changed files with 111 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,12 @@ import { MetadataBearer as __MetadataBearer } from "@smithy/types";

import { CognitoIdentityClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../CognitoIdentityClient";
import { commonParams } from "../endpoint/EndpointParameters";
import { GetCredentialsForIdentityInput, GetCredentialsForIdentityResponse } from "../models/models_0";
import {
GetCredentialsForIdentityInput,
GetCredentialsForIdentityInputFilterSensitiveLog,
GetCredentialsForIdentityResponse,
GetCredentialsForIdentityResponseFilterSensitiveLog,
} from "../models/models_0";
import { de_GetCredentialsForIdentityCommand, se_GetCredentialsForIdentityCommand } from "../protocols/Aws_json1_1";

/**
Expand Down Expand Up @@ -118,7 +123,7 @@ export class GetCredentialsForIdentityCommand extends $Command
})
.s("AWSCognitoIdentityService", "GetCredentialsForIdentity", {})
.n("CognitoIdentityClient", "GetCredentialsForIdentityCommand")
.f(void 0, void 0)
.f(GetCredentialsForIdentityInputFilterSensitiveLog, GetCredentialsForIdentityResponseFilterSensitiveLog)
.ser(se_GetCredentialsForIdentityCommand)
.de(de_GetCredentialsForIdentityCommand)
.build() {}
4 changes: 2 additions & 2 deletions clients/client-cognito-identity/src/commands/GetIdCommand.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { MetadataBearer as __MetadataBearer } from "@smithy/types";

import { CognitoIdentityClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../CognitoIdentityClient";
import { commonParams } from "../endpoint/EndpointParameters";
import { GetIdInput, GetIdResponse } from "../models/models_0";
import { GetIdInput, GetIdInputFilterSensitiveLog, GetIdResponse } from "../models/models_0";
import { de_GetIdCommand, se_GetIdCommand } from "../protocols/Aws_json1_1";

/**
Expand Down Expand Up @@ -109,7 +109,7 @@ export class GetIdCommand extends $Command
})
.s("AWSCognitoIdentityService", "GetId", {})
.n("CognitoIdentityClient", "GetIdCommand")
.f(void 0, void 0)
.f(GetIdInputFilterSensitiveLog, void 0)
.ser(se_GetIdCommand)
.de(de_GetIdCommand)
.build() {}
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,12 @@ import { MetadataBearer as __MetadataBearer } from "@smithy/types";

import { CognitoIdentityClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../CognitoIdentityClient";
import { commonParams } from "../endpoint/EndpointParameters";
import { GetOpenIdTokenInput, GetOpenIdTokenResponse } from "../models/models_0";
import {
GetOpenIdTokenInput,
GetOpenIdTokenInputFilterSensitiveLog,
GetOpenIdTokenResponse,
GetOpenIdTokenResponseFilterSensitiveLog,
} from "../models/models_0";
import { de_GetOpenIdTokenCommand, se_GetOpenIdTokenCommand } from "../protocols/Aws_json1_1";

/**
Expand Down Expand Up @@ -108,7 +113,7 @@ export class GetOpenIdTokenCommand extends $Command
})
.s("AWSCognitoIdentityService", "GetOpenIdToken", {})
.n("CognitoIdentityClient", "GetOpenIdTokenCommand")
.f(void 0, void 0)
.f(GetOpenIdTokenInputFilterSensitiveLog, GetOpenIdTokenResponseFilterSensitiveLog)
.ser(se_GetOpenIdTokenCommand)
.de(de_GetOpenIdTokenCommand)
.build() {}
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@ import { CognitoIdentityClientResolvedConfig, ServiceInputTypes, ServiceOutputTy
import { commonParams } from "../endpoint/EndpointParameters";
import {
GetOpenIdTokenForDeveloperIdentityInput,
GetOpenIdTokenForDeveloperIdentityInputFilterSensitiveLog,
GetOpenIdTokenForDeveloperIdentityResponse,
GetOpenIdTokenForDeveloperIdentityResponseFilterSensitiveLog,
} from "../models/models_0";
import {
de_GetOpenIdTokenForDeveloperIdentityCommand,
Expand Down Expand Up @@ -129,7 +131,10 @@ export class GetOpenIdTokenForDeveloperIdentityCommand extends $Command
})
.s("AWSCognitoIdentityService", "GetOpenIdTokenForDeveloperIdentity", {})
.n("CognitoIdentityClient", "GetOpenIdTokenForDeveloperIdentityCommand")
.f(void 0, void 0)
.f(
GetOpenIdTokenForDeveloperIdentityInputFilterSensitiveLog,
GetOpenIdTokenForDeveloperIdentityResponseFilterSensitiveLog
)
.ser(se_GetOpenIdTokenForDeveloperIdentityCommand)
.de(de_GetOpenIdTokenForDeveloperIdentityCommand)
.build() {}
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { MetadataBearer as __MetadataBearer } from "@smithy/types";

import { CognitoIdentityClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../CognitoIdentityClient";
import { commonParams } from "../endpoint/EndpointParameters";
import { UnlinkIdentityInput } from "../models/models_0";
import { UnlinkIdentityInput, UnlinkIdentityInputFilterSensitiveLog } from "../models/models_0";
import { de_UnlinkIdentityCommand, se_UnlinkIdentityCommand } from "../protocols/Aws_json1_1";

/**
Expand Down Expand Up @@ -107,7 +107,7 @@ export class UnlinkIdentityCommand extends $Command
})
.s("AWSCognitoIdentityService", "UnlinkIdentity", {})
.n("CognitoIdentityClient", "UnlinkIdentityCommand")
.f(void 0, void 0)
.f(UnlinkIdentityInputFilterSensitiveLog, void 0)
.ser(se_UnlinkIdentityCommand)
.de(de_UnlinkIdentityCommand)
.build() {}
78 changes: 77 additions & 1 deletion clients/client-cognito-identity/src/models/models_0.ts
Original file line number Diff line number Diff line change
@@ -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 { CognitoIdentityServiceException as __BaseException } from "./CognitoIdentityServiceException";

Expand Down Expand Up @@ -1438,3 +1438,79 @@ export interface UntagResourceInput {
* @public
*/
export interface UntagResourceResponse {}

/**
* @internal
*/
export const GetCredentialsForIdentityInputFilterSensitiveLog = (obj: GetCredentialsForIdentityInput): any => ({
...obj,
...(obj.Logins && { Logins: SENSITIVE_STRING }),
});

/**
* @internal
*/
export const CredentialsFilterSensitiveLog = (obj: Credentials): any => ({
...obj,
...(obj.SecretKey && { SecretKey: SENSITIVE_STRING }),
});

/**
* @internal
*/
export const GetCredentialsForIdentityResponseFilterSensitiveLog = (obj: GetCredentialsForIdentityResponse): any => ({
...obj,
...(obj.Credentials && { Credentials: CredentialsFilterSensitiveLog(obj.Credentials) }),
});

/**
* @internal
*/
export const GetIdInputFilterSensitiveLog = (obj: GetIdInput): any => ({
...obj,
...(obj.Logins && { Logins: SENSITIVE_STRING }),
});

/**
* @internal
*/
export const GetOpenIdTokenInputFilterSensitiveLog = (obj: GetOpenIdTokenInput): any => ({
...obj,
...(obj.Logins && { Logins: SENSITIVE_STRING }),
});

/**
* @internal
*/
export const GetOpenIdTokenResponseFilterSensitiveLog = (obj: GetOpenIdTokenResponse): any => ({
...obj,
...(obj.Token && { Token: SENSITIVE_STRING }),
});

/**
* @internal
*/
export const GetOpenIdTokenForDeveloperIdentityInputFilterSensitiveLog = (
obj: GetOpenIdTokenForDeveloperIdentityInput
): any => ({
...obj,
...(obj.Logins && { Logins: SENSITIVE_STRING }),
});

/**
* @internal
*/
export const GetOpenIdTokenForDeveloperIdentityResponseFilterSensitiveLog = (
obj: GetOpenIdTokenForDeveloperIdentityResponse
): any => ({
...obj,
...(obj.Token && { Token: SENSITIVE_STRING }),
});

/**
* @internal
*/
export const UnlinkIdentityInputFilterSensitiveLog = (obj: UnlinkIdentityInput): any => ({
...obj,
...(obj.Logins && { Logins: SENSITIVE_STRING }),
});
13 changes: 10 additions & 3 deletions codegen/sdk-codegen/aws-models/cognito-identity.json
Original file line number Diff line number Diff line change
Expand Up @@ -2279,7 +2279,8 @@
"smithy.api#length": {
"min": 1,
"max": 50000
}
},
"smithy.api#sensitive": {}
}
},
"com.amazonaws.cognitoidentity#IdentityProviders": {
Expand Down Expand Up @@ -2907,7 +2908,10 @@
}
},
"com.amazonaws.cognitoidentity#OIDCToken": {
"type": "string"
"type": "string",
"traits": {
"smithy.api#sensitive": {}
}
},
"com.amazonaws.cognitoidentity#PaginationKey": {
"type": "string",
Expand Down Expand Up @@ -3099,7 +3103,10 @@
}
},
"com.amazonaws.cognitoidentity#SecretKeyString": {
"type": "string"
"type": "string",
"traits": {
"smithy.api#sensitive": {}
}
},
"com.amazonaws.cognitoidentity#SessionTokenString": {
"type": "string"
Expand Down

0 comments on commit 28a1dee

Please sign in to comment.