pwned 2.2.0 → 2.4.1
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 +4 -4
- data/.github/workflows/tests.yml +11 -2
- data/CHANGELOG.md +23 -1
- data/README.md +126 -33
- data/lib/locale/fr.yml +5 -0
- data/lib/locale/nl.yml +5 -0
- data/lib/pwned/deep_merge.rb +13 -0
- data/lib/pwned/hashed_password.rb +11 -4
- data/lib/pwned/password.rb +10 -5
- data/lib/pwned/password_base.rb +4 -3
- data/lib/pwned/version.rb +1 -1
- data/lib/pwned.rb +29 -0
- metadata +6 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 226abf113cc3359c1157ed43ba530e83123673626ba5c36cb5431518c2236abf
|
4
|
+
data.tar.gz: bcbb22e607b9ac74c5d9aad4f73ab7995bdee8cdca77cc5a6d4048033289f565
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 012faac5d01ece3a5e7a1b56b127c7487cfe11a9d9d69c5b91727a4fcf938fc82ae62d95669a776b1dac87efbddc7073617991d5012738e5761978821310b812
|
7
|
+
data.tar.gz: e51e2f74240394f89a4ecf8ebae3336f3deeb2aff640df5eff937d917b79544467ba96bc42f208f9688c1fb22d510b4ace7f17715f96347ea2e3f9590ca1f7c2
|
data/.github/workflows/tests.yml
CHANGED
@@ -8,9 +8,12 @@ jobs:
|
|
8
8
|
strategy:
|
9
9
|
fail-fast: false
|
10
10
|
matrix:
|
11
|
-
ruby: [2.
|
12
|
-
rails: [4.2.11.3, 5.0.7.2, 5.1.7, 5.2.4.4, 6.0.3.4, 6.1.0]
|
11
|
+
ruby: [2.6, 2.7, 3.0, 3.1, head]
|
12
|
+
rails: [4.2.11.3, 5.0.7.2, 5.1.7, 5.2.4.4, 6.0.3.4, 6.1.0, 7.0.3.1]
|
13
13
|
exclude:
|
14
|
+
# Ruby 2.6 and Rails 7 do not get along together.
|
15
|
+
- ruby: 2.6
|
16
|
+
rails: 7.0.3.1
|
14
17
|
# Ruby 3.0 and Rails 5 do not get along together.
|
15
18
|
- ruby: 3.0
|
16
19
|
rails: 5.0.7.2
|
@@ -18,6 +21,12 @@ jobs:
|
|
18
21
|
rails: 5.1.7
|
19
22
|
- ruby: 3.0
|
20
23
|
rails: 5.2.4.4
|
24
|
+
- ruby: 3.1
|
25
|
+
rails: 5.0.7.2
|
26
|
+
- ruby: 3.1
|
27
|
+
rails: 5.1.7
|
28
|
+
- ruby: 3.1
|
29
|
+
rails: 5.2.4.4
|
21
30
|
- ruby: head
|
22
31
|
rails: 5.0.7.2
|
23
32
|
- ruby: head
|
data/CHANGELOG.md
CHANGED
@@ -1,6 +1,28 @@
|
|
1
1
|
# Changelog for `Pwned`
|
2
2
|
|
3
|
-
## Ongoing [☰](https://github.com/philnash/pwned/compare/v2.0
|
3
|
+
## Ongoing [☰](https://github.com/philnash/pwned/compare/v2.4.0...master)
|
4
|
+
|
5
|
+
## 2.4.1 (August 29, 2022) [☰](https://github.com/philnash/pwned/compare/v2.4.0...v2.4.1)
|
6
|
+
|
7
|
+
- Minor updates
|
8
|
+
|
9
|
+
- Adds French and Dutch translations
|
10
|
+
- Adds Rails 7 to the test matrix
|
11
|
+
|
12
|
+
## 2.4.0 (February 23, 2022) [☰](https://github.com/philnash/pwned/compare/v2.3.0...v2.4.0)
|
13
|
+
|
14
|
+
- Minor updates
|
15
|
+
|
16
|
+
- Adds `default_request_options` to set global defaults for the gem
|
17
|
+
- Adds Ruby 3.1 to the test matrix
|
18
|
+
|
19
|
+
## 2.3.0 (August 30, 2021) [☰](https://github.com/philnash/pwned/compare/v2.2.0...v2.3.0)
|
20
|
+
|
21
|
+
- Minor updates
|
22
|
+
|
23
|
+
- Restores `Net::HTTP` default behaviour to use environment supplied HTTP
|
24
|
+
proxy
|
25
|
+
- Adds `ignore_env_proxy` to ignore any proxies set in the environment
|
4
26
|
|
5
27
|
## 2.2.0 (March 27, 2021) [☰](https://github.com/philnash/pwned/compare/v2.1.0...v2.2.0)
|
6
28
|
|
data/README.md
CHANGED
@@ -8,36 +8,39 @@ An easy, Ruby way to use the Pwned Passwords API.
|
|
8
8
|
|
9
9
|
## Table of Contents
|
10
10
|
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
11
|
+
* [Table of Contents](#table-of-contents)
|
12
|
+
* [About](#about)
|
13
|
+
* [Installation](#installation)
|
14
|
+
* [Usage](#usage)
|
15
|
+
* [Plain Ruby](#plain-ruby)
|
16
|
+
* [Custom request options](#custom-request-options)
|
17
|
+
* [HTTP Headers](#http-headers)
|
18
|
+
* [HTTP Proxy](#http-proxy)
|
19
|
+
* [ActiveRecord Validator](#activerecord-validator)
|
20
|
+
* [I18n](#i18n)
|
21
|
+
* [Threshold](#threshold)
|
22
|
+
* [Network Error Handling](#network-error-handling)
|
23
|
+
* [Custom Request Options](#custom-request-options-1)
|
24
|
+
* [HTTP Headers](#http-headers-1)
|
25
|
+
* [HTTP Proxy](#http-proxy-1)
|
26
|
+
* [Using Asynchronously](#using-asynchronously)
|
27
|
+
* [Devise](#devise)
|
28
|
+
* [Rodauth](#rodauth)
|
29
|
+
* [Command line](#command-line)
|
30
|
+
* [Unpwn](#unpwn)
|
31
|
+
* [How Pwned is Pi?](#how-pwned-is-pi)
|
32
|
+
* [Development](#development)
|
33
|
+
* [Contributing](#contributing)
|
34
|
+
* [License](#license)
|
35
|
+
* [Code of Conduct](#code-of-conduct)
|
33
36
|
|
34
37
|
## About
|
35
38
|
|
36
|
-
Troy Hunt's [Pwned Passwords API
|
39
|
+
Troy Hunt's [Pwned Passwords API](https://haveibeenpwned.com/API/v3#PwnedPasswords) allows you to check if a password has been found in any of the huge data breaches.
|
37
40
|
|
38
41
|
`Pwned` is a Ruby library to use the Pwned Passwords API's [k-Anonymity model](https://www.troyhunt.com/ive-just-launched-pwned-passwords-version-2/#cloudflareprivacyandkanonymity) to test a password against the API without sending the entire password to the service.
|
39
42
|
|
40
|
-
The data from this API is provided by [Have I been pwned?](https://haveibeenpwned.com/). Before using the API, please check [the acceptable uses and license of the API](https://haveibeenpwned.com/API/
|
43
|
+
The data from this API is provided by [Have I been pwned?](https://haveibeenpwned.com/). Before using the API, please check [the acceptable uses and license of the API](https://haveibeenpwned.com/API/v3#AcceptableUse).
|
41
44
|
|
42
45
|
Here is a blog post I wrote on [how to use this gem in your Ruby applications to make your users' passwords better](https://www.twilio.com/blog/2018/03/better-passwords-in-ruby-applications-pwned-passwords-api.html).
|
43
46
|
|
@@ -105,13 +108,57 @@ Pwned.pwned_count("password")
|
|
105
108
|
#=> 3303003
|
106
109
|
```
|
107
110
|
|
108
|
-
####
|
111
|
+
#### Custom request options
|
109
112
|
|
110
|
-
You can set
|
111
|
-
|
113
|
+
You can set HTTP request options to be used with `Net::HTTP.start` when making the request to the API. These options are documented in the [`Net::HTTP.start` documentation](https://ruby-doc.org/stdlib-3.0.0/libdoc/net/http/rdoc/Net/HTTP.html#method-c-start).
|
114
|
+
|
115
|
+
You can pass the options to the constructor:
|
116
|
+
|
117
|
+
```ruby
|
118
|
+
password = Pwned::Password.new("password", read_timeout: 10)
|
119
|
+
```
|
120
|
+
|
121
|
+
You can also specify global defaults:
|
122
|
+
|
123
|
+
```ruby
|
124
|
+
Pwned.default_request_options = { read_timeout: 10 }
|
125
|
+
```
|
126
|
+
|
127
|
+
##### HTTP Headers
|
128
|
+
|
129
|
+
The `:headers` option defines defines HTTP headers. These headers must be string keys.
|
130
|
+
|
131
|
+
```ruby
|
132
|
+
password = Pwned::Password.new("password", headers: {
|
133
|
+
'User-Agent' => 'Super fun new user agent'
|
134
|
+
})
|
135
|
+
```
|
136
|
+
|
137
|
+
##### HTTP Proxy
|
138
|
+
|
139
|
+
An HTTP proxy can be set using the `http_proxy` or `HTTP_PROXY` environment variable. This is the same way that `Net::HTTP` handles HTTP proxies if no proxy options are given. See [`URI::Generic#find_proxy`](https://ruby-doc.org/stdlib-3.0.1/libdoc/uri/rdoc/URI/Generic.html#method-i-find_proxy) for full details on how Ruby detects a proxy from the environment.
|
112
140
|
|
113
141
|
```ruby
|
114
|
-
|
142
|
+
# Set in the environment
|
143
|
+
ENV["http_proxy"] = "https://username:password@example.com:12345"
|
144
|
+
|
145
|
+
# Will use the above proxy
|
146
|
+
password = Pwned::Password.new("password")
|
147
|
+
```
|
148
|
+
|
149
|
+
You can specify a custom HTTP proxy with the `:proxy` option:
|
150
|
+
|
151
|
+
```ruby
|
152
|
+
password = Pwned::Password.new(
|
153
|
+
"password",
|
154
|
+
proxy: "https://username:password@example.com:12345"
|
155
|
+
)
|
156
|
+
```
|
157
|
+
|
158
|
+
If you don't want to set a proxy and you don't want a proxy to be inferred from the environment, set the `:ignore_env_proxy` key:
|
159
|
+
|
160
|
+
```ruby
|
161
|
+
password = Pwned::Password.new("password", ignore_env_proxy: true)
|
115
162
|
```
|
116
163
|
|
117
164
|
### ActiveRecord Validator
|
@@ -182,29 +229,75 @@ end
|
|
182
229
|
#### Custom Request Options
|
183
230
|
|
184
231
|
You can configure network requests made from the validator using `:request_options` (see [Net::HTTP.start](http://ruby-doc.org/stdlib-2.6.3/libdoc/net/http/rdoc/Net/HTTP.html#method-c-start) for the list of available options).
|
185
|
-
In addition to these options, HTTP headers can be specified with the `:headers` key (e.g. `"User-Agent"`) and proxy can be specified with the `:proxy` key:
|
186
232
|
|
187
233
|
```ruby
|
188
234
|
validates :password, not_pwned: {
|
189
235
|
request_options: {
|
190
236
|
read_timeout: 5,
|
191
|
-
open_timeout: 1
|
192
|
-
|
237
|
+
open_timeout: 1
|
238
|
+
}
|
239
|
+
}
|
240
|
+
```
|
241
|
+
|
242
|
+
These options override the globally defined default options (see above).
|
243
|
+
|
244
|
+
In addition to these options, you can also set the following:
|
245
|
+
|
246
|
+
##### HTTP Headers
|
247
|
+
|
248
|
+
HTTP headers can be specified with the `:headers` key (e.g. `"User-Agent"`)
|
249
|
+
|
250
|
+
```ruby
|
251
|
+
validates :password, not_pwned: {
|
252
|
+
request_options: {
|
253
|
+
headers: { "User-Agent" => "Super fun user agent" }
|
254
|
+
}
|
255
|
+
}
|
256
|
+
```
|
257
|
+
|
258
|
+
##### HTTP Proxy
|
259
|
+
|
260
|
+
An HTTP proxy can be set using the `http_proxy` or `HTTP_PROXY` environment variable. This is the same way that `Net::HTTP` handles HTTP proxies if no proxy options are given. See [`URI::Generic#find_proxy`](https://ruby-doc.org/stdlib-3.0.1/libdoc/uri/rdoc/URI/Generic.html#method-i-find_proxy) for full details on how Ruby detects a proxy from the environment.
|
261
|
+
|
262
|
+
```ruby
|
263
|
+
# Set in the environment
|
264
|
+
ENV["http_proxy"] = "https://username:password@example.com:12345"
|
265
|
+
|
266
|
+
validates :password, not_pwned: true
|
267
|
+
```
|
268
|
+
|
269
|
+
You can specify a custom HTTP proxy with the `:proxy` key:
|
270
|
+
|
271
|
+
```ruby
|
272
|
+
validates :password, not_pwned: {
|
273
|
+
request_options: {
|
193
274
|
proxy: "https://username:password@example.com:12345"
|
194
275
|
}
|
195
276
|
}
|
196
277
|
```
|
197
278
|
|
279
|
+
If you don't want to set a proxy and you don't want a proxy to be inferred from the environment, set the `:ignore_env_proxy` key:
|
280
|
+
|
281
|
+
```ruby
|
282
|
+
validates :password, not_pwned: {
|
283
|
+
request_options: {
|
284
|
+
ignore_env_proxy: true
|
285
|
+
}
|
286
|
+
}
|
287
|
+
```
|
288
|
+
|
198
289
|
### Using Asynchronously
|
199
290
|
|
200
|
-
You may have a use case for hashing the password in advance, and then making the call to the Pwned Passwords API later (for example if you want to enqueue a job without storing the plaintext password). To do this, you can hash the password with the `Pwned.hash_password` method and then initialize the `Pwned::
|
291
|
+
You may have a use case for hashing the password in advance, and then making the call to the Pwned Passwords API later (for example if you want to enqueue a job without storing the plaintext password). To do this, you can hash the password with the `Pwned.hash_password` method and then initialize the `Pwned::HashedPassword` class with the hash, like this:
|
201
292
|
|
202
293
|
```ruby
|
203
294
|
hashed_password = Pwned.hash_password(password)
|
204
295
|
# some time later
|
205
|
-
Pwned::
|
296
|
+
Pwned::HashedPassword.new(hashed_password, request_options).pwned?
|
206
297
|
```
|
207
298
|
|
299
|
+
The `Pwned::HashedPassword` constructor takes all the same options as the regular `Pwned::Password` contructor.
|
300
|
+
|
208
301
|
### Devise
|
209
302
|
|
210
303
|
If you are using [Devise](https://github.com/heartcombo/devise) I recommend you use the [devise-pwned_password extension](https://github.com/michaelbanfield/devise-pwned_password) which is now powered by this gem.
|
data/lib/locale/fr.yml
ADDED
data/lib/locale/nl.yml
ADDED
@@ -1,6 +1,8 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
require "pwned/password_base"
|
4
|
+
require "pwned/deep_merge"
|
5
|
+
|
4
6
|
|
5
7
|
module Pwned
|
6
8
|
##
|
@@ -9,6 +11,7 @@ module Pwned
|
|
9
11
|
# @see https://haveibeenpwned.com/API/v2#PwnedPasswords
|
10
12
|
class HashedPassword
|
11
13
|
include PasswordBase
|
14
|
+
using DeepMerge
|
12
15
|
##
|
13
16
|
# Creates a new hashed password object.
|
14
17
|
#
|
@@ -19,18 +22,22 @@ module Pwned
|
|
19
22
|
#
|
20
23
|
# @param hashed_password [String] The hash of the password you want to check against the API.
|
21
24
|
# @param [Hash] request_options Options that can be passed to +Net::HTTP.start+ when
|
22
|
-
# calling the API
|
25
|
+
# calling the API. This overrides any keys specified in +Pwned.default_request_options+.
|
23
26
|
# @option request_options [Symbol] :headers ({ "User-Agent" => "Ruby Pwned::Password #{Pwned::VERSION}" })
|
24
27
|
# HTTP headers to include in the request
|
28
|
+
# @option request_options [Symbol] :ignore_env_proxy (false) The library
|
29
|
+
# will try to infer an HTTP proxy from the `http_proxy` environment
|
30
|
+
# variable. If you do not want this behaviour, set this option to true.
|
25
31
|
# @raise [TypeError] if the password is not a string.
|
26
32
|
# @since 2.1.0
|
27
33
|
def initialize(hashed_password, request_options={})
|
28
34
|
raise TypeError, "hashed_password must be of type String" unless hashed_password.is_a? String
|
29
35
|
@hashed_password = hashed_password.upcase
|
30
|
-
@request_options =
|
31
|
-
@request_headers = Hash(request_options.delete(:headers))
|
36
|
+
@request_options = Pwned.default_request_options.deep_merge(request_options)
|
37
|
+
@request_headers = Hash(@request_options.delete(:headers))
|
32
38
|
@request_headers = DEFAULT_REQUEST_HEADERS.merge(@request_headers)
|
33
|
-
@request_proxy = URI(request_options.delete(:proxy)) if request_options.key?(:proxy)
|
39
|
+
@request_proxy = URI(@request_options.delete(:proxy)) if @request_options.key?(:proxy)
|
40
|
+
@ignore_env_proxy = @request_options.delete(:ignore_env_proxy) || false
|
34
41
|
end
|
35
42
|
end
|
36
43
|
end
|
data/lib/pwned/password.rb
CHANGED
@@ -1,6 +1,7 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
require "pwned/password_base"
|
4
|
+
require "pwned/deep_merge"
|
4
5
|
|
5
6
|
module Pwned
|
6
7
|
##
|
@@ -9,6 +10,7 @@ module Pwned
|
|
9
10
|
# @see https://haveibeenpwned.com/API/v2#PwnedPasswords
|
10
11
|
class Password
|
11
12
|
include PasswordBase
|
13
|
+
using DeepMerge
|
12
14
|
##
|
13
15
|
# @return [String] the password that is being checked.
|
14
16
|
# @since 1.0.0
|
@@ -24,20 +26,23 @@ module Pwned
|
|
24
26
|
#
|
25
27
|
# @param password [String] The password you want to check against the API.
|
26
28
|
# @param [Hash] request_options Options that can be passed to +Net::HTTP.start+ when
|
27
|
-
# calling the API
|
29
|
+
# calling the API. This overrides any keys specified in +Pwned.default_request_options+.
|
28
30
|
# @option request_options [Symbol] :headers ({ "User-Agent" => "Ruby Pwned::Password #{Pwned::VERSION}" })
|
29
31
|
# HTTP headers to include in the request
|
30
|
-
# @
|
32
|
+
# @option request_options [Symbol] :ignore_env_proxy (false) The library
|
33
|
+
# will try to infer an HTTP proxy from the `http_proxy` environment
|
34
|
+
# variable. If you do not want this behaviour, set this option to true.
|
31
35
|
# @raise [TypeError] if the password is not a string.
|
32
36
|
# @since 1.1.0
|
33
37
|
def initialize(password, request_options={})
|
34
38
|
raise TypeError, "password must be of type String" unless password.is_a? String
|
35
39
|
@password = password
|
36
40
|
@hashed_password = Pwned.hash_password(password)
|
37
|
-
@request_options =
|
38
|
-
@request_headers = Hash(request_options.delete(:headers))
|
41
|
+
@request_options = Pwned.default_request_options.deep_merge(request_options)
|
42
|
+
@request_headers = Hash(@request_options.delete(:headers))
|
39
43
|
@request_headers = DEFAULT_REQUEST_HEADERS.merge(@request_headers)
|
40
|
-
@request_proxy = URI(request_options.delete(:proxy)) if request_options.key?(:proxy)
|
44
|
+
@request_proxy = URI(@request_options.delete(:proxy)) if @request_options.key?(:proxy)
|
45
|
+
@ignore_env_proxy = @request_options.delete(:ignore_env_proxy) || false
|
41
46
|
end
|
42
47
|
end
|
43
48
|
end
|
data/lib/pwned/password_base.rb
CHANGED
@@ -65,7 +65,7 @@ module Pwned
|
|
65
65
|
|
66
66
|
private
|
67
67
|
|
68
|
-
attr_reader :request_options, :request_headers, :request_proxy
|
68
|
+
attr_reader :request_options, :request_headers, :request_proxy, :ignore_env_proxy
|
69
69
|
|
70
70
|
def fetch_pwned_count
|
71
71
|
for_each_response_line do |line|
|
@@ -108,10 +108,12 @@ module Pwned
|
|
108
108
|
request.initialize_http_header(request_headers)
|
109
109
|
request_options[:use_ssl] = true
|
110
110
|
|
111
|
+
environment_proxy = ignore_env_proxy ? nil : :ENV
|
112
|
+
|
111
113
|
Net::HTTP.start(
|
112
114
|
uri.host,
|
113
115
|
uri.port,
|
114
|
-
request_proxy&.host,
|
116
|
+
request_proxy&.host || environment_proxy,
|
115
117
|
request_proxy&.port,
|
116
118
|
request_proxy&.user,
|
117
119
|
request_proxy&.password,
|
@@ -136,6 +138,5 @@ module Pwned
|
|
136
138
|
|
137
139
|
yield last_line unless last_line.empty?
|
138
140
|
end
|
139
|
-
|
140
141
|
end
|
141
142
|
end
|
data/lib/pwned/version.rb
CHANGED
data/lib/pwned.rb
CHANGED
@@ -23,6 +23,29 @@ end
|
|
23
23
|
# results for a password.
|
24
24
|
|
25
25
|
module Pwned
|
26
|
+
@default_request_options = {}
|
27
|
+
|
28
|
+
##
|
29
|
+
# The default request options passed to +Net::HTTP.start+ when calling the API.
|
30
|
+
#
|
31
|
+
# @return [Hash]
|
32
|
+
# @see Pwned::Password#initialize
|
33
|
+
def self.default_request_options
|
34
|
+
@default_request_options
|
35
|
+
end
|
36
|
+
|
37
|
+
##
|
38
|
+
# Sets the default request options passed to +Net::HTTP.start+ when calling
|
39
|
+
# the API.
|
40
|
+
#
|
41
|
+
# The default options may be overridden in +Pwned::Password#new+.
|
42
|
+
#
|
43
|
+
# @param [Hash] request_options
|
44
|
+
# @see Pwned::Password#initialize
|
45
|
+
def self.default_request_options=(request_options)
|
46
|
+
@default_request_options = request_options
|
47
|
+
end
|
48
|
+
|
26
49
|
##
|
27
50
|
# Returns +true+ when the password has been pwned.
|
28
51
|
#
|
@@ -35,6 +58,9 @@ module Pwned
|
|
35
58
|
# calling the API
|
36
59
|
# @option request_options [Symbol] :headers ({ "User-Agent" => "Ruby Pwned::Password #{Pwned::VERSION}" })
|
37
60
|
# HTTP headers to include in the request
|
61
|
+
# @option request_options [Symbol] :ignore_env_proxy (false) The library
|
62
|
+
# will try to infer an HTTP proxy from the `http_proxy` environment
|
63
|
+
# variable. If you do not want this behaviour, set this option to true.
|
38
64
|
# @return [Boolean] Whether the password appears in the data breaches or not.
|
39
65
|
# @since 1.1.0
|
40
66
|
def self.pwned?(password, request_options={})
|
@@ -53,6 +79,9 @@ module Pwned
|
|
53
79
|
# calling the API
|
54
80
|
# @option request_options [Symbol] :headers ({ "User-Agent" => "Ruby Pwned::Password #{Pwned::VERSION}" })
|
55
81
|
# HTTP headers to include in the request
|
82
|
+
# @option request_options [Symbol] :ignore_env_proxy (false) The library
|
83
|
+
# will try to infer an HTTP proxy from the `http_proxy` environment
|
84
|
+
# variable. If you do not want this behaviour, set this option to true.
|
56
85
|
# @return [Integer] The number of times the password has appeared in the data
|
57
86
|
# breaches.
|
58
87
|
# @since 1.1.0
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: pwned
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.
|
4
|
+
version: 2.4.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Phil Nash
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2022-08-29 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -109,7 +109,10 @@ files:
|
|
109
109
|
- bin/pwned
|
110
110
|
- bin/setup
|
111
111
|
- lib/locale/en.yml
|
112
|
+
- lib/locale/fr.yml
|
113
|
+
- lib/locale/nl.yml
|
112
114
|
- lib/pwned.rb
|
115
|
+
- lib/pwned/deep_merge.rb
|
113
116
|
- lib/pwned/error.rb
|
114
117
|
- lib/pwned/hashed_password.rb
|
115
118
|
- lib/pwned/not_pwned_validator.rb
|
@@ -141,7 +144,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
141
144
|
- !ruby/object:Gem::Version
|
142
145
|
version: '0'
|
143
146
|
requirements: []
|
144
|
-
rubygems_version: 3.2
|
147
|
+
rubygems_version: 3.1.2
|
145
148
|
signing_key:
|
146
149
|
specification_version: 4
|
147
150
|
summary: Tools to use the Pwned Passwords API.
|