😱 An easy, Ruby way to use the Pwned Passwords API.
Minor updates
Minor updates
:proxy
option to request_options
to directly set a proxy on the
request. Fixes #21, thanks dparpyani.Minor updates
Pwned::HashedPassword
class which is initializd with a SHA1 hash to
query the API with so that the lookup can be done in the background without
storing passwords. Fixes #19, thanks @paprikati.Switches from open-uri
to Net::HTTP
. This is a potentially breaking change.
request_options
are now used to configure Net::HTTP.start
.
Rather than using all string keys from request_options
, HTTP headers are now
specified in their own headers
hash. To upgrade, any options intended as
headers need to be extracted into a headers
hash, e.g.
validates :password, not_pwned: {
- request_options: { read_timeout: 5, open_timeout: 1, "User-Agent" => "Super fun user agent" }
+ request_options: { read_timeout: 5, open_timeout: 1, headers: { "User-Agent" => "Super fun user agent" } }
}
- password = Pwned::Password.new("password", 'User-Agent' => 'Super fun new user agent')
+ password = Pwned::Password.new("password", headers: { 'User-Agent' => 'Super fun new user agent' }, read_timeout: 10)
Adds a CLI to let you check passwords on the command line
$ pwned password
Pwned!
The password has been found in public breaches 3730471 times.