stytch 9.2.0 → 9.4.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/stytch/b2b_organizations.rb +87 -0
- data/lib/stytch/b2b_scim.rb +1 -1
- data/lib/stytch/crypto_wallets.rb +15 -2
- data/lib/stytch/sessions.rb +64 -0
- data/lib/stytch/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 680830d0bdb86bd92d7341d2ed07519a4a185ccaa64b7caa10d342839de88292
|
4
|
+
data.tar.gz: 2e05ae2dfb502777236daddfe88de208f8c27232144f46a7fcbc57514382a6bc
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: '0466802a5065694b7fe51d184d81f70fa869785b6578d389913781cb9d520e6195644a3911b82535cf5cff5c7c41a33ec5e85b099ce36f78e34759406c3368e7'
|
7
|
+
data.tar.gz: 5c26c228ebb6969c0ca476362b611d54ac9cfc7b0e8601640f54e5927c8900dec26c9720cfca9d2b22b8c21e4b748f84816ec17230b3b600f8343f025e1e2613
|
@@ -631,6 +631,25 @@ module StytchB2B
|
|
631
631
|
end
|
632
632
|
end
|
633
633
|
|
634
|
+
class UnlinkRetiredEmailRequestOptions
|
635
|
+
# Optional authorization object.
|
636
|
+
# Pass in an active Stytch Member session token or session JWT and the request
|
637
|
+
# will be run using that member's permissions.
|
638
|
+
attr_accessor :authorization
|
639
|
+
|
640
|
+
def initialize(
|
641
|
+
authorization: nil
|
642
|
+
)
|
643
|
+
@authorization = authorization
|
644
|
+
end
|
645
|
+
|
646
|
+
def to_headers
|
647
|
+
headers = {}
|
648
|
+
headers.merge!(@authorization.to_headers) if authorization
|
649
|
+
headers
|
650
|
+
end
|
651
|
+
end
|
652
|
+
|
634
653
|
class CreateRequestOptions
|
635
654
|
# Optional authorization object.
|
636
655
|
# Pass in an active Stytch Member session token or session JWT and the request
|
@@ -1078,6 +1097,74 @@ module StytchB2B
|
|
1078
1097
|
get_request(request, headers)
|
1079
1098
|
end
|
1080
1099
|
|
1100
|
+
# Unlinks a retired email address from a Member specified by their `organization_id` and `member_id`. The email address
|
1101
|
+
# to be retired can be identified in the request body by either its `email_id`, its `email_address`, or both. If using
|
1102
|
+
# both identifiers they must refer to the same email.
|
1103
|
+
#
|
1104
|
+
# A previously active email address can be marked as retired in one of two ways:
|
1105
|
+
#
|
1106
|
+
# - It's replaced with a new primary email address during an explicit Member update.
|
1107
|
+
# - A new email address is surfaced by an OAuth, SAML or OIDC provider. In this case the new email address becomes the
|
1108
|
+
# Member's primary email address and the old primary email address is retired.
|
1109
|
+
#
|
1110
|
+
# A retired email address cannot be used by other Members in the same Organization. However, unlinking retired email
|
1111
|
+
# addresses allows them to be subsequently re-used by other Organization Members. Retired email addresses can be viewed
|
1112
|
+
# on the [Member object](https://stytch.com/docs/b2b/api/member-object).
|
1113
|
+
# %}
|
1114
|
+
#
|
1115
|
+
# == Parameters:
|
1116
|
+
# organization_id::
|
1117
|
+
# 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.
|
1118
|
+
# The type of this field is +String+.
|
1119
|
+
# member_id::
|
1120
|
+
# 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.
|
1121
|
+
# The type of this field is +String+.
|
1122
|
+
# email_id::
|
1123
|
+
# The globally unique UUID of a Member's email.
|
1124
|
+
# The type of this field is nilable +String+.
|
1125
|
+
# email_address::
|
1126
|
+
# The email address of the Member.
|
1127
|
+
# The type of this field is nilable +String+.
|
1128
|
+
#
|
1129
|
+
# == Returns:
|
1130
|
+
# An object with the following fields:
|
1131
|
+
# request_id::
|
1132
|
+
# 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.
|
1133
|
+
# The type of this field is +String+.
|
1134
|
+
# member_id::
|
1135
|
+
# Globally unique UUID that identifies a specific Member.
|
1136
|
+
# The type of this field is +String+.
|
1137
|
+
# organization_id::
|
1138
|
+
# 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.
|
1139
|
+
# The type of this field is +String+.
|
1140
|
+
# member::
|
1141
|
+
# The [Member object](https://stytch.com/docs/b2b/api/member-object)
|
1142
|
+
# The type of this field is +Member+ (+object+).
|
1143
|
+
# organization::
|
1144
|
+
# The [Organization object](https://stytch.com/docs/b2b/api/organization-object).
|
1145
|
+
# The type of this field is +Organization+ (+object+).
|
1146
|
+
# status_code::
|
1147
|
+
# 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.
|
1148
|
+
# The type of this field is +Integer+.
|
1149
|
+
#
|
1150
|
+
# == Method Options:
|
1151
|
+
# This method supports an optional +StytchB2B::Organizations::Members::UnlinkRetiredEmailRequestOptions+ object which will modify the headers sent in the HTTP request.
|
1152
|
+
def unlink_retired_email(
|
1153
|
+
organization_id:,
|
1154
|
+
member_id:,
|
1155
|
+
email_id: nil,
|
1156
|
+
email_address: nil,
|
1157
|
+
method_options: nil
|
1158
|
+
)
|
1159
|
+
headers = {}
|
1160
|
+
headers = headers.merge(method_options.to_headers) unless method_options.nil?
|
1161
|
+
request = {}
|
1162
|
+
request[:email_id] = email_id unless email_id.nil?
|
1163
|
+
request[:email_address] = email_address unless email_address.nil?
|
1164
|
+
|
1165
|
+
post_request("/v1/b2b/organizations/#{organization_id}/members/#{member_id}/unlink_retired_email", request, headers)
|
1166
|
+
end
|
1167
|
+
|
1081
1168
|
# Creates a Member. An `organization_id` and `email_address` are required.
|
1082
1169
|
#
|
1083
1170
|
# == Parameters:
|
data/lib/stytch/b2b_scim.rb
CHANGED
@@ -194,7 +194,7 @@ module StytchB2B
|
|
194
194
|
# (no documentation yet)
|
195
195
|
# The type of this field is nilable +UpdateRequestIdentityProvider+ (string enum).
|
196
196
|
# scim_group_implicit_role_assignments::
|
197
|
-
#
|
197
|
+
# An array of SCIM group implicit role assignments. Each object in the array must contain a `group` and a `role_id`.
|
198
198
|
# The type of this field is nilable list of +SCIMGroupImplicitRoleAssignments+.
|
199
199
|
#
|
200
200
|
# == Returns:
|
@@ -16,7 +16,12 @@ module Stytch
|
|
16
16
|
@connection = connection
|
17
17
|
end
|
18
18
|
|
19
|
-
# Initiate the authentication of a crypto wallet. After calling this endpoint, the user will need to sign a message containing
|
19
|
+
# Initiate the authentication of a crypto wallet. After calling this endpoint, the user will need to sign a message containing the returned `challenge` field.
|
20
|
+
#
|
21
|
+
# For Ethereum crypto wallets, you can optionally use the Sign In With Ethereum (SIWE) protocol for the message by passing in the `siwe_params`. The only required fields are `domain` and `uri`.
|
22
|
+
# If the crypto wallet detects that the domain in the message does not match the website's domain, it will display a warning to the user.
|
23
|
+
#
|
24
|
+
# If not using the SIWE protocol, the message will simply consist of the project name and a random string.
|
20
25
|
#
|
21
26
|
# == Parameters:
|
22
27
|
# crypto_wallet_type::
|
@@ -34,6 +39,9 @@ module Stytch
|
|
34
39
|
# session_jwt::
|
35
40
|
# The `session_jwt` associated with a User's existing Session.
|
36
41
|
# The type of this field is nilable +String+.
|
42
|
+
# siwe_params::
|
43
|
+
# The parameters for a Sign In With Ethereum (SIWE) message. May only be passed if the `crypto_wallet_type` is `ethereum`.
|
44
|
+
# The type of this field is nilable +SIWEParams+ (+object+).
|
37
45
|
#
|
38
46
|
# == Returns:
|
39
47
|
# An object with the following fields:
|
@@ -57,7 +65,8 @@ module Stytch
|
|
57
65
|
crypto_wallet_address:,
|
58
66
|
user_id: nil,
|
59
67
|
session_token: nil,
|
60
|
-
session_jwt: nil
|
68
|
+
session_jwt: nil,
|
69
|
+
siwe_params: nil
|
61
70
|
)
|
62
71
|
headers = {}
|
63
72
|
request = {
|
@@ -67,6 +76,7 @@ module Stytch
|
|
67
76
|
request[:user_id] = user_id unless user_id.nil?
|
68
77
|
request[:session_token] = session_token unless session_token.nil?
|
69
78
|
request[:session_jwt] = session_jwt unless session_jwt.nil?
|
79
|
+
request[:siwe_params] = siwe_params unless siwe_params.nil?
|
70
80
|
|
71
81
|
post_request('/v1/crypto_wallets/authenticate/start', request, headers)
|
72
82
|
end
|
@@ -132,6 +142,9 @@ module Stytch
|
|
132
142
|
# See [GET sessions](https://stytch.com/docs/api/session-get) for complete response fields.
|
133
143
|
#
|
134
144
|
# The type of this field is nilable +Session+ (+object+).
|
145
|
+
# siwe_params::
|
146
|
+
# The parameters of the Sign In With Ethereum (SIWE) message that was signed.
|
147
|
+
# The type of this field is nilable +SIWEParamsResponse+ (+object+).
|
135
148
|
def authenticate(
|
136
149
|
crypto_wallet_type:,
|
137
150
|
crypto_wallet_address:,
|
data/lib/stytch/sessions.rb
CHANGED
@@ -156,6 +156,70 @@ module Stytch
|
|
156
156
|
post_request('/v1/sessions/revoke', request, headers)
|
157
157
|
end
|
158
158
|
|
159
|
+
# Migrate a session from an external OIDC compliant endpoint. Stytch will call the external UserInfo endpoint defined in your Stytch Project settings in the [Dashboard](/dashboard), and then perform a lookup using the `session_token`. If the response contains a valid email address, Stytch will attempt to match that email address with an existing User and create a Stytch Session. You will need to create the user before using this endpoint.
|
160
|
+
#
|
161
|
+
# == Parameters:
|
162
|
+
# session_token::
|
163
|
+
# The `session_token` associated with a User's existing Session.
|
164
|
+
# The type of this field is +String+.
|
165
|
+
# session_duration_minutes::
|
166
|
+
# Set the session lifetime to be this many minutes from now. This will start a new session if one doesn't already exist,
|
167
|
+
# returning both an opaque `session_token` and `session_jwt` for this session. Remember that the `session_jwt` will have a fixed lifetime of
|
168
|
+
# five minutes regardless of the underlying session duration, and will need to be refreshed over time.
|
169
|
+
#
|
170
|
+
# This value must be a minimum of 5 and a maximum of 527040 minutes (366 days).
|
171
|
+
#
|
172
|
+
# If a `session_token` or `session_jwt` is provided then a successful authentication will continue to extend the session this many minutes.
|
173
|
+
#
|
174
|
+
# If the `session_duration_minutes` parameter is not specified, a Stytch session will not be created.
|
175
|
+
# The type of this field is nilable +Integer+.
|
176
|
+
# session_custom_claims::
|
177
|
+
# 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.
|
178
|
+
#
|
179
|
+
# Custom claims made with reserved claims ("iss", "sub", "aud", "exp", "nbf", "iat", "jti") will be ignored. Total custom claims size cannot exceed four kilobytes.
|
180
|
+
# The type of this field is nilable +object+.
|
181
|
+
#
|
182
|
+
# == Returns:
|
183
|
+
# An object with the following fields:
|
184
|
+
# request_id::
|
185
|
+
# 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.
|
186
|
+
# The type of this field is +String+.
|
187
|
+
# user_id::
|
188
|
+
# The unique ID of the affected User.
|
189
|
+
# The type of this field is +String+.
|
190
|
+
# session_token::
|
191
|
+
# A secret token for a given Stytch Session.
|
192
|
+
# The type of this field is +String+.
|
193
|
+
# session_jwt::
|
194
|
+
# The JSON Web Token (JWT) for a given Stytch Session.
|
195
|
+
# The type of this field is +String+.
|
196
|
+
# user::
|
197
|
+
# 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.
|
198
|
+
# The type of this field is +User+ (+object+).
|
199
|
+
# status_code::
|
200
|
+
# (no documentation yet)
|
201
|
+
# The type of this field is +Integer+.
|
202
|
+
# session::
|
203
|
+
# If you initiate a Session, by including `session_duration_minutes` in your authenticate call, you'll receive a full Session object in the response.
|
204
|
+
#
|
205
|
+
# See [GET sessions](https://stytch.com/docs/api/session-get) for complete response fields.
|
206
|
+
#
|
207
|
+
# The type of this field is nilable +Session+ (+object+).
|
208
|
+
def migrate(
|
209
|
+
session_token:,
|
210
|
+
session_duration_minutes: nil,
|
211
|
+
session_custom_claims: nil
|
212
|
+
)
|
213
|
+
headers = {}
|
214
|
+
request = {
|
215
|
+
session_token: session_token
|
216
|
+
}
|
217
|
+
request[:session_duration_minutes] = session_duration_minutes unless session_duration_minutes.nil?
|
218
|
+
request[:session_custom_claims] = session_custom_claims unless session_custom_claims.nil?
|
219
|
+
|
220
|
+
post_request('/v1/sessions/migrate', request, headers)
|
221
|
+
end
|
222
|
+
|
159
223
|
# Get the JSON Web Key Set (JWKS) for a project.
|
160
224
|
#
|
161
225
|
# 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.
|
data/lib/stytch/version.rb
CHANGED
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: 9.
|
4
|
+
version: 9.4.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- stytch
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-
|
11
|
+
date: 2024-08-01 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: faraday
|