stytch 10.19.0 → 10.21.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 2e638ef6189392a14cc312951f14b9882c9c9479bb9bccd2e87884576cd944a8
4
- data.tar.gz: c070606c02c73bb54aa6b90c755491e6da2d38e7a5dff07ac661712bef1c6e14
3
+ metadata.gz: 92655a5f974bb3fc56399b60d2ce6e3689dc00fab9ec6a13e61144960937f8b0
4
+ data.tar.gz: bca0fc61a0cbbc0b357bd044b2ef52f87e82ecc5c542dd7637f1d64fa5e1ffdd
5
5
  SHA512:
6
- metadata.gz: c48b5f1e1a8a5b25061175848c74997918af834e0d499deace18fcbf670885821b3281158b8a41a8d6ada238b372ceb61a61a8bb48a2ee406be984c058ee88b1
7
- data.tar.gz: 4400e4caea7dcedd1e81fdea293997583bb4eebe6f4b5687f2ab0f0a60bc9ef22e95f7a377ab4c6064a6b4d36f91066dc8f4425e4fffa4eb2e362b063799f55b
6
+ metadata.gz: 4f770d5d5fe2d5d62780fc80ec0328801ad1cd00a45772c56d0b881b7c4c3291002bbfa84a1d21a332518483da7068a6ca21655c48ebe304aea999be46e3bd5d
7
+ data.tar.gz: 4cbfab64433fbc29c3b5256387f74e7de8ab05fe9427c11ab510b7415d1c164eaf1e52e1a62561de76b41122f198e8701e8a6a6c36c6043ea6f555184d4b6ffa
@@ -124,6 +124,9 @@ module StytchB2B
124
124
  # mfa_required::
125
125
  # Information about the MFA requirements of the Organization and the Member's options for fulfilling MFA.
126
126
  # The type of this field is nilable +MfaRequired+ (+object+).
