stytch 3.2.1 → 3.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 +4 -1
- data/lib/stytch/crypto_wallets.rb +3 -1
- data/lib/stytch/magic_links.rb +11 -3
- data/lib/stytch/oauth.rb +5 -1
- data/lib/stytch/otps.rb +3 -1
- data/lib/stytch/sessions.rb +8 -2
- data/lib/stytch/totps.rb +6 -2
- data/lib/stytch/version.rb +1 -1
- data/lib/stytch/webauthn.rb +3 -1
- metadata +7 -7
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e14a2ef2166355c60c94db8b352690af8f307c1b5dad77309d662d9bab0f0838
|
4
|
+
data.tar.gz: 2ab96922302d86fda507b7ab12ad205106ee345adf1c0a88553a8930f286b9fc
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 22569e30740820e2f3e05e960484d1d846ea6bf2f6b88dfa36e17b9ec8e2bbd90933357995370188fe79864909f4d777b526c12816029c5382ba3632553e91eb
|
7
|
+
data.tar.gz: 17c64f8bcc4374caae275fd83a6d2e2d02142b918cd428abb00298b58f7d46dbecca1fe1d3ca2bc9c69ca3f7c102f57d2f81f9d42dbf1e90c0ae4388f45c6723
|
data/lib/stytch/client.rb
CHANGED
@@ -40,8 +40,11 @@ module Stytch
|
|
40
40
|
'https://api.stytch.com'
|
41
41
|
when :test
|
42
42
|
'https://test.stytch.com'
|
43
|
+
when /\Ahttps?:\/\//
|
44
|
+
# If this is a string that looks like a URL, assume it's an internal development URL.
|
45
|
+
env
|
43
46
|
else
|
44
|
-
raise ArgumentError, "Invalid value for env (#{
|
47
|
+
raise ArgumentError, "Invalid value for env (#{env}): should be :live or :test"
|
45
48
|
end
|
46
49
|
end
|
47
50
|
|
@@ -33,7 +33,8 @@ module Stytch
|
|
33
33
|
signature:,
|
34
34
|
session_token: nil,
|
35
35
|
session_jwt: nil,
|
36
|
-
session_duration_minutes: nil
|
36
|
+
session_duration_minutes: nil,
|
37
|
+
session_custom_claims: nil
|
37
38
|
)
|
38
39
|
request = {
|
39
40
|
crypto_wallet_address: crypto_wallet_address,
|
@@ -44,6 +45,7 @@ module Stytch
|
|
44
45
|
request[:session_token] = session_token unless session_token.nil?
|
45
46
|
request[:session_jwt] = session_jwt unless session_jwt.nil?
|
46
47
|
request[:session_duration_minutes] = session_duration_minutes unless session_duration_minutes.nil?
|
48
|
+
request[:session_custom_claims] = session_custom_claims unless session_custom_claims.nil?
|
47
49
|
|
48
50
|
post_request("#{PATH}/authenticate", request)
|
49
51
|
end
|
data/lib/stytch/magic_links.rb
CHANGED
@@ -37,7 +37,9 @@ module Stytch
|
|
37
37
|
options: {},
|
38
38
|
session_token: nil,
|
39
39
|
session_jwt: nil,
|
40
|
-
session_duration_minutes: nil
|
40
|
+
session_duration_minutes: nil,
|
41
|
+
session_custom_claims: nil,
|
42
|
+
code_verifier: nil
|
41
43
|
)
|
42
44
|
request = {
|
43
45
|
token: token
|
@@ -48,6 +50,8 @@ module Stytch
|
|
48
50
|
request[:session_token] = session_token unless session_token.nil?
|
49
51
|
request[:session_jwt] = session_jwt unless session_jwt.nil?
|
50
52
|
request[:session_duration_minutes] = session_duration_minutes unless session_duration_minutes.nil?
|
53
|
+
request[:session_custom_claims] = session_custom_claims unless session_custom_claims.nil?
|
54
|
+
request[:code_verifier] = code_verifier unless code_verifier.nil?
|
51
55
|
|
52
56
|
post_request("#{PATH}/authenticate", request)
|
53
57
|
end
|
@@ -67,7 +71,8 @@ module Stytch
|
|
67
71
|
signup_magic_link_url: nil,
|
68
72
|
login_expiration_minutes: nil,
|
69
73
|
signup_expiration_minutes: nil,
|
70
|
-
attributes: {}
|
74
|
+
attributes: {},
|
75
|
+
code_challenge: nil
|
71
76
|
)
|
72
77
|
request = {
|
73
78
|
email: email
|
@@ -78,6 +83,7 @@ module Stytch
|
|
78
83
|
request[:login_expiration_minutes] = login_expiration_minutes unless login_expiration_minutes.nil?
|
79
84
|
request[:signup_expiration_minutes] = signup_expiration_minutes unless signup_expiration_minutes.nil?
|
80
85
|
request[:attributes] = attributes if attributes != {}
|
86
|
+
request[:code_challenge] = code_challenge unless code_challenge.nil?
|
81
87
|
|
82
88
|
post_request("#{PATH}/send", request)
|
83
89
|
end
|
@@ -89,7 +95,8 @@ module Stytch
|
|
89
95
|
login_expiration_minutes: nil,
|
90
96
|
signup_expiration_minutes: nil,
|
91
97
|
attributes: {},
|
92
|
-
create_user_as_pending: false
|
98
|
+
create_user_as_pending: false,
|
99
|
+
code_challenge: nil
|
93
100
|
)
|
94
101
|
request = {
|
95
102
|
email: email,
|
@@ -101,6 +108,7 @@ module Stytch
|
|
101
108
|
request[:login_expiration_minutes] = login_expiration_minutes unless login_expiration_minutes.nil?
|
102
109
|
request[:signup_expiration_minutes] = signup_expiration_minutes unless signup_expiration_minutes.nil?
|
103
110
|
request[:attributes] = attributes if attributes != {}
|
111
|
+
request[:code_challenge] = code_challenge unless code_challenge.nil?
|
104
112
|
|
105
113
|
post_request("#{PATH}/login_or_create", request)
|
106
114
|
end
|
data/lib/stytch/oauth.rb
CHANGED
@@ -16,7 +16,9 @@ module Stytch
|
|
16
16
|
token:,
|
17
17
|
session_token: nil,
|
18
18
|
session_jwt: nil,
|
19
|
-
session_duration_minutes: nil
|
19
|
+
session_duration_minutes: nil,
|
20
|
+
session_custom_claims: nil,
|
21
|
+
code_verifier: nil
|
20
22
|
)
|
21
23
|
request = {
|
22
24
|
token: token
|
@@ -24,6 +26,8 @@ module Stytch
|
|
24
26
|
request[:session_token] = session_token unless session_token.nil?
|
25
27
|
request[:session_jwt] = session_jwt unless session_jwt.nil?
|
26
28
|
request[:session_duration_minutes] = session_duration_minutes unless session_duration_minutes.nil?
|
29
|
+
request[:session_custom_claims] = session_custom_claims unless session_custom_claims.nil?
|
30
|
+
request[:code_verifier] = code_verifier unless code_verifier.nil?
|
27
31
|
|
28
32
|
post_request("#{PATH}/authenticate", request)
|
29
33
|
end
|
data/lib/stytch/otps.rb
CHANGED
@@ -25,7 +25,8 @@ module Stytch
|
|
25
25
|
options: {},
|
26
26
|
session_token: nil,
|
27
27
|
session_jwt: nil,
|
28
|
-
session_duration_minutes: nil
|
28
|
+
session_duration_minutes: nil,
|
29
|
+
session_custom_claims: nil
|
29
30
|
)
|
30
31
|
request = {
|
31
32
|
method_id: method_id,
|
@@ -37,6 +38,7 @@ module Stytch
|
|
37
38
|
request[:session_token] = session_token unless session_token.nil?
|
38
39
|
request[:session_jwt] = session_jwt unless session_jwt.nil?
|
39
40
|
request[:session_duration_minutes] = session_duration_minutes unless session_duration_minutes.nil?
|
41
|
+
request[:session_custom_claims] = session_custom_claims unless session_custom_claims.nil?
|
40
42
|
|
41
43
|
post_request("#{PATH}/authenticate", request)
|
42
44
|
end
|
data/lib/stytch/sessions.rb
CHANGED
@@ -33,13 +33,15 @@ module Stytch
|
|
33
33
|
def authenticate(
|
34
34
|
session_token: nil,
|
35
35
|
session_jwt: nil,
|
36
|
-
session_duration_minutes: nil
|
36
|
+
session_duration_minutes: nil,
|
37
|
+
session_custom_claims: nil
|
37
38
|
)
|
38
39
|
request = {}
|
39
40
|
|
40
41
|
request[:session_token] = session_token unless session_token.nil?
|
41
42
|
request[:session_jwt] = session_jwt unless session_jwt.nil?
|
42
43
|
request[:session_duration_minutes] = session_duration_minutes unless session_duration_minutes.nil?
|
44
|
+
request[:session_custom_claims] = session_custom_claims unless session_custom_claims.nil?
|
43
45
|
|
44
46
|
post_request("#{PATH}/authenticate", request)
|
45
47
|
end
|
@@ -68,12 +70,14 @@ module Stytch
|
|
68
70
|
def authenticate_jwt(
|
69
71
|
session_jwt,
|
70
72
|
max_token_age_seconds: nil,
|
71
|
-
session_duration_minutes: nil
|
73
|
+
session_duration_minutes: nil,
|
74
|
+
session_custom_claims: nil
|
72
75
|
)
|
73
76
|
if max_token_age_seconds == 0
|
74
77
|
return authenticate(
|
75
78
|
session_jwt: session_jwt,
|
76
79
|
session_duration_minutes: session_duration_minutes,
|
80
|
+
session_custom_claims: session_custom_claims,
|
77
81
|
)
|
78
82
|
end
|
79
83
|
|
@@ -86,6 +90,7 @@ module Stytch
|
|
86
90
|
return authenticate(
|
87
91
|
session_jwt: session_jwt,
|
88
92
|
session_duration_minutes: session_duration_minutes,
|
93
|
+
session_custom_claims: session_custom_claims,
|
89
94
|
)
|
90
95
|
end
|
91
96
|
rescue StandardError
|
@@ -93,6 +98,7 @@ module Stytch
|
|
93
98
|
return authenticate(
|
94
99
|
session_jwt: session_jwt,
|
95
100
|
session_duration_minutes: session_duration_minutes,
|
101
|
+
session_custom_claims: session_custom_claims,
|
96
102
|
)
|
97
103
|
end
|
98
104
|
|
data/lib/stytch/totps.rb
CHANGED
@@ -30,7 +30,8 @@ module Stytch
|
|
30
30
|
totp_code:,
|
31
31
|
session_token: nil,
|
32
32
|
session_jwt: nil,
|
33
|
-
session_duration_minutes: nil
|
33
|
+
session_duration_minutes: nil,
|
34
|
+
session_custom_claims: nil
|
34
35
|
)
|
35
36
|
request = {
|
36
37
|
user_id: user_id,
|
@@ -40,6 +41,7 @@ module Stytch
|
|
40
41
|
request[:session_token] = session_token unless session_token.nil?
|
41
42
|
request[:session_jwt] = session_jwt unless session_jwt.nil?
|
42
43
|
request[:session_duration_minutes] = session_duration_minutes unless session_duration_minutes.nil?
|
44
|
+
request[:session_custom_claims] = session_custom_claims unless session_custom_claims.nil?
|
43
45
|
|
44
46
|
post_request("#{PATH}/authenticate", request)
|
45
47
|
end
|
@@ -59,7 +61,8 @@ module Stytch
|
|
59
61
|
recovery_code:,
|
60
62
|
session_token: nil,
|
61
63
|
session_jwt: nil,
|
62
|
-
session_duration_minutes: nil
|
64
|
+
session_duration_minutes: nil,
|
65
|
+
session_custom_claims: nil
|
63
66
|
)
|
64
67
|
request = {
|
65
68
|
user_id: user_id,
|
@@ -69,6 +72,7 @@ module Stytch
|
|
69
72
|
request[:session_token] = session_token unless session_token.nil?
|
70
73
|
request[:session_jwt] = session_jwt unless session_jwt.nil?
|
71
74
|
request[:session_duration_minutes] = session_duration_minutes unless session_duration_minutes.nil?
|
75
|
+
request[:session_custom_claims] = session_custom_claims unless session_custom_claims.nil?
|
72
76
|
|
73
77
|
post_request("#{PATH}/recover", request)
|
74
78
|
end
|
data/lib/stytch/version.rb
CHANGED
data/lib/stytch/webauthn.rb
CHANGED
@@ -57,7 +57,8 @@ module Stytch
|
|
57
57
|
public_key_credential:,
|
58
58
|
session_token: nil,
|
59
59
|
session_jwt: nil,
|
60
|
-
session_duration_minutes: nil
|
60
|
+
session_duration_minutes: nil,
|
61
|
+
session_custom_claims: nil
|
61
62
|
)
|
62
63
|
request = {
|
63
64
|
public_key_credential: public_key_credential
|
@@ -66,6 +67,7 @@ module Stytch
|
|
66
67
|
request[:session_token] = session_token unless session_token.nil?
|
67
68
|
request[:session_jwt] = session_jwt unless session_jwt.nil?
|
68
69
|
request[:session_duration_minutes] = session_duration_minutes unless session_duration_minutes.nil?
|
70
|
+
request[:session_custom_claims] = session_custom_claims unless session_custom_claims.nil?
|
69
71
|
|
70
72
|
post_request("#{PATH}/authenticate", request)
|
71
73
|
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: 3.
|
4
|
+
version: 3.5.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- stytch
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-
|
11
|
+
date: 2022-07-01 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: faraday
|
@@ -92,7 +92,7 @@ dependencies:
|
|
92
92
|
- - ">="
|
93
93
|
- !ruby/object:Gem::Version
|
94
94
|
version: 3.5.3
|
95
|
-
description:
|
95
|
+
description:
|
96
96
|
email:
|
97
97
|
- support@stytch.com
|
98
98
|
executables: []
|
@@ -132,7 +132,7 @@ licenses:
|
|
132
132
|
metadata:
|
133
133
|
homepage_uri: https://stytch.com
|
134
134
|
source_code_uri: https://github.com/stytchauth/stytch-ruby
|
135
|
-
post_install_message:
|
135
|
+
post_install_message:
|
136
136
|
rdoc_options: []
|
137
137
|
require_paths:
|
138
138
|
- lib
|
@@ -147,8 +147,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
147
147
|
- !ruby/object:Gem::Version
|
148
148
|
version: '0'
|
149
149
|
requirements: []
|
150
|
-
rubygems_version: 3.
|
151
|
-
signing_key:
|
150
|
+
rubygems_version: 3.0.3
|
151
|
+
signing_key:
|
152
152
|
specification_version: 4
|
153
153
|
summary: Stytch Ruby Gem
|
154
154
|
test_files: []
|