stytch 10.21.0 → 10.23.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_discovery.rb +35 -1
- data/lib/stytch/b2b_impersonation.rb +1 -1
- data/lib/stytch/b2b_organizations.rb +1 -1
- data/lib/stytch/b2b_passwords.rb +17 -9
- data/lib/stytch/b2b_rbac.rb +2 -1
- data/lib/stytch/b2b_sessions.rb +90 -1
- data/lib/stytch/impersonation.rb +1 -1
- data/lib/stytch/passwords.rb +12 -7
- data/lib/stytch/sessions.rb +79 -0
- data/lib/stytch/version.rb +1 -1
- data/lib/stytch/webauthn.rb +6 -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: e2fb08700aeee0c0840e48859d8dc235da8d2aaf781645d76b257d72478d84ac
|
4
|
+
data.tar.gz: b76a0da30460f7973558c2c7b6fa134af9c67df528e6b9e90e5780f444145260
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3e05a4ca1b82b877382db1ff2e98ae9d2687c82e4a0f1d084b2ea8c7e52ea5abc5da17e450378a353e9c5f300e890da5e02f1a8c4931f5506df098b89c2affc1
|
7
|
+
data.tar.gz: 6ad571d7bbf7d452d20e742dbf340836b0c5cb68ae1e6ddce55022c5ef19a431a71a4d32d6053f573f2487f1d0132b3876332681bed627f0e593009149b4745d
|
data/lib/stytch/b2b_discovery.rb
CHANGED
@@ -279,6 +279,32 @@ module StytchB2B
|
|
279
279
|
# allowed_oauth_tenants::
|
280
280
|
# 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".
|
281
281
|
# The type of this field is nilable +object+.
|
282
|
+
# first_party_connected_apps_allowed_type::
|
283
|
+
# The authentication setting that sets the Organization's policy towards first party Connected Apps. The accepted values are:
|
284
|
+
#
|
285
|
+
# `ALL_ALLOWED` – any first party Connected App in the Project is permitted for use by Members.
|
286
|
+
#
|
287
|
+
# `RESTRICTED` – only first party Connected Apps with IDs in `allowed_first_party_connected_apps` can be used by Members.
|
288
|
+
#
|
289
|
+
# `NOT_ALLOWED` – no first party Connected Apps are permitted.
|
290
|
+
#
|
291
|
+
# The type of this field is nilable +CreateRequestFirstPartyConnectedAppsAllowedType+ (string enum).
|
292
|
+
# allowed_first_party_connected_apps::
|
293
|
+
# An array of first party Connected App IDs that are allowed for the Organization. Only used when the Organization's `first_party_connected_apps_allowed_type` is `RESTRICTED`.
|
294
|
+
# The type of this field is nilable list of +String+.
|
295
|
+
# third_party_connected_apps_allowed_type::
|
296
|
+
# The authentication setting that sets the Organization's policy towards third party Connected Apps. The accepted values are:
|
297
|
+
#
|
298
|
+
# `ALL_ALLOWED` – any third party Connected App in the Project is permitted for use by Members.
|
299
|
+
#
|
300
|
+
# `RESTRICTED` – only third party Connected Apps with IDs in `allowed_first_party_connected_apps` can be used by Members.
|
301
|
+
#
|
302
|
+
# `NOT_ALLOWED` – no third party Connected Apps are permitted.
|
303
|
+
#
|
304
|
+
# The type of this field is nilable +CreateRequestThirdPartyConnectedAppsAllowedType+ (string enum).
|
305
|
+
# allowed_third_party_connected_apps::
|
306
|
+
# An array of third party Connected App IDs that are allowed for the Organization. Only used when the Organization's `third_party_connected_apps_allowed_type` is `RESTRICTED`.
|
307
|
+
# The type of this field is nilable list of +String+.
|
282
308
|
#
|
283
309
|
# == Returns:
|
284
310
|
# An object with the following fields:
|
@@ -337,7 +363,11 @@ module StytchB2B
|
|
337
363
|
mfa_methods: nil,
|
338
364
|
allowed_mfa_methods: nil,
|
339
365
|
oauth_tenant_jit_provisioning: nil,
|
340
|
-
allowed_oauth_tenants: nil
|
366
|
+
allowed_oauth_tenants: nil,
|
367
|
+
first_party_connected_apps_allowed_type: nil,
|
368
|
+
allowed_first_party_connected_apps: nil,
|
369
|
+
third_party_connected_apps_allowed_type: nil,
|
370
|
+
allowed_third_party_connected_apps: nil
|
341
371
|
)
|
342
372
|
headers = {}
|
343
373
|
request = {
|
@@ -361,6 +391,10 @@ module StytchB2B
|
|
361
391
|
request[:allowed_mfa_methods] = allowed_mfa_methods unless allowed_mfa_methods.nil?
|
362
392
|
request[:oauth_tenant_jit_provisioning] = oauth_tenant_jit_provisioning unless oauth_tenant_jit_provisioning.nil?
|
363
393
|
request[:allowed_oauth_tenants] = allowed_oauth_tenants unless allowed_oauth_tenants.nil?
|
394
|
+
request[:first_party_connected_apps_allowed_type] = first_party_connected_apps_allowed_type unless first_party_connected_apps_allowed_type.nil?
|
395
|
+
request[:allowed_first_party_connected_apps] = allowed_first_party_connected_apps unless allowed_first_party_connected_apps.nil?
|
396
|
+
request[:third_party_connected_apps_allowed_type] = third_party_connected_apps_allowed_type unless third_party_connected_apps_allowed_type.nil?
|
397
|
+
request[:allowed_third_party_connected_apps] = allowed_third_party_connected_apps unless allowed_third_party_connected_apps.nil?
|
364
398
|
|
365
399
|
post_request('/v1/b2b/discovery/organizations/create', request, headers)
|
366
400
|
end
|
@@ -19,7 +19,7 @@ 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
|
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
23
|
#
|
24
24
|
# == Parameters:
|
25
25
|
# impersonation_token::
|
@@ -1543,7 +1543,7 @@ module StytchB2B
|
|
1543
1543
|
# Identifies the Member as a break glass user - someone who has permissions to authenticate into an Organization by bypassing the Organization's settings. A break glass account is typically used for emergency purposes to gain access outside of normal authentication procedures. Refer to the [Organization object](organization-object) and its `auth_methods` and `allowed_auth_methods` fields for more details.
|
1544
1544
|
# The type of this field is nilable +Boolean+.
|
1545
1545
|
# mfa_phone_number::
|
1546
|
-
# The Member's phone number. A Member may only have one phone number.
|
1546
|
+
# The Member's phone number. A Member may only have one phone number. The phone number should be in E.164 format (i.e. +1XXXXXXXXXX).
|
1547
1547
|
# The type of this field is nilable +String+.
|
1548
1548
|
# mfa_enrolled::
|
1549
1549
|
# Sets whether the Member is enrolled in MFA. If true, the Member must complete an MFA step whenever they wish to log in to their Organization. If false, the Member only needs to complete an MFA step if the Organization's MFA policy is set to `REQUIRED_FOR_ALL`.
|
data/lib/stytch/b2b_passwords.rb
CHANGED
@@ -24,10 +24,13 @@ module StytchB2B
|
|
24
24
|
|
25
25
|
# This API allows you to check whether the user’s provided password is valid, and to provide feedback to the user on how to increase the strength of their password.
|
26
26
|
#
|
27
|
-
# This endpoint adapts to your Project's password strength configuration.
|
27
|
+
# This endpoint adapts to your Project's password strength configuration.
|
28
|
+
# If you're using [zxcvbn](https://stytch.com/docs/guides/passwords/strength-policy), the default, your passwords are considered valid if the strength score is >= 3.
|
29
|
+
# If you're using [LUDS](https://stytch.com/docs/guides/passwords/strength-policy), your passwords are considered valid if they meet the requirements that you've set with Stytch.
|
30
|
+
# You may update your password strength configuration on the [Passwords Policy page](https://stytch.com/dashboard/password-strength-config) in the Stytch Dashboard.
|
28
31
|
#
|
29
32
|
# ## Password feedback
|
30
|
-
# The zxcvbn_feedback and luds_feedback objects contains relevant fields for you to relay feedback to users that failed to create a strong enough password.
|
33
|
+
# The `zxcvbn_feedback` and `luds_feedback` objects contains relevant fields for you to relay feedback to users that failed to create a strong enough password.
|
31
34
|
#
|
32
35
|
# If you're using [zxcvbn](https://stytch.com/docs/guides/passwords/strength-policy), the feedback object will contain warning and suggestions for any password that does not meet the [zxcvbn](https://stytch.com/docs/guides/passwords/strength-policy) strength requirements. You can return these strings directly to the user to help them craft a strong password.
|
33
36
|
#
|
@@ -88,9 +91,13 @@ module StytchB2B
|
|
88
91
|
post_request('/v1/b2b/passwords/strength_check', request, headers)
|
89
92
|
end
|
90
93
|
|
91
|
-
# Adds an existing password to a
|
94
|
+
# Adds an existing password to a Member's email that doesn't have a password yet.
|
92
95
|
#
|
93
|
-
#
|
96
|
+
# We support migrating members from passwords stored with bcrypt, scrypt, argon2, MD-5, SHA-1, and PBKDF2. This endpoint has a rate limit of 100 requests per second.
|
97
|
+
#
|
98
|
+
# The Member's email will be marked as verified when you use this endpoint.
|
99
|
+
#
|
100
|
+
# If you are using **cross-organization passwords**, i.e. allowing an end user to share the same password across all of their Organizations, call this method separately for each `organization_id` associated with the given `email_address` to ensure the password is set across all of their Organizations.
|
94
101
|
#
|
95
102
|
# == Parameters:
|
96
103
|
# email_address::
|
@@ -147,10 +154,11 @@ module StytchB2B
|
|
147
154
|
# authentication factors with the affected SSO connection IDs will be revoked.
|
148
155
|
# The type of this field is nilable +Boolean+.
|
149
156
|
# mfa_phone_number::
|
150
|
-
# (
|
157
|
+
# The Member's phone number. A Member may only have one phone number. The phone number should be in E.164 format (i.e. +1XXXXXXXXXX).
|
151
158
|
# The type of this field is nilable +String+.
|
152
159
|
# set_phone_number_verified::
|
153
|
-
#
|
160
|
+
# Whether to set the user's phone number as verified. This is a dangerous field. This flag should only be set if you can attest that
|
161
|
+
# the user owns the phone number in question.
|
154
162
|
# The type of this field is nilable +Boolean+.
|
155
163
|
# external_id::
|
156
164
|
# If a new member is created, this will set an identifier that can be used in API calls wherever a member_id is expected. This is a string consisting of alphanumeric, `.`, `_`, `-`, or `|` characters with a maximum length of 128 characters. External IDs must be unique within an organization, but may be reused across different organizations in the same project. Note that if a member already exists, this field will be ignored.
|
@@ -377,7 +385,7 @@ module StytchB2B
|
|
377
385
|
# If you're using [zxcvbn](https://stytch.com/docs/guides/passwords/strength-policy), the default, your passwords are considered valid
|
378
386
|
# if the strength score is >= 3. If you're using [LUDS](https://stytch.com/docs/guides/passwords/strength-policy), your passwords are
|
379
387
|
# considered valid if they meet the requirements that you've set with Stytch.
|
380
|
-
# You may update your password strength configuration
|
388
|
+
# You may update your password strength configuration on the [Passwords Policy page](https://stytch.com/dashboard/password-strength-config) in the Stytch Dashboard.
|
381
389
|
#
|
382
390
|
# == Parameters:
|
383
391
|
# organization_id::
|
@@ -769,7 +777,7 @@ module StytchB2B
|
|
769
777
|
# If you're using [zxcvbn](https://stytch.com/docs/guides/passwords/strength-policy), the default, your passwords are considered valid
|
770
778
|
# if the strength score is >= 3. If you're using [LUDS](https://stytch.com/docs/guides/passwords/strength-policy), your passwords are
|
771
779
|
# considered valid if they meet the requirements that you've set with Stytch.
|
772
|
-
# You may update your password strength configuration
|
780
|
+
# You may update your password strength configuration on the [Passwords Policy page](https://stytch.com/dashboard/password-strength-config) in the Stytch Dashboard.
|
773
781
|
#
|
774
782
|
# If the Member is required to complete MFA to log in to the Organization, the returned value of `member_authenticated` will be `false`, and an `intermediate_session_token` will be returned.
|
775
783
|
# The `intermediate_session_token` can be passed into the [OTP SMS Authenticate endpoint](https://stytch.com/docs/b2b/api/authenticate-otp-sms) to complete the MFA step and acquire a full member session.
|
@@ -971,7 +979,7 @@ module StytchB2B
|
|
971
979
|
# If you're using [zxcvbn](https://stytch.com/docs/guides/passwords/strength-policy), the default, your passwords are considered valid
|
972
980
|
# if the strength score is >= 3. If you're using [LUDS](https://stytch.com/docs/guides/passwords/strength-policy), your passwords are
|
973
981
|
# considered valid if they meet the requirements that you've set with Stytch.
|
974
|
-
# You may update your password strength configuration
|
982
|
+
# You may update your password strength configuration on the [Passwords Policy page](https://stytch.com/dashboard/password-strength-config) in the Stytch Dashboard.
|
975
983
|
#
|
976
984
|
# == Parameters:
|
977
985
|
# email_address::
|
data/lib/stytch/b2b_rbac.rb
CHANGED
@@ -20,7 +20,8 @@ module StytchB2B
|
|
20
20
|
#
|
21
21
|
# When using the backend SDKs, the RBAC Policy will be cached to allow for local evaluations, eliminating the need for an extra request to Stytch. The policy will be refreshed if an authorization check is requested and the RBAC policy was last updated more than 5 minutes ago.
|
22
22
|
#
|
23
|
-
# Resources and Roles can be created and managed within the [
|
23
|
+
# Resources and Roles can be created and managed within the [RBAC page](https://stytch.com/docs/dashboard/rbac) in the Dashboard.
|
24
|
+
# Additionally, [Role assignment](https://stytch.com/docs/b2b/guides/rbac/role-assignment) can be programmatically managed through certain Stytch API endpoints.
|
24
25
|
#
|
25
26
|
# Check out the [RBAC overview](https://stytch.com/docs/b2b/guides/rbac/overview) to learn more about Stytch's RBAC permissioning model.
|
26
27
|
#
|
data/lib/stytch/b2b_sessions.rb
CHANGED
@@ -417,7 +417,96 @@ module StytchB2B
|
|
417
417
|
post_request('/v1/b2b/sessions/exchange_access_token', request, headers)
|
418
418
|
end
|
419
419
|
|
420
|
-
#
|
420
|
+
# Exchange an auth token issued by a trusted identity provider for a Stytch session. You must first register a Trusted Auth Token profile in the Stytch dashboard [here](https://stytch.com/docs/dashboard/trusted-auth-tokens). If a session token or session JWT is provided, it will add the trusted auth token as an authentication factor to the existing session.
|
421
|
+
#
|
422
|
+
# == Parameters:
|
423
|
+
# organization_id::
|
424
|
+
# The organization ID that the session should be authenticated in.
|
425
|
+
# The type of this field is +String+.
|
426
|
+
# profile_id::
|
427
|
+
# The ID of the trusted auth token profile to use for attestation.
|
428
|
+
# The type of this field is +String+.
|
429
|
+
# token::
|
430
|
+
# The trusted auth token to authenticate.
|
431
|
+
# The type of this field is +String+.
|
432
|
+
# session_duration_minutes::
|
433
|
+
# Set the session lifetime to be this many minutes from now. This will start a new session if one doesn't already exist,
|
434
|
+
# returning both an opaque `session_token` and `session_jwt` for this session. Remember that the `session_jwt` will have a fixed lifetime of
|
435
|
+
# five minutes regardless of the underlying session duration, and will need to be refreshed over time.
|
436
|
+
#
|
437
|
+
# This value must be a minimum of 5 and a maximum of 527040 minutes (366 days).
|
438
|
+
#
|
439
|
+
# If a `session_token` or `session_jwt` is provided then a successful authentication will continue to extend the session this many minutes.
|
440
|
+
#
|
441
|
+
# 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
|
442
|
+
# to use the Stytch session product, you can ignore the session fields in the response.
|
443
|
+
# The type of this field is nilable +Integer+.
|
444
|
+
# session_custom_claims::
|
445
|
+
# Add a custom claims map to the Session being authenticated. Claims are only created if a Session is initialized by providing a value in
|
446
|
+
# `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
|
447
|
+
# delete a key, supply a null value. Custom claims made with reserved claims (`iss`, `sub`, `aud`, `exp`, `nbf`, `iat`, `jti`) will be ignored.
|
448
|
+
# Total custom claims size cannot exceed four kilobytes.
|
449
|
+
# The type of this field is nilable +object+.
|
450
|
+
# session_token::
|
451
|
+
# The `session_token` for the session that you wish to add the trusted auth token authentication factor to.
|
452
|
+
# The type of this field is nilable +String+.
|
453
|
+
# session_jwt::
|
454
|
+
# The `session_jwt` for the session that you wish to add the trusted auth token authentication factor to.
|
455
|
+
# The type of this field is nilable +String+.
|
456
|
+
#
|
457
|
+
# == Returns:
|
458
|
+
# An object with the following fields:
|
459
|
+
# request_id::
|
460
|
+
# 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.
|
461
|
+
# The type of this field is +String+.
|
462
|
+
# member_id::
|
463
|
+
# Globally unique UUID that identifies a specific Member.
|
464
|
+
# The type of this field is +String+.
|
465
|
+
# member_session::
|
466
|
+
# The [Session object](https://stytch.com/docs/b2b/api/session-object).
|
467
|
+
# The type of this field is +MemberSession+ (+object+).
|
468
|
+
# session_token::
|
469
|
+
# A secret token for a given Stytch Session.
|
470
|
+
# The type of this field is +String+.
|
471
|
+
# session_jwt::
|
472
|
+
# The JSON Web Token (JWT) for a given Stytch Session.
|
473
|
+
# The type of this field is +String+.
|
474
|
+
# member::
|
475
|
+
# The [Member object](https://stytch.com/docs/b2b/api/member-object)
|
476
|
+
# The type of this field is +Member+ (+object+).
|
477
|
+
# organization::
|
478
|
+
# The [Organization object](https://stytch.com/docs/b2b/api/organization-object).
|
479
|
+
# The type of this field is +Organization+ (+object+).
|
480
|
+
# status_code::
|
481
|
+
# 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.
|
482
|
+
# The type of this field is +Integer+.
|
483
|
+
def attest(
|
484
|
+
organization_id:,
|
485
|
+
profile_id:,
|
486
|
+
token:,
|
487
|
+
session_duration_minutes: nil,
|
488
|
+
session_custom_claims: nil,
|
489
|
+
session_token: nil,
|
490
|
+
session_jwt: nil
|
491
|
+
)
|
492
|
+
headers = {}
|
493
|
+
request = {
|
494
|
+
organization_id: organization_id,
|
495
|
+
profile_id: profile_id,
|
496
|
+
token: token
|
497
|
+
}
|
498
|
+
request[:session_duration_minutes] = session_duration_minutes unless session_duration_minutes.nil?
|
499
|
+
request[:session_custom_claims] = session_custom_claims unless session_custom_claims.nil?
|
500
|
+
request[:session_token] = session_token unless session_token.nil?
|
501
|
+
request[:session_jwt] = session_jwt unless session_jwt.nil?
|
502
|
+
|
503
|
+
post_request('/v1/b2b/sessions/attest', request, headers)
|
504
|
+
end
|
505
|
+
|
506
|
+
# Migrate a session from an external OIDC compliant endpoint.
|
507
|
+
# 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`. <!-- FIXME more specific dashboard link-->
|
508
|
+
# 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.
|
509
|
+
# You will need to create the member before using this endpoint.
|
421
510
|
#
|
422
511
|
# == Parameters:
|
423
512
|
# session_token::
|
data/lib/stytch/impersonation.rb
CHANGED
@@ -19,7 +19,7 @@ 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
|
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
23
|
#
|
24
24
|
# == Parameters:
|
25
25
|
# impersonation_token::
|
data/lib/stytch/passwords.rb
CHANGED
@@ -201,7 +201,7 @@ module Stytch
|
|
201
201
|
|
202
202
|
# This API allows you to check whether or not the user’s provided password is valid, and to provide feedback to the user on how to increase the strength of their password.
|
203
203
|
#
|
204
|
-
# This endpoint adapts to your Project's password strength configuration. If you're using [zxcvbn](https://stytch.com/docs/guides/passwords/strength-policy), the default, your passwords are considered valid if the strength score is >= 3. If you're using [LUDS](https://stytch.com/docs/guides/passwords/strength-policy), your passwords are considered valid if they meet the requirements that you've set with Stytch. You may update your password strength configuration in the [
|
204
|
+
# This endpoint adapts to your Project's password strength configuration. If you're using [zxcvbn](https://stytch.com/docs/guides/passwords/strength-policy), the default, your passwords are considered valid if the strength score is >= 3. If you're using [LUDS](https://stytch.com/docs/guides/passwords/strength-policy), your passwords are considered valid if they meet the requirements that you've set with Stytch. You may update your password strength configuration in the [Stytch Dashboard](https://stytch.com/dashboard/password-strength-config).
|
205
205
|
#
|
206
206
|
#
|
207
207
|
# ### Password feedback
|
@@ -293,9 +293,9 @@ module Stytch
|
|
293
293
|
# The `untrusted_metadata` field contains an arbitrary JSON object of application-specific data. Untrusted metadata can be edited by end users directly via the SDK, and **cannot be used to store critical information.** See the [Metadata](https://stytch.com/docs/api/metadata) reference for complete field behavior details.
|
294
294
|
# The type of this field is nilable +object+.
|
295
295
|
# set_email_verified::
|
296
|
-
# Whether to set the user's email as verified. This is a dangerous field
|
297
|
-
# deduplicated into one
|
298
|
-
#
|
296
|
+
# Whether to set the user's email as verified. This is a dangerous field, incorrect use may lead to users getting erroneously
|
297
|
+
# deduplicated into one User object. This flag should only be set if you can attest that the user owns the email address in question.
|
298
|
+
#
|
299
299
|
# The type of this field is nilable +Boolean+.
|
300
300
|
# name::
|
301
301
|
# The name of the user. Each field in the name object is optional.
|
@@ -304,12 +304,15 @@ module Stytch
|
|
304
304
|
# The phone number of the user. The phone number should be in E.164 format (i.e. +1XXXXXXXXXX).
|
305
305
|
# The type of this field is nilable +String+.
|
306
306
|
# set_phone_number_verified::
|
307
|
-
# Whether to set the user's phone number as verified. This is a dangerous field
|
308
|
-
# the user owns the phone number in question.
|
307
|
+
# Whether to set the user's phone number as verified. This is a dangerous field, this flag should only be set if you can attest that
|
308
|
+
# the user owns the phone number in question.
|
309
309
|
# The type of this field is nilable +Boolean+.
|
310
310
|
# external_id::
|
311
311
|
# If a new user is created, this will set an identifier that can be used in API calls wherever a user_id is expected. This is a string consisting of alphanumeric, `.`, `_`, `-`, or `|` characters with a maximum length of 128 characters.
|
312
312
|
# The type of this field is nilable +String+.
|
313
|
+
# roles::
|
314
|
+
# (no documentation yet)
|
315
|
+
# The type of this field is nilable list of +String+.
|
313
316
|
#
|
314
317
|
# == Returns:
|
315
318
|
# An object with the following fields:
|
@@ -346,7 +349,8 @@ module Stytch
|
|
346
349
|
name: nil,
|
347
350
|
phone_number: nil,
|
348
351
|
set_phone_number_verified: nil,
|
349
|
-
external_id: nil
|
352
|
+
external_id: nil,
|
353
|
+
roles: nil
|
350
354
|
)
|
351
355
|
headers = {}
|
352
356
|
request = {
|
@@ -366,6 +370,7 @@ module Stytch
|
|
366
370
|
request[:phone_number] = phone_number unless phone_number.nil?
|
367
371
|
request[:set_phone_number_verified] = set_phone_number_verified unless set_phone_number_verified.nil?
|
368
372
|
request[:external_id] = external_id unless external_id.nil?
|
373
|
+
request[:roles] = roles unless roles.nil?
|
369
374
|
|
370
375
|
post_request('/v1/passwords/migrate', request, headers)
|
371
376
|
end
|
data/lib/stytch/sessions.rb
CHANGED
@@ -326,6 +326,85 @@ module Stytch
|
|
326
326
|
get_request(request, headers)
|
327
327
|
end
|
328
328
|
|
329
|
+
# Exchange an auth token issued by a trusted identity provider for a Stytch session. You must first register a Trusted Auth Token profile in the Stytch dashboard [here](https://stytch.com/docs/dashboard/trusted-auth-tokens). If a session token or session JWT is provided, it will add the trusted auth token as an authentication factor to the existing session.
|
330
|
+
#
|
331
|
+
# == Parameters:
|
332
|
+
# profile_id::
|
333
|
+
# The ID of the trusted auth token profile to use for attestation.
|
334
|
+
# The type of this field is +String+.
|
335
|
+
# token::
|
336
|
+
# The trusted auth token to authenticate.
|
337
|
+
# The type of this field is +String+.
|
338
|
+
# session_duration_minutes::
|
339
|
+
# Set the session lifetime to be this many minutes from now. This will start a new session if one doesn't already exist,
|
340
|
+
# returning both an opaque `session_token` and `session_jwt` for this session. Remember that the `session_jwt` will have a fixed lifetime of
|
341
|
+
# five minutes regardless of the underlying session duration, and will need to be refreshed over time.
|
342
|
+
#
|
343
|
+
# This value must be a minimum of 5 and a maximum of 527040 minutes (366 days).
|
344
|
+
#
|
345
|
+
# If a `session_token` or `session_jwt` is provided then a successful authentication will continue to extend the session this many minutes.
|
346
|
+
#
|
347
|
+
# If the `session_duration_minutes` parameter is not specified, a Stytch session will not be created.
|
348
|
+
# The type of this field is nilable +Integer+.
|
349
|
+
# session_custom_claims::
|
350
|
+
# 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.
|
351
|
+
#
|
352
|
+
# Custom claims made with reserved claims ("iss", "sub", "aud", "exp", "nbf", "iat", "jti") will be ignored. Total custom claims size cannot exceed four kilobytes.
|
353
|
+
# The type of this field is nilable +object+.
|
354
|
+
# session_token::
|
355
|
+
# The `session_token` for the session that you wish to add the trusted auth token authentication factor to.
|
356
|
+
# The type of this field is nilable +String+.
|
357
|
+
# session_jwt::
|
358
|
+
# The `session_jwt` for the session that you wish to add the trusted auth token authentication factor to.
|
359
|
+
# The type of this field is nilable +String+.
|
360
|
+
#
|
361
|
+
# == Returns:
|
362
|
+
# An object with the following fields:
|
363
|
+
# request_id::
|
364
|
+
# 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.
|
365
|
+
# The type of this field is +String+.
|
366
|
+
# user_id::
|
367
|
+
# The unique ID of the affected User.
|
368
|
+
# The type of this field is +String+.
|
369
|
+
# session_token::
|
370
|
+
# A secret token for a given Stytch Session.
|
371
|
+
# The type of this field is +String+.
|
372
|
+
# session_jwt::
|
373
|
+
# The JSON Web Token (JWT) for a given Stytch Session.
|
374
|
+
# The type of this field is +String+.
|
375
|
+
# user::
|
376
|
+
# 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.
|
377
|
+
# The type of this field is +User+ (+object+).
|
378
|
+
# status_code::
|
379
|
+
# 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.
|
380
|
+
# The type of this field is +Integer+.
|
381
|
+
# session::
|
382
|
+
# If you initiate a Session, by including `session_duration_minutes` in your authenticate call, you'll receive a full Session object in the response.
|
383
|
+
#
|
384
|
+
# See [Session object](https://stytch.com/docs/api/session-object) for complete response fields.
|
385
|
+
#
|
386
|
+
# The type of this field is nilable +Session+ (+object+).
|
387
|
+
def attest(
|
388
|
+
profile_id:,
|
389
|
+
token:,
|
390
|
+
session_duration_minutes: nil,
|
391
|
+
session_custom_claims: nil,
|
392
|
+
session_token: nil,
|
393
|
+
session_jwt: nil
|
394
|
+
)
|
395
|
+
headers = {}
|
396
|
+
request = {
|
397
|
+
profile_id: profile_id,
|
398
|
+
token: token
|
399
|
+
}
|
400
|
+
request[:session_duration_minutes] = session_duration_minutes unless session_duration_minutes.nil?
|
401
|
+
request[:session_custom_claims] = session_custom_claims unless session_custom_claims.nil?
|
402
|
+
request[:session_token] = session_token unless session_token.nil?
|
403
|
+
request[:session_jwt] = session_jwt unless session_jwt.nil?
|
404
|
+
|
405
|
+
post_request('/v1/sessions/attest', request, headers)
|
406
|
+
end
|
407
|
+
|
329
408
|
# MANUAL(Sessions::authenticate_jwt)(SERVICE_METHOD)
|
330
409
|
# ADDIMPORT: require 'jwt'
|
331
410
|
# ADDIMPORT: require 'json/jwt'
|
data/lib/stytch/version.rb
CHANGED
data/lib/stytch/webauthn.rb
CHANGED
@@ -50,6 +50,9 @@ module Stytch
|
|
50
50
|
# override_display_name::
|
51
51
|
# (no documentation yet)
|
52
52
|
# The type of this field is nilable +String+.
|
53
|
+
# use_base64_url_encoding::
|
54
|
+
# (no documentation yet)
|
55
|
+
# The type of this field is nilable +Boolean+.
|
53
56
|
#
|
54
57
|
# == Returns:
|
55
58
|
# An object with the following fields:
|
@@ -73,7 +76,8 @@ module Stytch
|
|
73
76
|
return_passkey_credential_options: nil,
|
74
77
|
override_id: nil,
|
75
78
|
override_name: nil,
|
76
|
-
override_display_name: nil
|
79
|
+
override_display_name: nil,
|
80
|
+
use_base64_url_encoding: nil
|
77
81
|
)
|
78
82
|
headers = {}
|
79
83
|
request = {
|
@@ -86,6 +90,7 @@ module Stytch
|
|
86
90
|
request[:override_id] = override_id unless override_id.nil?
|
87
91
|
request[:override_name] = override_name unless override_name.nil?
|
88
92
|
request[:override_display_name] = override_display_name unless override_display_name.nil?
|
93
|
+
request[:use_base64_url_encoding] = use_base64_url_encoding unless use_base64_url_encoding.nil?
|
89
94
|
|
90
95
|
post_request('/v1/webauthn/register/start', request, headers)
|
91
96
|
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.23.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-07-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: faraday
|