pwned 1.2.1 → 2.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/FUNDING.yml +1 -0
- data/.github/workflows/tests.yml +39 -0
- data/CHANGELOG.md +75 -18
- data/README.md +153 -10
- data/bin/pwned +52 -0
- data/lib/pwned.rb +22 -6
- data/lib/pwned/hashed_password.rb +36 -0
- data/lib/pwned/not_pwned_validator.rb +3 -3
- data/lib/pwned/password.rb +12 -96
- data/lib/pwned/password_base.rb +141 -0
- data/lib/pwned/version.rb +1 -1
- data/pwned.gemspec +11 -2
- metadata +29 -34
- data/.travis.yml +0 -23
- data/docs/NotPwnedValidator.html +0 -488
- data/docs/Pwned.html +0 -513
- data/docs/Pwned/Error.html +0 -149
- data/docs/Pwned/Password.html +0 -925
- data/docs/Pwned/TimeoutError.html +0 -152
- data/docs/PwnedValidator.html +0 -192
- data/docs/_index.html +0 -162
- data/docs/class_list.html +0 -51
- data/docs/css/common.css +0 -1
- data/docs/css/full_list.css +0 -58
- data/docs/css/style.css +0 -499
- data/docs/file.README.html +0 -294
- data/docs/file_list.html +0 -56
- data/docs/frames.html +0 -17
- data/docs/index.html +0 -294
- data/docs/js/app.js +0 -248
- data/docs/js/full_list.js +0 -216
- data/docs/js/jquery.js +0 -4
- data/docs/method_list.html +0 -115
- data/docs/top-level-namespace.html +0 -112
data/docs/Pwned.html
DELETED
@@ -1,513 +0,0 @@
|
|
1
|
-
<!DOCTYPE html>
|
2
|
-
<html>
|
3
|
-
<head>
|
4
|
-
<meta charset="utf-8">
|
5
|
-
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
6
|
-
<title>
|
7
|
-
Module: Pwned
|
8
|
-
|
9
|
-
— Documentation by YARD 0.9.12
|
10
|
-
|
11
|
-
</title>
|
12
|
-
|
13
|
-
<link rel="stylesheet" href="css/style.css" type="text/css" charset="utf-8" />
|
14
|
-
|
15
|
-
<link rel="stylesheet" href="css/common.css" type="text/css" charset="utf-8" />
|
16
|
-
|
17
|
-
<script type="text/javascript" charset="utf-8">
|
18
|
-
pathId = "Pwned";
|
19
|
-
relpath = '';
|
20
|
-
</script>
|
21
|
-
|
22
|
-
|
23
|
-
<script type="text/javascript" charset="utf-8" src="js/jquery.js"></script>
|
24
|
-
|
25
|
-
<script type="text/javascript" charset="utf-8" src="js/app.js"></script>
|
26
|
-
|
27
|
-
|
28
|
-
</head>
|
29
|
-
<body>
|
30
|
-
<div class="nav_wrap">
|
31
|
-
<iframe id="nav" src="class_list.html?1"></iframe>
|
32
|
-
<div id="resizer"></div>
|
33
|
-
</div>
|
34
|
-
|
35
|
-
<div id="main" tabindex="-1">
|
36
|
-
<div id="header">
|
37
|
-
<div id="menu">
|
38
|
-
|
39
|
-
<a href="_index.html">Index (P)</a> »
|
40
|
-
|
41
|
-
|
42
|
-
<span class="title">Pwned</span>
|
43
|
-
|
44
|
-
</div>
|
45
|
-
|
46
|
-
<div id="search">
|
47
|
-
|
48
|
-
<a class="full_list_link" id="class_list_link"
|
49
|
-
href="class_list.html">
|
50
|
-
|
51
|
-
<svg width="24" height="24">
|
52
|
-
<rect x="0" y="4" width="24" height="4" rx="1" ry="1"></rect>
|
53
|
-
<rect x="0" y="12" width="24" height="4" rx="1" ry="1"></rect>
|
54
|
-
<rect x="0" y="20" width="24" height="4" rx="1" ry="1"></rect>
|
55
|
-
</svg>
|
56
|
-
</a>
|
57
|
-
|
58
|
-
</div>
|
59
|
-
<div class="clear"></div>
|
60
|
-
</div>
|
61
|
-
|
62
|
-
<div id="content"><h1>Module: Pwned
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
</h1>
|
67
|
-
<div class="box_info">
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
<dl>
|
80
|
-
<dt>Defined in:</dt>
|
81
|
-
<dd>lib/pwned.rb<span class="defines">,<br />
|
82
|
-
lib/pwned/error.rb,<br /> lib/pwned/version.rb,<br /> lib/pwned/password.rb</span>
|
83
|
-
</dd>
|
84
|
-
</dl>
|
85
|
-
|
86
|
-
</div>
|
87
|
-
|
88
|
-
<h2>Overview</h2><div class="docstring">
|
89
|
-
<div class="discussion">
|
90
|
-
|
91
|
-
<p>The main namespace for <code>Pwned</code>. Includes convenience methods for
|
92
|
-
getting the results for a password.</p>
|
93
|
-
|
94
|
-
|
95
|
-
</div>
|
96
|
-
</div>
|
97
|
-
<div class="tags">
|
98
|
-
|
99
|
-
|
100
|
-
</div><h2>Defined Under Namespace</h2>
|
101
|
-
<p class="children">
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
<strong class="classes">Classes:</strong> <span class='object_link'><a href="Pwned/Error.html" title="Pwned::Error (class)">Error</a></span>, <span class='object_link'><a href="Pwned/Password.html" title="Pwned::Password (class)">Password</a></span>, <span class='object_link'><a href="Pwned/TimeoutError.html" title="Pwned::TimeoutError (class)">TimeoutError</a></span>
|
107
|
-
|
108
|
-
|
109
|
-
</p>
|
110
|
-
|
111
|
-
<h2>Constant Summary</h2>
|
112
|
-
<dl class="constants">
|
113
|
-
|
114
|
-
<dt id="VERSION-constant" class="">VERSION =
|
115
|
-
<div class="docstring">
|
116
|
-
<div class="discussion">
|
117
|
-
|
118
|
-
<p>The current version of the <code>pwned</code> gem.</p>
|
119
|
-
|
120
|
-
|
121
|
-
</div>
|
122
|
-
</div>
|
123
|
-
<div class="tags">
|
124
|
-
|
125
|
-
|
126
|
-
</div>
|
127
|
-
</dt>
|
128
|
-
<dd><pre class="code"><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>1.2.1</span><span class='tstring_end'>"</span></span></pre></dd>
|
129
|
-
|
130
|
-
</dl>
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
<h2>
|
140
|
-
Class Method Summary
|
141
|
-
<small><a href="#" class="summary_toggle">collapse</a></small>
|
142
|
-
</h2>
|
143
|
-
|
144
|
-
<ul class="summary">
|
145
|
-
|
146
|
-
<li class="public ">
|
147
|
-
<span class="summary_signature">
|
148
|
-
|
149
|
-
<a href="#pwned%3F-class_method" title="pwned? (class method)">.<strong>pwned?</strong>(password, request_options = {}) ⇒ Boolean </a>
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
</span>
|
154
|
-
|
155
|
-
|
156
|
-
|
157
|
-
|
158
|
-
|
159
|
-
|
160
|
-
|
161
|
-
|
162
|
-
|
163
|
-
<span class="summary_desc"><div class='inline'>
|
164
|
-
<p>Returns <code>true</code> when the password has been pwned.</p>
|
165
|
-
</div></span>
|
166
|
-
|
167
|
-
</li>
|
168
|
-
|
169
|
-
|
170
|
-
<li class="public ">
|
171
|
-
<span class="summary_signature">
|
172
|
-
|
173
|
-
<a href="#pwned_count-class_method" title="pwned_count (class method)">.<strong>pwned_count</strong>(password, request_options = {}) ⇒ Integer </a>
|
174
|
-
|
175
|
-
|
176
|
-
|
177
|
-
</span>
|
178
|
-
|
179
|
-
|
180
|
-
|
181
|
-
|
182
|
-
|
183
|
-
|
184
|
-
|
185
|
-
|
186
|
-
|
187
|
-
<span class="summary_desc"><div class='inline'>
|
188
|
-
<p>Returns number of times the password has been pwned.</p>
|
189
|
-
</div></span>
|
190
|
-
|
191
|
-
</li>
|
192
|
-
|
193
|
-
|
194
|
-
</ul>
|
195
|
-
|
196
|
-
|
197
|
-
|
198
|
-
|
199
|
-
<div id="class_method_details" class="method_details_list">
|
200
|
-
<h2>Class Method Details</h2>
|
201
|
-
|
202
|
-
|
203
|
-
<div class="method_details first">
|
204
|
-
<h3 class="signature first" id="pwned?-class_method">
|
205
|
-
|
206
|
-
.<strong>pwned?</strong>(password, request_options = {}) ⇒ <tt>Boolean</tt>
|
207
|
-
|
208
|
-
|
209
|
-
|
210
|
-
|
211
|
-
|
212
|
-
</h3><div class="docstring">
|
213
|
-
<div class="discussion">
|
214
|
-
|
215
|
-
<p>Returns <code>true</code> when the password has been pwned.</p>
|
216
|
-
|
217
|
-
|
218
|
-
</div>
|
219
|
-
</div>
|
220
|
-
<div class="tags">
|
221
|
-
|
222
|
-
<div class="examples">
|
223
|
-
<p class="tag_title">Examples:</p>
|
224
|
-
|
225
|
-
|
226
|
-
<pre class="example code"><code><span class='const'><span class='object_link'><a href="" title="Pwned (module)">Pwned</a></span></span><span class='period'>.</span><span class='id identifier rubyid_pwned?'>pwned?</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>password</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span> <span class='comment'>#=> true
|
227
|
-
</span><span class='const'><span class='object_link'><a href="" title="Pwned (module)">Pwned</a></span></span><span class='period'>.</span><span class='id identifier rubyid_pwned?'>pwned?</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>pwned::password</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span> <span class='comment'>#=> false</span></code></pre>
|
228
|
-
|
229
|
-
</div>
|
230
|
-
<p class="tag_title">Parameters:</p>
|
231
|
-
<ul class="param">
|
232
|
-
|
233
|
-
<li>
|
234
|
-
|
235
|
-
<span class='name'>password</span>
|
236
|
-
|
237
|
-
|
238
|
-
<span class='type'>(<tt>String</tt>)</span>
|
239
|
-
|
240
|
-
|
241
|
-
|
242
|
-
—
|
243
|
-
<div class='inline'>
|
244
|
-
<p>The password you want to check against the API.</p>
|
245
|
-
</div>
|
246
|
-
|
247
|
-
</li>
|
248
|
-
|
249
|
-
<li>
|
250
|
-
|
251
|
-
<span class='name'>request_options</span>
|
252
|
-
|
253
|
-
|
254
|
-
<span class='type'>(<tt>Hash</tt>)</span>
|
255
|
-
|
256
|
-
|
257
|
-
<em class="default">(defaults to: <tt>{}</tt>)</em>
|
258
|
-
|
259
|
-
|
260
|
-
—
|
261
|
-
<div class='inline'>
|
262
|
-
<p>Options that can be passed to <code>open</code> when calling the API</p>
|
263
|
-
</div>
|
264
|
-
|
265
|
-
</li>
|
266
|
-
|
267
|
-
</ul>
|
268
|
-
|
269
|
-
|
270
|
-
|
271
|
-
|
272
|
-
|
273
|
-
|
274
|
-
<p class="tag_title">Options Hash (<tt>request_options</tt>):</p>
|
275
|
-
<ul class="option">
|
276
|
-
|
277
|
-
<li>
|
278
|
-
<span class="name">'User-Agent'</span>
|
279
|
-
<span class="type">(<tt>String</tt>)</span>
|
280
|
-
<span class="default">
|
281
|
-
|
282
|
-
— default:
|
283
|
-
<tt>"Ruby Pwned::Password #{Pwned::VERSION}"</tt>
|
284
|
-
|
285
|
-
</span>
|
286
|
-
|
287
|
-
— <div class='inline'>
|
288
|
-
<p>The user agent used when making an API request.</p>
|
289
|
-
</div>
|
290
|
-
|
291
|
-
</li>
|
292
|
-
|
293
|
-
</ul>
|
294
|
-
|
295
|
-
|
296
|
-
<p class="tag_title">Returns:</p>
|
297
|
-
<ul class="return">
|
298
|
-
|
299
|
-
<li>
|
300
|
-
|
301
|
-
|
302
|
-
<span class='type'>(<tt>Boolean</tt>)</span>
|
303
|
-
|
304
|
-
|
305
|
-
|
306
|
-
—
|
307
|
-
<div class='inline'>
|
308
|
-
<p>Whether the password appears in the data breaches or not.</p>
|
309
|
-
</div>
|
310
|
-
|
311
|
-
</li>
|
312
|
-
|
313
|
-
</ul>
|
314
|
-
<p class="tag_title">Since:</p>
|
315
|
-
<ul class="since">
|
316
|
-
|
317
|
-
<li>
|
318
|
-
|
319
|
-
|
320
|
-
|
321
|
-
|
322
|
-
|
323
|
-
<div class='inline'>
|
324
|
-
<p>1.1.0</p>
|
325
|
-
</div>
|
326
|
-
|
327
|
-
</li>
|
328
|
-
|
329
|
-
</ul>
|
330
|
-
|
331
|
-
</div><table class="source_code">
|
332
|
-
<tr>
|
333
|
-
<td>
|
334
|
-
<pre class="lines">
|
335
|
-
|
336
|
-
|
337
|
-
38
|
338
|
-
39
|
339
|
-
40</pre>
|
340
|
-
</td>
|
341
|
-
<td>
|
342
|
-
<pre class="code"><span class="info file"># File 'lib/pwned.rb', line 38</span>
|
343
|
-
|
344
|
-
<span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_pwned?'>pwned?</span><span class='lparen'>(</span><span class='id identifier rubyid_password'>password</span><span class='comma'>,</span> <span class='id identifier rubyid_request_options'>request_options</span><span class='op'>=</span><span class='lbrace'>{</span><span class='rbrace'>}</span><span class='rparen'>)</span>
|
345
|
-
<span class='const'><span class='object_link'><a href="" title="Pwned (module)">Pwned</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="Pwned/Password.html" title="Pwned::Password (class)">Password</a></span></span><span class='period'>.</span><span class='id identifier rubyid_new'><span class='object_link'><a href="Pwned/Password.html#initialize-instance_method" title="Pwned::Password#initialize (method)">new</a></span></span><span class='lparen'>(</span><span class='id identifier rubyid_password'>password</span><span class='comma'>,</span> <span class='id identifier rubyid_request_options'>request_options</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_pwned?'>pwned?</span>
|
346
|
-
<span class='kw'>end</span></pre>
|
347
|
-
</td>
|
348
|
-
</tr>
|
349
|
-
</table>
|
350
|
-
</div>
|
351
|
-
|
352
|
-
<div class="method_details ">
|
353
|
-
<h3 class="signature " id="pwned_count-class_method">
|
354
|
-
|
355
|
-
.<strong>pwned_count</strong>(password, request_options = {}) ⇒ <tt>Integer</tt>
|
356
|
-
|
357
|
-
|
358
|
-
|
359
|
-
|
360
|
-
|
361
|
-
</h3><div class="docstring">
|
362
|
-
<div class="discussion">
|
363
|
-
|
364
|
-
<p>Returns number of times the password has been pwned.</p>
|
365
|
-
|
366
|
-
|
367
|
-
</div>
|
368
|
-
</div>
|
369
|
-
<div class="tags">
|
370
|
-
|
371
|
-
<div class="examples">
|
372
|
-
<p class="tag_title">Examples:</p>
|
373
|
-
|
374
|
-
|
375
|
-
<pre class="example code"><code><span class='const'><span class='object_link'><a href="" title="Pwned (module)">Pwned</a></span></span><span class='period'>.</span><span class='id identifier rubyid_pwned_count'>pwned_count</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>password</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span> <span class='comment'>#=> 3303003
|
376
|
-
</span><span class='const'><span class='object_link'><a href="" title="Pwned (module)">Pwned</a></span></span><span class='period'>.</span><span class='id identifier rubyid_pwned_count'>pwned_count</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>pwned::password</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span> <span class='comment'>#=> 0</span></code></pre>
|
377
|
-
|
378
|
-
</div>
|
379
|
-
<p class="tag_title">Parameters:</p>
|
380
|
-
<ul class="param">
|
381
|
-
|
382
|
-
<li>
|
383
|
-
|
384
|
-
<span class='name'>password</span>
|
385
|
-
|
386
|
-
|
387
|
-
<span class='type'>(<tt>String</tt>)</span>
|
388
|
-
|
389
|
-
|
390
|
-
|
391
|
-
—
|
392
|
-
<div class='inline'>
|
393
|
-
<p>The password you want to check against the API.</p>
|
394
|
-
</div>
|
395
|
-
|
396
|
-
</li>
|
397
|
-
|
398
|
-
<li>
|
399
|
-
|
400
|
-
<span class='name'>request_options</span>
|
401
|
-
|
402
|
-
|
403
|
-
<span class='type'>(<tt>Hash</tt>)</span>
|
404
|
-
|
405
|
-
|
406
|
-
<em class="default">(defaults to: <tt>{}</tt>)</em>
|
407
|
-
|
408
|
-
|
409
|
-
—
|
410
|
-
<div class='inline'>
|
411
|
-
<p>Options that can be passed to <code>open</code> when calling the API</p>
|
412
|
-
</div>
|
413
|
-
|
414
|
-
</li>
|
415
|
-
|
416
|
-
</ul>
|
417
|
-
|
418
|
-
|
419
|
-
|
420
|
-
|
421
|
-
|
422
|
-
|
423
|
-
<p class="tag_title">Options Hash (<tt>request_options</tt>):</p>
|
424
|
-
<ul class="option">
|
425
|
-
|
426
|
-
<li>
|
427
|
-
<span class="name">'User-Agent'</span>
|
428
|
-
<span class="type">(<tt>String</tt>)</span>
|
429
|
-
<span class="default">
|
430
|
-
|
431
|
-
— default:
|
432
|
-
<tt>"Ruby Pwned::Password #{Pwned::VERSION}"</tt>
|
433
|
-
|
434
|
-
</span>
|
435
|
-
|
436
|
-
— <div class='inline'>
|
437
|
-
<p>The user agent used when making an API request.</p>
|
438
|
-
</div>
|
439
|
-
|
440
|
-
</li>
|
441
|
-
|
442
|
-
</ul>
|
443
|
-
|
444
|
-
|
445
|
-
<p class="tag_title">Returns:</p>
|
446
|
-
<ul class="return">
|
447
|
-
|
448
|
-
<li>
|
449
|
-
|
450
|
-
|
451
|
-
<span class='type'>(<tt>Integer</tt>)</span>
|
452
|
-
|
453
|
-
|
454
|
-
|
455
|
-
—
|
456
|
-
<div class='inline'>
|
457
|
-
<p>The number of times the password has appeared in the data breaches.</p>
|
458
|
-
</div>
|
459
|
-
|
460
|
-
</li>
|
461
|
-
|
462
|
-
</ul>
|
463
|
-
<p class="tag_title">Since:</p>
|
464
|
-
<ul class="since">
|
465
|
-
|
466
|
-
<li>
|
467
|
-
|
468
|
-
|
469
|
-
|
470
|
-
|
471
|
-
|
472
|
-
<div class='inline'>
|
473
|
-
<p>1.1.0</p>
|
474
|
-
</div>
|
475
|
-
|
476
|
-
</li>
|
477
|
-
|
478
|
-
</ul>
|
479
|
-
|
480
|
-
</div><table class="source_code">
|
481
|
-
<tr>
|
482
|
-
<td>
|
483
|
-
<pre class="lines">
|
484
|
-
|
485
|
-
|
486
|
-
57
|
487
|
-
58
|
488
|
-
59</pre>
|
489
|
-
</td>
|
490
|
-
<td>
|
491
|
-
<pre class="code"><span class="info file"># File 'lib/pwned.rb', line 57</span>
|
492
|
-
|
493
|
-
<span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_pwned_count'>pwned_count</span><span class='lparen'>(</span><span class='id identifier rubyid_password'>password</span><span class='comma'>,</span> <span class='id identifier rubyid_request_options'>request_options</span><span class='op'>=</span><span class='lbrace'>{</span><span class='rbrace'>}</span><span class='rparen'>)</span>
|
494
|
-
<span class='const'><span class='object_link'><a href="" title="Pwned (module)">Pwned</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="Pwned/Password.html" title="Pwned::Password (class)">Password</a></span></span><span class='period'>.</span><span class='id identifier rubyid_new'><span class='object_link'><a href="Pwned/Password.html#initialize-instance_method" title="Pwned::Password#initialize (method)">new</a></span></span><span class='lparen'>(</span><span class='id identifier rubyid_password'>password</span><span class='comma'>,</span> <span class='id identifier rubyid_request_options'>request_options</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_pwned_count'>pwned_count</span>
|
495
|
-
<span class='kw'>end</span></pre>
|
496
|
-
</td>
|
497
|
-
</tr>
|
498
|
-
</table>
|
499
|
-
</div>
|
500
|
-
|
501
|
-
</div>
|
502
|
-
|
503
|
-
</div>
|
504
|
-
|
505
|
-
<div id="footer">
|
506
|
-
Generated on Sat Mar 17 09:15:06 2018 by
|
507
|
-
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
508
|
-
0.9.12 (ruby-2.5.0).
|
509
|
-
</div>
|
510
|
-
|
511
|
-
</div>
|
512
|
-
</body>
|
513
|
-
</html>
|