have-i-been-pwned 0.1.1 → 0.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +5 -5
- data/lib/have_i_been_pwned.rb +3 -3
- data/lib/version.rb +1 -1
- metadata +3 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: c1fae8e9609676b44b47bacba29a2ee73b9d326262592f016826d404d941d3a1
|
4
|
+
data.tar.gz: 14560b63260a53af339ad2499faa4cbff780500e574ec0dd2a37466aaf4b4191
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7b9d2e52e61e4751487bb89914ecb3fc313bd6bf5c093d79d8b83134a77927c1fd5064e0bfb475e783f2d587f6b3f78ca6b775d1e04f9aad7ff6f5477629179c
|
7
|
+
data.tar.gz: 80fe8f5e423e9164a63b60e7fcb0832f5a7dab0ad21b2db701c058534deb3941917de2adef288164a6e34c384a8c4fe52fd1c4a7257a0350750601ad776d8c46
|
data/lib/have_i_been_pwned.rb
CHANGED
@@ -10,10 +10,10 @@ module HaveIBeenPwned
|
|
10
10
|
digest = Digest::SHA1.hexdigest password
|
11
11
|
# get the first 5 characters of the hash
|
12
12
|
firstFive = digest[0..4]
|
13
|
-
# make the
|
13
|
+
# make the API call
|
14
14
|
results = HTTParty.get("https://api.pwnedpasswords.com/range/#{firstFive}")
|
15
15
|
# if we get something back
|
16
|
-
if results.code
|
16
|
+
if results.code == 200
|
17
17
|
# split the string based on line breaks into an array
|
18
18
|
resArray = results.split("\n")
|
19
19
|
# interate through the list of hashes
|
@@ -27,7 +27,7 @@ module HaveIBeenPwned
|
|
27
27
|
# return false if we dont find anything
|
28
28
|
return false
|
29
29
|
else
|
30
|
-
raise 'Troy Hunt has failed us. The API returned
|
30
|
+
raise 'Troy Hunt has failed us. The API returned something not 200.'
|
31
31
|
end
|
32
32
|
else
|
33
33
|
raise 'You must provide a password to check!'
|
data/lib/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: have-i-been-pwned
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Dale Myszewski
|
@@ -53,7 +53,7 @@ dependencies:
|
|
53
53
|
- !ruby/object:Gem::Version
|
54
54
|
version: '0'
|
55
55
|
description: A simple gem to check and see if a given password was compromised by
|
56
|
-
a hack. Special thanks to Troy Hunt facilitating
|
56
|
+
a hack. Special thanks to Troy Hunt for facilitating haveibeenpwned.
|
57
57
|
email: dale@daleslab.com
|
58
58
|
executables: []
|
59
59
|
extensions: []
|
@@ -84,8 +84,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
84
84
|
- !ruby/object:Gem::Version
|
85
85
|
version: '0'
|
86
86
|
requirements: []
|
87
|
-
|
88
|
-
rubygems_version: 2.6.7
|
87
|
+
rubygems_version: 3.0.4
|
89
88
|
signing_key:
|
90
89
|
specification_version: 4
|
91
90
|
summary: Check to see if your passwords are safe
|