stytch 6.5.2 → 6.6.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 3a2f460766302fa45dac9429da80a2c35f3bf81fdf699f1facd9b604c63ce29e
4
- data.tar.gz: 997dc4dfddfdf15912a7d9c6b80ce2064264f7c27dc2530cb0a1868b9001cb42
3
+ metadata.gz: 54d73b52aa606a1039a55239a77a2ce3af67804599db720510823f91133d4bb0
4
+ data.tar.gz: c4c5e784f08c425acd2f2f5ec18e79f8278981bea4ea447172ae74b7f4ef18f2
5
5
  SHA512:
6
- metadata.gz: 700ed564d563b810f48284d25a7d4a73857ed8807c192f38e30d6f1db75da6eb67265453579f1d4477f58a0c5544c30498fb2b7528c81b96fc4bb194dd972230
7
- data.tar.gz: c9e904425177ec57295efebed39e6b10b1ef6e7dc223f8d86466590c50cbc4bebd5498b57d5a851d4a8c71ffc69b7bd87233362ab7bb72d789b498fe51e82052
6
+ metadata.gz: 954e87e5310e35e16352b553d02a4a7d7a8c431a3fc68937c06236072a6f2287a66020339714998069184e5b2a9d0bd7e96c8236848fd06c5a7f66b3f468c9e7
7
+ data.tar.gz: 9902bd4bcc6154aff8a00e7fbc1ae9e2c8e3d4a4ce676b93f2fce49a033ffafdd4290bb3e60013e6a44d693bf900c802a4946f5c4c48d9a4b249de75be1b8c7f
@@ -27,10 +27,10 @@ module StytchB2B
27
27
  #
28
28
  # == Parameters:
29
29
  # organization_name::
30
- # The name of the Organization.
30
+ # The name of the Organization. Must be between 1 and 128 characters in length.
31
31
  # The type of this field is +String+.
32
32
  # organization_slug::
33
- # The unique URL slug of the Organization. A minimum of two characters is required. The slug only accepts alphanumeric characters and the following reserved characters: `-` `.` `_` `~`.
33
+ # The unique URL slug of the Organization. The slug only accepts alphanumeric characters and the following reserved characters: `-` `.` `_` `~`. Must be between 2 and 128 characters in length.
34
34
  # The type of this field is nilable +String+.
35
35
  # organization_logo_url::
36
36
  # The image URL of the Organization logo.
@@ -162,7 +162,7 @@ module StytchB2B
162
162
  get_request(request)
163
163
  end
164
164
 
165
- # Updates an Organization specified by `organization_id`. An Organization must always have at least one auth setting set to either `RESTRICTED` or `ALL_ALLOWED` in order to provision new Members. test
165
+ # Updates an Organization specified by `organization_id`. An Organization must always have at least one auth setting set to either `RESTRICTED` or `ALL_ALLOWED` in order to provision new Members.
166
166
  #
167
167
  # *See the [Organization authentication settings](https://stytch.com/docs/b2b/api/org-auth-settings) resource to learn more about fields like `email_jit_provisioning`, `email_invites`, `sso_jit_provisioning`, etc., and their behaviors.
168
168
  #
@@ -171,10 +171,10 @@ module StytchB2B
171
171
  # Globally unique UUID that identifies a specific Organization. The `organization_id` is critical to perform operations on an Organization, so be sure to preserve this value.
172
172
  # The type of this field is +String+.
173
173
  # organization_name::
174
- # The name of the Organization.
174
+ # The name of the Organization. Must be between 1 and 128 characters in length.
175
175
  # The type of this field is nilable +String+.
176
176
  # organization_slug::
177
- # The unique URL slug of the Organization. A minimum of two characters is required. The slug only accepts alphanumeric characters and the following reserved characters: `-` `.` `_` `~`.
177
+ # The unique URL slug of the Organization. The slug only accepts alphanumeric characters and the following reserved characters: `-` `.` `_` `~`. Must be between 2 and 128 characters in length.
178
178
  # The type of this field is nilable +String+.
179
179
  # organization_logo_url::
180
180
  # The image URL of the Organization logo.
@@ -619,6 +619,38 @@ module StytchB2B
619
619
  delete_request("/v1/b2b/organizations/#{organization_id}/members/passwords/#{member_password_id}")