127
+ # primary_required::
128
+ # (no documentation yet)
129
+ # The type of this field is nilable +PrimaryRequired+ (+object+).
127
130
  def authenticate(
128
131
  magic_links_token:,
129
132
  pkce_code_verifier: nil,
@@ -203,16 +203,30 @@ module StytchB2B
203
203
  # A list of email domains that are claimed by the Organization.
204
204
  # The type of this field is nilable list of +String+.
205
205
  # first_party_connected_apps_allowed_type::
206
- # (no documentation yet)
206
+ # The authentication setting that sets the Organization's policy towards first party Connected Apps. The accepted values are:
207
+ #
208
+ # `ALL_ALLOWED` – any first party Connected App in the Project is permitted for use by Members.
209
+ #
210
+ # `RESTRICTED` – only first party Connected Apps with IDs in `allowed_first_party_connected_apps` can be used by Members.
211
+ #
212
+ # `NOT_ALLOWED` – no first party Connected Apps are permitted.
213
+ #
207
214
  # The type of this field is nilable +CreateRequestFirstPartyConnectedAppsAllowedType+ (string enum).
208
215
  # allowed_first_party_connected_apps::
209
- # (no documentation yet)
216
+ # 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`.
210
217
  # The type of this field is nilable list of +String+.
211
218
  # third_party_connected_apps_allowed_type::
212
- # (no documentation yet)
219
+ # The authentication setting that sets the Organization's policy towards third party Connected Apps. The accepted values are:
220
+ #
221
+ # `ALL_ALLOWED` – any third party Connected App in the Project is permitted for use by Members.
222
+ #
223
+ # `RESTRICTED` – only third party Connected Apps with IDs in `allowed_first_party_connected_apps` can be used by Members.
224
+ #
225
+ # `NOT_ALLOWED` – no third party Connected Apps are permitted.
226
+ #
213
227
  # The type of this field is nilable +CreateRequestThirdPartyConnectedAppsAllowedType+ (string enum).
214
228
  # allowed_third_party_connected_apps::
215
- # (no documentation yet)
229
+ # 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`.
216
230
  # The type of this field is nilable list of +String+.
217
231
  #
218
232
  # == Returns:
@@ -456,16 +470,30 @@ module StytchB2B
456
470
  # A list of email domains that are claimed by the Organization.
457
471
  # The type of this field is nilable list of +String+.
458
472
  # first_party_connected_apps_allowed_type::
459
- # (no documentation yet)
473
+ # The authentication setting that sets the Organization's policy towards first party Connected Apps. The accepted values are:
474
+ #
475
+ # `ALL_ALLOWED` – any first party Connected App in the Project is permitted for use by Members.
476
+ #
477
+ # `RESTRICTED` – only first party Connected Apps with IDs in `allowed_first_party_connected_apps` can be used by Members.
478
+ #
479
+ # `NOT_ALLOWED` – no first party Connected Apps are permitted.
480
+ #
460
481
  # The type of this field is nilable +UpdateRequestFirstPartyConnectedAppsAllowedType+ (string enum).
461
482
  # allowed_first_party_connected_apps::
462
- # (no documentation yet)
483
+ # 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`.
463
484
  # The type of this field is nilable list of +String+.
464
485
  # third_party_connected_apps_allowed_type::
465
- # (no documentation yet)
486
+ # The authentication setting that sets the Organization's policy towards third party Connected Apps. The accepted values are:
487
+ #
488
+ # `ALL_ALLOWED` – any third party Connected App in the Project is permitted for use by Members.
489
+ #
490
+ # `RESTRICTED` – only third party Connected Apps with IDs in `allowed_first_party_connected_apps` can be used by Members.
491
+ #
492
+ # `NOT_ALLOWED` – no third party Connected Apps are permitted.
493
+ #
466
494
  # The type of this field is nilable +UpdateRequestThirdPartyConnectedAppsAllowedType+ (string enum).
467
495
  # allowed_third_party_connected_apps::
468
- # (no documentation yet)
496
+ # 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`.
469
497
  # The type of this field is nilable list of +String+.
470
498
  #
471
499
  # == Returns:
@@ -405,9 +405,6 @@ module StytchB2B
405
405
  # session_jwt::
406
406
  # The JSON Web Token (JWT) for a given Stytch Session.
407
407
  # The type of this field is +String+.
408
- # member_session::
409
- # The [Session object](https://stytch.com/docs/b2b/api/session-object).
410
- # The type of this field is +MemberSession+ (+object+).
411
408
  # organization::
412
409
  # The [Organization object](https://stytch.com/docs/b2b/api/organization-object).
413
410
  # The type of this field is +Organization+ (+object+).
@@ -420,9 +417,15 @@ module StytchB2B
420
417
  # status_code::
421
418
  # 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.
422
419
  # The type of this field is +Integer+.
420
+ # member_session::
421
+ # The [Session object](https://stytch.com/docs/b2b/api/session-object).
422
+ # The type of this field is nilable +MemberSession+ (+object+).
423
423
  # mfa_required::
424
424
  # Information about the MFA requirements of the Organization and the Member's options for fulfilling MFA.
425
425
  # The type of this field is nilable +MfaRequired+ (+object+).
426
+ # primary_required::
427
+ # (no documentation yet)
428
+ # The type of this field is nilable +PrimaryRequired+ (+object+).
426
429
  def authenticate(
427
430
  organization_id:,
428
431
  email_address:,
@@ -315,6 +315,9 @@ module StytchB2B
315
315
  # mfa_required::
316
316
  # Information about the MFA requirements of the Organization and the Member's options for fulfilling MFA.
317
317
  # The type of this field is nilable +MfaRequired+ (+object+).
318
+ # primary_required::
319
+ # Information about the primary authentication requirements of the Organization.
320
+ # The type of this field is nilable +PrimaryRequired+ (+object+).
318
321
  def authenticate(
319
322
  organization_id:,
320
323
  email_address:,
@@ -389,7 +392,7 @@ module StytchB2B
389
392
  # If you have not set a default `reset_password_redirect_url`, an error is returned.
390
393
  # The type of this field is nilable +String+.
391
394
  # reset_password_expiration_minutes::
392
- # Sets a time limit after which the email link to reset the member's password will no longer be valid.
395
+ # Sets a time limit after which the email link to reset the member's password will no longer be valid. The minimum allowed expiration is 5 minutes and the maximum is 10080 minutes (7 days). By default, the expiration is 30 minutes.
393
396
  # The type of this field is nilable +Integer+.
394
397
  # code_challenge::
395
398
  # A base64url encoded SHA256 hash of a one time secret used to validate that the request starts and ends on the same device.
@@ -412,7 +415,7 @@ module StytchB2B
412
415
  # 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 Passwords - Reset Password.
413
416
  # The type of this field is nilable +String+.
414
417
  # verify_email_template_id::
415
- # Use a custom template for verification emails sent during password reset flows. This template will be used the first time a user sets a password via a
418
+ # Use a custom template for verification emails sent during password reset flows. When cross-organization passwords are enabled for your Project, this template will be used the first time a user sets a password via a
416
419
  # password reset flow. 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 Passwords - Email Verification.
417
420
  # The type of this field is nilable +String+.
418
421
  #
@@ -565,6 +568,9 @@ module StytchB2B
565
568
  # mfa_required::
566
569
  # Information about the MFA requirements of the Organization and the Member's options for fulfilling MFA.
567
570
  # The type of this field is nilable +MfaRequired+ (+object+).
571
+ # primary_required::
572
+ # Information about the primary authentication requirements of the Organization.
573
+ # The type of this field is nilable +PrimaryRequired+ (+object+).
568
574
  def reset(
569
575
  password_reset_token:,
570
576
  password:,
@@ -856,6 +862,9 @@ module StytchB2B
856
862
  # mfa_required::
857
863
  # Information about the MFA requirements of the Organization and the Member's options for fulfilling MFA.
858
864
  # The type of this field is nilable +MfaRequired+ (+object+).
865
+ # primary_required::
866
+ # Information about the primary authentication requirements of the Organization.
867
+ # The type of this field is nilable +PrimaryRequired+ (+object+).
859
868
  def reset(
860
869
  email_address:,
861
870
  existing_password:,
@@ -982,7 +991,7 @@ module StytchB2B
982
991
  # 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 Passwords - Reset Password.
983
992
  # The type of this field is nilable +String+.
984
993
  # reset_password_expiration_minutes::
985
- # Sets a time limit after which the email link to reset the member's password will no longer be valid.
994
+ # Sets a time limit after which the email link to reset the member's password will no longer be valid. The minimum allowed expiration is 5 minutes and the maximum is 10080 minutes (7 days). By default, the expiration is 30 minutes.
986
995
  # The type of this field is nilable +Integer+.
987
996
  # pkce_code_challenge::
988
997
  # (no documentation yet)
@@ -996,7 +1005,7 @@ module StytchB2B
996
1005
  #
997
1006
  # The type of this field is nilable +String+.
998
1007
  # verify_email_template_id::
999
- # Use a custom template for verification emails sent during password reset flows. This template will be used the first time a user sets a password via a
1008
+ # Use a custom template for verification emails sent during password reset flows. When cross-organization passwords are enabled for your Project, this template will be used the first time a user sets a password via a
1000
1009
  # password reset flow. 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 Passwords - Email Verification.
1001
1010
  # The type of this field is nilable +String+.
1002
1011
  #
@@ -293,9 +293,6 @@ module StytchB2B
293
293
  # member_id::
294
294
  # Globally unique UUID that identifies a specific Member.
295
295
  # The type of this field is +String+.
296
- # member_session::
297
- # The [Session object](https://stytch.com/docs/b2b/api/session-object).
298
- # The type of this field is +MemberSession+ (+object+).
299
296
  # session_token::
300
297
  # A secret token for a given Stytch Session.
301
298
  # The type of this field is +String+.
@@ -317,6 +314,9 @@ module StytchB2B
317
314
  # status_code::
318
315
  # 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.
319
316
  # The type of this field is +Integer+.
317
+ # member_session::
318
+ # The [Session object](https://stytch.com/docs/b2b/api/session-object).
319
+ # The type of this field is nilable +MemberSession+ (+object+).
320
320
  # mfa_required::
321
321
  # Information about the MFA requirements of the Organization and the Member's options for fulfilling MFA.
322
322
  # The type of this field is nilable +MfaRequired+ (+object+).
@@ -347,7 +347,9 @@ module StytchB2B
347
347
  # Use this endpoint to exchange a Connected Apps Access Token back into a Member Session for the underlying Member.
348
348
  # This session can be used with the Stytch SDKs and APIs.
349
349
  #
350
- # 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.
350
+ # The Access Token must contain the `full_access` scope (only available to First Party clients) and must not be more than 5 minutes old. Access Tokens may only be exchanged a single time.
351
+ #
352
+ # The Member Session returned will be the same Member Session that was active in your application (the authorizing party) during the initial authorization flow.
351
353
  #
352
354
  # 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.
353
355
  #
@@ -230,6 +230,9 @@ module StytchB2B
230
230
  # mfa_required::
231
231
  # Information about the MFA requirements of the Organization and the Member's options for fulfilling MFA.
232
232
  # The type of this field is nilable +MfaRequired+ (+object+).
233
+ # primary_required::
234
+ # (no documentation yet)
235
+ # The type of this field is nilable +PrimaryRequired+ (+object+).
233
236
  def authenticate(
234
237
  sso_token:,
235
238
  pkce_code_verifier: nil,
data/lib/stytch/fraud.rb CHANGED
@@ -11,13 +11,14 @@ require_relative 'request_helper'
11
11
  module Stytch
12
12
  class Fraud
13
13
  include Stytch::RequestHelper
14
- attr_reader :fingerprint, :rules
14
+ attr_reader :fingerprint, :rules, :verdict_reasons
15
15
 
16
16
  def initialize(connection)
17
17
  @connection = connection
18
18
 
19
19
  @fingerprint = Stytch::Fraud::Fingerprint.new(@connection)
20
20
  @rules = Stytch::Fraud::Rules.new(@connection)
21
+ @verdict_reasons = Stytch::Fraud::VerdictReasons.new(@connection)
21
22
  end
22
23
 
23
24
  class Fingerprint
@@ -252,5 +253,82 @@ module Stytch
252
253
  post_request('/v1/rules/list', request, headers)
253
254
  end
254
255
  end
256
+
257
+ class VerdictReasons
258
+ include Stytch::RequestHelper
259
+
260
+ def initialize(connection)
261
+ @connection = connection
262
+ end
263
+
264
+ # Use this endpoint to override the action returned for a specific verdict reason during a fingerprint lookup. For example, Stytch Device Fingerprinting returns a `CHALLENGE` verdict action by default for the verdict reason `VIRTUAL_MACHINE`. You can use this endpoint to override that reason to return an `ALLOW` verdict instead if you expect many legitimate users to be using a browser that runs in a virtual machine.
265
+ #
266
+ # == Parameters:
267
+ # verdict_reason::
268
+ # The verdict reason that you wish to override. For a list of possible reasons to override, see [Warning Flags (Verdict Reasons)](https://stytch.com/docs/docs/fraud/guides/device-fingerprinting/reference/warning-flags-verdict-reasons). You may not override the `RULE_MATCH` reason.
269
+ # The type of this field is +String+.
270
+ # override_action::
271
+ # The action that you want to be returned for the specified verdict reason. The override action must be one of `ALLOW`, `BLOCK`, or `CHALLENGE`.
272
+ # The type of this field is +OverrideRequestAction+ (string enum).
273
+ # override_description::
274
+ # An optional description for the verdict reason override.
275
+ # The type of this field is nilable +String+.
276
+ #
277
+ # == Returns:
278
+ # An object with the following fields:
279
+ # request_id::
280
+ # 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.
281
+ # The type of this field is +String+.
282
+ # verdict_reason_action::
283
+ # Information about the verdict reason override that was just set.
284
+ # The type of this field is +VerdictReasonAction+ (+object+).
285
+ # status_code::
286
+ # 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.
287
+ # The type of this field is +Integer+.
288
+ def override(
289
+ verdict_reason:,
290
+ override_action:,
291
+ override_description: nil
292
+ )
293
+ headers = {}
294
+ request = {
295
+ verdict_reason: verdict_reason,
296
+ override_action: override_action
297
+ }
298
+ request[:override_description] = override_description unless override_description.nil?
299
+
300
+ post_request('/v1/verdict_reasons/override', request, headers)
301
+ end
302
+
303
+ # Get the list of verdict reasons returned by the Stytch Device Fingerprinting product along with their default actions and any overrides you may have defined. This is not an exhaustive list of verdict reasons, but it contains all verdict reasons that you may set an override on.
304
+ #
305
+ # For a full list of possible verdict reasons, see [Warning Flags (Verdict Reasons)](https://stytch.com/docs/docs/fraud/guides/device-fingerprinting/reference/warning-flags-verdict-reasons).
306
+ #
307
+ # == Parameters:
308
+ # overrides_only::
309
+ # Whether to return only verdict reasons that have overrides set. Defaults to false.
310
+ # The type of this field is nilable +Boolean+.
311
+ #
312
+ # == Returns:
313
+ # An object with the following fields:
314
+ # request_id::
315
+ # 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.
316
+ # The type of this field is +String+.
317
+ # verdict_reason_actions::
318
+ # Information about verdict reasons and any overrides that were set on them.
319
+ # The type of this field is list of +VerdictReasonAction+ (+object+).
320
+ # status_code::
321
+ # 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.
322
+ # The type of this field is +Integer+.
323
+ def list(
324
+ overrides_only: nil
325
+ )
326
+ headers = {}
327
+ request = {}
328
+ request[:overrides_only] = overrides_only unless overrides_only.nil?
329
+
330
+ post_request('/v1/verdict_reasons/list', request, headers)
331
+ end
332
+ end
255
333
  end
256
334
  end
@@ -223,7 +223,9 @@ module Stytch
223
223
  # Use this endpoint to exchange a Connected Apps Access Token back into a Stytch Session for the underlying User.
224
224
  # This session can be used with the Stytch SDKs and APIs.
225
225
  #
226
- # 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.
226
+ # The Session returned will be the same Session that was active in your application (the authorizing party) during the initial authorization flow.
227
+ #
228
+ # The Access Token must contain the `full_access` scope (only available to First Party clients) and must not be more than 5 minutes old. Access Tokens may only be exchanged a single time.
227
229
  #
228
230
  # == Parameters:
229
231
  # access_token::
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Stytch
4
- VERSION = '10.19.0'
4
+ VERSION = '10.21.0'
5
5
  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.19.0
4
+ version: 10.21.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-06-05 00:00:00.000000000 Z
11
+ date: 2025-06-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday