This repository has been archived on 2023-08-20. You can view files and clone it, but cannot push or open issues or pull requests.
symfony/src/Symfony/Component
Fabien Potencier 8de664d4f3 feature #40267 [Security] Decouple passwords from UserInterface (chalasr)
This PR was merged into the 5.3-dev branch.

Discussion
----------

[Security] Decouple passwords from UserInterface

| Q             | A
| ------------- | ---
| Branch?       | 5.x
| Bug fix?      | no
| New feature?  | yes
| Deprecations? | yes
| Tickets       | #23081, helps with #39308
| License       | MIT
| Doc PR        | todo

This PR addresses a long-standing issue of the Security component: UserInterface is coupled to passwords.
It does it by moving the `getPassword()` method from `UserInterface` to a `PasswordAuthenticatedUserInterface`, and the `getSalt()` method to a `LegacyPasswordAuthenticatedUserInterface`.

Steps:
- In 5.3, we add the new interface and, at places where password-based authentication happens, trigger deprecation notices when a `UserInterface` object does not implement the new interface(s). The UserInterface is kept as-is until 6.0.
- In 6.0, we can remove the methods from `UserInterface` as well as support for using password authentication with user objects not implementing the new interface(s).

As a side-effect, some password-related interfaces (`UserPasswordHasherInterface` and `PasswordUpgraderInterface`) must change their signatures to type-hint against the new interface.
That is done in a BC way, which is to make the concerned methods virtual until 6.0, with deprecation notices triggered from callers and concrete implementations.

Benefits:
In 6.0, applications that use password-less authentication (e.g. login links) won't need to write no-op `getPassword()` and `getSalt()` in order to fulfil the `UserInterface` contract.

For applications that do use password-based authentication, they will need to opt-in explicitly by implementing the relevant interface(s).

This build on great discussions with @wouterj and @nicolas-grekas, and it is part of the overall rework of the Security component.

Commits
-------

2764225a38 [Security] Decouple passwords from UserInterface
2021-03-06 11:59:38 +01:00
..
Asset [Asset] Add tag assets.package to register asset packages 2021-02-11 23:08:21 +01:00
BrowserKit Merge branch '5.2' into 5.x 2021-02-22 07:55:17 +01:00
Cache Merge branch '5.2' into 5.x 2021-02-26 00:55:26 +01:00
Config Deprecate passing null as $message or $code to exceptions 2021-02-24 14:36:13 +01:00
Console Merge branch '5.2' into 5.x 2021-03-06 09:05:19 +01:00
CssSelector Merge branch '4.4' into 5.1 2021-01-27 11:01:46 +01:00
DependencyInjection [DependencyInjection] Implement psr/container 1.1 2021-03-05 23:51:52 +01:00
DomCrawler Merge branch '5.2' into 5.x 2021-02-15 19:57:44 +01:00
Dotenv Merge branch '4.4' into 5.1 2021-01-27 11:01:46 +01:00
ErrorHandler Merge branch '5.2' into 5.x 2021-02-11 09:21:33 +01:00
EventDispatcher feature #40234 [Console] Add ConsoleCommand attribute for declaring commands on PHP 8 (nicolas-grekas) 2021-02-19 01:04:43 +01:00
ExpressionLanguage Merge branch '4.4' into 5.2 2021-02-12 11:38:38 +01:00
Filesystem Merge branch '5.2' into 5.x 2021-02-12 11:47:00 +01:00
Finder Merge branch '4.4' into 5.2 2021-02-15 19:55:04 +01:00
Form Merge branch '5.2' into 5.x 2021-03-06 09:05:19 +01:00
HttpClient Merge branch '5.2' into 5.x 2021-03-01 01:41:04 +01:00
HttpFoundation Merge branch '5.2' into 5.x 2021-02-25 18:20:06 +01:00
HttpKernel Bump Symfony version to 5.2.5 2021-03-04 19:11:30 +01:00
Inflector Changed private static array-properties to const 2021-01-25 00:44:26 +01:00
Intl [Intl] Add Currencies::getCashFractionDigits() and Currencies::getCashRoundingIncrement() 2021-02-19 16:39:40 +01:00
Ldap [Security] Decouple passwords from UserInterface 2021-03-06 00:37:05 +01:00
Lock Merge branch '5.2' into 5.x 2021-02-15 19:57:44 +01:00
Mailer Deprecate passing null as $message or $code to exceptions 2021-02-24 14:36:13 +01:00
Messenger Merge branch '5.2' into 5.x 2021-03-06 09:05:19 +01:00
Mime Merge branch '4.4' into 5.2 2021-02-15 19:55:04 +01:00
Notifier [Notifier] [OvhCloud] Add "sender" 2021-03-06 09:31:27 +01:00
OptionsResolver Merge branch '5.1' into 5.2 2021-01-27 13:56:27 +01:00
PasswordHasher feature #40267 [Security] Decouple passwords from UserInterface (chalasr) 2021-03-06 11:59:38 +01:00
Process Merge branch '5.1' into 5.2 2021-01-27 11:15:41 +01:00
PropertyAccess Merge branch '5.1' into 5.2 2021-01-27 11:15:41 +01:00
PropertyInfo [PropertyInfo] fix direct deprecation 2021-02-18 17:47:29 +01:00
RateLimiter Merge branch '5.2' into 5.x 2021-02-11 09:21:33 +01:00
Routing feature #40266 [Routing] Construct Route annotations using named arguments (derrabus) 2021-02-25 08:31:04 +01:00
Security feature #40267 [Security] Decouple passwords from UserInterface (chalasr) 2021-03-06 11:59:38 +01:00
Semaphore [Semaphore] remove "experimental" status 2021-01-28 15:38:19 +01:00
Serializer Merge branch '5.2' into 5.x 2021-03-02 13:23:03 +01:00
Stopwatch Merge branch '5.1' into 5.2 2021-01-27 11:15:41 +01:00
String Merge branch '5.2' into 5.x 2021-02-17 16:27:35 +01:00
Templating Merge branch '4.4' into 5.1 2021-01-27 11:01:46 +01:00
Translation Merge branch '5.2' into 5.x 2021-03-06 09:05:19 +01:00
Uid Fix typo 2021-03-06 09:14:32 +01:00
Validator Merge branch '5.2' into 5.x 2021-03-06 09:11:22 +01:00
VarDumper Merge branch '5.2' into 5.x 2021-03-06 09:05:19 +01:00
VarExporter Merge branch '4.4' into 5.1 2021-01-27 11:01:46 +01:00
WebLink Merge branch '4.4' into 5.2 2021-02-17 16:24:54 +01:00
Workflow Merge branch '5.2' into 5.x 2021-02-15 19:57:44 +01:00
Yaml Merge branch '5.2' into 5.x 2021-03-06 09:05:19 +01:00