8000 [Security] deprecate BCryptPasswordEncoder in favor of NativePassword… · symfony/symfony@a1a3af9 · GitHub
[go: up one dir, main page]

Skip to content

Commit a1a3af9

Browse files
[Security] deprecate BCryptPasswordEncoder in favor of NativePasswordEncoder
1 parent 89ec311 commit a1a3af9

File tree

6 files changed

+13
-3
lines changed

6 files changed

+13
-3
lines changed

UPGRADE-4.3.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -168,13 +168,14 @@ Security
168168
```
169169

170170
* The `Argon2iPasswordEncoder` class has been deprecated, use `SodiumPasswordEncoder` instead.
171+
* The `BCryptPasswordEncoder` class has been deprecated, use `NativePasswordEncoder` instead.
171172
* Not implementing the methods `__serialize` and `__unserialize` in classes implementing
172173
the `TokenInterface` is deprecated
173174

174175
SecurityBundle
175176
--------------
176177

177-
* Configuring encoders using `argon2i` as algorithm has been deprecated, use `auto` instead.
178+
* Configuring encoders using `argon2i` or `bcrypt` as algorithm has been deprecated, use `auto` instead.
178179

179180
TwigBridge
180181
----------

UPGRADE-5.0.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -342,6 +342,7 @@ Security
342342
```
343343

344344
* The `Argon2iPasswordEncoder` class has been removed, use `SodiumPasswordEncoder` instead.
345+
* The `BCryptPasswordEncoder` class has been removed, use `NativePasswordEncoder` instead.
345346
* Classes implementing the `TokenInterface` must implement the two new methods
346347
`__serialize` and `__unserialize`
347348

@@ -364,7 +365,7 @@ SecurityBundle
364365
changed to underscores.
365366
Before: `my-cookie` deleted the `my_cookie` cookie (with an underscore).
366367
After: `my-cookie` deletes the `my-cookie` cookie (with a dash).
367-
* Configuring encoders using `argon2i` as algorithm is not supported anymore, use `sodium` instead.
368+
* Configuring encoders using `argon2i` or `bcrypt` as algorithm is not supported anymore, use `auto` instead.
368369

369370
Serializer
370371
----------

src/Symfony/Bundle/SecurityBundle/DependencyInjection/SecurityExtension.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -558,6 +558,8 @@ private function createEncoder($config, ContainerBuilder $container)
558558

559559
// bcrypt encoder
560560
if ('bcrypt' === $config['algorithm']) {
561+
@trigger_error('Configuring an encoder with "bcrypt" as algorithm is deprecated since Symfony 4.3, use "auto" instead.', E_USER_DEPRECATED);
562+
561563
return [
562564
'class' => 'Symfony\Component\Security\Core\Encoder\BCryptPasswordEncoder',
563565
'arguments' => [$config['cost'] ?? 13],

src/Symfony/Component/Security/CHANGELOG.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,8 @@ CHANGELOG
2121
* Dispatch `AuthenticationFailureEvent` on `security.authentication.failure`
2222
* Dispatch `InteractiveLoginEvent` on `security.interactive_login`
2323
* Dispatch `SwitchUserEvent` on `security.switch_user`
24-
* Deprecated `Argon2iPasswordEncoder`, use `SodiumPasswordEncoder`
24+
* Deprecated `Argon2iPasswordEncoder`, use `SodiumPasswordEncoder` instead
25+
* Deprecated `BCryptPasswordEncoder`, use `NativePasswordEncoder` instead
2526

2627
4.2.0
2728
-----

src/Symfony/Component/Security/Core/Encoder/BCryptPasswordEncoder.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,15 @@
1111

1212
namespace Symfony\Component\Security\Core\Encoder;
1313

14+
@trigger_error(sprintf('The "%s" class is deprecated since Symfony 4.3, use "%s" instead.', BCryptPasswordEncoder::class, NativePasswordEncoder::class), E_USER_DEPRECATED);
15+
1416
use Symfony\Component\Security\Core\Exception\BadCredentialsException;
1517

1618
/**
1719
* @author Elnur Abdurrakhimov <elnur@elnur.pro>
1820
* @author Terje Bråten <terje@braten.be>
21+
*
22+
* @deprecated since Symfony 4.3, use NativePasswordEncoder instead
1923
*/
2024
class BCryptPasswordEncoder extends BasePasswordEncoder implements SelfSaltingEncoderInterface
2125
{

src/Symfony/Component/Security/Core/Encoder/EncoderFactory.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,7 @@ private function getEncoderConfigFromAlgorithm($config)
106106
],
107107
];
108108

109+
/* @deprecated since Symfony 4.3 */
109110
case 'bcrypt':
110111
return [
111112
'class' => BCryptPasswordEncoder::class,

0 commit comments

Comments
 (0)
0