diff --git a/src/Auth/BaseAuthenticate.php b/src/Auth/BaseAuthenticate.php index 84b69c586a0..38fea41d965 100644 --- a/src/Auth/BaseAuthenticate.php +++ b/src/Auth/BaseAuthenticate.php @@ -38,7 +38,7 @@ abstract class BaseAuthenticate { * - `contain` Extra models to contain and store in session. * - `passwordHasher` Password hasher class. Can be a string specifying class name * or an array containing `className` key, any other keys will be passed as - * config to the class. Defaults to 'Simple'. + * config to the class. Defaults to 'Default'. * * @var array */ @@ -50,7 +50,7 @@ abstract class BaseAuthenticate { 'userModel' => 'Users', 'scope' => [], 'contain' => null, - 'passwordHasher' => 'Simple' + 'passwordHasher' => 'Default' ]; /** diff --git a/src/Auth/SimplePasswordHasher.php b/src/Auth/DefaultPasswordHasher.php similarity index 95% rename from src/Auth/SimplePasswordHasher.php rename to src/Auth/DefaultPasswordHasher.php index f25b667b18c..7c14ad1eb2e 100644 --- a/src/Auth/SimplePasswordHasher.php +++ b/src/Auth/DefaultPasswordHasher.php @@ -17,10 +17,10 @@ use Cake\Auth\AbstractPasswordHasher; /** - * Simple password hashing class. + * Default password hashing class. * */ -class SimplePasswordHasher extends AbstractPasswordHasher { +class DefaultPasswordHasher extends AbstractPasswordHasher { /** * Default config for this object. diff --git a/tests/TestCase/Auth/SimplePasswordHasherTest.php b/tests/TestCase/Auth/DefaultPasswordHasherTest.php similarity index 79% rename from tests/TestCase/Auth/SimplePasswordHasherTest.php rename to tests/TestCase/Auth/DefaultPasswordHasherTest.php index 05482165bbe..5ede69d72d9 100644 --- a/tests/TestCase/Auth/SimplePasswordHasherTest.php +++ b/tests/TestCase/Auth/DefaultPasswordHasherTest.php @@ -14,23 +14,23 @@ */ namespace Cake\Test\TestCase\Auth; -use Cake\Auth\SimplePasswordHasher; +use Cake\Auth\DefaultPasswordHasher; use Cake\TestSuite\TestCase; /** - * Test case for SimplePasswordHasher + * Test case for DefaultPasswordHasher * */ -class SimplePasswordHasherTest extends TestCase { +class DefaultPasswordHasherTest extends TestCase { /** - * Tests that a password not produced by SimplePasswordHasher needs + * Tests that a password not produced by DefaultPasswordHasher needs * to be rehashed * * @return void */ public function testNeedsRehash() { - $hasher = new SimplePasswordHasher(); + $hasher = new DefaultPasswordHasher(); $this->assertTrue($hasher->needsRehash(md5('foo'))); $password = $hasher->hash('foo'); $this->assertFalse($hasher->needsRehash($password)); diff --git a/tests/TestCase/Auth/FallbackPasswordHasherTest.php b/tests/TestCase/Auth/FallbackPasswordHasherTest.php index 489daa23caa..7decc33fe9b 100644 --- a/tests/TestCase/Auth/FallbackPasswordHasherTest.php +++ b/tests/TestCase/Auth/FallbackPasswordHasherTest.php @@ -14,8 +14,8 @@ */ namespace Cake\Test\TestCase\Auth; +use Cake\Auth\DefaultPasswordHasher; use Cake\Auth\FallbackPasswordHasher; -use Cake\Auth\SimplePasswordHasher; use Cake\Auth\WeakPasswordHasher; use Cake\TestSuite\TestCase; @@ -31,12 +31,12 @@ class FallbackPasswordHasherTest extends TestCase { * @return void */ public function testHash() { - $hasher = new FallbackPasswordHasher(['hashers' => ['Weak', 'Simple']]); + $hasher = new FallbackPasswordHasher(['hashers' => ['Weak', 'Default']]); $weak = new WeakPasswordHasher(); $this->assertSame($weak->hash('foo'), $hasher->hash('foo')); - $simple = new SimplePasswordHasher(); - $hasher = new FallbackPasswordHasher(['hashers' => ['Weak', 'Simple']]); + $simple = new DefaultPasswordHasher(); + $hasher = new FallbackPasswordHasher(['hashers' => ['Weak', 'Default']]); $this->assertSame($weak->hash('foo'), $hasher->hash('foo')); } @@ -47,9 +47,9 @@ public function testHash() { * @return void */ public function testCheck() { - $hasher = new FallbackPasswordHasher(['hashers' => ['Weak', 'Simple']]); + $hasher = new FallbackPasswordHasher(['hashers' => ['Weak', 'Default']]); $weak = new WeakPasswordHasher(); - $simple = new SimplePasswordHasher(); + $simple = new DefaultPasswordHasher(); $hash = $simple->hash('foo'); $otherHash = $weak->hash('foo'); @@ -63,12 +63,12 @@ public function testCheck() { * @return void */ public function testNeedsRehash() { - $hasher = new FallbackPasswordHasher(['hashers' => ['Simple', 'Weak']]); + $hasher = new FallbackPasswordHasher(['hashers' => ['Default', 'Weak']]); $weak = new WeakPasswordHasher(); $otherHash = $weak->hash('foo'); $this->assertTrue($hasher->needsRehash($otherHash)); - $simple = new SimplePasswordHasher(); + $simple = new DefaultPasswordHasher(); $hash = $simple->hash('foo'); $this->assertFalse($hasher->needsRehash($hash)); } diff --git a/tests/TestCase/Auth/FormAuthenticateTest.php b/tests/TestCase/Auth/FormAuthenticateTest.php index 9f3934535eb..09f61a9be97 100644 --- a/tests/TestCase/Auth/FormAuthenticateTest.php +++ b/tests/TestCase/Auth/FormAuthenticateTest.php @@ -263,7 +263,7 @@ public function testPluginModel() { */ public function testPasswordHasherSettings() { $this->auth->config('passwordHasher', [ - 'className' => 'Simple', + 'className' => 'Default', 'hashType' => PASSWORD_BCRYPT ]); @@ -298,7 +298,7 @@ public function testPasswordHasherSettings() { 'userModel' => 'Users' ]); $this->auth->config('passwordHasher', [ - 'className' => 'Simple' + 'className' => 'Default' ]); $this->assertEquals($expected, $this->auth->authenticate($request, $this->response)); @@ -326,7 +326,7 @@ public function testAuthenticateNoRehash() { } /** - * Tests that not using the Simple password hasher means that the password + * Tests that not using the Default password hasher means that the password * needs to be rehashed * * @return void diff --git a/tests/TestCase/Controller/Component/AuthComponentTest.php b/tests/TestCase/Controller/Component/AuthComponentTest.php index ff2428eac7a..6c06900fb8b 100644 --- a/tests/TestCase/Controller/Component/AuthComponentTest.php +++ b/tests/TestCase/Controller/Component/AuthComponentTest.php @@ -364,7 +364,7 @@ public function testAllConfigWithAuthenticate() { */ public function testSameAuthenticateWithDifferentHashers() { $this->Controller->Auth->config('authenticate', [ - 'FormSimple' => ['className' => 'Form', 'passwordHasher' => 'Simple'], + 'FormSimple' => ['className' => 'Form', 'passwordHasher' => 'Default'], 'FormBlowfish' => ['className' => 'Form', 'passwordHasher' => 'Fallback'], ]); @@ -374,7 +374,7 @@ public function testSameAuthenticateWithDifferentHashers() { $this->assertInstanceOf('Cake\Auth\FormAuthenticate', $objects[0]); $this->assertInstanceOf('Cake\Auth\FormAuthenticate', $objects[1]); - $this->assertInstanceOf('Cake\Auth\SimplePasswordHasher', $objects[0]->passwordHasher()); + $this->assertInstanceOf('Cake\Auth\DefaultPasswordHasher', $objects[0]->passwordHasher()); $this->assertInstanceOf('Cake\Auth\FallbackPasswordHasher', $objects[1]->passwordHasher()); }