google-authenticator-rails 3.2.0 → 3.2.1
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.
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/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
google-authenticator-rails (3.2.
|
4
|
+
google-authenticator-rails (3.2.1)
|
5
5
|
actionpack
|
6
6
|
activerecord
|
7
7
|
rails
|
@@ -103,7 +103,6 @@ GEM
|
|
103
103
|
marcel (1.0.2)
|
104
104
|
method_source (1.0.0)
|
105
105
|
mini_mime (1.1.2)
|
106
|
-
mini_portile2 (2.8.1)
|
107
106
|
minitest (5.17.0)
|
108
107
|
net-imap (0.3.4)
|
109
108
|
date
|
@@ -115,8 +114,7 @@ GEM
|
|
115
114
|
net-smtp (0.3.3)
|
116
115
|
net-protocol
|
117
116
|
nio4r (2.5.8)
|
118
|
-
nokogiri (1.14.2)
|
119
|
-
mini_portile2 (~> 2.8.0)
|
117
|
+
nokogiri (1.14.2-arm64-darwin)
|
120
118
|
racc (~> 1.4)
|
121
119
|
racc (1.6.2)
|
122
120
|
rack (2.2.6.2)
|
@@ -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.2.
|
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
|