Skip to content

2.0.0

Compare
Choose a tag to compare
@philnash philnash released this 01 Oct 11:22

Major updates

  • 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.