authsignal-ruby 5.4.0 → 5.6.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.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/lib/authsignal/client.rb +14 -0
- data/lib/authsignal/version.rb +1 -1
- data/lib/authsignal.rb +8 -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: bddfd91dc4c9e2d9477c99535c59160f7338829419f63fe424c6bcd538c08be7
|
|
4
|
+
data.tar.gz: dd70996f04e540a2b0e5f854207025fc74e04c3ac78a2b0184619d41fc914b6a
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 2617321416548e639b6ecb627c88f60f1b544bea4aeb17315c7972ed15616af8e2f259f0627110c33df7e85754614e425626010b029b72008e96d6239efeb103
|
|
7
|
+
data.tar.gz: 0e73b0c2030c86ec255273b54a4e59556eca16f02c2d4c741e8dd93b1c2a4930cae9ed1f393c12a8e770d5ee13e804de7dbc2b8d46b28be3780633a3fbf18745
|
data/Gemfile.lock
CHANGED
data/lib/authsignal/client.rb
CHANGED
|
@@ -39,6 +39,16 @@ module Authsignal
|
|
|
39
39
|
end
|
|
40
40
|
end
|
|
41
41
|
|
|
42
|
+
def start_flow(action_code:, user: nil, attributes: nil, redirect_url: nil, client_id: nil)
|
|
43
|
+
body = { action_code: action_code, user: camelcase_keys(user), attributes: camelcase_keys(attributes),
|
|
44
|
+
redirect_url: redirect_url, client_id: client_id }
|
|
45
|
+
make_request(:post, 'flows', body: body)
|
|
46
|
+
end
|
|
47
|
+
|
|
48
|
+
def verify_flow(action_code:, challenge_token:)
|
|
49
|
+
make_request(:post, 'flows/verify', body: { action_code: action_code, challenge_token: challenge_token })
|
|
50
|
+
end
|
|
51
|
+
|
|
42
52
|
def get_user(user_id:)
|
|
43
53
|
path = "users/#{url_encode(user_id)}"
|
|
44
54
|
make_request(:get, path)
|
|
@@ -237,6 +247,10 @@ module Authsignal
|
|
|
237
247
|
|
|
238
248
|
private
|
|
239
249
|
|
|
250
|
+
def camelcase_keys(hash)
|
|
251
|
+
hash&.transform_keys { |key| key.to_s.gsub(/_([a-z])/) { Regexp.last_match(1).upcase } }
|
|
252
|
+
end
|
|
253
|
+
|
|
240
254
|
def url_encode(str)
|
|
241
255
|
ERB::Util.url_encode(str)
|
|
242
256
|
end
|
data/lib/authsignal/version.rb
CHANGED
data/lib/authsignal.rb
CHANGED
|
@@ -33,6 +33,14 @@ module Authsignal
|
|
|
33
33
|
@webhook ||= Webhook.new(configuration.api_secret_key)
|
|
34
34
|
end
|
|
35
35
|
|
|
36
|
+
def start_flow(**options)
|
|
37
|
+
handle_response(Client.new.start_flow(**options))
|
|
38
|
+
end
|
|
39
|
+
|
|
40
|
+
def verify_flow(action_code:, challenge_token:)
|
|
41
|
+
handle_response(Client.new.verify_flow(action_code: action_code, challenge_token: challenge_token))
|
|
42
|
+
end
|
|
43
|
+
|
|
36
44
|
def get_user(user_id:)
|
|
37
45
|
response = Client.new.get_user(user_id: user_id)
|
|
38
46
|
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: authsignal-ruby
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 5.
|
|
4
|
+
version: 5.6.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- justinsoong
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: exe
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2026-
|
|
11
|
+
date: 2026-09-23 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: faraday
|