stytch 2.4.0 → 2.5.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
  SHA256:
3
- metadata.gz: c6f511de04dc81d999863698f74e78e602ef56b0ad69ebeda06fba44d30066be
4
- data.tar.gz: 6c167abff08d5fc5c418499443bf030b95bb5d8a8a2185bb29729372abc42011
3
+ metadata.gz: 96a3001aced4c8717890e94108fa8ab11c8272f3dff64a271ec16e04fa86853d
4
+ data.tar.gz: ac4224acb1e5242c783728bdfa6ce87e5349a6488d6aee789017870e0caa9749
5
5
  SHA512:
6
- metadata.gz: 2471cf9eba300cbd8110f23a260b7e926f4fc33ed8b19af55e7c8a9f90457ec24823d95b86b3116912473cef5b45219491e445d3e83c6a1b2809fba6e7a53a6f
7
- data.tar.gz: 61e5e6e89811f4bb5ba94c1bf2c004ce411c5de6c6f3025761fb99310ded9810d5acbdbad507f8a42ef1baaafdbffdd1d1c433f3423e6e05c63c556ced63c7f2
6
+ metadata.gz: fd8d2138c34c2e4d595d6c92d6c51a0df43bd8f0709b55f5fb1536274a0b6827d2ba93e5a46d2dd843352460cd6bc4e8f321255efc8ffd649867056981f4158f
7
+ data.tar.gz: a86d8be0624be63f7be3748641962e10019a729f311c7d5579e577184e099b03bd3cdae5dea761c61bac5d6c3033a6453c9e09dccddba3cd1d3411c965c42ab5
data/lib/stytch/client.rb CHANGED
@@ -2,6 +2,7 @@
2
2
 
3
3
  require_relative 'users'
4
4
  require_relative 'magic_links'
5
+ require_relative 'oauth'
5
6
  require_relative 'otps'
6
7
  require_relative 'sessions'
7
8
 
@@ -9,7 +10,7 @@ module Stytch
9
10
  class Client
10
11
  ENVIRONMENTS = %i[live test].freeze
11
12
 
12
- attr_reader :users, :magic_links, :otps, :sessions
13
+ attr_reader :users, :magic_links, :oauth, :otps, :sessions
13
14
 
14
15
  def initialize(env:, project_id:, secret:, &block)
15
16
  @api_host = api_host(env)
@@ -20,6 +21,7 @@ module Stytch
20
21
 
21
22
  @users = Stytch::Users.new(@connection)
22
23
  @magic_links = Stytch::MagicLinks.new(@connection)
24
+ @oauth = Stytch::OAuth.new(@connection)
23
25
  @otps = Stytch::OTPs.new(@connection)
24
26
  @sessions = Stytch::Sessions.new(@connection)
25
27
  end
@@ -0,0 +1,27 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative 'request_helper'
4
+
5
+ module Stytch
6
+ class OAuth
7
+ include Stytch::RequestHelper
8
+
9
+ PATH = '/v1/oauth'
10
+
11
+ def initialize(connection)
12
+ @connection = connection
13
+ end
14
+
15
+ def authenticate(
16
+ token:,
17
+ session_management_type: nil
18
+ )
19
+ request = {
20
+ token: token
21
+ }
22
+ request[:session_management_type] = session_management_type unless session_management_type.nil?
23
+
24
+ post_request("#{PATH}/authenticate", request)
25
+ end
26
+ end
27
+ end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Stytch
4
- VERSION = '2.4.0'
4
+ VERSION = '2.5.0'
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: stytch
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.4.0
4
+ version: 2.5.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - stytch
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2021-09-10 00:00:00.000000000 Z
11
+ date: 2021-09-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday
@@ -73,6 +73,7 @@ files:
73
73
  - lib/stytch/client.rb
74
74
  - lib/stytch/magic_links.rb
75
75
  - lib/stytch/middleware.rb
76
+ - lib/stytch/oauth.rb
76
77
  - lib/stytch/otps.rb
77
78
  - lib/stytch/request_helper.rb
78
79
  - lib/stytch/sessions.rb