stytch 9.3.0 → 9.4.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/b2b_organizations.rb +1 -1
- data/lib/stytch/b2b_scim.rb +1 -1
- data/lib/stytch/crypto_wallets.rb +15 -2
- data/lib/stytch/sessions.rb +64 -0
- data/lib/stytch/version.rb +1 -1
- 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: 680830d0bdb86bd92d7341d2ed07519a4a185ccaa64b7caa10d342839de88292
|
4
|
+
data.tar.gz: 2e05ae2dfb502777236daddfe88de208f8c27232144f46a7fcbc57514382a6bc
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: '0466802a5065694b7fe51d184d81f70fa869785b6578d389913781cb9d520e6195644a3911b82535cf5cff5c7c41a33ec5e85b099ce36f78e34759406c3368e7'
|
7
|
+
data.tar.gz: 5c26c228ebb6969c0ca476362b611d54ac9cfc7b0e8601640f54e5927c8900dec26c9720cfca9d2b22b8c21e4b748f84816ec17230b3b600f8343f025e1e2613
|
@@ -1108,7 +1108,7 @@ module StytchB2B
|
|
1108
1108
|
# Member's primary email address and the old primary email address is retired.
|
1109
1109
|
#
|
1110
1110
|
# A retired email address cannot be used by other Members in the same Organization. However, unlinking retired email
|
1111
|
-
# addresses allows
|
1111
|
+
# addresses allows them to be subsequently re-used by other Organization Members. Retired email addresses can be viewed
|
1112
1112
|
# on the [Member object](https://stytch.com/docs/b2b/api/member-object).
|
1113
1113
|
# %}
|
1114
1114
|
#
|
data/lib/stytch/b2b_scim.rb
CHANGED
@@ -194,7 +194,7 @@ module StytchB2B
|
|
194
194
|
# (no documentation yet)
|
195
195
|
# The type of this field is nilable +UpdateRequestIdentityProvider+ (string enum).
|
196
196
|
# scim_group_implicit_role_assignments::
|
197
|
-
#
|
197
|
+
# An array of SCIM group implicit role assignments. Each object in the array must contain a `group` and a `role_id`.
|
198
198
|
# The type of this field is nilable list of +SCIMGroupImplicitRoleAssignments+.
|
199
199
|
#
|
200
200
|
# == Returns:
|
@@ -16,7 +16,12 @@ module Stytch
|
|
16
16
|
@connection = connection
|
17
17
|
end
|
18
18
|
|
19
|
-
# Initiate the authentication of a crypto wallet. After calling this endpoint, the user will need to sign a message containing
|
19
|
+
# Initiate the authentication of a crypto wallet. After calling this endpoint, the user will need to sign a message containing the returned `challenge` field.
|
20
|
+
#
|
21
|
+
# For Ethereum crypto wallets, you can optionally use the Sign In With Ethereum (SIWE) protocol for the message by passing in the `siwe_params`. The only required fields are `domain` and `uri`.
|
22
|
+
# If the crypto wallet detects that the domain in the message does not match the website's domain, it will display a warning to the user.
|
23
|
+
#
|
24
|
+
# If not using the SIWE protocol, the message will simply consist of the project name and a random string.
|
20
25
|
#
|
21
26
|
# == Parameters:
|
22
27
|
# crypto_wallet_type::
|
@@ -34,6 +39,9 @@ module Stytch
|
|
34
39
|
# session_jwt::
|
35
40
|
# The `session_jwt` associated with a User's existing Session.
|
36
41
|
# The type of this field is nilable +String+.
|
42
|
+
# siwe_params::
|
43
|
+
# The parameters for a Sign In With Ethereum (SIWE) message. May only be passed if the `crypto_wallet_type` is `ethereum`.
|
44
|
+
# The type of this field is nilable +SIWEParams+ (+object+).
|
37
45
|
#
|
38
46
|
# == Returns:
|
39
47
|
# An object with the following fields:
|
@@ -57,7 +65,8 @@ module Stytch
|
|
57
65
|
crypto_wallet_address:,
|
58
66
|
user_id: nil,
|
59
67
|
session_token: nil,
|
60
|
-
session_jwt: nil
|
68
|
+
session_jwt: nil,
|
69
|
+
siwe_params: nil
|
61
70
|
)
|
62
71
|
headers = {}
|
63
72
|
request = {
|
@@ -67,6 +76,7 @@ module Stytch
|
|
67
76
|
request[:user_id] = user_id unless user_id.nil?
|
68
77
|
request[:session_token] = session_token unless session_token.nil?
|
69
78
|
request[:session_jwt] = session_jwt unless session_jwt.nil?
|
79
|
+
request[:siwe_params] = siwe_params unless siwe_params.nil?
|
70
80
|
|
71
81
|
post_request('/v1/crypto_wallets/authenticate/start', request, headers)
|
72
82
|
end
|
@@ -132,6 +142,9 @@ module Stytch
|
|
132
142
|
# See [GET sessions](https://stytch.com/docs/api/session-get) for complete response fields.
|
133
143
|
#
|
134
144
|
# The type of this field is nilable +Session+ (+object+).
|
145
|
+
# siwe_params::
|
146
|
+
# The parameters of the Sign In With Ethereum (SIWE) message that was signed.
|
147
|
+
# The type of this field is nilable +SIWEParamsResponse+ (+object+).
|
135
148
|
def authenticate(
|
136
149
|
crypto_wallet_type:,
|
137
150
|
crypto_wallet_address:,
|
data/lib/stytch/sessions.rb
CHANGED
@@ -156,6 +156,70 @@ module Stytch
|
|
156
156
|
post_request('/v1/sessions/revoke', request, headers)
|
157
157
|
end
|
158
158
|
|
159
|
+
# Migrate a session from an external OIDC compliant endpoint. Stytch will call the external UserInfo endpoint defined in your Stytch Project settings in the [Dashboard](/dashboard), and then perform a lookup using the `session_token`. If the response contains a valid email address, Stytch will attempt to match that email address with an existing User and create a Stytch Session. You will need to create the user before using this endpoint.
|
160
|
+
#
|
161
|
+
# == Parameters:
|
162
|
+
# session_token::
|
163
|
+
# The `session_token` associated with a User's existing Session.
|
164
|
+
# The type of this field is +String+.
|
165
|
+
# session_duration_minutes::
|
166
|
+
# Set the session lifetime to be this many minutes from now. This will start a new session if one doesn't already exist,
|
167
|
+
# returning both an opaque `session_token` and `session_jwt` for this session. Remember that the `session_jwt` will have a fixed lifetime of
|
168
|
+
# five minutes regardless of the underlying session duration, and will need to be refreshed over time.
|
169
|
+
#
|
170
|
+
# This value must be a minimum of 5 and a maximum of 527040 minutes (366 days).
|
171
|
+
#
|
172
|
+
# If a `session_token` or `session_jwt` is provided then a successful authentication will continue to extend the session this many minutes.
|
173
|
+
#
|
174
|
+
# If the `session_duration_minutes` parameter is not specified, a Stytch session will not be created.
|
175
|
+
# The type of this field is nilable +Integer+.
|
176
|
+
# session_custom_claims::
|
177
|
+
# Add a custom claims map to the Session being authenticated. Claims are only created if a Session is initialized by providing a value in `session_duration_minutes`. Claims will be included on the Session object and in the JWT. To update a key in an existing Session, supply a new value. To delete a key, supply a null value.
|
178
|
+
#
|
179
|
+
# Custom claims made with reserved claims ("iss", "sub", "aud", "exp", "nbf", "iat", "jti") will be ignored. Total custom claims size cannot exceed four kilobytes.
|
180
|
+
# The type of this field is nilable +object+.
|
181
|
+
#
|
182
|
+
# == Returns:
|
183
|
+
# An object with the following fields:
|
184
|
+
# request_id::
|
185
|
+
# Globally unique UUID that is returned with every API call. This value is important to log for debugging purposes; we may ask for this value to help identify a specific API call when helping you debug an issue.
|
186
|
+
# The type of this field is +String+.
|
187
|
+
# user_id::
|
188
|
+
# The unique ID of the affected User.
|
189
|
+
# The type of this field is +String+.
|
190
|
+
# session_token::
|
191
|
+
# A secret token for a given Stytch Session.
|
192
|
+
# The type of this field is +String+.
|
193
|
+
# session_jwt::
|
194
|
+
# The JSON Web Token (JWT) for a given Stytch Session.
|
195
|
+
# The type of this field is +String+.
|
196
|
+
# user::
|
197
|
+
# The `user` object affected by this API call. See the [Get user endpoint](https://stytch.com/docs/api/get-user) for complete response field details.
|
198
|
+
# The type of this field is +User+ (+object+).
|
199
|
+
# status_code::
|
200
|
+
# (no documentation yet)
|
201
|
+
# The type of this field is +Integer+.
|
202
|
+
# session::
|
203
|
+
# If you initiate a Session, by including `session_duration_minutes` in your authenticate call, you'll receive a full Session object in the response.
|
204
|
+
#
|
205
|
+
# See [GET sessions](https://stytch.com/docs/api/session-get) for complete response fields.
|
206
|
+
#
|
207
|
+
# The type of this field is nilable +Session+ (+object+).
|
208
|
+
def migrate(
|
209
|
+
session_token:,
|
210
|
+
session_duration_minutes: nil,
|
211
|
+
session_custom_claims: nil
|
212
|
+
)
|
213
|
+
headers = {}
|
214
|
+
request = {
|
215
|
+
session_token: session_token
|
216
|
+
}
|
217
|
+
request[:session_duration_minutes] = session_duration_minutes unless session_duration_minutes.nil?
|
218
|
+
request[:session_custom_claims] = session_custom_claims unless session_custom_claims.nil?
|
219
|
+
|
220
|
+
post_request('/v1/sessions/migrate', request, headers)
|
221
|
+
end
|
222
|
+
|
159
223
|
# Get the JSON Web Key Set (JWKS) for a project.
|
160
224
|
#
|
161
225
|
# JWKS are rotated every ~6 months. Upon rotation, new JWTs will be signed using the new key set, and both key sets will be returned by this endpoint for a period of 1 month.
|
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: 9.
|
4
|
+
version: 9.4.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- stytch
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-
|
11
|
+
date: 2024-08-01 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: faraday
|