620
620
  end
621
621
 
622
+ # Get a Member by `member_id`. This endpoint does not require an `organization_id`, so you can use it to get members across organizations. This is a dangerous operation. Incorrect use may open you up to indirect object reference (IDOR) attacks. We recommend using the [Get Member](https://stytch.com/docs/b2b/api/get-member) API instead.
623
+ #
624
+ # == Parameters:
625
+ # member_id::
626
+ # Globally unique UUID that identifies a specific Member. The `member_id` is critical to perform operations on a Member, so be sure to preserve this value.
627
+ # The type of this field is +String+.
628
+ #
629
+ # == Returns:
630
+ # An object with the following fields:
631
+ # request_id::
632
+ # 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.
633
+ # The type of this field is +String+.
634
+ # member_id::
635
+ # Globally unique UUID that identifies a specific Member.
636
+ # The type of this field is +String+.
637
+ # member::
638
+ # The [Member object](https://stytch.com/docs/b2b/api/member-object)
639
+ # The type of this field is +Member+ (+object+).
640
+ # organization::
641
+ # The [Organization object](https://stytch.com/docs/b2b/api/organization-object).
642
+ # The type of this field is +Organization+ (+object+).
643
+ # status_code::
644
+ # 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.
645
+ # The type of this field is +Integer+.
646
+ def dangerously_get(
647
+ member_id:
648
+ )
649
+ query_params = {}
650
+ request = request_with_query_params("/v1/b2b/organizations/members/dangerously_get/#{member_id}", query_params)
651
+ get_request(request)
652
+ end
653
+
622
654
  # Creates a Member. An `organization_id` and `email_address` are required.
623
655
  #
624
656
  # == Parameters:
@@ -40,6 +40,8 @@ module StytchB2B
40
40
  # ### Cost to send SMS OTP
41
41
  # Before configuring SMS or WhatsApp OTPs, please review how Stytch [bills the costs of international OTPs](https://stytch.com/pricing) and understand how to protect your app against [toll fraud](https://stytch.com/docs/guides/passcodes/toll-fraud/overview).
42
42
  #
43
+ # __Note:__ SMS to phone numbers outside of the US and Canada is disabled by default for customers who did not use SMS prior to October 2023. If you're interested in sending international SMS, please reach out to [support@stytch.com](mailto:support@stytch.com?subject=Enable%20international%20SMS).
44
+ #
43
45
  # == Parameters:
44
46
  # organization_id::
45
47
  # Globally unique UUID that identifies a specific Organization. The `organization_id` is critical to perform operations on an Organization, so be sure to preserve this value.
@@ -284,6 +284,14 @@ module StytchB2B
284
284
 
285
285
  # Get the JSON Web Key Set (JWKS) for a project.
286
286
  #
287
+ # JWKS are rotated every ~6 months. Upon rotation, new JWTs will be signed using the new key set, and both key sets will be returned by this endpoint for a period of 1 month.
288
+ #
289
+ # JWTs have a set lifetime of 5 minutes, so there will be a 5 minute period where some JWTs will be signed by the old JWKS, and some JWTs will be signed by the new JWKS. The correct JWKS to use for validation is determined by matching the `kid` value of the JWT and JWKS.
290
+ #
291
+ # If you're using one of our [backend SDKs](https://stytch.com/docs/b2b/sdks), the JWKS roll will be handled for you.
292
+ #
293
+ # If you're using your own JWT validation library, many have built-in support for JWKS rotation, and you'll just need to supply this API endpoint. If not, your application should decide which JWKS to use for validation by inspecting the `kid` value.
294
+ #
287
295
  # == Parameters:
288
296
  # project_id::
289
297
  # The `project_id` to get the JWKS for.
@@ -394,6 +394,9 @@ module StytchB2B
394
394
  # idp_sso_url::
395
395
  # The URL for which assertions for login requests will be sent. This will be provided by the IdP.
396
396
  # The type of this field is nilable +String+.
397
+ # alternative_audience_uri::
398
+ # An alternative URL to use for the Audience Restriction. This value can be used when you wish to migrate an existing SAML integration to Stytch with zero downtime.
399
+ # The type of this field is nilable +String+.
397
400
  #
398
401
  # == Returns:
399
402
  # An object with the following fields:
