stytch 10.7.0 → 10.9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/stytch/b2b_impersonation.rb +2 -0
- data/lib/stytch/b2b_organizations.rb +11 -1
- data/lib/stytch/b2b_passwords.rb +18 -8
- data/lib/stytch/b2b_sessions.rb +71 -0
- data/lib/stytch/impersonation.rb +2 -0
- data/lib/stytch/m2m.rb +1 -2
- data/lib/stytch/version.rb +1 -1
- data/lib/stytch/webauthn.rb +13 -0
- 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: 37ef91117acc932dce839f2a5257f0b6ae2b309db949faf7890940bd423e291f
|
4
|
+
data.tar.gz: a0eec3c205a40bc02f223b76ddc9a6f6f46f34fed374d6bf1dd78bdd108df886
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 74f3f9ca261c3621f9d71bcb924468955f75f8578fb0877f864687df1f7516e4a2aa777e6f76ed34b98661427e0bd412867ad47b3482960bda5617a7fc57fc82
|
7
|
+
data.tar.gz: 1f4c5375484f88c0ade67f85a91f70d2a7e54ca04341ebc30cf7d125860f266c39c7388c78ab9b0047e28e0644133305455ff715cd4cea36d8d74413a02cbce3
|
@@ -19,6 +19,8 @@ module StytchB2B
|
|
19
19
|
# Authenticate an impersonation token to impersonate a. This endpoint requires an impersonation token that is not expired or previously used.
|
20
20
|
# A Stytch session will be created for the impersonated member with a 60 minute duration. Impersonated sessions cannot be extended.
|
21
21
|
#
|
22
|
+
# Prior to this step, you can generate an impersonation token by visiting the Stytch dashboard, viewing a member, and clicking the `Impersonate Member` button.
|
23
|
+
#
|
22
24
|
# == Parameters:
|
23
25
|
# impersonation_token::
|
24
26
|
# The User Impersonation token to authenticate.
|
@@ -161,6 +161,9 @@ module StytchB2B
|
|
161
161
|
# allowed_oauth_tenants::
|
162
162
|
# A map of allowed OAuth tenants. If this field is not passed in, the Organization will not allow JIT provisioning by OAuth Tenant. Allowed keys are "slack", "hubspot", and "github".
|
163
163
|
# The type of this field is nilable +object+.
|
164
|
+
# claimed_email_domains::
|
165
|
+
# A list of email domains that are claimed by the Organization.
|
166
|
+
# The type of this field is nilable list of +String+.
|
164
167
|
#
|
165
168
|
# == Returns:
|
166
169
|
# An object with the following fields:
|
@@ -189,7 +192,8 @@ module StytchB2B
|
|
189
192
|
mfa_methods: nil,
|
190
193
|
allowed_mfa_methods: nil,
|
191
194
|
oauth_tenant_jit_provisioning: nil,
|
192
|
-
allowed_oauth_tenants: nil
|
195
|
+
allowed_oauth_tenants: nil,
|
196
|
+
claimed_email_domains: nil
|
193
197
|
)
|
194
198
|
headers = {}
|
195
199
|
request = {
|
@@ -210,6 +214,7 @@ module StytchB2B
|
|
210
214
|
request[:allowed_mfa_methods] = allowed_mfa_methods unless allowed_mfa_methods.nil?
|
211
215
|
request[:oauth_tenant_jit_provisioning] = oauth_tenant_jit_provisioning unless oauth_tenant_jit_provisioning.nil?
|
212
216
|
request[:allowed_oauth_tenants] = allowed_oauth_tenants unless allowed_oauth_tenants.nil?
|
217
|
+
request[:claimed_email_domains] = claimed_email_domains unless claimed_email_domains.nil?
|
213
218
|
|
214
219
|
post_request('/v1/b2b/organizations', request, headers)
|
215
220
|
end
|
@@ -389,6 +394,9 @@ module StytchB2B
|
|
389
394
|
#
|
390
395
|
# If this field is provided and a session header is passed into the request, the Member Session must have permission to perform the `update.settings.allowed-oauth-tenants` action on the `stytch.organization` Resource.
|
391
396
|
# The type of this field is nilable +object+.
|
397
|
+
# claimed_email_domains::
|
398
|
+
# A list of email domains that are claimed by the Organization.
|
399
|
+
# The type of this field is nilable list of +String+.
|
392
400
|
#
|
393
401
|
# == Returns:
|
394
402
|
# An object with the following fields:
|
@@ -424,6 +432,7 @@ module StytchB2B
|
|
424
432
|
allowed_mfa_methods: nil,
|
425
433
|
oauth_tenant_jit_provisioning: nil,
|
426
434
|
allowed_oauth_tenants: nil,
|
435
|
+
claimed_email_domains: nil,
|
427
436
|
method_options: nil
|
428
437
|
)
|
429
438
|
headers = {}
|
@@ -447,6 +456,7 @@ module StytchB2B
|
|
447
456
|
request[:allowed_mfa_methods] = allowed_mfa_methods unless allowed_mfa_methods.nil?
|
448
457
|
request[:oauth_tenant_jit_provisioning] = oauth_tenant_jit_provisioning unless oauth_tenant_jit_provisioning.nil?
|
449
458
|
request[:allowed_oauth_tenants] = allowed_oauth_tenants unless allowed_oauth_tenants.nil?
|
459
|
+
request[:claimed_email_domains] = claimed_email_domains unless claimed_email_domains.nil?
|
450
460
|
|
451
461
|
put_request("/v1/b2b/organizations/#{organization_id}", request, headers)
|
452
462
|
end
|
data/lib/stytch/b2b_passwords.rb
CHANGED
@@ -406,6 +406,9 @@ module StytchB2B
|
|
406
406
|
# reset_password_template_id::
|
407
407
|
# Use a custom template for reset password emails. By default, it will use your default email template. The template must be a template using our built-in customizations or a custom HTML email for Magic Links - Reset Password.
|
408
408
|
# The type of this field is nilable +String+.
|
409
|
+
# verify_email_template_id::
|
410
|
+
# (no documentation yet)
|
411
|
+
# The type of this field is nilable +String+.
|
409
412
|
#
|
410
413
|
# == Returns:
|
411
414
|
# An object with the following fields:
|
@@ -432,7 +435,8 @@ module StytchB2B
|
|
432
435
|
code_challenge: nil,
|
433
436
|
login_redirect_url: nil,
|
434
437
|
locale: nil,
|
435
|
-
reset_password_template_id: nil
|
438
|
+
reset_password_template_id: nil,
|
439
|
+
verify_email_template_id: nil
|
436
440
|
)
|
437
441
|
headers = {}
|
438
442
|
request = {
|
@@ -445,6 +449,7 @@ module StytchB2B
|
|
445
449
|
request[:login_redirect_url] = login_redirect_url unless login_redirect_url.nil?
|
446
450
|
request[:locale] = locale unless locale.nil?
|
447
451
|
request[:reset_password_template_id] = reset_password_template_id unless reset_password_template_id.nil?
|
452
|
+
request[:verify_email_template_id] = verify_email_template_id unless verify_email_template_id.nil?
|
448
453
|
|
449
454
|
post_request('/v1/b2b/passwords/email/reset/start', request, headers)
|
450
455
|
end
|
@@ -596,18 +601,18 @@ module StytchB2B
|
|
596
601
|
#
|
597
602
|
# == Returns:
|
598
603
|
# An object with the following fields:
|
599
|
-
# member::
|
600
|
-
# The [Member object](https://stytch.com/docs/b2b/api/member-object)
|
601
|
-
# The type of this field is +Member+ (+object+).
|
602
|
-
# organization::
|
603
|
-
# The [Organization object](https://stytch.com/docs/b2b/api/organization-object).
|
604
|
-
# The type of this field is +Organization+ (+object+).
|
605
604
|
# status_code::
|
606
605
|
# 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.
|
607
606
|
# The type of this field is +Integer+.
|
608
607
|
# member_id::
|
609
608
|
# Globally unique UUID that identifies a specific Member.
|
610
609
|
# The type of this field is nilable +String+.
|
610
|
+
# member::
|
611
|
+
# The [Member object](https://stytch.com/docs/b2b/api/member-object)
|
612
|
+
# The type of this field is nilable +Member+ (+object+).
|
613
|
+
# organization::
|
614
|
+
# The [Organization object](https://stytch.com/docs/b2b/api/organization-object).
|
615
|
+
# The type of this field is nilable +Organization+ (+object+).
|
611
616
|
#
|
612
617
|
# == Method Options:
|
613
618
|
# This method supports an optional +StytchB2B::Passwords::Email::RequireResetRequestOptions+ object which will modify the headers sent in the HTTP request.
|
@@ -984,6 +989,9 @@ module StytchB2B
|
|
984
989
|
# Request support for additional languages [here](https://docs.google.com/forms/d/e/1FAIpQLScZSpAu_m2AmLXRT3F3kap-s_mcV6UTBitYn6CdyWP0-o7YjQ/viewform?usp=sf_link")!
|
985
990
|
#
|
986
991
|
# The type of this field is nilable +String+.
|
992
|
+
# verify_email_template_id::
|
993
|
+
# (no documentation yet)
|
994
|
+
# The type of this field is nilable +String+.
|
987
995
|
#
|
988
996
|
# == Returns:
|
989
997
|
# An object with the following fields:
|
@@ -1000,7 +1008,8 @@ module StytchB2B
|
|
1000
1008
|
reset_password_template_id: nil,
|
1001
1009
|
reset_password_expiration_minutes: nil,
|
1002
1010
|
pkce_code_challenge: nil,
|
1003
|
-
locale: nil
|
1011
|
+
locale: nil,
|
1012
|
+
verify_email_template_id: nil
|
1004
1013
|
)
|
1005
1014
|
headers = {}
|
1006
1015
|
request = {
|
@@ -1012,6 +1021,7 @@ module StytchB2B
|
|
1012
1021
|
request[:reset_password_expiration_minutes] = reset_password_expiration_minutes unless reset_password_expiration_minutes.nil?
|
1013
1022
|
request[:pkce_code_challenge] = pkce_code_challenge unless pkce_code_challenge.nil?
|
1014
1023
|
request[:locale] = locale unless locale.nil?
|
1024
|
+
request[:verify_email_template_id] = verify_email_template_id unless verify_email_template_id.nil?
|
1015
1025
|
|
1016
1026
|
post_request('/v1/b2b/passwords/discovery/email/reset/start', request, headers)
|
1017
1027
|
end
|
data/lib/stytch/b2b_sessions.rb
CHANGED
@@ -341,6 +341,77 @@ module StytchB2B
|
|
341
341
|
post_request('/v1/b2b/sessions/exchange', request, headers)
|
342
342
|
end
|
343
343
|
|
344
|
+
# Use this endpoint to exchange a Connected Apps Access Token back into a Member Session for the underlying Member.
|
345
|
+
# This session can be used with the Stytch SDKs and APIs.
|
346
|
+
#
|
347
|
+
# The Access Token must contain the `full_access` scope and must not be more than 5 minutes old. Access Tokens may only be exchanged a single time.
|
348
|
+
#
|
349
|
+
# Because the Member previously completed MFA and satisfied all Organization authentication requirements at the time of the original Access Token issuance, this endpoint will never return an `intermediate_session_token` or require MFA.
|
350
|
+
#
|
351
|
+
# == Parameters:
|
352
|
+
# access_token::
|
353
|
+
# The access token to exchange for a Stytch Session. Must be granted the `full_access` scope.
|
354
|
+
# The type of this field is +String+.
|
355
|
+
# session_duration_minutes::
|
356
|
+
# Set the session lifetime to be this many minutes from now. This will start a new session if one doesn't already exist,
|
357
|
+
# returning both an opaque `session_token` and `session_jwt` for this session. Remember that the `session_jwt` will have a fixed lifetime of
|
358
|
+
# five minutes regardless of the underlying session duration, and will need to be refreshed over time.
|
359
|
+
#
|
360
|
+
# This value must be a minimum of 5 and a maximum of 527040 minutes (366 days).
|
361
|
+
#
|
362
|
+
# If a `session_token` or `session_jwt` is provided then a successful authentication will continue to extend the session this many minutes.
|
363
|
+
#
|
364
|
+
# 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
|
365
|
+
# to use the Stytch session product, you can ignore the session fields in the response.
|
366
|
+
# The type of this field is nilable +Integer+.
|
367
|
+
# session_custom_claims::
|
368
|
+
# Add a custom claims map to the Session being authenticated. Claims are only created if a Session is initialized by providing a value in
|
369
|
+
# `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
|
370
|
+
# delete a key, supply a null value. Custom claims made with reserved claims (`iss`, `sub`, `aud`, `exp`, `nbf`, `iat`, `jti`) will be ignored.
|
371
|
+
# Total custom claims size cannot exceed four kilobytes.
|
372
|
+
# The type of this field is nilable +object+.
|
373
|
+
#
|
374
|
+
# == Returns:
|
375
|
+
# An object with the following fields:
|
376
|
+
# request_id::
|
377
|
+
# 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.
|
378
|
+
# The type of this field is +String+.
|
379
|
+
# member_id::
|
380
|
+
# Globally unique UUID that identifies a specific Member.
|
381
|
+
# The type of this field is +String+.
|
382
|
+
# session_token::
|
383
|
+
# A secret token for a given Stytch Session.
|
384
|
+
# The type of this field is +String+.
|
385
|
+
# session_jwt::
|
386
|
+
# The JSON Web Token (JWT) for a given Stytch Session.
|
387
|
+
# The type of this field is +String+.
|
388
|
+
# member::
|
389
|
+
# The [Member object](https://stytch.com/docs/b2b/api/member-object)
|
390
|
+
# The type of this field is +Member+ (+object+).
|
391
|
+
# organization::
|
392
|
+
# The [Organization object](https://stytch.com/docs/b2b/api/organization-object).
|
393
|
+
# The type of this field is +Organization+ (+object+).
|
394
|
+
# status_code::
|
395
|
+
# 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.
|
396
|
+
# The type of this field is +Integer+.
|
397
|
+
# member_session::
|
398
|
+
# The [Session object](https://stytch.com/docs/b2b/api/session-object).
|
399
|
+
# The type of this field is nilable +MemberSession+ (+object+).
|
400
|
+
def exchange_access_token(
|
401
|
+
access_token:,
|
402
|
+
session_duration_minutes: nil,
|
403
|
+
session_custom_claims: nil
|
404
|
+
)
|
405
|
+
headers = {}
|
406
|
+
request = {
|
407
|
+
access_token: access_token
|
408
|
+
}
|
409
|
+
request[:session_duration_minutes] = session_duration_minutes unless session_duration_minutes.nil?
|
410
|
+
request[:session_custom_claims] = session_custom_claims unless session_custom_claims.nil?
|
411
|
+
|
412
|
+
post_request('/v1/b2b/sessions/exchange_access_token', request, headers)
|
413
|
+
end
|
414
|
+
|
344
415
|
# 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](https://stytch.com/docs/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 in your and create a Stytch Session. You will need to create the member before using this endpoint.
|
345
416
|
#
|
346
417
|
# == Parameters:
|
data/lib/stytch/impersonation.rb
CHANGED
@@ -19,6 +19,8 @@ module Stytch
|
|
19
19
|
# Authenticate an impersonation token to impersonate a User. This endpoint requires an impersonation token that is not expired or previously used.
|
20
20
|
# A Stytch session will be created for the impersonated user with a 60 minute duration. Impersonated sessions cannot be extended.
|
21
21
|
#
|
22
|
+
# Prior to this step, you can generate an impersonation token by visiting the Stytch dashboard, viewing a user, and clicking the `Impersonate User` button.
|
23
|
+
#
|
22
24
|
# == Parameters:
|
23
25
|
# impersonation_token::
|
24
26
|
# The User Impersonation token to authenticate.
|
data/lib/stytch/m2m.rb
CHANGED
@@ -443,8 +443,7 @@ module Stytch
|
|
443
443
|
@connection = connection
|
444
444
|
end
|
445
445
|
|
446
|
-
# Initiate the rotation of an M2M client secret. After this endpoint is called, both the client's `client_secret` and `next_client_secret` will be valid. To complete the secret rotation flow, update all usages of `client_secret` to `next_client_secret` and call the [Rotate Secret Endpoint](https://stytch.com/docs/b2b/api/m2m-rotate-secret)[Rotate Secret Endpoint](https://stytch.com/docs/api/m2m-rotate-secret) to complete the flow.
|
447
|
-
# Secret rotation can be cancelled using the [Rotate Cancel Endpoint](https://stytch.com/docs/b2b/api/m2m-rotate-secret-cancel)[Rotate Cancel Endpoint](https://stytch.com/docs/api/m2m-rotate-secret-cancel).
|
446
|
+
# Initiate the rotation of an M2M client secret. After this endpoint is called, both the client's `client_secret` and `next_client_secret` will be valid. To complete the secret rotation flow, update all usages of `client_secret` to `next_client_secret` and call the [Rotate Secret Endpoint](https://stytch.com/docs/b2b/api/m2m-rotate-secret)[Rotate Secret Endpoint](https://stytch.com/docs/api/m2m-rotate-secret) to complete the flow.Secret rotation can be cancelled using the [Rotate Cancel Endpoint](https://stytch.com/docs/b2b/api/m2m-rotate-secret-cancel)[Rotate Cancel Endpoint](https://stytch.com/docs/api/m2m-rotate-secret-cancel).
|
448
447
|
#
|
449
448
|
# **Important:** This is the only time you will be able to view the generated `next_client_secret` in the API response. Stytch stores a hash of the `next_client_secret` and cannot recover the value if lost. Be sure to persist the `next_client_secret` in a secure location. If the `next_client_secret` is lost, you will need to trigger a secret rotation flow to receive another one.
|
450
449
|
#
|
data/lib/stytch/version.rb
CHANGED
data/lib/stytch/webauthn.rb
CHANGED
@@ -334,5 +334,18 @@ module Stytch
|
|
334
334
|
|
335
335
|
put_request("/v1/webauthn/#{webauthn_registration_id}", request, headers)
|
336
336
|
end
|
337
|
+
|
338
|
+
def credentials(
|
339
|
+
user_id:,
|
340
|
+
domain:
|
341
|
+
)
|
342
|
+
headers = {}
|
343
|
+
query_params = {
|
344
|
+
user_id: user_id,
|
345
|
+
domain: domain
|
346
|
+
}
|
347
|
+
request = request_with_query_params('/v1/webauthn/credentials', query_params)
|
348
|
+
get_request(request, headers)
|
349
|
+
end
|
337
350
|
end
|
338
351
|
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: 10.
|
4
|
+
version: 10.9.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- stytch
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2025-
|
11
|
+
date: 2025-03-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: faraday
|