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

feat(cognito): support password history size #33164

Merged
merged 6 commits into from
Jan 26, 2025

Conversation

mazyu36
Copy link
Contributor

@mazyu36 mazyu36 commented Jan 25, 2025

Issue # (if applicable)

Closes #33106.

Reason for this change

To enable password reuse prevention settings in Cognito user pools.

Description of changes

Add passwordHistorySize property.

Describe any new or updated permissions being added

No permission update.

Description of how you validated changes

Add unit tests and an integ test.

Checklist


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

@github-actions github-actions bot added feature-request A feature should be added or improved. p2 labels Jan 25, 2025
@aws-cdk-automation aws-cdk-automation requested a review from a team January 25, 2025 06:23
@github-actions github-actions bot added the distinguished-contributor [Pilot] contributed 50+ PRs to the CDK label Jan 25, 2025
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.

(This review is outdated)

Copy link

codecov bot commented Jan 25, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 80.79%. Comparing base (bfa0f15) to head (38cada9).
Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main   #33164   +/-   ##
=======================================
  Coverage   80.79%   80.79%           
=======================================
  Files         232      232           
  Lines       14110    14110           
  Branches     2453     2453           
=======================================
  Hits        11400    11400           
  Misses       2430     2430           
  Partials      280      280           
Flag Coverage Δ
suite.unit 80.79% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

Components Coverage Δ
packages/aws-cdk 79.53% <ø> (ø)
packages/aws-cdk-lib/core 82.17% <ø> (ø)

@mazyu36 mazyu36 marked this pull request as ready for review January 25, 2025 11:12
@aws-cdk-automation aws-cdk-automation dismissed their stale review January 25, 2025 11:14

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

@aws-cdk-automation aws-cdk-automation added the pr/needs-community-review This PR needs a review from a Trusted Community Member or Core Team Member. label Jan 25, 2025
Copy link
Contributor

@lpizzinidev lpizzinidev left a comment

Choose a reason for hiding this comment

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

Thanks 👍 Couple of nits on docs

packages/aws-cdk-lib/aws-cognito/README.md Outdated Show resolved Hide resolved
@aws-cdk-automation aws-cdk-automation added pr/needs-maintainer-review This PR needs a review from a Core Team Member and removed pr/needs-community-review This PR needs a review from a Trusted Community Member or Core Team Member. labels Jan 25, 2025
Comment on lines 1326 to 1330
if (props.featurePlan === FeaturePlan.LITE) {
throw new Error('`passwordHistorySize` can not be set when `featurePlan` is `FeaturePlan.LITE`.');
}
if (passwordHistorySize < 0 || passwordHistorySize > 24) {
throw new Error(`\`passwordHistorySize\` must be between 0 and 24 (received: ${passwordHistorySize})`);
Copy link
Contributor

Choose a reason for hiding this comment

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

could you please change the Error to be ValidationError according to the ongoing change the team is doing now .. see tracking issue #32324

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thank you for the comment.

Am I correct in understanding that in this PR, you want to replace all Errors within aws-cognito with ValidationErrors? I was aware that the replacement was in progress, but I thought the maintenance team would handle it, so I left the Errors as they were.​​​​​​​​​​​​​​​​

Copy link
Contributor

@moelasmar moelasmar Jan 26, 2025

Choose a reason for hiding this comment

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

at least do it for the new added throw statements .. I believe we can have both in the sam construct .. and if you like to help more, you can open a new pr to replace the Errors in this construct with the validation error :)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thank you. I've replaced only the Errors added this time. If this PR is merged before the maintainer starts work, I'm considering creating a PR to replace other Errors in aws-cognito.

@aws-cdk-automation aws-cdk-automation removed the pr/needs-maintainer-review This PR needs a review from a Core Team Member label Jan 26, 2025
@mergify mergify bot dismissed moelasmar’s stale review January 26, 2025 00:33

Pull request has been modified.

@mazyu36 mazyu36 force-pushed the feature/cognito-PasswordHistorySize branch from 4bc10c3 to 03cccb6 Compare January 26, 2025 00:34
Copy link
Contributor

@moelasmar moelasmar left a comment

Choose a reason for hiding this comment

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

thanks @mazyu36 for your quick response and contribution :)

@moelasmar
Copy link
Contributor

moelasmar commented Jan 26, 2025

@mergify update

Copy link
Contributor

mergify bot commented Jan 26, 2025

udpate

❌ Sorry but I didn't understand the command. Please consult the commands documentation 📚.

Copy link
Contributor

mergify bot commented Jan 26, 2025

update

✅ Branch has been successfully updated

Copy link
Contributor

mergify bot commented Jan 26, 2025

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).

@mazyu36
Copy link
Contributor Author

mazyu36 commented Jan 26, 2025

@Mergifyio requeue

Copy link
Contributor

mergify bot commented Jan 26, 2025

requeue

❌ Command disallowed due to command restrictions in the Mergify configuration.

  • sender-permission >= write

@mazyu36
Copy link
Contributor Author

mazyu36 commented Jan 26, 2025

@Mergifyio update

Copy link
Contributor

mergify bot commented Jan 26, 2025

update

☑️ Nothing to do

  • queue-position = -1 [📌 update requirement]
  • #commits-behind > 0 [📌 update requirement]
  • -closed [📌 update requirement]
  • -conflict [📌 update requirement]

@mazyu36
Copy link
Contributor Author

mazyu36 commented Jan 26, 2025

@Mergifyio refresh

Copy link
Contributor

mergify bot commented Jan 26, 2025

refresh

✅ Pull request refreshed

@aws-cdk-automation
Copy link
Collaborator

AWS CodeBuild CI Report

  • CodeBuild project: AutoBuildv2Project1C6BFA3F-wQm2hXv2jqQv
  • Commit ID: 38cada9
  • 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 988043e into aws:main Jan 26, 2025
20 checks passed
Copy link
Contributor

mergify bot commented Jan 26, 2025

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 Jan 26, 2025
@mazyu36 mazyu36 deleted the feature/cognito-PasswordHistorySize branch January 26, 2025 03:54
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
distinguished-contributor [Pilot] contributed 50+ PRs to the CDK feature-request A feature should be added or improved. p2
Projects
None yet
Development

Successfully merging this pull request may close these issues.

aws-cognito: add support for PasswordHistorySize attribute in passwordPolicy
4 participants