google-authenticator-rails 3.1.0 → 3.2.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Appraisals +0 -8
- data/CONTRIBUTING.md +5 -1
- data/Gemfile.lock +80 -83
- data/lib/google-authenticator-rails/active_record/helpers.rb +3 -1
- data/lib/google-authenticator-rails/version.rb +1 -1
- data/spec/google_authenticator_spec.rb +12 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 24553cf253ac005e951bbd6937e3ec7da80c0d29dd1ea119cb8a51caaf22bce6
|
4
|
+
data.tar.gz: 529785446eb3b6ee2bcd66ecbc8aa1890b7efcfa6c6d98dcfd13a5f7e7663034
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f0592fa696434b350fe844fc6ef86959923d3796a86b7c13d7da70bd2e21da5fad36e6a21ad540ef1215b8d4146dd3f8d7d37f89874f85063afbe6cb2cb889f7
|
7
|
+
data.tar.gz: 79b74b86b86e509e34033b4c0da95d68b044d4bcaa255563ef18895234f42421c60074931a603c0c37e386222c19d667debbc25db25141ff5f98b42366b31d1e
|
data/Appraisals
CHANGED
@@ -4,14 +4,6 @@ major = version_info.first.to_i
|
|
4
4
|
minor = version_info[1].to_i
|
5
5
|
hotfix = version_info.last.to_i
|
6
6
|
|
7
|
-
appraise "rails-5.2" do
|
8
|
-
gem "activerecord", "~> 5.2.0"
|
9
|
-
end
|
10
|
-
|
11
|
-
appraise "rails-6.0" do
|
12
|
-
gem "activerecord", "~> 6.0.0"
|
13
|
-
end
|
14
|
-
|
15
7
|
appraise "rails-6.1" do
|
16
8
|
gem "activerecord", "~> 6.1.0"
|
17
9
|
end
|
data/CONTRIBUTING.md
CHANGED
@@ -4,4 +4,8 @@
|
|
4
4
|
2. Create your feature branch (`git checkout -b my-new-feature`)
|
5
5
|
3. Commit your changes (`git commit -am 'Added some feature'`)
|
6
6
|
4. Push to the branch (`git push origin my-new-feature`)
|
7
|
-
5. Create new Pull Request
|
7
|
+
5. Create new Pull Request
|
8
|
+
|
9
|
+
## Bug fixes
|
10
|
+
|
11
|
+
It's very helpful for me if you include a failing spec with your bug fix so I can verify the behavior that is changing.
|
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
google-authenticator-rails (3.1
|
4
|
+
google-authenticator-rails (3.2.1)
|
5
5
|
actionpack
|
6
6
|
activerecord
|
7
7
|
rails
|
@@ -11,67 +11,67 @@ PATH
|
|
11
11
|
GEM
|
12
12
|
remote: https://rubygems.org/
|
13
13
|
specs:
|
14
|
-
actioncable (7.0.
|
15
|
-
actionpack (= 7.0.
|
16
|
-
activesupport (= 7.0.
|
14
|
+
actioncable (7.0.4.2)
|
15
|
+
actionpack (= 7.0.4.2)
|
16
|
+
activesupport (= 7.0.4.2)
|
17
17
|
nio4r (~> 2.0)
|
18
18
|
websocket-driver (>= 0.6.1)
|
19
|
-
actionmailbox (7.0.
|
20
|
-
actionpack (= 7.0.
|
21
|
-
activejob (= 7.0.
|
22
|
-
activerecord (= 7.0.
|
23
|
-
activestorage (= 7.0.
|
24
|
-
activesupport (= 7.0.
|
19
|
+
actionmailbox (7.0.4.2)
|
20
|
+
actionpack (= 7.0.4.2)
|
21
|
+
activejob (= 7.0.4.2)
|
22
|
+
activerecord (= 7.0.4.2)
|
23
|
+
activestorage (= 7.0.4.2)
|
24
|
+
activesupport (= 7.0.4.2)
|
25
25
|
mail (>= 2.7.1)
|
26
26
|
net-imap
|
27
27
|
net-pop
|
28
28
|
net-smtp
|
29
|
-
actionmailer (7.0.
|
30
|
-
actionpack (= 7.0.
|
31
|
-
actionview (= 7.0.
|
32
|
-
activejob (= 7.0.
|
33
|
-
activesupport (= 7.0.
|
29
|
+
actionmailer (7.0.4.2)
|
30
|
+
actionpack (= 7.0.4.2)
|
31
|
+
actionview (= 7.0.4.2)
|
32
|
+
activejob (= 7.0.4.2)
|
33
|
+
activesupport (= 7.0.4.2)
|
34
34
|
mail (~> 2.5, >= 2.5.4)
|
35
35
|
net-imap
|
36
36
|
net-pop
|
37
37
|
net-smtp
|
38
38
|
rails-dom-testing (~> 2.0)
|
39
|
-
actionpack (7.0.
|
40
|
-
actionview (= 7.0.
|
41
|
-
activesupport (= 7.0.
|
39
|
+
actionpack (7.0.4.2)
|
40
|
+
actionview (= 7.0.4.2)
|
41
|
+
activesupport (= 7.0.4.2)
|
42
42
|
rack (~> 2.0, >= 2.2.0)
|
43
43
|
rack-test (>= 0.6.3)
|
44
44
|
rails-dom-testing (~> 2.0)
|
45
45
|
rails-html-sanitizer (~> 1.0, >= 1.2.0)
|
46
|
-
actiontext (7.0.
|
47
|
-
actionpack (= 7.0.
|
48
|
-
activerecord (= 7.0.
|
49
|
-
activestorage (= 7.0.
|
50
|
-
activesupport (= 7.0.
|
46
|
+
actiontext (7.0.4.2)
|
47
|
+
actionpack (= 7.0.4.2)
|
48
|
+
activerecord (= 7.0.4.2)
|
49
|
+
activestorage (= 7.0.4.2)
|
50
|
+
activesupport (= 7.0.4.2)
|
51
51
|
globalid (>= 0.6.0)
|
52
52
|
nokogiri (>= 1.8.5)
|
53
|
-
actionview (7.0.
|
54
|
-
activesupport (= 7.0.
|
53
|
+
actionview (7.0.4.2)
|
54
|
+
activesupport (= 7.0.4.2)
|
55
55
|
builder (~> 3.1)
|
56
56
|
erubi (~> 1.4)
|
57
57
|
rails-dom-testing (~> 2.0)
|
58
58
|
rails-html-sanitizer (~> 1.1, >= 1.2.0)
|
59
|
-
activejob (7.0.
|
60
|
-
activesupport (= 7.0.
|
59
|
+
activejob (7.0.4.2)
|
60
|
+
activesupport (= 7.0.4.2)
|
61
61
|
globalid (>= 0.3.6)
|
62
|
-
activemodel (7.0.
|
63
|
-
activesupport (= 7.0.
|
64
|
-
activerecord (7.0.
|
65
|
-
activemodel (= 7.0.
|
66
|
-
activesupport (= 7.0.
|
67
|
-
activestorage (7.0.
|
68
|
-
actionpack (= 7.0.
|
69
|
-
activejob (= 7.0.
|
70
|
-
activerecord (= 7.0.
|
71
|
-
activesupport (= 7.0.
|
62
|
+
activemodel (7.0.4.2)
|
63
|
+
activesupport (= 7.0.4.2)
|
64
|
+
activerecord (7.0.4.2)
|
65
|
+
activemodel (= 7.0.4.2)
|
66
|
+
activesupport (= 7.0.4.2)
|
67
|
+
activestorage (7.0.4.2)
|
68
|
+
actionpack (= 7.0.4.2)
|
69
|
+
activejob (= 7.0.4.2)
|
70
|
+
activerecord (= 7.0.4.2)
|
71
|
+
activesupport (= 7.0.4.2)
|
72
72
|
marcel (~> 1.0)
|
73
73
|
mini_mime (>= 1.1.0)
|
74
|
-
activesupport (7.0.
|
74
|
+
activesupport (7.0.4.2)
|
75
75
|
concurrent-ruby (~> 1.0, >= 1.0.2)
|
76
76
|
i18n (>= 1.6, < 2)
|
77
77
|
minitest (>= 5.1)
|
@@ -82,75 +82,73 @@ GEM
|
|
82
82
|
thor (>= 0.14.0)
|
83
83
|
builder (3.2.4)
|
84
84
|
chunky_png (1.4.0)
|
85
|
-
concurrent-ruby (1.
|
85
|
+
concurrent-ruby (1.2.0)
|
86
86
|
crass (1.0.6)
|
87
|
+
date (3.3.3)
|
87
88
|
diff-lcs (1.5.0)
|
88
|
-
digest (3.1.0)
|
89
89
|
docile (1.4.0)
|
90
|
-
erubi (1.
|
91
|
-
globalid (1.
|
90
|
+
erubi (1.12.0)
|
91
|
+
globalid (1.1.0)
|
92
92
|
activesupport (>= 5.0)
|
93
|
-
i18n (1.
|
93
|
+
i18n (1.12.0)
|
94
94
|
concurrent-ruby (~> 1.0)
|
95
95
|
loofah (2.19.1)
|
96
96
|
crass (~> 1.0.2)
|
97
97
|
nokogiri (>= 1.5.9)
|
98
|
-
mail (2.
|
98
|
+
mail (2.8.1)
|
99
99
|
mini_mime (>= 0.1.1)
|
100
|
+
net-imap
|
101
|
+
net-pop
|
102
|
+
net-smtp
|
100
103
|
marcel (1.0.2)
|
101
104
|
method_source (1.0.0)
|
102
105
|
mini_mime (1.1.2)
|
103
|
-
minitest (5.
|
104
|
-
net-imap (0.
|
105
|
-
|
106
|
+
minitest (5.17.0)
|
107
|
+
net-imap (0.3.4)
|
108
|
+
date
|
106
109
|
net-protocol
|
107
|
-
|
108
|
-
net-pop (0.1.1)
|
109
|
-
digest
|
110
|
+
net-pop (0.1.2)
|
110
111
|
net-protocol
|
112
|
+
net-protocol (0.2.1)
|
111
113
|
timeout
|
112
|
-
net-
|
113
|
-
timeout
|
114
|
-
net-smtp (0.3.1)
|
115
|
-
digest
|
114
|
+
net-smtp (0.3.3)
|
116
115
|
net-protocol
|
117
|
-
timeout
|
118
116
|
nio4r (2.5.8)
|
119
|
-
nokogiri (1.
|
117
|
+
nokogiri (1.14.2-arm64-darwin)
|
120
118
|
racc (~> 1.4)
|
121
|
-
racc (1.6.
|
122
|
-
rack (2.2.
|
123
|
-
rack-test (
|
124
|
-
rack (>= 1.
|
125
|
-
rails (7.0.
|
126
|
-
actioncable (= 7.0.
|
127
|
-
actionmailbox (= 7.0.
|
128
|
-
actionmailer (= 7.0.
|
129
|
-
actionpack (= 7.0.
|
130
|
-
actiontext (= 7.0.
|
131
|
-
actionview (= 7.0.
|
132
|
-
activejob (= 7.0.
|
133
|
-
activemodel (= 7.0.
|
134
|
-
activerecord (= 7.0.
|
135
|
-
activestorage (= 7.0.
|
136
|
-
activesupport (= 7.0.
|
119
|
+
racc (1.6.2)
|
120
|
+
rack (2.2.6.2)
|
121
|
+
rack-test (2.0.2)
|
122
|
+
rack (>= 1.3)
|
123
|
+
rails (7.0.4.2)
|
124
|
+
actioncable (= 7.0.4.2)
|
125
|
+
actionmailbox (= 7.0.4.2)
|
126
|
+
actionmailer (= 7.0.4.2)
|
127
|
+
actionpack (= 7.0.4.2)
|
128
|
+
actiontext (= 7.0.4.2)
|
129
|
+
actionview (= 7.0.4.2)
|
130
|
+
activejob (= 7.0.4.2)
|
131
|
+
activemodel (= 7.0.4.2)
|
132
|
+
activerecord (= 7.0.4.2)
|
133
|
+
activestorage (= 7.0.4.2)
|
134
|
+
activesupport (= 7.0.4.2)
|
137
135
|
bundler (>= 1.15.0)
|
138
|
-
railties (= 7.0.
|
136
|
+
railties (= 7.0.4.2)
|
139
137
|
rails-dom-testing (2.0.3)
|
140
138
|
activesupport (>= 4.2.0)
|
141
139
|
nokogiri (>= 1.6)
|
142
|
-
rails-html-sanitizer (1.
|
140
|
+
rails-html-sanitizer (1.5.0)
|
143
141
|
loofah (~> 2.19, >= 2.19.1)
|
144
|
-
railties (7.0.
|
145
|
-
actionpack (= 7.0.
|
146
|
-
activesupport (= 7.0.
|
142
|
+
railties (7.0.4.2)
|
143
|
+
actionpack (= 7.0.4.2)
|
144
|
+
activesupport (= 7.0.4.2)
|
147
145
|
method_source
|
148
146
|
rake (>= 12.2)
|
149
147
|
thor (~> 1.0)
|
150
148
|
zeitwerk (~> 2.5)
|
151
149
|
rake (13.0.6)
|
152
|
-
rotp (6.2.
|
153
|
-
rqrcode (2.1.
|
150
|
+
rotp (6.2.2)
|
151
|
+
rqrcode (2.1.2)
|
154
152
|
chunky_png (~> 1.0)
|
155
153
|
rqrcode_core (~> 1.0)
|
156
154
|
rqrcode_core (1.2.0)
|
@@ -174,15 +172,14 @@ GEM
|
|
174
172
|
simplecov-html (0.12.3)
|
175
173
|
simplecov_json_formatter (0.1.4)
|
176
174
|
sqlite3 (1.4.2)
|
177
|
-
strscan (3.0.3)
|
178
175
|
thor (1.2.1)
|
179
|
-
timeout (0.3.
|
180
|
-
tzinfo (2.0.
|
176
|
+
timeout (0.3.2)
|
177
|
+
tzinfo (2.0.6)
|
181
178
|
concurrent-ruby (~> 1.0)
|
182
179
|
websocket-driver (0.7.5)
|
183
180
|
websocket-extensions (>= 0.1.0)
|
184
181
|
websocket-extensions (0.1.5)
|
185
|
-
zeitwerk (2.6.
|
182
|
+
zeitwerk (2.6.7)
|
186
183
|
|
187
184
|
PLATFORMS
|
188
185
|
ruby
|
@@ -28,7 +28,9 @@ module GoogleAuthenticatorRails # :nodoc:
|
|
28
28
|
end
|
29
29
|
|
30
30
|
def google_authentic?(code)
|
31
|
-
|
31
|
+
raise ArgumentError, "Can't authenticate before google secret is set!" unless google_secret_value.present?
|
32
|
+
|
33
|
+
GoogleAuthenticatorRails.valid?(code.to_s, google_secret_value, self.class.google_drift)
|
32
34
|
end
|
33
35
|
|
34
36
|
def google_qr_uri(size = nil)
|
@@ -80,6 +80,12 @@ describe GoogleAuthenticatorRails do
|
|
80
80
|
end
|
81
81
|
end
|
82
82
|
|
83
|
+
context 'integer code validation' do
|
84
|
+
subject { user.google_authentic?(code.to_i) }
|
85
|
+
|
86
|
+
it { should be true }
|
87
|
+
end
|
88
|
+
|
83
89
|
it 'creates a secret' do
|
84
90
|
user.set_google_secret
|
85
91
|
user.google_secret.should == secret
|
@@ -90,6 +96,12 @@ describe GoogleAuthenticatorRails do
|
|
90
96
|
@user.clear_google_secret!
|
91
97
|
@user.google_secret_value.should(be_nil) && @user.reload.google_secret_value.should(be_nil)
|
92
98
|
end
|
99
|
+
|
100
|
+
it 'raises exception when checking authenticity' do
|
101
|
+
@user.clear_google_secret!
|
102
|
+
|
103
|
+
expect { @user.google_authentic?(code) }.to raise_error(ArgumentError)
|
104
|
+
end
|
93
105
|
end
|
94
106
|
|
95
107
|
it_behaves_like 'handles nil secrets'
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: google-authenticator-rails
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.1
|
4
|
+
version: 3.2.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jared McFarland
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-
|
11
|
+
date: 2023-03-03 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rotp
|