Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(cognito): deprecate privateKey and add privateKeyValue as typed S…
…ecureValue (#31409) ### Issue # (if applicable) Closes #31378 ### Reason for this change 1. `privateKey` was typed `string` which should be `SecureValue` just as [clientSecretValue](https://github.com/aws/aws-cdk/blob/1e203753519e10e19ef0db87e1382377b609bcaa/packages/aws-cdk-lib/aws-cognito/lib/user-pool-idps/google.ts#L28) in Google IdP. This PR deprecates `privateKey` and adds `privateKeyValue` with correct type. 2. `apple.ts` was named by mistake and it won't be unit tested. This PR renames it to `apple.test.ts` so it would be covered. Figured an existing test was failed, just fixed that failed one as well. ### Description of changes - Add `privateKeyValue` property of type SecretValue to UserPoolIdentityProviderAppleProps - Deprecate the existing `privateKey` string property - Implement logic to ensure exactly one of `privateKey` or `privateKeyValue` is provided - Update UserPoolIdentityProviderApple to use the new `privateKeyValue` when available - Rename apple.ts test file to apple.test.ts for consistency - Add new test case to verify mutually exclusive properties Users must now provide either `privateKey` or `privateKeyValue`, but not both. This change enhances security by allowing the use of SecretValue for the Apple IDP private key. ### Description of how you validated changes ### Checklist - [x] My code adheres to the [CONTRIBUTING GUIDE](https://github.com/aws/aws-cdk/blob/main/CONTRIBUTING.md) and [DESIGN GUIDELINES](https://github.com/aws/aws-cdk/blob/main/docs/DESIGN_GUIDELINES.md) ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
- Loading branch information