have-i-been-pwned 0.1.1 → 0.1.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: 4711dd81ac9ca50eba43b0bb6ba9fb11ab360326
4
- data.tar.gz: '018f62905a5d68f2221f2e15d2231eaeeb7ca0b1'
2
+ SHA256:
3
+ metadata.gz: c1fae8e9609676b44b47bacba29a2ee73b9d326262592f016826d404d941d3a1
4
+ data.tar.gz: 14560b63260a53af339ad2499faa4cbff780500e574ec0dd2a37466aaf4b4191
5
5
  SHA512:
6
- metadata.gz: b0055b956fd638355ac2234523eb408a65cdf58bd1bb5b9a2dae466f37b52f6d33e1c424a575b2fe9dd822b6daca516c4823afa6fbd12cf4dc6de57a8ac6eaad
7
- data.tar.gz: 802e570b65737f296ffb5668aec0ddf44b1dda82e7953b1cac470778b3294ff9477faafe131214419cf3d798b0cddb7052c6c9ff963efd6b33d057c517f75acc
6
+ metadata.gz: 7b9d2e52e61e4751487bb89914ecb3fc313bd6bf5c093d79d8b83134a77927c1fd5064e0bfb475e783f2d587f6b3f78ca6b775d1e04f9aad7ff6f5477629179c
7
+ data.tar.gz: 80fe8f5e423e9164a63b60e7fcb0832f5a7dab0ad21b2db701c058534deb3941917de2adef288164a6e34c384a8c4fe52fd1c4a7257a0350750601ad776d8c46
@@ -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 APU call
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 != 404
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 a 404.'
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
@@ -1,3 +1,3 @@
1
1
  module HaveIBeenPwned
2
- VERSION = "0.1.1"
2
+ VERSION = "0.1.2"
3
3
  end
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.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 the service.
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
- rubyforge_project:
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