rotp 4.0.0 → 6.3.0

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.
Files changed (55) hide show
  1. checksums.yaml +4 -4
  2. data/.devcontainer/Dockerfile +19 -0
  3. data/.devcontainer/devcontainer.json +41 -0
  4. data/.github/workflows/release.yaml +36 -0
  5. data/.github/workflows/test.yaml +26 -0
  6. data/.release-please-manifest.json +3 -0
  7. data/CHANGELOG.md +91 -24
  8. data/Dockerfile-2.3 +1 -7
  9. data/Dockerfile-2.7 +11 -0
  10. data/Dockerfile-3.0 +12 -0
  11. data/Guardfile +1 -1
  12. data/README.md +64 -15
  13. data/bin/rotp +1 -1
  14. data/docker-compose.yml +37 -0
  15. data/lib/rotp/arguments.rb +6 -5
  16. data/lib/rotp/base32.rb +56 -30
  17. data/lib/rotp/cli.rb +4 -5
  18. data/lib/rotp/hotp.rb +6 -13
  19. data/lib/rotp/otp/uri.rb +78 -0
  20. data/lib/rotp/otp.rb +26 -25
  21. data/lib/rotp/totp.rb +13 -33
  22. data/lib/rotp/version.rb +1 -1
  23. data/lib/rotp.rb +2 -4
  24. data/release-please-config.json +12 -0
  25. data/rotp.gemspec +13 -15
  26. data/spec/lib/rotp/arguments_spec.rb +5 -6
  27. data/spec/lib/rotp/base32_spec.rb +45 -19
  28. data/spec/lib/rotp/cli_spec.rb +21 -6
  29. data/spec/lib/rotp/hotp_spec.rb +38 -17
  30. data/spec/lib/rotp/otp/uri_spec.rb +99 -0
  31. data/spec/lib/rotp/totp_spec.rb +61 -98
  32. data/spec/spec_helper.rb +1 -2
  33. metadata +25 -43
  34. data/.travis.yml +0 -8
  35. data/Dockerfile-1.9 +0 -15
  36. data/Dockerfile-2.1 +0 -16
  37. data/Rakefile +0 -9
  38. data/doc/ROTP/HOTP.html +0 -308
  39. data/doc/ROTP/OTP.html +0 -593
  40. data/doc/ROTP/TOTP.html +0 -493
  41. data/doc/Rotp.html +0 -179
  42. data/doc/_index.html +0 -144
  43. data/doc/class_list.html +0 -36
  44. data/doc/css/common.css +0 -1
  45. data/doc/css/full_list.css +0 -53
  46. data/doc/css/style.css +0 -310
  47. data/doc/file.README.html +0 -89
  48. data/doc/file_list.html +0 -38
  49. data/doc/frames.html +0 -13
  50. data/doc/index.html +0 -89
  51. data/doc/js/app.js +0 -203
  52. data/doc/js/full_list.js +0 -149
  53. data/doc/js/jquery.js +0 -154
  54. data/doc/method_list.html +0 -155
  55. data/doc/top-level-namespace.html +0 -88
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rotp
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.0.0
4
+ version: 6.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mark Percival
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-11-01 00:00:00.000000000 Z
11
+ date: 2023-08-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: '10.5'
19
+ version: '13.0'
20
20
  type: :development
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
- version: '10.5'
26
+ version: '13.0'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: rspec
29
29
  requirement: !ruby/object:Gem::Requirement
@@ -39,33 +39,33 @@ dependencies:
39
39
  - !ruby/object:Gem::Version
40
40
  version: '3.5'
41
41
  - !ruby/object:Gem::Dependency
42
- name: timecop
42
+ name: simplecov
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
45
  - - "~>"
46
46
  - !ruby/object:Gem::Version
47
- version: '0.8'
47
+ version: '0.12'
48
48
  type: :development
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
52
  - - "~>"
53
53
  - !ruby/object:Gem::Version
54
- version: '0.8'
54
+ version: '0.12'
55
55
  - !ruby/object:Gem::Dependency
56
- name: simplecov
56
+ name: timecop
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
59
  - - "~>"
60
60
  - !ruby/object:Gem::Version
61
- version: '0.12'
61
+ version: '0.8'
62
62
  type: :development
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
66
  - - "~>"
67
67
  - !ruby/object:Gem::Version
68
- version: '0.12'
68
+ version: '0.8'
69
69
  description: Works for both HOTP and TOTP, and includes QR Code provisioning
70
70
  email:
71
71
  - mark@markpercival.us
@@ -74,53 +74,42 @@ executables:
74
74
  extensions: []
75
75
  extra_rdoc_files: []
76
76
  files:
77
+ - ".devcontainer/Dockerfile"
78
+ - ".devcontainer/devcontainer.json"
77
79
  - ".dockerignore"
80
+ - ".github/workflows/release.yaml"
81
+ - ".github/workflows/test.yaml"
78
82
  - ".gitignore"
79
- - ".travis.yml"
83
+ - ".release-please-manifest.json"
80
84
  - CHANGELOG.md
81
- - Dockerfile-1.9
82
- - Dockerfile-2.1
83
85
  - Dockerfile-2.3
86
+ - Dockerfile-2.7
87
+ - Dockerfile-3.0
84
88
  - Gemfile
85
89
  - Guardfile