@@ -413,7 +416,8 @@ module StytchB2B
413
416
  display_name: nil,
414
417
  attribute_mapping: nil,
415
418
  x509_certificate: nil,
416
- idp_sso_url: nil
419
+ idp_sso_url: nil,
420
+ alternative_audience_uri: nil
417
421
  )
418
422
  request = {}
419
423
  request[:idp_entity_id] = idp_entity_id unless idp_entity_id.nil?
@@ -421,10 +425,53 @@ module StytchB2B
421
425
  request[:attribute_mapping] = attribute_mapping unless attribute_mapping.nil?
422
426
  request[:x509_certificate] = x509_certificate unless x509_certificate.nil?
423
427
  request[:idp_sso_url] = idp_sso_url unless idp_sso_url.nil?
428
+ request[:alternative_audience_uri] = alternative_audience_uri unless alternative_audience_uri.nil?
424
429
 
425
430
  put_request("/v1/b2b/sso/saml/#{organization_id}/connections/#{connection_id}", request)
426
431
  end
427
432
 
433
+ # Used to update an existing SAML connection using an IDP metadata URL.
434
+ #
435
+ # A newly created connection will not become active until all the following are provided:
436
+ # * `idp_sso_url`
437
+ # * `idp_entity_id`
438
+ # * `x509_certificate`
439
+ # * `attribute_mapping` (must be supplied using [Update SAML Connection](update-saml-connection))
440
+ #
441
+ # == Parameters:
442
+ # organization_id::
443
+ # Globally unique UUID that identifies a specific Organization. The `organization_id` is critical to perform operations on an Organization, so be sure to preserve this value.
444
+ # The type of this field is +String+.
445
+ # connection_id::
446
+ # Globally unique UUID that identifies a specific SSO `connection_id` for a Member.
447
+ # The type of this field is +String+.
448
+ # metadata_url::
449
+ # A URL that points to the IdP metadata. This will be provided by the IdP.
450
+ # The type of this field is +String+.
451
+ #
452
+ # == Returns:
453
+ # An object with the following fields:
454
+ # request_id::
455
+ # 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.
456
+ # The type of this field is +String+.
457
+ # status_code::
458
+ # 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.
459
+ # The type of this field is +Integer+.
460
+ # connection::
461
+ # The `SAML Connection` object affected by this API call. See the [SAML Connection Object](https://stytch.com/docs/b2b/api/saml-connection-object) for complete response field details.
462
+ # The type of this field is nilable +SAMLConnection+ (+object+).
463
+ def update_by_url(
464
+ organization_id:,
465
+ connection_id:,
466
+ metadata_url:
467
+ )
468
+ request = {
469
+ metadata_url: metadata_url
470
+ }
471
+
472
+ put_request("/v1/b2b/sso/saml/#{organization_id}/connections/#{connection_id}/url", request)
473
+ end
474
+
428
475
  # Delete a SAML verification certificate.
429
476
  #
430
477
  # You may need to do this when rotating certificates from your IdP, since Stytch allows a maximum of 5 certificates per connection. There must always be at least one certificate per active connection.
data/lib/stytch/otps.rb CHANGED
@@ -129,6 +129,8 @@ module Stytch
129
129
  # ### Cost to send SMS OTP
130
130
  # Before configuring SMS or WhatsApp OTPs, please review how Stytch [bills the costs of international OTPs](https://stytch.com/pricing) and understand how to protect your app against [toll fraud](https://stytch.com/docs/guides/passcodes/toll-fraud/overview).
131
131
  #
132
+ # __Note:__ SMS to phone numbers outside of the US and Canada is disabled by default for customers who did not use SMS prior to October 2023. If you're interested in sending international SMS, please reach out to [support@stytch.com](mailto:support@stytch.com?subject=Enable%20international%20SMS).
133
+ #
132
134
  # ### Add a phone number to an existing user
133
135
  #
134
136
  # This endpoint also allows you to add a new phone number to an existing Stytch User. Including a `user_id`, `session_token`, or `session_jwt` in your Send one-time passcode by SMS request will add the new, unverified phone number to the existing Stytch User. If the user successfully authenticates within 5 minutes, the new phone number will be marked as verified and remain permanently on the existing Stytch User. Otherwise, it will be removed from the User object, and any subsequent login requests using that phone number will create a new User.
