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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: d4e2ae503388f1035ae5d360035105fd1c1c0162
4
- data.tar.gz: 779c34257db659c28b824352e3275c0a9b152c32
3
+ metadata.gz: 3b9c875851870f1ffd4d0afb3ceb7d906f419946
4
+ data.tar.gz: d09a871d00ea317ada9e23568d2d3c139bea24df
5
5
  SHA512:
6
- metadata.gz: 9c7a1981b30a3e9b8c841c1a8cb0becf1cf1fb3b1a5157703a946d49e2a845b8004e4832d06619bb3a690970a84070bd59b343ab8abaa8d21b1d1022d7e8e965
7
- data.tar.gz: e99d4229fc89e8a6f516998004d72bc678a0554a02533b0a9db98a6ae8a09aae6bf48d6f3ffdc5e8235e76700d0e5133863aac1690e2a18ec1105c3d6ea1f25f
6
+ metadata.gz: 0f6eb6bf80af59f6fa323342db75f0f58dad9689d546dd2c24c51e73e0862f299b432fa94a1a0340d8ad29b25b3ea3a3b41bb24e7b306de678bba3659f955b45
7
+ data.tar.gz: 23ec82660041333b9ab14121ddf08f78013befc255dc3295a2817e8f504323be7f93e6332429fd8487a8bcae1a61710d209480047d0cb61043133e9d18388866
@@ -1,3 +1,7 @@
1
+ #### 2.3.0
2
+
3
+ - Add support for TOTP MFA
4
+
1
5
  #### 2.2.0
2
6
 
3
7
  - Add Realm#jwt_algo
@@ -1,3 +1,3 @@
1
1
  module AuthRocket
2
- VERSION = '2.2.0'
2
+ VERSION = '2.3.0'
3
3
  end
@@ -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
@@ -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.2.0
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-03-20 00:00:00.000000000 Z
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.10
122
+ rubygems_version: 2.6.13
123
123
  signing_key:
124
124
  specification_version: 4
125
125
  summary: AuthRocket client for Ruby