Skip to content
This repository was archived by the owner on May 31, 2024. It is now read-only.

Commit df8d858

Browse files
[Security] deprecate BCryptPasswordEncoder in favor of NativePasswordEncoder
1 parent 75cd01d commit df8d858

File tree

4 files changed

+9
-1
lines changed

4 files changed

+9
-1
lines changed

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
-----

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 <[email protected]>
1820
* @author Terje Bråten <[email protected]>
21+
*
22+
* @deprecated since Symfony 4.3, use NativePasswordEncoder instead
1923
*/
2024
class BCryptPasswordEncoder extends BasePasswordEncoder implements SelfSaltingEncoderInterface
2125
{

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,

Core/Tests/Encoder/BCryptPasswordEncoderTest.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@
1616

1717
/**
1818
* @author Elnur Abdurrakhimov <[email protected]>
19+
*
20+
* @group legacy
1921
*/
2022
class BCryptPasswordEncoderTest extends TestCase
2123
{

0 commit comments

Comments
 (0)