stytch 10.26.0 → 10.28.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 +19 -3
- data/lib/stytch/b2b_magic_links.rb +12 -4
- data/lib/stytch/b2b_oauth.rb +10 -2
- data/lib/stytch/b2b_organizations.rb +41 -25
- data/lib/stytch/b2b_otp.rb +23 -7
- data/lib/stytch/b2b_passwords.rb +43 -11
- data/lib/stytch/b2b_recovery_codes.rb +12 -4
- data/lib/stytch/b2b_scim.rb +8 -8
- data/lib/stytch/b2b_sessions.rb +30 -6
- data/lib/stytch/b2b_sso.rb +19 -11
- data/lib/stytch/b2b_totps.rb +12 -4
- data/lib/stytch/crypto_wallets.rb +9 -1
- data/lib/stytch/magic_links.rb +9 -1
- data/lib/stytch/oauth.rb +9 -1
- data/lib/stytch/otps.rb +9 -1
- data/lib/stytch/passwords.rb +48 -8
- data/lib/stytch/sessions.rb +27 -3
- data/lib/stytch/totps.rb +18 -2
- data/lib/stytch/users.rb +3 -0
- data/lib/stytch/version.rb +1 -1
- data/lib/stytch/webauthn.rb +18 -2
- metadata +2 -2
data/lib/stytch/b2b_totps.rb
CHANGED
@@ -24,7 +24,7 @@ module StytchB2B
|
|
24
24
|
#
|
25
25
|
# == Parameters:
|
26
26
|
# organization_id::
|
27
|
-
# 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. You may also use the organization_slug here as a convenience.
|
27
|
+
# 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. You may also use the organization_slug or organization_external_id here as a convenience.
|
28
28
|
# The type of this field is +String+.
|
29
29
|
# member_id::
|
30
30
|
# 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. You may use an external_id here if one is set for the member.
|
@@ -96,7 +96,7 @@ module StytchB2B
|
|
96
96
|
#
|
97
97
|
# == Parameters:
|
98
98
|
# organization_id::
|
99
|
-
# 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. You may also use the organization_slug here as a convenience.
|
99
|
+
# 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. You may also use the organization_slug or organization_external_id here as a convenience.
|
100
100
|
# The type of this field is +String+.
|
101
101
|
# member_id::
|
102
102
|
# 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. You may use an external_id here if one is set for the member.
|
@@ -142,6 +142,9 @@ module StytchB2B
|
|
142
142
|
# set_default_mfa::
|
143
143
|
# If passed will set the authenticated method to the default MFA method. Completing an MFA authentication flow for the first time for a Member will implicitly set the method to the default MFA method. This option can be used to update the default MFA method if multiple are being used.
|
144
144
|
# The type of this field is nilable +Boolean+.
|
145
|
+
# telemetry_id::
|
146
|
+
# If the `telemetry_id` is passed, as part of this request, Stytch will call the [Fingerprint Lookup API](https://stytch.com/docs/fraud/api/fingerprint-lookup) and store the associated fingerprints and IPGEO information for the Member. Your workspace must be enabled for Device Fingerprinting to use this feature.
|
147
|
+
# The type of this field is nilable +String+.
|
145
148
|
#
|
146
149
|
# == Returns:
|
147
150
|
# An object with the following fields:
|
@@ -169,6 +172,9 @@ module StytchB2B
|
|
169
172
|
# member_session::
|
170
173
|
# The [Session object](https://stytch.com/docs/b2b/api/session-object).
|
171
174
|
# The type of this field is nilable +MemberSession+ (+object+).
|
175
|
+
# member_device::
|
176
|
+
# If a valid `telemetry_id` was passed in the request and the [Fingerprint Lookup API](https://stytch.com/docs/fraud/api/fingerprint-lookup) returned results, the `member_device` response field will contain information about the member's device attributes.
|
177
|
+
# The type of this field is nilable +DeviceInfo+ (+object+).
|
172
178
|
def authenticate(
|
173
179
|
organization_id:,
|
174
180
|
member_id:,
|
@@ -179,7 +185,8 @@ module StytchB2B
|
|
179
185
|
session_duration_minutes: nil,
|
180
186
|
session_custom_claims: nil,
|
181
187
|
set_mfa_enrollment: nil,
|
182
|
-
set_default_mfa: nil
|
188
|
+
set_default_mfa: nil,
|
189
|
+
telemetry_id: nil
|
183
190
|
)
|
184
191
|
headers = {}
|
185
192
|
request = {
|
@@ -194,6 +201,7 @@ module StytchB2B
|
|
194
201
|
request[:session_custom_claims] = session_custom_claims unless session_custom_claims.nil?
|
195
202
|
request[:set_mfa_enrollment] = set_mfa_enrollment unless set_mfa_enrollment.nil?
|
196
203
|
request[:set_default_mfa] = set_default_mfa unless set_default_mfa.nil?
|
204
|
+
request[:telemetry_id] = telemetry_id unless telemetry_id.nil?
|
197
205
|
|
198
206
|
post_request('/v1/b2b/totp/authenticate', request, headers)
|
199
207
|
end
|
@@ -202,7 +210,7 @@ module StytchB2B
|
|
202
210
|
#
|
203
211
|
# == Parameters:
|
204
212
|
# organization_id::
|
205
|
-
# 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. You may also use the organization_slug here as a convenience.
|
213
|
+
# 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. You may also use the organization_slug or organization_external_id here as a convenience.
|
206
214
|
# The type of this field is +String+.
|
207
215
|
# member_id::
|
208
216
|
# 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. You may use an external_id here if one is set for the member.
|
@@ -115,6 +115,9 @@ module Stytch
|
|
115
115
|
#
|
116
116
|
# Custom claims made with reserved claims ("iss", "sub", "aud", "exp", "nbf", "iat", "jti") will be ignored. Total custom claims size cannot exceed four kilobytes.
|
117
117
|
# The type of this field is nilable +object+.
|
118
|
+
# telemetry_id::
|
119
|
+
# If the `telemetry_id` is passed, as part of this request, Stytch will call the [Fingerprint Lookup API](https://stytch.com/docs/fraud/api/fingerprint-lookup) and store the associated fingerprints and IPGEO information for the User. Your workspace must be enabled for Device Fingerprinting to use this feature.
|
120
|
+
# The type of this field is nilable +String+.
|
118
121
|
#
|
119
122
|
# == Returns:
|
120
123
|
# An object with the following fields:
|
@@ -145,6 +148,9 @@ module Stytch
|
|
145
148
|
# siwe_params::
|
146
149
|
# The parameters of the Sign In With Ethereum (SIWE) message that was signed.
|
147
150
|
# The type of this field is nilable +SIWEParamsResponse+ (+object+).
|
151
|
+
# user_device::
|
152
|
+
# If a valid `telemetry_id` was passed in the request and the [Fingerprint Lookup API](https://stytch.com/docs/fraud/api/fingerprint-lookup) returned results, the `user_device` response field will contain information about the user's device attributes.
|
153
|
+
# The type of this field is nilable +DeviceInfo+ (+object+).
|
148
154
|
def authenticate(
|
149
155
|
crypto_wallet_type:,
|
150
156
|
crypto_wallet_address:,
|
@@ -152,7 +158,8 @@ module Stytch
|
|
152
158
|
session_token: nil,
|
153
159
|
session_duration_minutes: nil,
|
154
160
|
session_jwt: nil,
|
155
|
-
session_custom_claims: nil
|
161
|
+
session_custom_claims: nil,
|
162
|
+
telemetry_id: nil
|
156
163
|
)
|
157
164
|
headers = {}
|
158
165
|
request = {
|
@@ -164,6 +171,7 @@ module Stytch
|
|
164
171
|
request[:session_duration_minutes] = session_duration_minutes unless session_duration_minutes.nil?
|
165
172
|
request[:session_jwt] = session_jwt unless session_jwt.nil?
|
166
173
|
request[:session_custom_claims] = session_custom_claims unless session_custom_claims.nil?
|
174
|
+
request[:telemetry_id] = telemetry_id unless telemetry_id.nil?
|
167
175
|
|
168
176
|
post_request('/v1/crypto_wallets/authenticate', request, headers)
|
169
177
|
end
|
data/lib/stytch/magic_links.rb
CHANGED
@@ -60,6 +60,9 @@ module Stytch
|
|
60
60
|
# code_verifier::
|
61
61
|
# A base64url encoded one time secret used to validate that the request starts and ends on the same device.
|
62
62
|
# The type of this field is nilable +String+.
|
63
|
+
# telemetry_id::
|
64
|
+
# If the `telemetry_id` is passed, as part of this request, Stytch will call the [Fingerprint Lookup API](https://stytch.com/docs/fraud/api/fingerprint-lookup) and store the associated fingerprints and IPGEO information for the User. Your workspace must be enabled for Device Fingerprinting to use this feature.
|
65
|
+
# The type of this field is nilable +String+.
|
63
66
|
#
|
64
67
|
# == Returns:
|
65
68
|
# An object with the following fields:
|
@@ -93,6 +96,9 @@ module Stytch
|
|
93
96
|
# See [Session object](https://stytch.com/docs/api/session-object) for complete response fields.
|
94
97
|
#
|
95
98
|
# The type of this field is nilable +Session+ (+object+).
|
99
|
+
# user_device::
|
100
|
+
# If a valid `telemetry_id` was passed in the request and the [Fingerprint Lookup API](https://stytch.com/docs/fraud/api/fingerprint-lookup) returned results, the `user_device` response field will contain information about the user's device attributes.
|
101
|
+
# The type of this field is nilable +DeviceInfo+ (+object+).
|
96
102
|
def authenticate(
|
97
103
|
token:,
|
98
104
|
attributes: nil,
|
@@ -101,7 +107,8 @@ module Stytch
|
|
101
107
|
session_duration_minutes: nil,
|
102
108
|
session_jwt: nil,
|
103
109
|
session_custom_claims: nil,
|
104
|
-
code_verifier: nil
|
110
|
+
code_verifier: nil,
|
111
|
+
telemetry_id: nil
|
105
112
|
)
|
106
113
|
headers = {}
|
107
114
|
request = {
|
@@ -114,6 +121,7 @@ module Stytch
|
|
114
121
|
request[:session_jwt] = session_jwt unless session_jwt.nil?
|
115
122
|
request[:session_custom_claims] = session_custom_claims unless session_custom_claims.nil?
|
116
123
|
request[:code_verifier] = code_verifier unless code_verifier.nil?
|
124
|
+
request[:telemetry_id] = telemetry_id unless telemetry_id.nil?
|
117
125
|
|
118
126
|
post_request('/v1/magic_links/authenticate', request, headers)
|
119
127
|
end
|
data/lib/stytch/oauth.rb
CHANGED
@@ -101,6 +101,9 @@ module Stytch
|
|
101
101
|
# code_verifier::
|
102
102
|
# A base64url encoded one time secret used to validate that the request starts and ends on the same device.
|
103
103
|
# The type of this field is nilable +String+.
|
104
|
+
# telemetry_id::
|
105
|
+
# If the `telemetry_id` is passed, as part of this request, Stytch will call the [Fingerprint Lookup API](https://stytch.com/docs/fraud/api/fingerprint-lookup) and store the associated fingerprints and IPGEO information for the User. Your workspace must be enabled for Device Fingerprinting to use this feature.
|
106
|
+
# The type of this field is nilable +String+.
|
104
107
|
#
|
105
108
|
# == Returns:
|
106
109
|
# An object with the following fields:
|
@@ -145,13 +148,17 @@ module Stytch
|
|
145
148
|
# See [Session object](https://stytch.com/docs/api/session-object) for complete response fields.
|
146
149
|
#
|
147
150
|
# The type of this field is nilable +Session+ (+object+).
|
151
|
+
# user_device::
|
152
|
+
# If a valid `telemetry_id` was passed in the request and the [Fingerprint Lookup API](https://stytch.com/docs/fraud/api/fingerprint-lookup) returned results, the `user_device` response field will contain information about the user's device attributes.
|
153
|
+
# The type of this field is nilable +DeviceInfo+ (+object+).
|
148
154
|
def authenticate(
|
149
155
|
token:,
|
150
156
|
session_token: nil,
|
151
157
|
session_duration_minutes: nil,
|
152
158
|
session_jwt: nil,
|
153
159
|
session_custom_claims: nil,
|
154
|
-
code_verifier: nil
|
160
|
+
code_verifier: nil,
|
161
|
+
telemetry_id: nil
|
155
162
|
)
|
156
163
|
headers = {}
|
157
164
|
request = {
|
@@ -162,6 +169,7 @@ module Stytch
|
|
162
169
|
request[:session_jwt] = session_jwt unless session_jwt.nil?
|
163
170
|
request[:session_custom_claims] = session_custom_claims unless session_custom_claims.nil?
|
164
171
|
request[:code_verifier] = code_verifier unless code_verifier.nil?
|
172
|
+
request[:telemetry_id] = telemetry_id unless telemetry_id.nil?
|
165
173
|
|
166
174
|
post_request('/v1/oauth/authenticate', request, headers)
|
167
175
|
end
|
data/lib/stytch/otps.rb
CHANGED
@@ -58,6 +58,9 @@ module Stytch
|
|
58
58
|
#
|
59
59
|
# Custom claims made with reserved claims ("iss", "sub", "aud", "exp", "nbf", "iat", "jti") will be ignored. Total custom claims size cannot exceed four kilobytes.
|
60
60
|
# The type of this field is nilable +object+.
|
61
|
+
# telemetry_id::
|
62
|
+
# If the `telemetry_id` is passed, as part of this request, Stytch will call the [Fingerprint Lookup API](https://stytch.com/docs/fraud/api/fingerprint-lookup) and store the associated fingerprints and IPGEO information for the User. Your workspace must be enabled for Device Fingerprinting to use this feature.
|
63
|
+
# The type of this field is nilable +String+.
|
61
64
|
#
|
62
65
|
# == Returns:
|
63
66
|
# An object with the following fields:
|
@@ -91,6 +94,9 @@ module Stytch
|
|
91
94
|
# See [Session object](https://stytch.com/docs/api/session-object) for complete response fields.
|
92
95
|
#
|
93
96
|
# The type of this field is nilable +Session+ (+object+).
|
97
|
+
# user_device::
|
98
|
+
# If a valid `telemetry_id` was passed in the request and the [Fingerprint Lookup API](https://stytch.com/docs/fraud/api/fingerprint-lookup) returned results, the `user_device` response field will contain information about the user's device attributes.
|
99
|
+
# The type of this field is nilable +DeviceInfo+ (+object+).
|
94
100
|
def authenticate(
|
95
101
|
method_id:,
|
96
102
|
code:,
|
@@ -99,7 +105,8 @@ module Stytch
|
|
99
105
|
session_token: nil,
|
100
106
|
session_duration_minutes: nil,
|
101
107
|
session_jwt: nil,
|
102
|
-
session_custom_claims: nil
|
108
|
+
session_custom_claims: nil,
|
109
|
+
telemetry_id: nil
|
103
110
|
)
|
104
111
|
headers = {}
|
105
112
|
request = {
|
@@ -112,6 +119,7 @@ module Stytch
|
|
112
119
|
request[:session_duration_minutes] = session_duration_minutes unless session_duration_minutes.nil?
|
113
120
|
request[:session_jwt] = session_jwt unless session_jwt.nil?
|
114
121
|
request[:session_custom_claims] = session_custom_claims unless session_custom_claims.nil?
|
122
|
+
request[:telemetry_id] = telemetry_id unless telemetry_id.nil?
|
115
123
|
|
116
124
|
post_request('/v1/otps/authenticate', request, headers)
|
117
125
|
end
|
data/lib/stytch/passwords.rb
CHANGED
@@ -61,6 +61,9 @@ module Stytch
|
|
61
61
|
# name::
|
62
62
|
# The name of the user. Each field in the name object is optional.
|
63
63
|
# The type of this field is nilable +Name+ (+object+).
|
64
|
+
# telemetry_id::
|
65
|
+
# If the `telemetry_id` is passed, as part of this request, Stytch will call the [Fingerprint Lookup API](https://stytch.com/docs/fraud/api/fingerprint-lookup) and store the associated fingerprints and IPGEO information for the User. Your workspace must be enabled for Device Fingerprinting to use this feature.
|
66
|
+
# The type of this field is nilable +String+.
|
64
67
|
#
|
65
68
|
# == Returns:
|
66
69
|
# An object with the following fields:
|
@@ -91,6 +94,9 @@ module Stytch
|
|
91
94
|
# See [Session object](https://stytch.com/docs/api/session-object) for complete response fields.
|
92
95
|
#
|
93
96
|
# The type of this field is nilable +Session+ (+object+).
|
97
|
+
# user_device::
|
98
|
+
# If a valid `telemetry_id` was passed in the request and the [Fingerprint Lookup API](https://stytch.com/docs/fraud/api/fingerprint-lookup) returned results, the `user_device` response field will contain information about the user's device attributes.
|
99
|
+
# The type of this field is nilable +DeviceInfo+ (+object+).
|
94
100
|
def create(
|
95
101
|
email:,
|
96
102
|
password:,
|
@@ -98,7 +104,8 @@ module Stytch
|
|
98
104
|
session_custom_claims: nil,
|
99
105
|
trusted_metadata: nil,
|
100
106
|
untrusted_metadata: nil,
|
101
|
-
name: nil
|
107
|
+
name: nil,
|
108
|
+
telemetry_id: nil
|
102
109
|
)
|
103
110
|
headers = {}
|
104
111
|
request = {
|
@@ -110,13 +117,14 @@ module Stytch
|
|
110
117
|
request[:trusted_metadata] = trusted_metadata unless trusted_metadata.nil?
|
111
118
|
request[:untrusted_metadata] = untrusted_metadata unless untrusted_metadata.nil?
|
112
119
|
request[:name] = name unless name.nil?
|
120
|
+
request[:telemetry_id] = telemetry_id unless telemetry_id.nil?
|
113
121
|
|
114
122
|
post_request('/v1/passwords', request, headers)
|
115
123
|
end
|
116
124
|
|
117
125
|
# Authenticate a user with their email address and password. This endpoint verifies that the user has a password currently set, and that the entered password is correct. There are two instances where the endpoint will return a `reset_password` error even if they enter their previous password:
|
118
126
|
#
|
119
|
-
# **One:** The user
|
127
|
+
# **One:** The user's credentials appeared in the HaveIBeenPwned dataset. We force a password reset to ensure that the user is the legitimate owner of the email address, and not a malicious actor abusing the compromised credentials.
|
120
128
|
#
|
121
129
|
# **Two:** A user that has previously authenticated with email/password uses a passwordless authentication method tied to the same email address (e.g. Magic Links, Google OAuth) for the first time. Any subsequent email/password authentication attempt will result in this error. We force a password reset in this instance in order to safely deduplicate the account by email address, without introducing the risk of a pre-hijack account takeover attack.
|
122
130
|
#
|
@@ -151,6 +159,9 @@ module Stytch
|
|
151
159
|
#
|
152
160
|
# Custom claims made with reserved claims ("iss", "sub", "aud", "exp", "nbf", "iat", "jti") will be ignored. Total custom claims size cannot exceed four kilobytes.
|
153
161
|
# The type of this field is nilable +object+.
|
162
|
+
# telemetry_id::
|
163
|
+
# If the `telemetry_id` is passed, as part of this request, Stytch will call the [Fingerprint Lookup API](https://stytch.com/docs/fraud/api/fingerprint-lookup) and store the associated fingerprints and IPGEO information for the User. Your workspace must be enabled for Device Fingerprinting to use this feature.
|
164
|
+
# The type of this field is nilable +String+.
|
154
165
|
#
|
155
166
|
# == Returns:
|
156
167
|
# An object with the following fields:
|
@@ -178,13 +189,17 @@ module Stytch
|
|
178
189
|
# See [Session object](https://stytch.com/docs/api/session-object) for complete response fields.
|
179
190
|
#
|
180
191
|
# The type of this field is nilable +Session+ (+object+).
|
192
|
+
# user_device::
|
193
|
+
# If a valid `telemetry_id` was passed in the request and the [Fingerprint Lookup API](https://stytch.com/docs/fraud/api/fingerprint-lookup) returned results, the `user_device` response field will contain information about the user's device attributes.
|
194
|
+
# The type of this field is nilable +DeviceInfo+ (+object+).
|
181
195
|
def authenticate(
|
182
196
|
email:,
|
183
197
|
password:,
|
184
198
|
session_token: nil,
|
185
199
|
session_duration_minutes: nil,
|
186
200
|
session_jwt: nil,
|
187
|
-
session_custom_claims: nil
|
201
|
+
session_custom_claims: nil,
|
202
|
+
telemetry_id: nil
|
188
203
|
)
|
189
204
|
headers = {}
|
190
205
|
request = {
|
@@ -195,6 +210,7 @@ module Stytch
|
|
195
210
|
request[:session_duration_minutes] = session_duration_minutes unless session_duration_minutes.nil?
|
196
211
|
request[:session_jwt] = session_jwt unless session_jwt.nil?
|
197
212
|
request[:session_custom_claims] = session_custom_claims unless session_custom_claims.nil?
|
213
|
+
request[:telemetry_id] = telemetry_id unless telemetry_id.nil?
|
198
214
|
|
199
215
|
post_request('/v1/passwords/authenticate', request, headers)
|
200
216
|
end
|
@@ -462,7 +478,7 @@ module Stytch
|
|
462
478
|
post_request('/v1/passwords/email/reset/start', request, headers)
|
463
479
|
end
|
464
480
|
|
465
|
-
# Reset the user
|
481
|
+
# Reset the user's password and authenticate them. This endpoint checks that the magic link `token` is valid, hasn't expired, or already been used – and can optionally require additional security settings, such as the IP address and user agent matching the initial reset request.
|
466
482
|
#
|
467
483
|
# The provided password needs to meet our password strength requirements, which can be checked in advance with the password strength endpoint. If the token and password are accepted, the password is securely stored for future authentication and the user is authenticated.
|
468
484
|
#
|
@@ -510,6 +526,9 @@ module Stytch
|
|
510
526
|
# options::
|
511
527
|
# Specify optional security settings.
|
512
528
|
# The type of this field is nilable +Options+ (+object+).
|
529
|
+
# telemetry_id::
|
530
|
+
# If the `telemetry_id` is passed, as part of this request, Stytch will call the [Fingerprint Lookup API](https://stytch.com/docs/fraud/api/fingerprint-lookup) and store the associated fingerprints and IPGEO information for the User. Your workspace must be enabled for Device Fingerprinting to use this feature.
|
531
|
+
# The type of this field is nilable +String+.
|
513
532
|
#
|
514
533
|
# == Returns:
|
515
534
|
# An object with the following fields:
|
@@ -537,6 +556,9 @@ module Stytch
|
|
537
556
|
# See [Session object](https://stytch.com/docs/api/session-object) for complete response fields.
|
538
557
|
#
|
539
558
|
# The type of this field is nilable +Session+ (+object+).
|
559
|
+
# user_device::
|
560
|
+
# If a valid `telemetry_id` was passed in the request and the [Fingerprint Lookup API](https://stytch.com/docs/fraud/api/fingerprint-lookup) returned results, the `user_device` response field will contain information about the user's device attributes.
|
561
|
+
# The type of this field is nilable +DeviceInfo+ (+object+).
|
540
562
|
def reset(
|
541
563
|
token:,
|
542
564
|
password:,
|
@@ -546,7 +568,8 @@ module Stytch
|
|
546
568
|
code_verifier: nil,
|
547
569
|
session_custom_claims: nil,
|
548
570
|
attributes: nil,
|
549
|
-
options: nil
|
571
|
+
options: nil,
|
572
|
+
telemetry_id: nil
|
550
573
|
)
|
551
574
|
headers = {}
|
552
575
|
request = {
|
@@ -560,6 +583,7 @@ module Stytch
|
|
560
583
|
request[:session_custom_claims] = session_custom_claims unless session_custom_claims.nil?
|
561
584
|
request[:attributes] = attributes unless attributes.nil?
|
562
585
|
request[:options] = options unless options.nil?
|
586
|
+
request[:telemetry_id] = telemetry_id unless telemetry_id.nil?
|
563
587
|
|
564
588
|
post_request('/v1/passwords/email/reset', request, headers)
|
565
589
|
end
|
@@ -572,7 +596,7 @@ module Stytch
|
|
572
596
|
@connection = connection
|
573
597
|
end
|
574
598
|
|
575
|
-
# Reset the User
|
599
|
+
# Reset the User's password using their existing password.
|
576
600
|
#
|
577
601
|
# Note that a successful password reset via an existing password will revoke all active sessions for the `user_id`.
|
578
602
|
#
|
@@ -608,6 +632,9 @@ module Stytch
|
|
608
632
|
#
|
609
633
|
# Custom claims made with reserved claims ("iss", "sub", "aud", "exp", "nbf", "iat", "jti") will be ignored. Total custom claims size cannot exceed four kilobytes.
|
610
634
|
# The type of this field is nilable +object+.
|
635
|
+
# telemetry_id::
|
636
|
+
# If the `telemetry_id` is passed, as part of this request, Stytch will call the [Fingerprint Lookup API](https://stytch.com/docs/fraud/api/fingerprint-lookup) and store the associated fingerprints and IPGEO information for the User. Your workspace must be enabled for Device Fingerprinting to use this feature.
|
637
|
+
# The type of this field is nilable +String+.
|
611
638
|
#
|
612
639
|
# == Returns:
|
613
640
|
# An object with the following fields:
|
@@ -635,6 +662,9 @@ module Stytch
|
|
635
662
|
# See [Session object](https://stytch.com/docs/api/session-object) for complete response fields.
|
636
663
|
#
|
637
664
|
# The type of this field is nilable +Session+ (+object+).
|
665
|
+
# user_device::
|
666
|
+
# If a valid `telemetry_id` was passed in the request and the [Fingerprint Lookup API](https://stytch.com/docs/fraud/api/fingerprint-lookup) returned results, the `user_device` response field will contain information about the user's device attributes.
|
667
|
+
# The type of this field is nilable +DeviceInfo+ (+object+).
|
638
668
|
def reset(
|
639
669
|
email:,
|
640
670
|
existing_password:,
|
@@ -642,7 +672,8 @@ module Stytch
|
|
642
672
|
session_token: nil,
|
643
673
|
session_duration_minutes: nil,
|
644
674
|
session_jwt: nil,
|
645
|
-
session_custom_claims: nil
|
675
|
+
session_custom_claims: nil,
|
676
|
+
telemetry_id: nil
|
646
677
|
)
|
647
678
|
headers = {}
|
648
679
|
request = {
|
@@ -654,6 +685,7 @@ module Stytch
|
|
654
685
|
request[:session_duration_minutes] = session_duration_minutes unless session_duration_minutes.nil?
|
655
686
|
request[:session_jwt] = session_jwt unless session_jwt.nil?
|
656
687
|
request[:session_custom_claims] = session_custom_claims unless session_custom_claims.nil?
|
688
|
+
request[:telemetry_id] = telemetry_id unless telemetry_id.nil?
|
657
689
|
|
658
690
|
post_request('/v1/passwords/existing_password/reset', request, headers)
|
659
691
|
end
|
@@ -696,6 +728,9 @@ module Stytch
|
|
696
728
|
#
|
697
729
|
# Custom claims made with reserved claims ("iss", "sub", "aud", "exp", "nbf", "iat", "jti") will be ignored. Total custom claims size cannot exceed four kilobytes.
|
698
730
|
# The type of this field is nilable +object+.
|
731
|
+
# telemetry_id::
|
732
|
+
# If the `telemetry_id` is passed, as part of this request, Stytch will call the [Fingerprint Lookup API](https://stytch.com/docs/fraud/api/fingerprint-lookup) and store the associated fingerprints and IPGEO information for the User. Your workspace must be enabled for Device Fingerprinting to use this feature.
|
733
|
+
# The type of this field is nilable +String+.
|
699
734
|
#
|
700
735
|
# == Returns:
|
701
736
|
# An object with the following fields:
|
@@ -723,12 +758,16 @@ module Stytch
|
|
723
758
|
# See [Session object](https://stytch.com/docs/api/session-object) for complete response fields.
|
724
759
|
#
|
725
760
|
# The type of this field is nilable +Session+ (+object+).
|
761
|
+
# user_device::
|
762
|
+
# If a valid `telemetry_id` was passed in the request and the [Fingerprint Lookup API](https://stytch.com/docs/fraud/api/fingerprint-lookup) returned results, the `user_device` response field will contain information about the user's device attributes.
|
763
|
+
# The type of this field is nilable +DeviceInfo+ (+object+).
|
726
764
|
def reset(
|
727
765
|
password:,
|
728
766
|
session_token: nil,
|
729
767
|
session_jwt: nil,
|
730
768
|
session_duration_minutes: nil,
|
731
|
-
session_custom_claims: nil
|
769
|
+
session_custom_claims: nil,
|
770
|
+
telemetry_id: nil
|
732
771
|
)
|
733
772
|
headers = {}
|
734
773
|
request = {
|
@@ -738,6 +777,7 @@ module Stytch
|
|
738
777
|
request[:session_jwt] = session_jwt unless session_jwt.nil?
|
739
778
|
request[:session_duration_minutes] = session_duration_minutes unless session_duration_minutes.nil?
|
740
779
|
request[:session_custom_claims] = session_custom_claims unless session_custom_claims.nil?
|
780
|
+
request[:telemetry_id] = telemetry_id unless telemetry_id.nil?
|
741
781
|
|
742
782
|
post_request('/v1/passwords/session/reset', request, headers)
|
743
783
|
end
|
data/lib/stytch/sessions.rb
CHANGED
@@ -192,6 +192,9 @@ module Stytch
|
|
192
192
|
#
|
193
193
|
# Custom claims made with reserved claims ("iss", "sub", "aud", "exp", "nbf", "iat", "jti") will be ignored. Total custom claims size cannot exceed four kilobytes.
|
194
194
|
# The type of this field is nilable +object+.
|
195
|
+
# telemetry_id::
|
196
|
+
# If the `telemetry_id` is passed, as part of this request, Stytch will call the [Fingerprint Lookup API](https://stytch.com/docs/fraud/api/fingerprint-lookup) and store the associated fingerprints and IPGEO information for the User. Your workspace must be enabled for Device Fingerprinting to use this feature.
|
197
|
+
# The type of this field is nilable +String+.
|
195
198
|
#
|
196
199
|
# == Returns:
|
197
200
|
# An object with the following fields:
|
@@ -219,10 +222,14 @@ module Stytch
|
|
219
222
|
# See [Session object](https://stytch.com/docs/api/session-object) for complete response fields.
|
220
223
|
#
|
221
224
|
# The type of this field is nilable +Session+ (+object+).
|
225
|
+
# user_device::
|
226
|
+
# If a valid `telemetry_id` was passed in the request and the [Fingerprint Lookup API](https://stytch.com/docs/fraud/api/fingerprint-lookup) returned results, the `user_device` response field will contain information about the user's device attributes.
|
227
|
+
# The type of this field is nilable +DeviceInfo+ (+object+).
|
222
228
|
def migrate(
|
223
229
|
session_token:,
|
224
230
|
session_duration_minutes: nil,
|
225
|
-
session_custom_claims: nil
|
231
|
+
session_custom_claims: nil,
|
232
|
+
telemetry_id: nil
|
226
233
|
)
|
227
234
|
headers = {}
|
228
235
|
request = {
|
@@ -230,6 +237,7 @@ module Stytch
|
|
230
237
|
}
|
231
238
|
request[:session_duration_minutes] = session_duration_minutes unless session_duration_minutes.nil?
|
232
239
|
request[:session_custom_claims] = session_custom_claims unless session_custom_claims.nil?
|
240
|
+
request[:telemetry_id] = telemetry_id unless telemetry_id.nil?
|
233
241
|
|
234
242
|
post_request('/v1/sessions/migrate', request, headers)
|
235
243
|
end
|
@@ -261,6 +269,9 @@ module Stytch
|
|
261
269
|
#
|
262
270
|
# Custom claims made with reserved claims ("iss", "sub", "aud", "exp", "nbf", "iat", "jti") will be ignored. Total custom claims size cannot exceed four kilobytes.
|
263
271
|
# The type of this field is nilable +object+.
|
272
|
+
# telemetry_id::
|
273
|
+
# If the `telemetry_id` is passed, as part of this request, Stytch will call the [Fingerprint Lookup API](https://stytch.com/docs/fraud/api/fingerprint-lookup) and store the associated fingerprints and IPGEO information for the User. Your workspace must be enabled for Device Fingerprinting to use this feature.
|
274
|
+
# The type of this field is nilable +String+.
|
264
275
|
#
|
265
276
|
# == Returns:
|
266
277
|
# An object with the following fields:
|
@@ -288,10 +299,14 @@ module Stytch
|
|
288
299
|
# See [Session object](https://stytch.com/docs/api/session-object) for complete response fields.
|
289
300
|
#
|
290
301
|
# The type of this field is nilable +Session+ (+object+).
|
302
|
+
# user_device::
|
303
|
+
# If a valid `telemetry_id` was passed in the request and the [Fingerprint Lookup API](https://stytch.com/docs/fraud/api/fingerprint-lookup) returned results, the `user_device` response field will contain information about the user's device attributes.
|
304
|
+
# The type of this field is nilable +DeviceInfo+ (+object+).
|
291
305
|
def exchange_access_token(
|
292
306
|
access_token:,
|
293
307
|
session_duration_minutes: nil,
|
294
|
-
session_custom_claims: nil
|
308
|
+
session_custom_claims: nil,
|
309
|
+
telemetry_id: nil
|
295
310
|
)
|
296
311
|
headers = {}
|
297
312
|
request = {
|
@@ -299,6 +314,7 @@ module Stytch
|
|
299
314
|
}
|
300
315
|
request[:session_duration_minutes] = session_duration_minutes unless session_duration_minutes.nil?
|
301
316
|
request[:session_custom_claims] = session_custom_claims unless session_custom_claims.nil?
|
317
|
+
request[:telemetry_id] = telemetry_id unless telemetry_id.nil?
|
302
318
|
|
303
319
|
post_request('/v1/sessions/exchange_access_token', request, headers)
|
304
320
|
end
|
@@ -371,6 +387,9 @@ module Stytch
|
|
371
387
|
# session_jwt::
|
372
388
|
# The `session_jwt` for the session that you wish to add the trusted auth token authentication factor to.
|
373
389
|
# The type of this field is nilable +String+.
|
390
|
+
# telemetry_id::
|
391
|
+
# If the `telemetry_id` is passed, as part of this request, Stytch will call the [Fingerprint Lookup API](https://stytch.com/docs/fraud/api/fingerprint-lookup) and store the associated fingerprints and IPGEO information for the User. Your workspace must be enabled for Device Fingerprinting to use this feature.
|
392
|
+
# The type of this field is nilable +String+.
|
374
393
|
#
|
375
394
|
# == Returns:
|
376
395
|
# An object with the following fields:
|
@@ -398,13 +417,17 @@ module Stytch
|
|
398
417
|
# See [Session object](https://stytch.com/docs/api/session-object) for complete response fields.
|
399
418
|
#
|
400
419
|
# The type of this field is nilable +Session+ (+object+).
|
420
|
+
# user_device::
|
421
|
+
# If a valid `telemetry_id` was passed in the request and the [Fingerprint Lookup API](https://stytch.com/docs/fraud/api/fingerprint-lookup) returned results, the `user_device` response field will contain information about the user's device attributes.
|
422
|
+
# The type of this field is nilable +DeviceInfo+ (+object+).
|
401
423
|
def attest(
|
402
424
|
profile_id:,
|
403
425
|
token:,
|
404
426
|
session_duration_minutes: nil,
|
405
427
|
session_custom_claims: nil,
|
406
428
|
session_token: nil,
|
407
|
-
session_jwt: nil
|
429
|
+
session_jwt: nil,
|
430
|
+
telemetry_id: nil
|
408
431
|
)
|
409
432
|
headers = {}
|
410
433
|
request = {
|
@@ -415,6 +438,7 @@ module Stytch
|
|
415
438
|
request[:session_custom_claims] = session_custom_claims unless session_custom_claims.nil?
|
416
439
|
request[:session_token] = session_token unless session_token.nil?
|
417
440
|
request[:session_jwt] = session_jwt unless session_jwt.nil?
|
441
|
+
request[:telemetry_id] = telemetry_id unless telemetry_id.nil?
|
418
442
|
|
419
443
|
post_request('/v1/sessions/attest', request, headers)
|
420
444
|
end
|
data/lib/stytch/totps.rb
CHANGED
@@ -96,6 +96,9 @@ module Stytch
|
|
96
96
|
#
|
97
97
|
# Custom claims made with reserved claims ("iss", "sub", "aud", "exp", "nbf", "iat", "jti") will be ignored. Total custom claims size cannot exceed four kilobytes.
|
98
98
|
# The type of this field is nilable +object+.
|
99
|
+
# telemetry_id::
|
100
|
+
# If the `telemetry_id` is passed, as part of this request, Stytch will call the [Fingerprint Lookup API](https://stytch.com/docs/fraud/api/fingerprint-lookup) and store the associated fingerprints and IPGEO information for the User. Your workspace must be enabled for Device Fingerprinting to use this feature.
|
101
|
+
# The type of this field is nilable +String+.
|
99
102
|
#
|
100
103
|
# == Returns:
|
101
104
|
# An object with the following fields:
|
@@ -126,13 +129,17 @@ module Stytch
|
|
126
129
|
# See [Session object](https://stytch.com/docs/api/session-object) for complete response fields.
|
127
130
|
#
|
128
131
|
# The type of this field is nilable +Session+ (+object+).
|
132
|
+
# user_device::
|
133
|
+
# If a valid `telemetry_id` was passed in the request and the [Fingerprint Lookup API](https://stytch.com/docs/fraud/api/fingerprint-lookup) returned results, the `user_device` response field will contain information about the user's device attributes.
|
134
|
+
# The type of this field is nilable +DeviceInfo+ (+object+).
|
129
135
|
def authenticate(
|
130
136
|
user_id:,
|
131
137
|
totp_code:,
|
132
138
|
session_token: nil,
|
133
139
|
session_duration_minutes: nil,
|
134
140
|
session_jwt: nil,
|
135
|
-
session_custom_claims: nil
|
141
|
+
session_custom_claims: nil,
|
142
|
+
telemetry_id: nil
|
136
143
|
)
|
137
144
|
headers = {}
|
138
145
|
request = {
|
@@ -143,6 +150,7 @@ module Stytch
|
|
143
150
|
request[:session_duration_minutes] = session_duration_minutes unless session_duration_minutes.nil?
|
144
151
|
request[:session_jwt] = session_jwt unless session_jwt.nil?
|
145
152
|
request[:session_custom_claims] = session_custom_claims unless session_custom_claims.nil?
|
153
|
+
request[:telemetry_id] = telemetry_id unless telemetry_id.nil?
|
146
154
|
|
147
155
|
post_request('/v1/totps/authenticate', request, headers)
|
148
156
|
end
|
@@ -210,6 +218,9 @@ module Stytch
|
|
210
218
|
#
|
211
219
|
# Custom claims made with reserved claims ("iss", "sub", "aud", "exp", "nbf", "iat", "jti") will be ignored. Total custom claims size cannot exceed four kilobytes.
|
212
220
|
# The type of this field is nilable +object+.
|
221
|
+
# telemetry_id::
|
222
|
+
# If the `telemetry_id` is passed, as part of this request, Stytch will call the [Fingerprint Lookup API](https://stytch.com/docs/fraud/api/fingerprint-lookup) and store the associated fingerprints and IPGEO information for the User. Your workspace must be enabled for Device Fingerprinting to use this feature.
|
223
|
+
# The type of this field is nilable +String+.
|
213
224
|
#
|
214
225
|
# == Returns:
|
215
226
|
# An object with the following fields:
|
@@ -240,13 +251,17 @@ module Stytch
|
|
240
251
|
# See [Session object](https://stytch.com/docs/api/session-object) for complete response fields.
|
241
252
|
#
|
242
253
|
# The type of this field is nilable +Session+ (+object+).
|
254
|
+
# user_device::
|
255
|
+
# If a valid `telemetry_id` was passed in the request and the [Fingerprint Lookup API](https://stytch.com/docs/fraud/api/fingerprint-lookup) returned results, the `user_device` response field will contain information about the user's device attributes.
|
256
|
+
# The type of this field is nilable +DeviceInfo+ (+object+).
|
243
257
|
def recover(
|
244
258
|
user_id:,
|
245
259
|
recovery_code:,
|
246
260
|
session_token: nil,
|
247
261
|
session_duration_minutes: nil,
|
248
262
|
session_jwt: nil,
|
249
|
-
session_custom_claims: nil
|
263
|
+
session_custom_claims: nil,
|
264
|
+
telemetry_id: nil
|
250
265
|
)
|
251
266
|
headers = {}
|
252
267
|
request = {
|
@@ -257,6 +272,7 @@ module Stytch
|
|
257
272
|
request[:session_duration_minutes] = session_duration_minutes unless session_duration_minutes.nil?
|
258
273
|
request[:session_jwt] = session_jwt unless session_jwt.nil?
|
259
274
|
request[:session_custom_claims] = session_custom_claims unless session_custom_claims.nil?
|
275
|
+
request[:telemetry_id] = telemetry_id unless telemetry_id.nil?
|
260
276
|
|
261
277
|
post_request('/v1/totps/recover', request, headers)
|
262
278
|
end
|
data/lib/stytch/users.rb
CHANGED
@@ -173,6 +173,9 @@ module Stytch
|
|
173
173
|
get_request(request, headers)
|
174
174
|
end
|
175
175
|
|
176
|
+
#
|
177
|
+
# **Warning**: This endpoint is not recommended for use in login flows. Scaling issues may occur, as search performance may vary from ~150 milliseconds to 9 seconds depending on query complexity and rate limits are set to 150 requests/second.
|
178
|
+
#
|
176
179
|
# Search for Users within your Stytch Project.
|
177
180
|
#
|
178
181
|
# Use the `query` object to filter by different fields. See the `query.operands.filter_value` documentation below for a list of available filters.
|
data/lib/stytch/version.rb
CHANGED