@@ -205,6 +207,9 @@ module Stytch
205
207
  #
206
208
  # ### Cost to send SMS OTP
207
209
  # Before configuring SMS or WhatsApp OTPs, please review how Stytch [bills the costs of international OTPs](https://stytch.com/pricing) and understand how to protect your app against [toll fraud](https://stytch.com/docs/guides/passcodes/toll-fraud/overview).
210
+ #
211
+ # __Note:__ SMS to phone numbers outside of the US and Canada is disabled by default for customers who did not use SMS prior to October 2023. If you're interested in sending international SMS, please reach out to [support@stytch.com](mailto:support@stytch.com?subject=Enable%20international%20SMS).
212
+ #
208
213
  # ### Next steps
209
214
  #
210
215
  # Collect the OTP which was delivered to the User. Call [Authenticate OTP](https://stytch.com/docs/api/authenticate-otp) using the OTP `code` along with the `phone_id` found in the response as the `method_id`.
@@ -151,7 +151,15 @@ module Stytch
151
151
  post_request('/v1/sessions/revoke', request)
152
152
  end
153
153
 
154
- # Get the JSON Web Key Set (JWKS) for a Stytch Project.
154
+ # Get the JSON Web Key Set (JWKS) for a project.
155
+ #
156
+ # JWKS are rotated every ~6 months. Upon rotation, new JWTs will be signed using the new key set, and both key sets will be returned by this endpoint for a period of 1 month.
157
+ #
158
+ # JWTs have a set lifetime of 5 minutes, so there will be a 5 minute period where some JWTs will be signed by the old JWKS, and some JWTs will be signed by the new JWKS. The correct JWKS to use for validation is determined by matching the `kid` value of the JWT and JWKS.
159
+ #
160
+ # If you're using one of our [backend SDKs](https://stytch.com/docs/sdks), the JWKS roll will be handled for you.
161
+ #
162
+ # If you're using your own JWT validation library, many have built-in support for JWKS rotation, and you'll just need to supply this API endpoint. If not, your application should decide which JWKS to use for validation by inspecting the `kid` value.
155
163
  #
156
164
  # == Parameters:
157
165
  # project_id::
data/lib/stytch/totps.rb CHANGED
@@ -23,7 +23,7 @@ module Stytch
23
23
  # The `user_id` of an active user the TOTP registration should be tied to.
24
24
  # The type of this field is +String+.
25
25
  # expiration_minutes::
26
- # The expiration for the TOTP instance. If the newly created TOTP is not authenticated within this time frame the TOTP will be unusable. Defaults to 60 (1 hour) with a minimum of 5 and a maximum of 1440.
26
+ # The expiration for the TOTP instance. If the newly created TOTP is not authenticated within this time frame the TOTP will be unusable. Defaults to 1440 (1 day) with a minimum of 5 and a maximum of 1440.
27
27
  # The type of this field is nilable +Integer+.
28
28
  #
29
29
  # == Returns:
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Stytch
4
- VERSION = '6.5.2'
4
+ VERSION = '6.6.0'
5
5
  end
@@ -31,10 +31,10 @@ module Stytch
31
31
  # The user agent of the User.
32
32
  # The type of this field is nilable +String+.
33
33
  # authenticator_type::
34
- # The requested authenticator type of the WebAuthn device. The two valid value are platform and cross-platform. If no value passed, we assume both values are allowed.
34
+ # The requested authenticator type of the WebAuthn device. The two valid values are platform and cross-platform. If no value passed, we assume both values are allowed.
35
35
  # The type of this field is nilable +String+.
36
36
  # return_passkey_credential_options::
37
- # If true, the public_key_credential_creation_options returned will be optimized for Passkeys.
37
+ # If true, the `public_key_credential_creation_options` returned will be optimized for Passkeys. This includes making `residentKey` required, `userVerification` preferred, and ignoring the `authenticator_type` passed.
38
38
  # The type of this field is nilable +Boolean+.
39
39
  #
40
40
  # == Returns:
@@ -81,13 +81,21 @@ module Stytch
81
81
  # The response of the [navigator.credentials.create()](https://www.w3.org/TR/webauthn-2/#sctn-createCredential).
82
82
  # The type of this field is +String+.
83
83
  # session_token::
