Add PasswordGeneratorInterface based service. Remove hook_password

Created on 28 August 2023, 10 months ago
Updated 6 September 2023, 10 months 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.69.0 2024