Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Password Strength estimator extraction to dedicated service (no Backward Compatibility)#54882

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Conversation

@yalit
Copy link
Contributor

@yalityalit commentedMay 10, 2024
edited
Loading

QA
Branch?7.1 (?8.0)
Bug fix?no
New feature?yes (allows for externally accessing password strength estimator)
Deprecations?no
Issuesna
LicenseMIT

Linked to the PasswordStrength Constraint, the need is to be able to get the "strength" of a password and not just only if it's strong enough. For instance, the need is to show a "score" bar in the frontend.

Currently, the strength is being computed by a private function within the PasswordStrengthValidator not accessible directly. The proposed change is to extract that computation in a specificPasswordStrengthEstimator service for it to be accessible from the "external" world.

This PR is proposing a no Backward Ccompatibility version with changing the constructor of the Validator. However, I created the same PR but without BC here :#54881

@yalityalit changed the titleFeat/extract password strength estimatorPassword Strength estimator extraction to dedicated service (BC)May 10, 2024
@yalityalit changed the titlePassword Strength estimator extraction to dedicated service (BC)Password Strength estimator extraction to dedicated service (no BC)May 10, 2024
@xabbuhxabbuh added this to the7.2 milestoneMay 10, 2024
/** @dataProvider getPasswords */
public function testEstimateStrength(string|Stringable $password, int $expectedStrength): void
{
self::assertEquals($expectedStrength, (new PasswordStrengthEstimator())->estimateStrength($password));
Copy link
Contributor

Choose a reason for hiding this comment

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

AsserSame?

yalit reacted with thumbs up emoji
Copy link
ContributorAuthor

Choose a reason for hiding this comment

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

Updated

@yalityalit changed the titlePassword Strength estimator extraction to dedicated service (no BC)Password Strength estimator extraction to dedicated service (no Backward Compatibility)May 11, 2024
@yalit
Copy link
ContributorAuthor

yalit commentedMay 11, 2024
edited
Loading

I updated the title and the comment as I got the comment (which I made to myself also) that BC could be "Backward Compatibility" (the case here) or Breaking Change.

This change is, according to me, breaking the backward compatibility as changing the Validator constructor signature and so I would not merge it in the 7.2 but only in the 8.0 (hence the creation of the#54881 to do the same but without breaking the compatibility)

@smnandre
Copy link
Member

If this one does not ensure a Backward compatible way, let close it and work on the other one, no ?

@yalit
Copy link
ContributorAuthor

I would indeed work currently on the other one but how to keep in mind that this one should be potentially meant to be the target one for the 8.0?

@xabbuh
Copy link
Member

For every BC breaking change in 8.0 there must be a deprecation in Symfony 7 first. I haven’t looked into your changes yet, but the comments sound like the deprecation should then be part of your other PR.

@yalit
Copy link
ContributorAuthor

@xabbuh thanks for the notification => I've been advised to do it indeed in the other change (pushed it just now).

@xabbuh
Copy link
Member

👍 closing here then

yalit reacted with thumbs up emoji

@xabbuhxabbuh closed thisMay 12, 2024
derrabus added a commit that referenced this pull requestMay 21, 2024
…trength()` public (yalit)This PR was merged into the 7.2 branch.Discussion----------[Validator] Make `PasswordStrengthValidator::estimateStrength()` public| Q             | A| ------------- | ---| Branch?       | 7.1| Bug fix?      | no| New feature?  | yes (allows for externally| Deprecations? | no| Issues        | na| License       | MITLinked to the PasswordStrength Constraint, the need is to be able to get the "strength" of a password and not just only if it's strong enough. For instance, the need is to show a "score" bar in the frontend.Currently, the strength is being computed by a private function within the PasswordStrengthValidator not accessible directly. The proposed change is to extract that computation in a specific `PasswordStrengthEstimator` service for it to be accessible from the "external" world.The best way to do so would be to inject the service in the Validator constructor but doing that it would break the compatibility as the current constructor is receiving a Closure to allow for self-strength computation.So here the service is called from within the Validator directly and so maintaining the Backward CompatibilityI created the same PR but with no Backward Compatibility (service injected in the constructor) here :#54882Commits-------e058d92 [Validator] Make `PasswordStrengthValidator::estimateStrength()` public
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@OskarStarkOskarStarkOskarStark left review comments

Assignees

No one assigned

Labels

Projects

None yet

Milestone

7.2

Development

Successfully merging this pull request may close these issues.

5 participants

@yalit@smnandre@xabbuh@OskarStark@derrabus

[8]ページ先頭

©2009-2025 Movatter.jp