authsignal-ruby 5.5.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 637e10c4c9869f4dba075be689b0e385b6182718f15c4e64e4de8169027f6961
4
- data.tar.gz: e5f994e7e7abad15ded0e0debaef11353b28700a4f44eeec62d3cf9c3c6ecd9a
3
+ metadata.gz: bddfd91dc4c9e2d9477c99535c59160f7338829419f63fe424c6bcd538c08be7
4
+ data.tar.gz: dd70996f04e540a2b0e5f854207025fc74e04c3ac78a2b0184619d41fc914b6a
5
5
  SHA512:
6
- metadata.gz: 8d997cc9bbac87e32ea4b0784e07bc6d57c4f7c1ed4e1ec1d7ec3632265c3d1f1ca12bde7d7b0dbecad3a0d8d6ef211057792fb152a191a8845bbb65bc2a9179
7
- data.tar.gz: d96522b1da2b775ac6ddbbdec859598aa8592f70ef2f3ec5d060bb42664adeb1f218d9cbb461ffd2eb387cd390327f80df1ab43e611b0f4a99e04489ea1759ea
6
+ metadata.gz: 2617321416548e639b6ecb627c88f60f1b544bea4aeb17315c7972ed15616af8e2f259f0627110c33df7e85754614e425626010b029b72008e96d6239efeb103
7
+ data.tar.gz: 0e73b0c2030c86ec255273b54a4e59556eca16f02c2d4c741e8dd93b1c2a4930cae9ed1f393c12a8e770d5ee13e804de7dbc2b8d46b28be3780633a3fbf18745
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- authsignal-ruby (5.5.0)
4
+ authsignal-ruby (5.6.0)
5
5
  base64
6
6
  faraday (>= 2.0.1)
7
7
  faraday-retry (~> 2.2)
@@ -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
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Authsignal
4
- VERSION = '5.5.0'
4
+ VERSION = '5.6.0'
5
5
  end
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.5.0
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-04-24 00:00:00.000000000 Z
11
+ date: 2026-09-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday