stytch 10.20.0 → 10.22.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: c952f51df5bedbec2f8ea1a1067d4f48f6e286ad4d3995a637fbbd9d0f8d2fd2
4
- data.tar.gz: f2aefae357b0bffc0d60766e0c135bb4d196f15d7eca7a85aba8a6c4cea6b9a7
3
+ metadata.gz: 79f83098068aa5afdbecff54fe59173d6e1c4e0e9660204d4dbd045cbfcc1561
4
+ data.tar.gz: 14d9b1a5fd3dafb1e2d26b8d26cf9e06d27e1fa9c0eb7082d4c240cb87fbdf29
5
5
  SHA512:
6
- metadata.gz: 0cbab2c8cec7e1f94a2573ff9e36abe59d511c75e773be046dfe9cd12fd0e17be70b6410581496a3d0a37ed40324fb1f8256628ed329ee3e62d0485efead885f
7
- data.tar.gz: 633239b9adaa11ccb7dd0baabb7b5b8ff2259feca39284efee3809cf83cfef2171c317eb2917496ed54ee729174f347c6f240f24111b1b60ade90f9c08f1e1dd
6
+ metadata.gz: fdf4c8bfea414eeb01e5aecfdbfb4ecaadaf31d9b079021557eb2e722facd43b07bf405b4d9518f0f114f6cdf0b09871092fa6c56077a3790f4c525ca9d9f6b6
7
+ data.tar.gz: '0990e814940119ed3eedc3d6f3bf90ec407de943633ab635ec6064e4cfede76bc35b9342b3fdee24497d56d2bf7b81b23e851ded86dea3cc9775af31f112ef5e'
@@ -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
@@ -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:
@@ -1515,7 +1543,7 @@ module StytchB2B
1515
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.
1516
1544
  # The type of this field is nilable +Boolean+.
1517
1545
  # mfa_phone_number::
1518
- # 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).
1519
1547
  # The type of this field is nilable +String+.
1520
1548
  # mfa_enrolled::
1521
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`.
@@ -88,9 +88,13 @@ module StytchB2B
88
88
  post_request('/v1/b2b/passwords/strength_check', request, headers)
89
89
  end
90
90
 
91
- # Adds an existing password to a member's email that doesn't have a password yet. 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.
91
+ # Adds an existing password to a Member's email that doesn't have a password yet.
92
92
  #
93
- # The member's email will be marked as verified when you use this endpoint. If you are using **cross-organization passwords**, call this method separately for each `organization_id` associated with the given `email_address` to ensure the email is verified across all of their organizations.
93
+ # 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.
94
+ #
95
+ # The Member's email will be marked as verified when you use this endpoint.
96
+ #
97
+ # 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
98
  #
95
99
  # == Parameters:
96
100
  # email_address::
@@ -147,10 +151,11 @@ module StytchB2B
147
151
  # authentication factors with the affected SSO connection IDs will be revoked.
148
152
  # The type of this field is nilable +Boolean+.
149
153
  # mfa_phone_number::
150
- # (no documentation yet)
154
+ # 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
155
  # The type of this field is nilable +String+.
152
156
  # set_phone_number_verified::
153
- # (no documentation yet)
157
+ # 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
158
+ # the user owns the phone number in question.
154
159
  # The type of this field is nilable +Boolean+.
155
160
  # external_id::
156
161
  # 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.
@@ -392,7 +397,7 @@ module StytchB2B
392
397
  # If you have not set a default `reset_password_redirect_url`, an error is returned.
393
398
  # The type of this field is nilable +String+.
394
399
  # reset_password_expiration_minutes::
395
- # Sets a time limit after which the email link to reset the member's password will no longer be valid.
400
+ # 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.
396
401
  # The type of this field is nilable +Integer+.
397
402
  # code_challenge::
398
403
  # A base64url encoded SHA256 hash of a one time secret used to validate that the request starts and ends on the same device.
@@ -991,7 +996,7 @@ module StytchB2B
991
996
  # 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.
992
997
  # The type of this field is nilable +String+.
993
998
  # reset_password_expiration_minutes::
994
- # Sets a time limit after which the email link to reset the member's password will no longer be valid.
999
+ # 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.
995
1000
  # The type of this field is nilable +Integer+.
996
1001
  # pkce_code_challenge::
997
1002
  # (no documentation yet)
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
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Stytch
4
- VERSION = '10.20.0'
4
+ VERSION = '10.22.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.20.0
4
+ version: 10.22.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-11 00:00:00.000000000 Z
11
+ date: 2025-06-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday