From cbe46d8242344df28900470a3e1dcb2756409142 Mon Sep 17 00:00:00 2001 From: Chinoms Date: Tue, 31 Oct 2017 08:59:07 +0100 Subject: [PATCH 1/9] Update Readme.md Please see [CHANGELOG](CHANGELOG.md) for more information on what has changed. You may swap "on" with "about." Any of them will be fine. --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 842ff40..7bd8724 100644 --- a/README.md +++ b/README.md @@ -70,7 +70,7 @@ You can customize the error message by opening `resources/lang/en/validation.php ## Change log -Please see [CHANGELOG](CHANGELOG.md) for more information what has changed recently. +Please see [CHANGELOG](CHANGELOG.md) for more information on what has changed recently. ## Contributing From 550a096a6e6daa51291efc4d66d6b6bddfb1c1be Mon Sep 17 00:00:00 2001 From: Shalvah A Date: Wed, 3 Jan 2018 19:05:20 +0100 Subject: [PATCH 2/9] Add support for Laravel 5.5 package auto-discovery --- composer.json | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/composer.json b/composer.json index 7d53dc5..001c101 100644 --- a/composer.json +++ b/composer.json @@ -42,6 +42,11 @@ "extra": { "branch-alias": { "dev-master": "1.0-dev" + }, + "laravel": { + "providers": [ + "Unicodeveloper\\DumbPassword\\DumbPasswordServiceProvider" + ] } } } From a28360841d182d6097be7c3d12160ebe03b19674 Mon Sep 17 00:00:00 2001 From: Shalvah A Date: Wed, 3 Jan 2018 19:10:53 +0100 Subject: [PATCH 3/9] Update README to reflect L5.5 auto-discovery --- README.md | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 7bd8724..44d836d 100644 --- a/README.md +++ b/README.md @@ -28,10 +28,12 @@ To get the latest version of Laravel Password, simply add the following line to You'll then need to run `composer install` or `composer update` to download it and have the autoloader updated. -Once Laravel Password is installed, you need to register the service provider. Open up `config/app.php` and add the following to the `providers` key. - -* `Unicodeveloper\DumbPassword\DumbPasswordServiceProvider::class` +- If you're on Laravel 5.5 or above, that's all you need to do! Check out the usage examples below. +- If you're on Laravel < 5.5, you'll need to register the service provider. Open up `config/app.php` and add the following to the `providers` array: +```php +Unicodeveloper\DumbPassword\DumbPasswordServiceProvider::class +``` ## Usage From cb847f4b1c786d88d69c8eb9b48c152dcd922e39 Mon Sep 17 00:00:00 2001 From: Johannes Schobel Date: Mon, 10 Sep 2018 12:28:06 +0200 Subject: [PATCH 4/9] change order of images change order of images to be more compliant with text --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 44d836d..86b7552 100644 --- a/README.md +++ b/README.md @@ -58,8 +58,6 @@ protected function validator(array $data) Error shows on the page like so: -screen shot 2016-07-02 at 2 12 14 pm - screen shot 2016-07-02 at 1 22 45 pm By default, the error message returned is `This password is just too common. Please try another!`. @@ -70,6 +68,8 @@ You can customize the error message by opening `resources/lang/en/validation.php 'dumbpwd' => 'You are using a dumb password abeg', ``` +screen shot 2016-07-02 at 2 12 14 pm + ## Change log Please see [CHANGELOG](CHANGELOG.md) for more information on what has changed recently. From bc9efa7b01bb3d4f3bb79406ac8d3febbaff56e8 Mon Sep 17 00:00:00 2001 From: Michael Vickers Date: Tue, 1 Oct 2019 21:33:35 +0100 Subject: [PATCH 5/9] Perform case insensitive comparison against the password list Make the password list and user provided password both lowercase, so bad passwords are always identified regardless of how many characters are capitalised --- src/DumbPasswordServiceProvider.php | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/DumbPasswordServiceProvider.php b/src/DumbPasswordServiceProvider.php index b5cb6da..c0a4317 100644 --- a/src/DumbPasswordServiceProvider.php +++ b/src/DumbPasswordServiceProvider.php @@ -40,9 +40,12 @@ public function boot() $path = realpath(__DIR__ . '/../resources/config/passwordlist.txt'); $cache_key = md5_file($path); $data = Cache::rememberForever('dumbpwd_list_' . $cache_key, function () use ($path) { - return collect(explode("\n", file_get_contents($path))); + return collect(explode("\n", file_get_contents($path))) + ->map(function ($password) { + return strtolower($password); + }); }); - return !$data->contains($value); + return !$data->contains(strtolower($value)); }, $this->message); } @@ -56,7 +59,7 @@ public function register() /** * Get the services provided by the provider. - * + * * @return array */ public function provides() From c377449ed9dfc4faff23d6ffd71bf801b729d8f5 Mon Sep 17 00:00:00 2001 From: Michael Vickers Date: Tue, 1 Oct 2019 21:48:17 +0100 Subject: [PATCH 6/9] Reinstate white space --- src/DumbPasswordServiceProvider.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/DumbPasswordServiceProvider.php b/src/DumbPasswordServiceProvider.php index c0a4317..719e926 100644 --- a/src/DumbPasswordServiceProvider.php +++ b/src/DumbPasswordServiceProvider.php @@ -59,7 +59,7 @@ public function register() /** * Get the services provided by the provider. - * + * * @return array */ public function provides() From 2e8285b88b249ec90b246e661fbf3e7ba554e1e8 Mon Sep 17 00:00:00 2001 From: Andrew Donald Johnson Date: Sun, 27 Dec 2020 09:26:38 -0500 Subject: [PATCH 7/9] PHP 8 Support --- .travis.yml | 1 + composer.json | 6 +++--- tests/ExampleTest.php | 3 ++- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/.travis.yml b/.travis.yml index af76124..5eb3a62 100644 --- a/.travis.yml +++ b/.travis.yml @@ -4,6 +4,7 @@ php: - 5.5 - 5.6 - 7.0 + - 8.0 - hhvm # This triggers builds to run on the new TravisCI infrastructure. diff --git a/composer.json b/composer.json index 001c101..eb33e8c 100644 --- a/composer.json +++ b/composer.json @@ -19,10 +19,10 @@ } ], "require": { - "php" : "~5.6|~7.0" + "php" : "~5.6 || ~7.0 || ~8.0" }, "require-dev": { - "phpunit/phpunit" : "~4.0||~5.0", + "phpunit/phpunit" : "~4.0 || ~5.0 || ~6.0 || ~7.0 || ~8.0 || ~9.0", "scrutinizer/ocular": "~1.1", "squizlabs/php_codesniffer": "~2.3" }, @@ -33,7 +33,7 @@ }, "autoload-dev": { "psr-4": { - "Unicodeveloper\\DumbPassword\\Test": "tests" + "Unicodeveloper\\DumbPassword\\Test\\": "tests" } }, "scripts": { diff --git a/tests/ExampleTest.php b/tests/ExampleTest.php index a3b4876..974c886 100644 --- a/tests/ExampleTest.php +++ b/tests/ExampleTest.php @@ -1,8 +1,9 @@ Date: Sun, 27 Dec 2020 15:56:29 -0500 Subject: [PATCH 8/9] Remove unsupported versions of php and phpunit --- .travis.yml | 5 +---- composer.json | 4 ++-- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/.travis.yml b/.travis.yml index 5eb3a62..ad6b5f6 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,11 +1,8 @@ language: php php: - - 5.5 - - 5.6 - 7.0 - 8.0 - - hhvm # This triggers builds to run on the new TravisCI infrastructure. # See: http://docs.travis-ci.com/user/workers/container-based-infrastructure/ @@ -18,7 +15,7 @@ cache: matrix: include: - - php: 5.5 + - php: 7.0 env: 'COMPOSER_FLAGS="--prefer-stable --prefer-lowest"' before_script: diff --git a/composer.json b/composer.json index eb33e8c..971ce2a 100644 --- a/composer.json +++ b/composer.json @@ -19,10 +19,10 @@ } ], "require": { - "php" : "~5.6 || ~7.0 || ~8.0" + "php" : "~7.0 || ~8.0" }, "require-dev": { - "phpunit/phpunit" : "~4.0 || ~5.0 || ~6.0 || ~7.0 || ~8.0 || ~9.0", + "phpunit/phpunit" : "~8.0 || ~9.0", "scrutinizer/ocular": "~1.1", "squizlabs/php_codesniffer": "~2.3" }, From 806e345ae992e0adf38c4cfa32063d7d7c9d189a Mon Sep 17 00:00:00 2001 From: Prosper Otemuyiwa Date: Wed, 30 Dec 2020 05:54:38 +0100 Subject: [PATCH 9/9] Update CHANGELOG.md --- CHANGELOG.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 89585cb..53acea4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,11 @@ All Notable changes to `laravel-password` will be documented in this file. Updates should follow the [Keep a CHANGELOG](http://keepachangelog.com/) principles. +## 2020-12-30 + +- Make passwords case insensitive. +- Support PHP 8 + ## 2017-04-26 - Removed the flip method