authrocket 2.2.0 → 2.3.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 +4 -0
- data/lib/authrocket/api/version.rb +1 -1
- data/lib/authrocket/app_hook.rb +1 -1
- data/lib/authrocket/credential.rb +10 -0
- data/lib/authrocket/user.rb +11 -0
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3b9c875851870f1ffd4d0afb3ceb7d906f419946
|
4
|
+
data.tar.gz: d09a871d00ea317ada9e23568d2d3c139bea24df
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0f6eb6bf80af59f6fa323342db75f0f58dad9689d546dd2c24c51e73e0862f299b432fa94a1a0340d8ad29b25b3ea3a3b41bb24e7b306de678bba3659f955b45
|
7
|
+
data.tar.gz: 23ec82660041333b9ab14121ddf08f78013befc255dc3295a2817e8f504323be7f93e6332429fd8487a8bcae1a61710d209480047d0cb61043133e9d18388866
|
data/CHANGELOG.md
CHANGED
data/lib/authrocket/app_hook.rb
CHANGED
@@ -18,7 +18,7 @@ module AuthRocket
|
|
18
18
|
realm.created realm.updated realm.deleted
|
19
19
|
user.created user.updated user.deleted
|
20
20
|
user.email.verification_requested user.email.verified
|
21
|
-
user.login.succeeded user.login.failed
|
21
|
+
user.login.succeeded user.login.failed user.login.initiated
|
22
22
|
user.password_token.created user.password_token.consumed user.password_token.failed
|
23
23
|
).sort
|
24
24
|
end
|
@@ -8,7 +8,17 @@ module AuthRocket
|
|
8
8
|
attr :credential_type
|
9
9
|
attr :api_key
|
10
10
|
attr :password, :password_confirmation
|
11
|
+
attr :name, :otp_secret, :provisioning_uri, :state
|
11
12
|
attr :access_token, :provider_user_id, :token_expires_at
|
12
13
|
|
14
|
+
|
15
|
+
# code - required
|
16
|
+
def verify(code, attribs={})
|
17
|
+
params = parse_request_params(attribs.merge(code: code), json_root: json_root).merge credentials: api_creds
|
18
|
+
parsed, _ = request(:post, url+'/verify', params)
|
19
|
+
load(parsed)
|
20
|
+
errors.empty? ? self : false
|
21
|
+
end
|
22
|
+
|
13
23
|
end
|
14
24
|
end
|
data/lib/authrocket/user.rb
CHANGED
@@ -51,6 +51,17 @@ module AuthRocket
|
|
51
51
|
new(parsed, creds)
|
52
52
|
end
|
53
53
|
|
54
|
+
# params - {username: '...', token: 'kli_...', code: '000000'}
|
55
|
+
def authenticate_code(params)
|
56
|
+
params = parse_request_params(params, json_root: json_root)
|
57
|
+
username = params[json_root].delete(:username) || '--'
|
58
|
+
parsed, creds = request(:post, "#{url}/#{CGI.escape username}/authenticate_code", params)
|
59
|
+
if parsed[:errors].any?
|
60
|
+
raise ValidationError, parsed[:errors]
|
61
|
+
end
|
62
|
+
new(parsed, creds)
|
63
|
+
end
|
64
|
+
|
54
65
|
def generate_password_token(username, params={})
|
55
66
|
params = parse_request_params(params)
|
56
67
|
parsed, creds = request(:post, "#{url}/#{CGI.escape username}/generate_password_token", params)
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: authrocket
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.
|
4
|
+
version: 2.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- AuthRocket Team
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-
|
11
|
+
date: 2017-09-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: ncore
|
@@ -119,7 +119,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
119
119
|
version: '0'
|
120
120
|
requirements: []
|
121
121
|
rubyforge_project:
|
122
|
-
rubygems_version: 2.6.
|
122
|
+
rubygems_version: 2.6.13
|
123
123
|
signing_key:
|
124
124
|
specification_version: 4
|
125
125
|
summary: AuthRocket client for Ruby
|