84
- # The session token to authenticate.
84
+ # The `session_token` associated with a User's existing Session.
85
85
  # The type of this field is nilable +String+.
86
86
  # session_duration_minutes::
87
- # Set the session lifetime to be this many minutes from now; minimum of 5 and a maximum of 527040 minutes (366 days). Note that a successful authentication will continue to extend the session this many minutes.
87
+ # Set the session lifetime to be this many minutes from now. This will start a new session if one doesn't already exist,
88
+ # returning both an opaque `session_token` and `session_jwt` for this session. Remember that the `session_jwt` will have a fixed lifetime of
89
+ # five minutes regardless of the underlying session duration, and will need to be refreshed over time.
90
+ #
91
+ # This value must be a minimum of 5 and a maximum of 527040 minutes (366 days).
92
+ #
93
+ # If a `session_token` or `session_jwt` is provided then a successful authentication will continue to extend the session this many minutes.
94
+ #
95
+ # If the `session_duration_minutes` parameter is not specified, a Stytch session will not be created.
88
96
  # The type of this field is nilable +Integer+.
89
97
  # session_jwt::
90
- # The JWT to authenticate. You may provide a JWT that has expired according to its `exp` claim and needs to be refreshed. If the signature is valid and the underlying session is still active then Stytch will return a new JWT.
98
+ # The `session_jwt` associated with a User's existing Session.
91
99
  # The type of this field is nilable +String+.
92
100
  # session_custom_claims::
93
101
  # 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.
@@ -113,7 +121,7 @@ module Stytch
113
121
  # The JSON Web Token (JWT) for a given Stytch Session.
114
122
  # The type of this field is +String+.
115
123
  # user::
116
- # 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.
124
+ # (no documentation yet)
117
125
  # The type of this field is +User+ (+object+).
118
126
  # status_code::
119
127
  # 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.
@@ -137,8 +145,8 @@ module Stytch
137
145
  public_key_credential: public_key_credential
138
146
  }
139
147
  request[:session_token] = session_token unless session_token.nil?
140
- request[:session_jwt] = session_jwt unless session_jwt.nil?
141
148
  request[:session_duration_minutes] = session_duration_minutes unless session_duration_minutes.nil?
149
+ request[:session_jwt] = session_jwt unless session_jwt.nil?
142
150
  request[:session_custom_claims] = session_custom_claims unless session_custom_claims.nil?
143
151
 
144
152
  post_request('/v1/webauthn/register', request)
@@ -156,7 +164,7 @@ module Stytch
156
164
  # The `user_id` of an active user the WebAuthn registration should be tied to.
157
165
  # The type of this field is nilable +String+.
158
166
  # return_passkey_credential_options::
159
- # If true, the public_key_credential_creation_options returned will be optimized for Passkeys.
167
+ # If true, the `public_key_credential_creation_options` returned will be optimized for Passkeys. This includes making `userVerification` preferred.
160
168
  # The type of this field is nilable +Boolean+.
161
169
  #
162
170
  # == Returns:
@@ -265,6 +273,27 @@ module Stytch
265
273
  post_request('/v1/webauthn/authenticate', request)
266
274
  end
267
275
 
276
+ # Updates a WebAuthn registration.
277
+ #
278
+ # == Parameters:
279
+ # webauthn_registration_id::
280
+ # Globally unique UUID that identifies a WebAuthn registration in the Stytch API. The `webautn_registration_id` is used when you need to operate on a specific User's WebAuthn registartion.
281
+ # The type of this field is +String+.
282
+ # name::
283
+ # The `name` of the WebAuthn registration.
284
+ # The type of this field is +String+.
285
+ #
286
+ # == Returns:
287
+ # An object with the following fields:
288
+ # request_id::
289
+ # 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.
290
+ # The type of this field is +String+.
291
+ # status_code::
292
+ # 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.
293
+ # The type of this field is +Integer+.
294
+ # webauthn_registration::
295
+ # A WebAuthn registration.
296
+ # The type of this field is nilable +WebAuthnRegistration+ (+object+).
268
297
  def update(
269
298
  webauthn_registration_id:,
270
299
  name:
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: 6.5.2
4
+ version: 6.6.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - stytch
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2023-11-01 00:00:00.000000000 Z
11
+ date: 2023-11-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday