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

Create DBPassword and refactor Member to use it #318

Open
emteknetnz opened this issue Sep 30, 2024 · 1 comment
Open

Create DBPassword and refactor Member to use it #318

emteknetnz opened this issue Sep 30, 2024 · 1 comment

Comments

@emteknetnz
Copy link
Member

emteknetnz commented Sep 30, 2024

While working on Implement DBField validation
there' an opportunity to split of some of the password functionality from the Member DataObject so that it could be used elsewhere, and also to just make the code a little cleaner.

The would allow passwords to be programatically updated e.g. $someDataObject->Password = 'lorem-ipsum'; would handle encryption, unlike now where it's done in places like Member::onBeforeWrite()

Implementation could look something like this:

  • Create a class DBPassword extends DBComposite
  • It includes the $db fields 'Password', 'Salt' and 'PasswordEncryption'
  • Logic is moved from Member to DBPassword e.g. encryption

We would probably also want to update PasswordValidator to extend FieldValidator and use that to validate the password before encyption, though that would be an api-break

@GuySartorelli
Copy link
Member

We would probably also want to update PasswordValidator to extend FieldValidator and use that to validate the password before encyption, though that would be an api-break

We're already breaking the API for PasswordValidator in CMS 6 so assuming this targets the 6.0.0 release that's totally fine.

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

No branches or pull requests

2 participants