Skip to content

[Form] Document the hash_property_path option #15872

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 1 commit into from
Oct 23, 2022

Conversation

Seb33300
Copy link
Contributor

@Seb33300 Seb33300 commented Sep 29, 2021

Documentation for symfony/symfony#46224

@Seb33300 Seb33300 requested a review from xabbuh as a code owner September 29, 2021 07:25
@carsonbot carsonbot added this to the 5.4 milestone Sep 29, 2021
@xabbuh xabbuh added the Waiting Code Merge Docs for features pending to be merged label Oct 1, 2021
@carsonbot carsonbot modified the milestones: 5.4, next Oct 1, 2021
@Seb33300 Seb33300 force-pushed the password-hash-mapping branch 2 times, most recently from abb2003 to 839808f Compare May 1, 2022 13:52
@Seb33300 Seb33300 changed the base branch from 5.4 to 6.1 May 1, 2022 13:53
@Seb33300 Seb33300 changed the base branch from 6.1 to 6.2 October 10, 2022 09:59
@Seb33300 Seb33300 changed the title [Form] Document the hash_mapping option [Form] Document the hash_property_path option Oct 10, 2022
@Seb33300 Seb33300 force-pushed the password-hash-mapping branch 2 times, most recently from d8ae8e7 to 5950427 Compare October 10, 2022 11:01
fabpot added a commit to symfony/symfony that referenced this pull request Oct 22, 2022
…e` (Seb33300)

This PR was merged into the 6.2 branch.

Discussion
----------

[Form] Add `hash_property_path` option to `PasswordType`

| Q             | A
| ------------- | ---
| Branch?       | 6.2
| Bug fix?      | no
| New feature?  | yes
| Deprecations? | no
| Tickets       | Fix #29066
| License       | MIT
| Doc PR        | symfony/symfony-docs#15872

Same as #42883 but using a Form Extension and rebased to 6.1 & tests.

This PR adds a new `hash_mapping` option to `PasswordType`.
The `hash_mapping` option can be set with a property path where we want to set the hashed password.
The `hash_mapping` option can only be used on unmapped fields to minimize plain password leak.

Commits
-------

7065dfe [Form] Add hash_mapping option to PasswordType
@Seb33300
Copy link
Contributor Author

This feature is now merged in 6.2 🎉

@javiereguiluz can we merge this PR?

@wouterj wouterj removed the Waiting Code Merge Docs for features pending to be merged label Oct 23, 2022
@wouterj wouterj force-pushed the password-hash-mapping branch from 5950427 to 228d73e Compare October 23, 2022 13:27
@wouterj wouterj merged commit beaa793 into symfony:6.2 Oct 23, 2022
@wouterj
Copy link
Member

wouterj commented Oct 23, 2022

Yes we can! Thanks for providing both feature and docs, @Seb33300!

fyi, I've slightly updated the PR while merging (move the versionadded and add some more links).

@wouterj wouterj modified the milestones: next, 6.2 Oct 23, 2022
@maxhelias
Copy link
Contributor

I think, we should also explain how to configure it on a RepeatedType

@Seb33300
Copy link
Contributor Author

If you want to create a PR to add it to the documentation:

$builder->add('plainPassword', RepeatedType::class, [
    'type' => PasswordType::class,
    'first_options'  => ['label' => 'Password', 'hash_property_path' => 'password'],
    'second_options' => ['label' => 'Repeat Password'],
    'mapped' => false,
]);

@Seb33300 Seb33300 deleted the password-hash-mapping branch November 30, 2022 16:03
@OskarStark
Copy link
Contributor

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants