You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Apr 23, 2021. It is now read-only.
Copy file name to clipboardExpand all lines: CHANGELOG.md
+7-1Lines changed: 7 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,9 +2,15 @@
2
2
3
3
All notable changes to `ubient/laravel-pwned-passwords` will be documented in this file
4
4
5
+
## 2.0.1 - 2020-04-11
6
+
- Add support for Laravel 7
7
+
- Fixed a bug where an error might be thrown for not being able to reach the Pwned Passwords API.
8
+
Instead, the default behaviour now is to accept the password as non-pwned and send a warning to Laravel's Log.
9
+
If you would like to override this behaviour, you can [create your own implementation of the LookupErrorHandler and bind it in your application](README.md#handling-lookup-errors).
Copy file name to clipboardExpand all lines: README.md
+21-8Lines changed: 21 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -19,7 +19,15 @@ In order to protect the value of the source password being searched for, Pwned P
19
19
This works by hashing the source password with SHA-1, and only sending the first 5 characters of that hash to the API.
20
20
By checking whether the rest of the SHA-1 hash occurs within the output, we can verify both whether the password was pwned previously, and how frequently.
21
21
22
-
### Usage
22
+
## Installation
23
+
24
+
You can install the package via composer:
25
+
26
+
```bash
27
+
composer require ubient/laravel-pwned-passwords
28
+
```
29
+
30
+
## Usage
23
31
24
32
Here's a few short examples of what you can do:
25
33
@@ -59,29 +67,34 @@ $request->validate([
59
67
]);
60
68
```
61
69
62
-
## Installation
70
+
#### Handling Lookup Errors
71
+
When the Pwned Passwords API cannot be queried, the default behavior is to accept the password as non-pwned and to send a warning message to the log.
72
+
While this doesn't add much value, it does allow you to be aware of when a pwned password was allowed, and to potentially manually act on this.
63
73
64
-
You can install the package via composer:
74
+
If you would like to automatically do something else based on this lookup error (such as marking the request as potentially pwned), or want to decline the password instead,
75
+
you may create your own implementation of the [LookupErrorHandler](src/Contracts/LookupErrorHandler.php) and overwrite the default binding in your application:
65
76
66
-
```bash
67
-
composer require ubient/laravel-pwned-passwords
77
+
```php
78
+
use Ubient\PwnedPasswords\Contracts\LookupErrorHandler;
0 commit comments