Skip to content

Define internal password policy typings #7446

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

Merged
merged 5 commits into from
Jul 11, 2023

Conversation

ch5zzy
Copy link
Contributor

@ch5zzy ch5zzy commented Jul 11, 2023

Define internal password policy typings for use in password validation. These types will allow us to split up validating different requirements into separate helper methods and construct the validation status as each of these requirements are validated.

@changeset-bot
Copy link

changeset-bot bot commented Jul 11, 2023

⚠️ No Changeset found

Latest commit: dd90053

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

* Validates the password against the policy.
* @param password Password to validate.
*/
validatePassword(password: string): PasswordValidationStatus;
Copy link
Contributor Author

@ch5zzy ch5zzy Jul 11, 2023

Choose a reason for hiding this comment

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

There will be 2 private helper methods (_checkLengthOptions and _checkCharacterOptions) defined in PasswordPolicyImpl which will implement this interface. The validatePassword method will call these helpers internally. I did not include this class in this PR to make this easier to review.

Choose a reason for hiding this comment

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

should we add public static annotation?

@google-oss-bot
Copy link
Contributor

google-oss-bot commented Jul 11, 2023

@google-oss-bot
Copy link
Contributor

google-oss-bot commented Jul 11, 2023

@ch5zzy ch5zzy requested a review from Xiaoshouzi-gh July 11, 2023 23:11
@ch5zzy ch5zzy marked this pull request as ready for review July 11, 2023 23:11
@ch5zzy ch5zzy requested review from lisajian, prameshj, renkelvin, sam-gc and a team as code owners July 11, 2023 23:11
Copy link

@Xiaoshouzi-gh Xiaoshouzi-gh left a comment

Choose a reason for hiding this comment

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

LGTM

* Validates the password against the policy.
* @param password Password to validate.
*/
validatePassword(password: string): PasswordValidationStatus;

Choose a reason for hiding this comment

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

should we add public static annotation?

@ch5zzy
Copy link
Contributor Author

ch5zzy commented Jul 11, 2023

validatePassword won't be static since it needs access to the internal fields (requirements) of the policy to perform validation.

@ch5zzy ch5zzy merged commit e40b1e7 into password-policy Jul 11, 2023
@ch5zzy ch5zzy deleted the update-internal-password-policy-typings branch July 11, 2023 23:30
ch5zzy added a commit that referenced this pull request Jul 13, 2023
* Define internal password policy typings
@firebase firebase locked and limited conversation to collaborators Aug 11, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants