rotp 2.1.1 → 6.2.2
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of rotp might be problematic. Click here for more details.
- checksums.yaml +5 -5
- data/.devcontainer/Dockerfile +19 -0
- data/.devcontainer/devcontainer.json +37 -0
- data/.dockerignore +1 -0
- data/.github/workflows/test.yaml +27 -0
- data/.gitignore +2 -0
- data/CHANGELOG.md +95 -0
- data/Dockerfile-2.3 +10 -0
- data/Dockerfile-2.7 +11 -0
- data/Dockerfile-3.0-rc +12 -0
- data/Guardfile +1 -1
- data/README.md +125 -31
- data/bin/rotp +1 -1
- data/docker-compose.yml +37 -0
- data/lib/rotp/arguments.rb +6 -5
- data/lib/rotp/base32.rb +56 -29
- data/lib/rotp/cli.rb +6 -10
- data/lib/rotp/hotp.rb +11 -26
- data/lib/rotp/otp/uri.rb +79 -0
- data/lib/rotp/otp.rb +20 -31
- data/lib/rotp/totp.rb +43 -29
- data/lib/rotp/version.rb +1 -1
- data/lib/rotp.rb +2 -3
- data/rotp.gemspec +15 -18
- data/spec/lib/rotp/arguments_spec.rb +18 -5
- data/spec/lib/rotp/base32_spec.rb +51 -19
- data/spec/lib/rotp/cli_spec.rb +42 -3
- data/spec/lib/rotp/hotp_spec.rb +39 -60
- data/spec/lib/rotp/otp/uri_spec.rb +99 -0
- data/spec/lib/rotp/totp_spec.rb +138 -120
- data/spec/spec_helper.rb +7 -0
- metadata +27 -45
- data/.travis.yml +0 -7
- data/Gemfile.lock +0 -75
- data/Rakefile +0 -9
- data/doc/ROTP/HOTP.html +0 -308
- data/doc/ROTP/OTP.html +0 -593
- data/doc/ROTP/TOTP.html +0 -493
- data/doc/Rotp.html +0 -179
- data/doc/_index.html +0 -144
- data/doc/class_list.html +0 -36
- data/doc/css/common.css +0 -1
- data/doc/css/full_list.css +0 -53
- data/doc/css/style.css +0 -310
- data/doc/file.README.html +0 -89
- data/doc/file_list.html +0 -38
- data/doc/frames.html +0 -13
- data/doc/index.html +0 -89
- data/doc/js/app.js +0 -203
- data/doc/js/full_list.js +0 -149
- data/doc/js/jquery.js +0 -154
- data/doc/method_list.html +0 -155
- data/doc/top-level-namespace.html +0 -88
data/doc/ROTP/HOTP.html
DELETED
@@ -1,308 +0,0 @@
|
|
1
|
-
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
2
|
-
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
3
|
-
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
4
|
-
<head>
|
5
|
-
<meta name="Content-Type" content="text/html; charset=utf-8" />
|
6
|
-
<title>Class: ROTP::HOTP</title>
|
7
|
-
<link rel="stylesheet" href="../css/style.css" type="text/css" media="screen" charset="utf-8" />
|
8
|
-
<link rel="stylesheet" href="../css/common.css" type="text/css" media="screen" charset="utf-8" />
|
9
|
-
|
10
|
-
<script type="text/javascript" charset="utf-8">
|
11
|
-
relpath = '..';
|
12
|
-
if (relpath != '') relpath += '/';
|
13
|
-
</script>
|
14
|
-
<script type="text/javascript" charset="utf-8" src="../js/jquery.js"></script>
|
15
|
-
<script type="text/javascript" charset="utf-8" src="../js/app.js"></script>
|
16
|
-
|
17
|
-
</head>
|
18
|
-
<body>
|
19
|
-
<script type="text/javascript" charset="utf-8">
|
20
|
-
if (window.top.frames.main) document.body.className = 'frames';
|
21
|
-
</script>
|
22
|
-
|
23
|
-
<div id="header">
|
24
|
-
<div id="menu">
|
25
|
-
|
26
|
-
<a href="../_index.html">Index (H)</a> »
|
27
|
-
<span class='title'><span class='object_link'><a href="../ROTP.html" title="ROTP (module)">ROTP</a></span></span>
|
28
|
-
»
|
29
|
-
<span class="title">HOTP</span>
|
30
|
-
|
31
|
-
|
32
|
-
<div class="noframes"><span class="title">(</span><a href="." target="_top">no frames</a><span class="title">)</span></div>
|
33
|
-
</div>
|
34
|
-
|
35
|
-
<div id="search">
|
36
|
-
<a id="class_list_link" href="#">Class List</a>
|
37
|
-
<a id="method_list_link" href="#">Method List</a>
|
38
|
-
<a id ="file_list_link" href="#">File List</a>
|
39
|
-
</div>
|
40
|
-
|
41
|
-
<div class="clear"></div>
|
42
|
-
</div>
|
43
|
-
|
44
|
-
<iframe id="search_frame"></iframe>
|
45
|
-
|
46
|
-
<div id="content"><h1>Class: ROTP::HOTP
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
</h1>
|
51
|
-
|
52
|
-
<dl class="box">
|
53
|
-
|
54
|
-
<dt class="r1">Inherits:</dt>
|
55
|
-
<dd class="r1">
|
56
|
-
<span class="inheritName"><span class='object_link'><a href="OTP.html" title="ROTP::OTP (class)">OTP</a></span></span>
|
57
|
-
|
58
|
-
<ul class="fullTree">
|
59
|
-
<li>Object</li>
|
60
|
-
|
61
|
-
<li class="next"><span class='object_link'><a href="OTP.html" title="ROTP::OTP (class)">OTP</a></span></li>
|
62
|
-
|
63
|
-
<li class="next">ROTP::HOTP</li>
|
64
|
-
|
65
|
-
</ul>
|
66
|
-
<a href="#" class="inheritanceTree">show all</a>
|
67
|
-
|
68
|
-
</dd>
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
<dt class="r2 last">Defined in:</dt>
|
79
|
-
<dd class="r2 last">lib/rotp/hotp.rb</dd>
|
80
|
-
|
81
|
-
</dl>
|
82
|
-
<div class="clear"></div>
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
<h2>
|
93
|
-
Instance Method Summary
|
94
|
-
<small>(<a href="#" class="summary_toggle">collapse</a>)</small>
|
95
|
-
</h2>
|
96
|
-
|
97
|
-
<ul class="summary">
|
98
|
-
|
99
|
-
<li class="public ">
|
100
|
-
<span class="summary_signature">
|
101
|
-
|
102
|
-
<a href="#at-instance_method" title="#at (instance method)">- (Object) <strong>at</strong>(count) </a>
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
</span>
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
<span class="summary_desc"><div class='inline'></div></span>
|
116
|
-
|
117
|
-
</li>
|
118
|
-
|
119
|
-
|
120
|
-
<li class="public ">
|
121
|
-
<span class="summary_signature">
|
122
|
-
|
123
|
-
<a href="#provisioning_uri-instance_method" title="#provisioning_uri (instance method)">- (String) <strong>provisioning_uri</strong>(name, start_count = 0) </a>
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
</span>
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
<span class="summary_desc"><div class='inline'><p>
|
137
|
-
Returns the provisioning URI for the OTP This can then be encoded in a QR
|
138
|
-
Code and used to provision the Google Authenticator app.
|
139
|
-
</p>
|
140
|
-
</div></span>
|
141
|
-
|
142
|
-
</li>
|
143
|
-
|
144
|
-
|
145
|
-
</ul>
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
|
156
|
-
<h3 class="inherited">Methods inherited from <span class='object_link'><a href="OTP.html" title="ROTP::OTP (class)">OTP</a></span></h3>
|
157
|
-
<p class="inherited"><span class='object_link'><a href="OTP.html#byte_secret-instance_method" title="ROTP::OTP#byte_secret (method)">#byte_secret</a></span>, <span class='object_link'><a href="OTP.html#generate_otp-instance_method" title="ROTP::OTP#generate_otp (method)">#generate_otp</a></span>, <span class='object_link'><a href="OTP.html#initialize-instance_method" title="ROTP::OTP#initialize (method)">#initialize</a></span>, <span class='object_link'><a href="OTP.html#int_to_bytestring-instance_method" title="ROTP::OTP#int_to_bytestring (method)">#int_to_bytestring</a></span></p>
|
158
|
-
<div id="constructor_details" class="method_details_list">
|
159
|
-
<h2>Constructor Details</h2>
|
160
|
-
|
161
|
-
<p class="notice">This class inherits a constructor from <span class='object_link'><a href="OTP.html#initialize-instance_method" title="ROTP::OTP#initialize (method)">ROTP::OTP</a></span></p>
|
162
|
-
|
163
|
-
</div>
|
164
|
-
|
165
|
-
|
166
|
-
<div id="instance_method_details" class="method_details_list">
|
167
|
-
<h2>Instance Method Details</h2>
|
168
|
-
|
169
|
-
|
170
|
-
<div class="method_details first">
|
171
|
-
<p class="signature first" id="at-instance_method">
|
172
|
-
|
173
|
-
- (<tt>Object</tt>) <strong>at</strong>(count)
|
174
|
-
|
175
|
-
|
176
|
-
|
177
|
-
</p><table class="source_code">
|
178
|
-
<tr>
|
179
|
-
<td>
|
180
|
-
<pre class="lines">
|
181
|
-
|
182
|
-
|
183
|
-
3
|
184
|
-
4
|
185
|
-
5</pre>
|
186
|
-
</td>
|
187
|
-
<td>
|
188
|
-
<pre class="code"><span class="info file"># File 'lib/rotp/hotp.rb', line 3</span>
|
189
|
-
|
190
|
-
<span class='def def kw'>def</span> <span class='at identifier id'>at</span><span class='lparen token'>(</span><span class='count identifier id'>count</span><span class='rparen token'>)</span>
|
191
|
-
<span class='generate_otp identifier id'>generate_otp</span><span class='lparen token'>(</span><span class='count identifier id'>count</span><span class='rparen token'>)</span>
|
192
|
-
<span class='end end kw'>end</span>
|
193
|
-
</pre>
|
194
|
-
</td>
|
195
|
-
</tr>
|
196
|
-
</table>
|
197
|
-
</div>
|
198
|
-
|
199
|
-
<div class="method_details ">
|
200
|
-
<p class="signature " id="provisioning_uri-instance_method">
|
201
|
-
|
202
|
-
- (<tt>String</tt>) <strong>provisioning_uri</strong>(name, start_count = 0)
|
203
|
-
|
204
|
-
|
205
|
-
|
206
|
-
</p><div class="docstring">
|
207
|
-
<div class="discussion">
|
208
|
-
<p>
|
209
|
-
Returns the provisioning URI for the OTP This can then be encoded in a QR
|
210
|
-
Code and used to provision the Google Authenticator app
|
211
|
-
</p>
|
212
|
-
|
213
|
-
|
214
|
-
</div>
|
215
|
-
</div>
|
216
|
-
<div class="tags">
|
217
|
-
<h3>Parameters:</h3>
|
218
|
-
<ul class="param">
|
219
|
-
|
220
|
-
<li>
|
221
|
-
|
222
|
-
<span class='type'>(<tt>String</tt>)</span>
|
223
|
-
|
224
|
-
|
225
|
-
<span class='name'>name</span>
|
226
|
-
|
227
|
-
|
228
|
-
|
229
|
-
—
|
230
|
-
<div class='inline'><p>
|
231
|
-
of the account
|
232
|
-
</p>
|
233
|
-
</div>
|
234
|
-
|
235
|
-
</li>
|
236
|
-
|
237
|
-
<li>
|
238
|
-
|
239
|
-
<span class='type'>(<tt>Integer</tt>)</span>
|
240
|
-
|
241
|
-
|
242
|
-
<span class='name'>initial</span>
|
243
|
-
|
244
|
-
|
245
|
-
|
246
|
-
—
|
247
|
-
<div class='inline'><p>
|
248
|
-
counter value, defaults to 0
|
249
|
-
</p>
|
250
|
-
</div>
|
251
|
-
|
252
|
-
</li>
|
253
|
-
|
254
|
-
</ul>
|
255
|
-
<h3>Returns:</h3>
|
256
|
-
<ul class="return">
|
257
|
-
|
258
|
-
<li>
|
259
|
-
|
260
|
-
<span class='type'>(<tt>String</tt>)</span>
|
261
|
-
|
262
|
-
|
263
|
-
|
264
|
-
|
265
|
-
—
|
266
|
-
<div class='inline'><p>
|
267
|
-
provisioning uri
|
268
|
-
</p>
|
269
|
-
</div>
|
270
|
-
|
271
|
-
</li>
|
272
|
-
|
273
|
-
</ul>
|
274
|
-
|
275
|
-
</div><table class="source_code">
|
276
|
-
<tr>
|
277
|
-
<td>
|
278
|
-
<pre class="lines">
|
279
|
-
|
280
|
-
|
281
|
-
13
|
282
|
-
14
|
283
|
-
15</pre>
|
284
|
-
</td>
|
285
|
-
<td>
|
286
|
-
<pre class="code"><span class="info file"># File 'lib/rotp/hotp.rb', line 13</span>
|
287
|
-
|
288
|
-
<span class='def def kw'>def</span> <span class='provisioning_uri identifier id'>provisioning_uri</span><span class='lparen token'>(</span><span class='name identifier id'>name</span><span class='comma token'>,</span> <span class='start_count identifier id'>start_count</span><span class='assign token'>=</span><span class='integer val'>0</span><span class='rparen token'>)</span>
|
289
|
-
<span class='dstring node'>"otpauth://hotp/#{URI.encode(name)}?secret=#{secret}&counter=#{start_count}"</span>
|
290
|
-
<span class='end end kw'>end</span>
|
291
|
-
</pre>
|
292
|
-
</td>
|
293
|
-
</tr>
|
294
|
-
</table>
|
295
|
-
</div>
|
296
|
-
|
297
|
-
</div>
|
298
|
-
|
299
|
-
</div>
|
300
|
-
|
301
|
-
<div id="footer">
|
302
|
-
Generated on Sun Feb 13 12:31:41 2011 by
|
303
|
-
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
304
|
-
0.6.4 (ruby-1.8.7).
|
305
|
-
</div>
|
306
|
-
|
307
|
-
</body>
|
308
|
-
</html>
|