Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(cognito): deprecate privateKey and add privateKeyValue as typed SecureValue #31409

Merged
merged 8 commits into from
Sep 13, 2024

Conversation

pahud
Copy link
Contributor

@pahud pahud commented Sep 11, 2024

Issue # (if applicable)

Closes #31378

Reason for this change

  1. privateKey was typed string which should be SecureValue just as clientSecretValue 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


By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license

@mergify mergify bot added the contribution/core This is a PR that came from AWS. label Sep 11, 2024
@aws-cdk-automation aws-cdk-automation requested a review from a team September 11, 2024 16:38
@github-actions github-actions bot added bug This issue is a bug. effort/medium Medium work item – several days of effort p2 labels Sep 11, 2024
Copy link
Collaborator

@aws-cdk-automation aws-cdk-automation left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The pull request linter has failed. See the aws-cdk-automation comment below for failure reasons. If you believe this pull request should receive an exemption, please comment and provide a justification.

A comment requesting an exemption should contain the text Exemption Request. Additionally, if clarification is needed add Clarification Request to a comment.

@pahud
Copy link
Contributor Author

pahud commented Sep 11, 2024

Exemption Request

@pahud pahud requested a review from GavinZZ September 11, 2024 22:47
@aws-cdk-automation aws-cdk-automation added pr-linter/exemption-requested The contributor has requested an exemption to the PR Linter feedback. pr/needs-maintainer-review This PR needs a review from a Core Team Member labels Sep 11, 2024
@GavinZZ
Copy link
Contributor

GavinZZ commented Sep 12, 2024

Exemption Request

Have you tested this by deploying to CFN?

@pahud
Copy link
Contributor Author

pahud commented Sep 13, 2024

@GavinZZ

Unfortunately I don't have a valid private_key for that. And there's no existing integ test for that as well so I am offering unit tests only.

8:07:08 PM | CREATE_FAILED | AWS::Cognito::UserPoolIdentityProvider | AppleIdentityProvider6271AB3B
Provided private key cannot be used for Sign in with Apple. (Service: AWSCognitoIdentityProviderService; Status Code: 400; Error Code: InvalidParameterException;
Request ID: b28d3b10-14ca-42bc-a288-e1db34e7d6e3; Proxy: null)

@GavinZZ GavinZZ added pr-linter/exempt-integ-test The PR linter will not require integ test changes and removed pr-linter/exemption-requested The contributor has requested an exemption to the PR Linter feedback. labels Sep 13, 2024
@aws-cdk-automation aws-cdk-automation dismissed their stale review September 13, 2024 04:28

✅ Updated pull request passes all PRLinter validations. Dismissing previous PRLinter review.

@aws-cdk-automation aws-cdk-automation removed the pr/needs-maintainer-review This PR needs a review from a Core Team Member label Sep 13, 2024
Copy link
Contributor

mergify bot commented Sep 13, 2024

Thank you for contributing! Your pull request will be updated from main and then merged automatically (do not update manually, and be sure to allow changes to be pushed to your fork).

Copy link
Contributor

mergify bot commented Sep 13, 2024

Thank you for contributing! Your pull request will be updated from main and then merged automatically (do not update manually, and be sure to allow changes to be pushed to your fork).

@aws-cdk-automation
Copy link
Collaborator

AWS CodeBuild CI Report

  • CodeBuild project: AutoBuildv2Project1C6BFA3F-wQm2hXv2jqQv
  • Commit ID: 9f78329
  • Result: SUCCEEDED
  • Build Logs (available for 30 days)

Powered by github-codebuild-logs, available on the AWS Serverless Application Repository

@mergify mergify bot merged commit 7ee183d into aws:main Sep 13, 2024
9 checks passed
Copy link
Contributor

mergify bot commented Sep 13, 2024

Thank you for contributing! Your pull request will be updated from main and then merged automatically (do not update manually, and be sure to allow changes to be pushed to your fork).

Copy link

Comments on closed issues and PRs are hard for our team to see.
If you need help, please open a new issue that references this one.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 13, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug This issue is a bug. contribution/core This is a PR that came from AWS. effort/medium Medium work item – several days of effort p2 pr-linter/exempt-integ-test The PR linter will not require integ test changes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

cognito: Using a token for UserPoolIdentityProviderApple doesn't resolve at deploy
3 participants