pwned 2.0.2 → 2.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +9 -1
- data/README.md +32 -13
- data/bin/pwned +3 -3
- data/lib/pwned.rb +18 -2
- data/lib/pwned/hashed_password.rb +35 -0
- data/lib/pwned/password.rb +4 -125
- data/lib/pwned/password_base.rb +133 -0
- data/lib/pwned/version.rb +1 -1
- data/pwned.gemspec +1 -1
- metadata +5 -23
- data/docs/NotPwnedValidator.html +0 -494
- data/docs/Pwned.html +0 -521
- data/docs/Pwned/Error.html +0 -149
- data/docs/Pwned/Password.html +0 -936
- 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 -496
- data/docs/file.README.html +0 -424
- data/docs/file_list.html +0 -56
- data/docs/frames.html +0 -17
- data/docs/index.html +0 -424
- data/docs/js/app.js +0 -303
- 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,521 +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.20
|
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
|
-
|
112
|
-
<h2>
|
113
|
-
Constant Summary
|
114
|
-
<small><a href="#" class="constants_summary_toggle">collapse</a></small>
|
115
|
-
</h2>
|
116
|
-
|
117
|
-
<dl class="constants">
|
118
|
-
|
119
|
-
<dt id="VERSION-constant" class="">VERSION =
|
120
|
-
<div class="docstring">
|
121
|
-
<div class="discussion">
|
122
|
-
|
123
|
-
<p>The current version of the <code>pwned</code> gem.</p>
|
124
|
-
|
125
|
-
|
126
|
-
</div>
|
127
|
-
</div>
|
128
|
-
<div class="tags">
|
129
|
-
|
130
|
-
|
131
|
-
</div>
|
132
|
-
</dt>
|
133
|
-
<dd><pre class="code"><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>2.0.0</span><span class='tstring_end'>"</span></span></pre></dd>
|
134
|
-
|
135
|
-
</dl>
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
<h2>
|
146
|
-
Class Method Summary
|
147
|
-
<small><a href="#" class="summary_toggle">collapse</a></small>
|
148
|
-
</h2>
|
149
|
-
|
150
|
-
<ul class="summary">
|
151
|
-
|
152
|
-
<li class="public ">
|
153
|
-
<span class="summary_signature">
|
154
|
-
|
155
|
-
<a href="#pwned%3F-class_method" title="pwned? (class method)">.<strong>pwned?</strong>(password, request_options = {}) ⇒ Boolean </a>
|
156
|
-
|
157
|
-
|
158
|
-
|
159
|
-
</span>
|
160
|
-
|
161
|
-
|
162
|
-
|
163
|
-
|
164
|
-
|
165
|
-
|
166
|
-
|
167
|
-
|
168
|
-
|
169
|
-
<span class="summary_desc"><div class='inline'>
|
170
|
-
<p>Returns <code>true</code> when the password has been pwned.</p>
|
171
|
-
</div></span>
|
172
|
-
|
173
|
-
</li>
|
174
|
-
|
175
|
-
|
176
|
-
<li class="public ">
|
177
|
-
<span class="summary_signature">
|
178
|
-
|
179
|
-
<a href="#pwned_count-class_method" title="pwned_count (class method)">.<strong>pwned_count</strong>(password, request_options = {}) ⇒ Integer </a>
|
180
|
-
|
181
|
-
|
182
|
-
|
183
|
-
</span>
|
184
|
-
|
185
|
-
|
186
|
-
|
187
|
-
|
188
|
-
|
189
|
-
|
190
|
-
|
191
|
-
|
192
|
-
|
193
|
-
<span class="summary_desc"><div class='inline'>
|
194
|
-
<p>Returns number of times the password has been pwned.</p>
|
195
|
-
</div></span>
|
196
|
-
|
197
|
-
</li>
|
198
|
-
|
199
|
-
|
200
|
-
</ul>
|
201
|
-
|
202
|
-
|
203
|
-
|
204
|
-
|
205
|
-
<div id="class_method_details" class="method_details_list">
|
206
|
-
<h2>Class Method Details</h2>
|
207
|
-
|
208
|
-
|
209
|
-
<div class="method_details first">
|
210
|
-
<h3 class="signature first" id="pwned?-class_method">
|
211
|
-
|
212
|
-
.<strong>pwned?</strong>(password, request_options = {}) ⇒ <tt>Boolean</tt>
|
213
|
-
|
214
|
-
|
215
|
-
|
216
|
-
|
217
|
-
|
218
|
-
</h3><div class="docstring">
|
219
|
-
<div class="discussion">
|
220
|
-
|
221
|
-
<p>Returns <code>true</code> when the password has been pwned.</p>
|
222
|
-
|
223
|
-
|
224
|
-
</div>
|
225
|
-
</div>
|
226
|
-
<div class="tags">
|
227
|
-
|
228
|
-
<div class="examples">
|
229
|
-
<p class="tag_title">Examples:</p>
|
230
|
-
|
231
|
-
|
232
|
-
<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
|
233
|
-
</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>
|
234
|
-
|
235
|
-
</div>
|
236
|
-
<p class="tag_title">Parameters:</p>
|
237
|
-
<ul class="param">
|
238
|
-
|
239
|
-
<li>
|
240
|
-
|
241
|
-
<span class='name'>password</span>
|
242
|
-
|
243
|
-
|
244
|
-
<span class='type'>(<tt>String</tt>)</span>
|
245
|
-
|
246
|
-
|
247
|
-
|
248
|
-
—
|
249
|
-
<div class='inline'>
|
250
|
-
<p>The password you want to check against the API.</p>
|
251
|
-
</div>
|
252
|
-
|
253
|
-
</li>
|
254
|
-
|
255
|
-
<li>
|
256
|
-
|
257
|
-
<span class='name'>request_options</span>
|
258
|
-
|
259
|
-
|
260
|
-
<span class='type'>(<tt>Hash</tt>)</span>
|
261
|
-
|
262
|
-
|
263
|
-
<em class="default">(defaults to: <tt>{}</tt>)</em>
|
264
|
-
|
265
|
-
|
266
|
-
—
|
267
|
-
<div class='inline'>
|
268
|
-
<p>Options that can be passed to <code>Net::HTTP.start</code> when calling the
|
269
|
-
API</p>
|
270
|
-
</div>
|
271
|
-
|
272
|
-
</li>
|
273
|
-
|
274
|
-
</ul>
|
275
|
-
|
276
|
-
|
277
|
-
|
278
|
-
|
279
|
-
|
280
|
-
|
281
|
-
<p class="tag_title">Options Hash (<tt>request_options</tt>):</p>
|
282
|
-
<ul class="option">
|
283
|
-
|
284
|
-
<li>
|
285
|
-
<span class="name">:headers</span>
|
286
|
-
<span class="type">(<tt>Symbol</tt>)</span>
|
287
|
-
<span class="default">
|
288
|
-
|
289
|
-
— default:
|
290
|
-
<tt>{ "User-Agent" => '"Ruby Pwned::Password #{Pwned::VERSION}" }</tt>
|
291
|
-
|
292
|
-
</span>
|
293
|
-
|
294
|
-
— <div class='inline'>
|
295
|
-
<p>HTTP headers to include in the request</p>
|
296
|
-
</div>
|
297
|
-
|
298
|
-
</li>
|
299
|
-
|
300
|
-
</ul>
|
301
|
-
|
302
|
-
|
303
|
-
<p class="tag_title">Returns:</p>
|
304
|
-
<ul class="return">
|
305
|
-
|
306
|
-
<li>
|
307
|
-
|
308
|
-
|
309
|
-
<span class='type'>(<tt>Boolean</tt>)</span>
|
310
|
-
|
311
|
-
|
312
|
-
|
313
|
-
—
|
314
|
-
<div class='inline'>
|
315
|
-
<p>Whether the password appears in the data breaches or not.</p>
|
316
|
-
</div>
|
317
|
-
|
318
|
-
</li>
|
319
|
-
|
320
|
-
</ul>
|
321
|
-
<p class="tag_title">Since:</p>
|
322
|
-
<ul class="since">
|
323
|
-
|
324
|
-
<li>
|
325
|
-
|
326
|
-
|
327
|
-
|
328
|
-
|
329
|
-
|
330
|
-
<div class='inline'>
|
331
|
-
<p>1.1.0</p>
|
332
|
-
</div>
|
333
|
-
|
334
|
-
</li>
|
335
|
-
|
336
|
-
</ul>
|
337
|
-
|
338
|
-
</div><table class="source_code">
|
339
|
-
<tr>
|
340
|
-
<td>
|
341
|
-
<pre class="lines">
|
342
|
-
|
343
|
-
|
344
|
-
38
|
345
|
-
39
|
346
|
-
40</pre>
|
347
|
-
</td>
|
348
|
-
<td>
|
349
|
-
<pre class="code"><span class="info file"># File 'lib/pwned.rb', line 38</span>
|
350
|
-
|
351
|
-
<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>
|
352
|
-
<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>
|
353
|
-
<span class='kw'>end</span></pre>
|
354
|
-
</td>
|
355
|
-
</tr>
|
356
|
-
</table>
|
357
|
-
</div>
|
358
|
-
|
359
|
-
<div class="method_details ">
|
360
|
-
<h3 class="signature " id="pwned_count-class_method">
|
361
|
-
|
362
|
-
.<strong>pwned_count</strong>(password, request_options = {}) ⇒ <tt>Integer</tt>
|
363
|
-
|
364
|
-
|
365
|
-
|
366
|
-
|
367
|
-
|
368
|
-
</h3><div class="docstring">
|
369
|
-
<div class="discussion">
|
370
|
-
|
371
|
-
<p>Returns number of times the password has been pwned.</p>
|
372
|
-
|
373
|
-
|
374
|
-
</div>
|
375
|
-
</div>
|
376
|
-
<div class="tags">
|
377
|
-
|
378
|
-
<div class="examples">
|
379
|
-
<p class="tag_title">Examples:</p>
|
380
|
-
|
381
|
-
|
382
|
-
<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
|
383
|
-
</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>
|
384
|
-
|
385
|
-
</div>
|
386
|
-
<p class="tag_title">Parameters:</p>
|
387
|
-
<ul class="param">
|
388
|
-
|
389
|
-
<li>
|
390
|
-
|
391
|
-
<span class='name'>password</span>
|
392
|
-
|
393
|
-
|
394
|
-
<span class='type'>(<tt>String</tt>)</span>
|
395
|
-
|
396
|
-
|
397
|
-
|
398
|
-
—
|
399
|
-
<div class='inline'>
|
400
|
-
<p>The password you want to check against the API.</p>
|
401
|
-
</div>
|
402
|
-
|
403
|
-
</li>
|
404
|
-
|
405
|
-
<li>
|
406
|
-
|
407
|
-
<span class='name'>request_options</span>
|
408
|
-
|
409
|
-
|
410
|
-
<span class='type'>(<tt>Hash</tt>)</span>
|
411
|
-
|
412
|
-
|
413
|
-
<em class="default">(defaults to: <tt>{}</tt>)</em>
|
414
|
-
|
415
|
-
|
416
|
-
—
|
417
|
-
<div class='inline'>
|
418
|
-
<p>Options that can be passed to <code>Net::HTTP.start</code> when calling the
|
419
|
-
API</p>
|
420
|
-
</div>
|
421
|
-
|
422
|
-
</li>
|
423
|
-
|
424
|
-
</ul>
|
425
|
-
|
426
|
-
|
427
|
-
|
428
|
-
|
429
|
-
|
430
|
-
|
431
|
-
<p class="tag_title">Options Hash (<tt>request_options</tt>):</p>
|
432
|
-
<ul class="option">
|
433
|
-
|
434
|
-
<li>
|
435
|
-
<span class="name">:headers</span>
|
436
|
-
<span class="type">(<tt>Symbol</tt>)</span>
|
437
|
-
<span class="default">
|
438
|
-
|
439
|
-
— default:
|
440
|
-
<tt>{ "User-Agent" => '"Ruby Pwned::Password #{Pwned::VERSION}" }</tt>
|
441
|
-
|
442
|
-
</span>
|
443
|
-
|
444
|
-
— <div class='inline'>
|
445
|
-
<p>HTTP headers to include in the request</p>
|
446
|
-
</div>
|
447
|
-
|
448
|
-
</li>
|
449
|
-
|
450
|
-
</ul>
|
451
|
-
|
452
|
-
|
453
|
-
<p class="tag_title">Returns:</p>
|
454
|
-
<ul class="return">
|
455
|
-
|
456
|
-
<li>
|
457
|
-
|
458
|
-
|
459
|
-
<span class='type'>(<tt>Integer</tt>)</span>
|
460
|
-
|
461
|
-
|
462
|
-
|
463
|
-
—
|
464
|
-
<div class='inline'>
|
465
|
-
<p>The number of times the password has appeared in the data breaches.</p>
|
466
|
-
</div>
|
467
|
-
|
468
|
-
</li>
|
469
|
-
|
470
|
-
</ul>
|
471
|
-
<p class="tag_title">Since:</p>
|
472
|
-
<ul class="since">
|
473
|
-
|
474
|
-
<li>
|
475
|
-
|
476
|
-
|
477
|
-
|
478
|
-
|
479
|
-
|
480
|
-
<div class='inline'>
|
481
|
-
<p>1.1.0</p>
|
482
|
-
</div>
|
483
|
-
|
484
|
-
</li>
|
485
|
-
|
486
|
-
</ul>
|
487
|
-
|
488
|
-
</div><table class="source_code">
|
489
|
-
<tr>
|
490
|
-
<td>
|
491
|
-
<pre class="lines">
|
492
|
-
|
493
|
-
|
494
|
-
57
|
495
|
-
58
|
496
|
-
59</pre>
|
497
|
-
</td>
|
498
|
-
<td>
|
499
|
-
<pre class="code"><span class="info file"># File 'lib/pwned.rb', line 57</span>
|
500
|
-
|
501
|
-
<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>
|
502
|
-
<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>
|
503
|
-
<span class='kw'>end</span></pre>
|
504
|
-
</td>
|
505
|
-
</tr>
|
506
|
-
</table>
|
507
|
-
</div>
|
508
|
-
|
509
|
-
</div>
|
510
|
-
|
511
|
-
</div>
|
512
|
-
|
513
|
-
<div id="footer">
|
514
|
-
Generated on Tue Oct 1 21:19:37 2019 by
|
515
|
-
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
516
|
-
0.9.20 (ruby-2.5.5).
|
517
|
-
</div>
|
518
|
-
|
519
|
-
</div>
|
520
|
-
</body>
|
521
|
-
</html>
|