86
90
  - LICENSE
87
91
  - README.md
88
- - Rakefile
89
92
  - bin/rotp
90
- - doc/ROTP/HOTP.html
91
- - doc/ROTP/OTP.html
92
- - doc/ROTP/TOTP.html
93
- - doc/Rotp.html
94
- - doc/_index.html
95
- - doc/class_list.html
96
- - doc/css/common.css
97
- - doc/css/full_list.css
98
- - doc/css/style.css
99
- - doc/file.README.html
100
- - doc/file_list.html
101
- - doc/frames.html
102
- - doc/index.html
103
- - doc/js/app.js
104
- - doc/js/full_list.js
105
- - doc/js/jquery.js
106
- - doc/method_list.html
107
- - doc/top-level-namespace.html
93
+ - docker-compose.yml
108
94
  - lib/rotp.rb
109
95
  - lib/rotp/arguments.rb
110
96
  - lib/rotp/base32.rb
111
97
  - lib/rotp/cli.rb
112
98
  - lib/rotp/hotp.rb
113
99
  - lib/rotp/otp.rb
100
+ - lib/rotp/otp/uri.rb
114
101
  - lib/rotp/totp.rb
115
102
  - lib/rotp/version.rb
103
+ - release-please-config.json
116
104
  - rotp.gemspec
117
105
  - spec/lib/rotp/arguments_spec.rb
118
106
  - spec/lib/rotp/base32_spec.rb
119
107
  - spec/lib/rotp/cli_spec.rb
120
108
  - spec/lib/rotp/hotp_spec.rb
109
+ - spec/lib/rotp/otp/uri_spec.rb
121
110
  - spec/lib/rotp/totp_spec.rb
122
111
  - spec/spec_helper.rb
123
- homepage: http://github.com/mdp/rotp
112
+ homepage: https://github.com/mdp/rotp
124
113
  licenses:
125
114
  - MIT
126
115
  metadata: {}
@@ -132,22 +121,15 @@ required_ruby_version: !ruby/object:Gem::Requirement
132
121
  requirements:
133
122
  - - ">="
134
123
  - !ruby/object:Gem::Version
135
- version: '0'
124
+ version: '2.3'
136
125
  required_rubygems_version: !ruby/object:Gem::Requirement
137
126
  requirements:
138
127
  - - ">="
139
128
  - !ruby/object:Gem::Version
140
129
  version: '0'
141
130
  requirements: []
142
- rubyforge_project: rotp
143
- rubygems_version: 2.7.6
131
+ rubygems_version: 3.4.10
144
132
  signing_key:
145
133
  specification_version: 4
146
134
  summary: A Ruby library for generating and verifying one time passwords
147
- test_files:
148
- - spec/lib/rotp/arguments_spec.rb
149
- - spec/lib/rotp/base32_spec.rb
150
- - spec/lib/rotp/cli_spec.rb
151
- - spec/lib/rotp/hotp_spec.rb
152
- - spec/lib/rotp/totp_spec.rb
153
- - spec/spec_helper.rb
135
+ test_files: []
data/.travis.yml DELETED
@@ -1,8 +0,0 @@
1
- language: ruby
2
- before_install: gem install bundler
3
- rvm:
4
- - 2.3.0
5
- - 2.1.0
6
- - 2.0.0
7
- script:
8
- - bundle exec rspec
data/Dockerfile-1.9 DELETED
@@ -1,15 +0,0 @@
1
- FROM ruby:1.9
2
-
3
- # throw errors if Gemfile has been modified since Gemfile.lock
4
- RUN bundle config --global frozen 1
5
-
6
- RUN mkdir -p /usr/src/app
7
- WORKDIR /usr/src/app
8
-
9
- COPY Gemfile /usr/src/app/
10
- COPY Gemfile.lock /usr/src/app/
11
- COPY . /usr/src/app
12
- RUN bundle install
13
-
14
- CMD ["bundler", "exec", "rspec"]
15
-
data/Dockerfile-2.1 DELETED
@@ -1,16 +0,0 @@
1
- FROM ruby:2.1
2
-
3
- # throw errors if Gemfile has been modified since Gemfile.lock
4
- RUN bundle config --global frozen 1
5
-
6
- RUN mkdir -p /usr/src/app
7
- WORKDIR /usr/src/app
8
-
9
- COPY Gemfile /usr/src/app/
10
- COPY Gemfile.lock /usr/src/app/
11
- COPY . /usr/src/app
12
- RUN bundle install
13
-
14
-
15
- CMD ["bundler", "exec", "rspec"]
16
-
data/Rakefile DELETED
@@ -1,9 +0,0 @@
1
- require 'bundler'
2
- Bundler::GemHelper.install_tasks
3
- require "rspec/core/rake_task"
4
-
5
- RSpec::Core::RakeTask.new(:rspec) do |spec|
6
- spec.pattern = 'spec/**/*_spec.rb'
7
- end
8
-
9
- task :default => :rspec
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> &raquo;
27
- <span class='title'><span class='object_link'><a href="../ROTP.html" title="ROTP (module)">ROTP</a></span></span>
28
- &raquo;
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
- &mdash;
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
- &mdash;
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
- &mdash;
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'>&quot;otpauth://hotp/#{URI.encode(name)}?secret=#{secret}&amp;counter=#{start_count}&quot;</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>