Skip to content

Commit

Permalink
feat(client-payment-cryptography): Added further restrictions on logg…
Browse files Browse the repository at this point in the history
…ing of potentially sensitive inputs and outputs.
  • Loading branch information
awstools committed Jul 1, 2024
1 parent 62d34b8 commit 66a9332
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 14 deletions.
10 changes: 9 additions & 1 deletion clients/client-payment-cryptography/src/models/models_0.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1893,6 +1893,14 @@ export const RootCertificatePublicKeyFilterSensitiveLog = (obj: RootCertificateP
...(obj.PublicKeyCertificate && { PublicKeyCertificate: SENSITIVE_STRING }),
});

/**
* @internal
*/
export const ImportTr31KeyBlockFilterSensitiveLog = (obj: ImportTr31KeyBlock): any => ({
...obj,
...(obj.WrappedKeyBlock && { WrappedKeyBlock: SENSITIVE_STRING }),
});

/**
* @internal
*/
Expand All @@ -1919,7 +1927,7 @@ export const ImportKeyMaterialFilterSensitiveLog = (obj: ImportKeyMaterial): any
return {
TrustedCertificatePublicKey: TrustedCertificatePublicKeyFilterSensitiveLog(obj.TrustedCertificatePublicKey),
};
if (obj.Tr31KeyBlock !== undefined) return { Tr31KeyBlock: obj.Tr31KeyBlock };
if (obj.Tr31KeyBlock !== undefined) return { Tr31KeyBlock: ImportTr31KeyBlockFilterSensitiveLog(obj.Tr31KeyBlock) };
if (obj.Tr34KeyBlock !== undefined) return { Tr34KeyBlock: ImportTr34KeyBlockFilterSensitiveLog(obj.Tr34KeyBlock) };
if (obj.KeyCryptogram !== undefined) return { KeyCryptogram: obj.KeyCryptogram };
if (obj.$unknown !== undefined) return { [obj.$unknown[0]]: "UNKNOWN" };
Expand Down
27 changes: 14 additions & 13 deletions codegen/sdk-codegen/aws-models/payment-cryptography.json
Original file line number Diff line number Diff line change
Expand Up @@ -432,6 +432,16 @@
"smithy.api#output": {}
}
},
"com.amazonaws.paymentcryptography#EvenHexLengthBetween16And32": {
"type": "string",
"traits": {
"smithy.api#length": {
"min": 16,
"max": 32
},
"smithy.api#pattern": "^(?:[0-9a-fA-F][0-9a-fA-F])+$"
}
},
"com.amazonaws.paymentcryptography#ExportAttributes": {
"type": "structure",
"members": {
Expand Down Expand Up @@ -658,7 +668,7 @@
}
},
"RandomNonce": {
"target": "com.amazonaws.paymentcryptography#HexLength16",
"target": "com.amazonaws.paymentcryptography#EvenHexLengthBetween16And32",
"traits": {
"smithy.api#documentation": "<p>A random number value that is unique to the TR-34 key block generated using 2 pass. The operation will fail, if a random nonce value is not provided for a TR-34 key block generated using 2 pass.</p>"
}
Expand Down Expand Up @@ -1085,16 +1095,6 @@
"smithy.api#output": {}
}
},
"com.amazonaws.paymentcryptography#HexLength16": {
"type": "string",
"traits": {
"smithy.api#length": {
"min": 16,
"max": 16
},
"smithy.api#pattern": "^[0-9A-F]+$"
}
},
"com.amazonaws.paymentcryptography#HexLength20Or24": {
"type": "string",
"traits": {
Expand Down Expand Up @@ -1338,7 +1338,7 @@
}
},
"RandomNonce": {
"target": "com.amazonaws.paymentcryptography#HexLength16",
"target": "com.amazonaws.paymentcryptography#EvenHexLengthBetween16And32",
"traits": {
"smithy.api#documentation": "<p>A random number value that is unique to the TR-34 key block generated using 2 pass. The operation will fail, if a random nonce value is not provided for a TR-34 key block generated using 2 pass.</p>"
}
Expand Down Expand Up @@ -3492,7 +3492,8 @@
"min": 56,
"max": 9984
},
"smithy.api#pattern": "^[0-9A-Z]+$"
"smithy.api#pattern": "^[0-9A-Z]+$",
"smithy.api#sensitive": {}
}
},
"com.amazonaws.paymentcryptography#Tr34KeyBlockFormat": {
Expand Down

0 comments on commit 66a9332

Please sign in to comment.