Merge branch '5.2' into 5.x
* 5.2: run tests against doctrine/persistence 2.2 again [Security] Do not try to rehash null-passwords Small phpdoc imporvement
This commit is contained in:
commit
83fd6ed8fb
@ -281,7 +281,6 @@ install:
|
||||
elif [[ $deps = low ]]; then
|
||||
echo "$COMPONENTS" | parallel --gnu "tfold {} 'cd {} && $COMPOSER_UP --prefer-lowest --prefer-stable && $PHPUNIT_X'"
|
||||
else
|
||||
composer require --no-update doctrine/persistence:2.1.*
|
||||
if [[ $PHP = 8.0* ]]; then
|
||||
# add return types before running the test suite
|
||||
sed -i 's/"\*\*\/Tests\/"//' composer.json
|
||||
|
@ -698,7 +698,7 @@ class Request
|
||||
* flexibility in controllers, it is better to explicitly get request parameters from the appropriate
|
||||
* public property instead (attributes, query, request).
|
||||
*
|
||||
* Order of precedence: PATH (routing placeholders or custom attributes), GET, BODY
|
||||
* Order of precedence: PATH (routing placeholders or custom attributes), GET, POST
|
||||
*
|
||||
* @param mixed $default The default value if the parameter key does not exist
|
||||
*
|
||||
|
@ -58,6 +58,10 @@ class PasswordMigratingListener implements EventSubscriberInterface
|
||||
}
|
||||
|
||||
$user = $passport->getUser();
|
||||
if (null === $user->getPassword()) {
|
||||
return;
|
||||
}
|
||||
|
||||
$passwordHasher = $this->hasherFactory instanceof EncoderFactoryInterface ? $this->hasherFactory->getEncoder($user) : $this->hasherFactory->getPasswordHasher($user);
|
||||
if (!$passwordHasher->needsRehash($user->getPassword())) {
|
||||
return;
|
||||
|
@ -110,6 +110,16 @@ class PasswordMigratingListenerTest extends TestCase
|
||||
$this->listener->onLoginSuccess($event);
|
||||
}
|
||||
|
||||
public function testUserWithoutPassword()
|
||||
{
|
||||
$this->user = new User('test', null);
|
||||
|
||||
$this->encoderFactory->expects($this->never())->method('getEncoder');
|
||||
|
||||
$event = $this->createEvent(new SelfValidatingPassport(new UserBadge('test', function () { return $this->user; }), [new PasswordUpgradeBadge('pa$$word')]));
|
||||
$this->listener->onLoginSuccess($event);
|
||||
}
|
||||
|
||||
private function createPasswordUpgrader()
|
||||
{
|
||||
return $this->getMockForAbstractClass(TestMigratingUserProvider::class);
|
||||
|
Reference in New Issue
Block a user