stytch 7.7.0 → 7.8.1
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_scim.rb +43 -8
- data/lib/stytch/b2b_sessions.rb +71 -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: ff5a6a36c47c302ec6cbcd712b1c428d392caccc0d423973130c209389a9064a
|
4
|
+
data.tar.gz: 4eccfd119a8f6b3332c37bbe317eeece7b4dd67f2ee06af0f09ba2ce548cee06
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 17200c052d42d517aaa02cf295f23799c8c9a4ccc68499277ec135cca853f9be061909fc8f4ff9e79e048c3d889312491d5d663be1df940d2619940a65f21663
|
7
|
+
data.tar.gz: 360d26af098aa0921781902493f669cef749d098cb2e71f0d2425eb027a40c4ea669ec4b4c1f754a0579f74de174bb01c4140415baddcb39adc16038894f98fc
|
data/lib/stytch/b2b_scim.rb
CHANGED
@@ -56,14 +56,19 @@ module StytchB2B
|
|
56
56
|
# connection::
|
57
57
|
# The `SAML Connection` object affected by this API call. See the [SAML Connection Object](https://stytch.com/docs/b2b/api/saml-connection-object) for complete response field details.
|
58
58
|
# The type of this field is nilable +SCIMConnection+ (+object+).
|
59
|
+
#
|
60
|
+
# == Method Options:
|
61
|
+
# This method supports an optional +UpdateRequestOptions+ object which will modify the headers sent in the HTTP request.
|
59
62
|
def update(
|
60
63
|
organization_id:,
|
61
64
|
connection_id:,
|
62
65
|
display_name: nil,
|
63
66
|
identity_provider: nil,
|
64
|
-
scim_group_implicit_role_assignments: nil
|
67
|
+
scim_group_implicit_role_assignments: nil,
|
68
|
+
method_options: nil
|
65
69
|
)
|
66
70
|
headers = {}
|
71
|
+
headers = headers.merge(method_options.to_headers) unless method_options.nil?
|
67
72
|
request = {}
|
68
73
|
request[:display_name] = display_name unless display_name.nil?
|
69
74
|
request[:identity_provider] = identity_provider unless identity_provider.nil?
|
@@ -79,7 +84,7 @@ module StytchB2B
|
|
79
84
|
# Globally unique UUID that identifies a specific Organization. The `organization_id` is critical to perform operations on an Organization, so be sure to preserve this value.
|
80
85
|
# The type of this field is +String+.
|
81
86
|
# connection_id::
|
82
|
-
#
|
87
|
+
# The ID of the SCIM connection.
|
83
88
|
# The type of this field is +String+.
|
84
89
|
#
|
85
90
|
# == Returns:
|
@@ -93,11 +98,16 @@ module StytchB2B
|
|
93
98
|
# status_code::
|
94
99
|
# The HTTP status code of the response. Stytch follows standard HTTP response status code patterns, e.g. 2XX values equate to success, 3XX values are redirects, 4XX are client errors, and 5XX are server errors.
|
95
100
|
# The type of this field is +Integer+.
|
101
|
+
#
|
102
|
+
# == Method Options:
|
103
|
+
# This method supports an optional +DeleteRequestOptions+ object which will modify the headers sent in the HTTP request.
|
96
104
|
def delete(
|
97
105
|
organization_id:,
|
98
|
-
connection_id
|
106
|
+
connection_id:,
|
107
|
+
method_options: nil
|
99
108
|
)
|
100
109
|
headers = {}
|
110
|
+
headers = headers.merge(method_options.to_headers) unless method_options.nil?
|
101
111
|
delete_request("/v1/b2b/scim/#{organization_id}/connections/#{connection_id}", headers)
|
102
112
|
end
|
103
113
|
|
@@ -122,11 +132,16 @@ module StytchB2B
|
|
122
132
|
# connection::
|
123
133
|
# The `SCIM Connection` object affected by this API call. See the [SCIM Connection Object](https://stytch.com/docs/b2b/api/scim-connection-object) for complete response field details.
|
124
134
|
# The type of this field is nilable +SCIMConnectionWithNextToken+ (+object+).
|
135
|
+
#
|
136
|
+
# == Method Options:
|
137
|
+
# This method supports an optional +RotateStartRequestOptions+ object which will modify the headers sent in the HTTP request.
|
125
138
|
def rotate_start(
|
126
139
|
organization_id:,
|
127
|
-
connection_id
|
140
|
+
connection_id:,
|
141
|
+
method_options: nil
|
128
142
|
)
|
129
143
|
headers = {}
|
144
|
+
headers = headers.merge(method_options.to_headers) unless method_options.nil?
|
130
145
|
request = {}
|
131
146
|
|
132
147
|
post_request("/v1/b2b/scim/#{organization_id}/connections/#{connection_id}/rotate/start", request, headers)
|
@@ -153,11 +168,16 @@ module StytchB2B
|
|
153
168
|
# connection::
|
154
169
|
# The `SCIM Connection` object affected by this API call. See the [SCIM Connection Object](https://stytch.com/docs/b2b/api/scim-connection-object) for complete response field details.
|
155
170
|
# The type of this field is nilable +SCIMConnection+ (+object+).
|
171
|
+
#
|
172
|
+
# == Method Options:
|
173
|
+
# This method supports an optional +RotateCompleteRequestOptions+ object which will modify the headers sent in the HTTP request.
|
156
174
|
def rotate_complete(
|
157
175
|
organization_id:,
|
158
|
-
connection_id
|
176
|
+
connection_id:,
|
177
|
+
method_options: nil
|
159
178
|
)
|
160
179
|
headers = {}
|
180
|
+
headers = headers.merge(method_options.to_headers) unless method_options.nil?
|
161
181
|
request = {}
|
162
182
|
|
163
183
|
post_request("/v1/b2b/scim/#{organization_id}/connections/#{connection_id}/rotate/complete", request, headers)
|
@@ -184,11 +204,16 @@ module StytchB2B
|
|
184
204
|
# connection::
|
185
205
|
# The `SCIM Connection` object affected by this API call. See the [SCIM Connection Object](https://stytch.com/docs/b2b/api/scim-connection-object) for complete response field details.
|
186
206
|
# The type of this field is nilable +SCIMConnection+ (+object+).
|
207
|
+
#
|
208
|
+
# == Method Options:
|
209
|
+
# This method supports an optional +RotateCancelRequestOptions+ object which will modify the headers sent in the HTTP request.
|
187
210
|
def rotate_cancel(
|
188
211
|
organization_id:,
|
189
|
-
connection_id
|
212
|
+
connection_id:,
|
213
|
+
method_options: nil
|
190
214
|
)
|
191
215
|
headers = {}
|
216
|
+
headers = headers.merge(method_options.to_headers) unless method_options.nil?
|
192
217
|
request = {}
|
193
218
|
|
194
219
|
post_request("/v1/b2b/scim/#{organization_id}/connections/#{connection_id}/rotate/cancel", request, headers)
|
@@ -218,12 +243,17 @@ module StytchB2B
|
|
218
243
|
# connection::
|
219
244
|
# The `SCIM Connection` object affected by this API call. See the [SCIM Connection Object](https://stytch.com/docs/b2b/api/scim-connection-object) for complete response field details.
|
220
245
|
# The type of this field is nilable +SCIMConnectionWithToken+ (+object+).
|
246
|
+
#
|
247
|
+
# == Method Options:
|
248
|
+
# This method supports an optional +CreateRequestOptions+ object which will modify the headers sent in the HTTP request.
|
221
249
|
def create(
|
222
250
|
organization_id:,
|
223
251
|
display_name: nil,
|
224
|
-
identity_provider: nil
|
252
|
+
identity_provider: nil,
|
253
|
+
method_options: nil
|
225
254
|
)
|
226
255
|
headers = {}
|
256
|
+
headers = headers.merge(method_options.to_headers) unless method_options.nil?
|
227
257
|
request = {}
|
228
258
|
request[:display_name] = display_name unless display_name.nil?
|
229
259
|
request[:identity_provider] = identity_provider unless identity_provider.nil?
|
@@ -249,10 +279,15 @@ module StytchB2B
|
|
249
279
|
# status_code::
|
250
280
|
# The HTTP status code of the response. Stytch follows standard HTTP response status code patterns, e.g. 2XX values equate to success, 3XX values are redirects, 4XX are client errors, and 5XX are server errors.
|
251
281
|
# The type of this field is +Integer+.
|
282
|
+
#
|
283
|
+
# == Method Options:
|
284
|
+
# This method supports an optional +GetRequestOptions+ object which will modify the headers sent in the HTTP request.
|
252
285
|
def get(
|
253
|
-
organization_id
|
286
|
+
organization_id:,
|
287
|
+
method_options: nil
|
254
288
|
)
|
255
289
|
headers = {}
|
290
|
+
headers = headers.merge(method_options.to_headers) unless method_options.nil?
|
256
291
|
query_params = {}
|
257
292
|
request = request_with_query_params("/v1/b2b/scim/#{organization_id}/connections", query_params)
|
258
293
|
get_request(request, headers)
|
data/lib/stytch/b2b_sessions.rb
CHANGED
@@ -316,6 +316,77 @@ module StytchB2B
|
|
316
316
|
post_request('/v1/b2b/sessions/exchange', request, headers)
|
317
317
|
end
|
318
318
|
|
319
|
+
# 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 a Member in your Organization and create a Stytch Session.
|
320
|
+
#
|
321
|
+
# == Parameters:
|
322
|
+
# session_token::
|
323
|
+
# The authorization token Stytch will pass in to the external userinfo endpoint.
|
324
|
+
# The type of this field is +String+.
|
325
|
+
# organization_id::
|
326
|
+
# Globally unique UUID that identifies a specific Organization. The `organization_id` is critical to perform operations on an Organization, so be sure to preserve this value.
|
327
|
+
# The type of this field is +String+.
|
328
|
+
# session_duration_minutes::
|
329
|
+
# Set the session lifetime to be this many minutes from now. This will start a new session if one doesn't already exist,
|
330
|
+
# returning both an opaque `session_token` and `session_jwt` for this session. Remember that the `session_jwt` will have a fixed lifetime of
|
331
|
+
# five minutes regardless of the underlying session duration, and will need to be refreshed over time.
|
332
|
+
#
|
333
|
+
# This value must be a minimum of 5 and a maximum of 527040 minutes (366 days).
|
334
|
+
#
|
335
|
+
# If a `session_token` or `session_jwt` is provided then a successful authentication will continue to extend the session this many minutes.
|
336
|
+
#
|
337
|
+
# If the `session_duration_minutes` parameter is not specified, a Stytch session will be created with a 60 minute duration. If you don't want
|
338
|
+
# to use the Stytch session product, you can ignore the session fields in the response.
|
339
|
+
# The type of this field is nilable +Integer+.
|
340
|
+
# session_custom_claims::
|
341
|
+
# Add a custom claims map to the Session being authenticated. Claims are only created if a Session is initialized by providing a value in
|
342
|
+
# `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
|
343
|
+
# delete a key, supply a null value. Custom claims made with reserved claims (`iss`, `sub`, `aud`, `exp`, `nbf`, `iat`, `jti`) will be ignored.
|
344
|
+
# Total custom claims size cannot exceed four kilobytes.
|
345
|
+
# The type of this field is nilable +object+.
|
346
|
+
#
|
347
|
+
# == Returns:
|
348
|
+
# An object with the following fields:
|
349
|
+
# request_id::
|
350
|
+
# 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.
|
351
|
+
# The type of this field is +String+.
|
352
|
+
# member_id::
|
353
|
+
# Globally unique UUID that identifies a specific Member.
|
354
|
+
# The type of this field is +String+.
|
355
|
+
# session_token::
|
356
|
+
# A secret token for a given Stytch Session.
|
357
|
+
# The type of this field is +String+.
|
358
|
+
# session_jwt::
|
359
|
+
# The JSON Web Token (JWT) for a given Stytch Session.
|
360
|
+
# The type of this field is +String+.
|
361
|
+
# member::
|
362
|
+
# The [Member object](https://stytch.com/docs/b2b/api/member-object)
|
363
|
+
# The type of this field is +Member+ (+object+).
|
364
|
+
# organization::
|
365
|
+
# The [Organization object](https://stytch.com/docs/b2b/api/organization-object).
|
366
|
+
# The type of this field is +Organization+ (+object+).
|
367
|
+
# status_code::
|
368
|
+
# (no documentation yet)
|
369
|
+
# The type of this field is +Integer+.
|
370
|
+
# member_session::
|
371
|
+
# The [Session object](https://stytch.com/docs/b2b/api/session-object).
|
372
|
+
# The type of this field is nilable +MemberSession+ (+object+).
|
373
|
+
def migrate(
|
374
|
+
session_token:,
|
375
|
+
organization_id:,
|
376
|
+
session_duration_minutes: nil,
|
377
|
+
session_custom_claims: nil
|
378
|
+
)
|
379
|
+
headers = {}
|
380
|
+
request = {
|
381
|
+
session_token: session_token,
|
382
|
+
organization_id: organization_id
|
383
|
+
}
|
384
|
+
request[:session_duration_minutes] = session_duration_minutes unless session_duration_minutes.nil?
|
385
|
+
request[:session_custom_claims] = session_custom_claims unless session_custom_claims.nil?
|
386
|
+
|
387
|
+
post_request('/v1/b2b/sessions/migrate', request, headers)
|
388
|
+
end
|
389
|
+
|
319
390
|
# Get the JSON Web Key Set (JWKS) for a project.
|
320
391
|
#
|
321
392
|
# 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: 7.
|
4
|
+
version: 7.8.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- stytch
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-04-
|
11
|
+
date: 2024-04-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: faraday
|