Add PasswordGeneratorInterface based service. Remove hook_password

Created on 28 August 2023, about 1 year ago
Updated 6 September 2023, about 1 year ago

Problem/Motivation

Drupal 9.1 introduced Drupal\Core\Password\PasswordGeneratorInterface a removed user_password function. As such, we can add a service which replaces the Core's DefaultPasswordGenerator with the Genpass one.

This also negates the need for the hook_password introduced by this module, as a module wishing provide a generator via hook_password can now just provide it via core's PasswordGeneratorInterface instead of this module's one.

Providing an option in this module for all passwords to be generated by the Genpass generator means that all passwords on the site will use the same method, regardless of the password field being present or not. eg When email verify is turned on - the password will be generated by Genpass with this option turned on, while currently it would not.

This module will continue to provide hook_genpass_character_sets_alter.

Steps to reproduce

N/A

Proposed resolution

Create service based on PasswordGeneratorInterface
Add option to replace core's generator.
Remove extraneous options.

Remaining tasks

  • ✅ File an issue
  • ➖ Addition/Change/Update/Fix
  • ➖ Testing to ensure no regression
  • ➖ Automated unit testing coverage
  • ➖ Automated functional testing coverage
  • ➖ UX/UI designer responsibilities
  • ➖ Readability
  • ➖ Accessibility
  • ➖ Performance
  • ➖ Security
  • ➖ Documentation
  • ➖ Code review by maintainers
  • ➖ Full testing and approval
  • ➖ Credit contributors
  • ➖ Review with the product owner
  • ➖ Release notes snippet
  • ❌ Release

User interface changes

  • Option to choose algorithm removed from ui
  • Option to use Genpass for all passwords by replacing DefaultPasswordGenerator

API changes

  • hook_password removed
  • genpass_password removed
  • genpass_generate removed

Data model changes

  • Settings removed: genpass_algorithm

Release notes snippet

📌 Task
Status

Fixed

Version

2.0

Component

Code

Created by

🇦🇺Australia elc

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.71.5 2024