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 +4 -4
- data/lib/stytch/client.rb +3 -1
- data/lib/stytch/oauth.rb +27 -0
- data/lib/stytch/version.rb +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 96a3001aced4c8717890e94108fa8ab11c8272f3dff64a271ec16e04fa86853d
|
4
|
+
data.tar.gz: ac4224acb1e5242c783728bdfa6ce87e5349a6488d6aee789017870e0caa9749
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
data/lib/stytch/oauth.rb
ADDED
@@ -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
|
data/lib/stytch/version.rb
CHANGED
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
|
+
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-
|
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
|