stytch 10.1.0 → 10.3.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_client.rb +3 -1
- data/lib/stytch/b2b_discovery.rb +1 -1
- data/lib/stytch/b2b_impersonation.rb +76 -0
- data/lib/stytch/b2b_organizations.rb +2 -2
- data/lib/stytch/version.rb +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 653ba0c5b4647be6cf2cc7aac82b9f45d69e4faa37d8fb33f6fe542be89e2569
|
4
|
+
data.tar.gz: 210c37ce333a4a394338ae46299e8af98f53a5569fc2766bb25ff7b836ca1921
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 15a1c847414eaa79a0685996f286ef7071ff3e4bc3367246c8f0a82e38a564e7c679810c4f3b6f6a80c77ad71f87a163282d8b047b405b5d118892eb0e3d384d
|
7
|
+
data.tar.gz: c5e7f30486c7493e6f6c0ff2cf1879c2def740762299addad91a5b837357fc0ed9eef838fc611248d6557300ea5c027cbcf4e47a576d0b3a175fa7649404ed28
|
data/lib/stytch/b2b_client.rb
CHANGED
@@ -1,6 +1,7 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
require_relative 'b2b_discovery'
|
4
|
+
require_relative 'b2b_impersonation'
|
4
5
|
require_relative 'b2b_magic_links'
|
5
6
|
require_relative 'b2b_oauth'
|
6
7
|
require_relative 'b2b_organizations'
|
@@ -21,7 +22,7 @@ module StytchB2B
|
|
21
22
|
class Client
|
22
23
|
ENVIRONMENTS = %i[live test].freeze
|
23
24
|
|
24
|
-
attr_reader :discovery, :fraud, :m2m, :magic_links, :oauth, :otps, :organizations, :passwords, :project, :rbac, :recovery_codes, :scim, :sso, :sessions, :totps
|
25
|
+
attr_reader :discovery, :fraud, :impersonation, :m2m, :magic_links, :oauth, :otps, :organizations, :passwords, :project, :rbac, :recovery_codes, :scim, :sso, :sessions, :totps
|
25
26
|
|
26
27
|
def initialize(project_id:, secret:, env: nil, fraud_env: nil, &block)
|
27
28
|
@api_host = api_host(env, project_id)
|
@@ -37,6 +38,7 @@ module StytchB2B
|
|
37
38
|
|
38
39
|
@discovery = StytchB2B::Discovery.new(@connection)
|
39
40
|
@fraud = Stytch::Fraud.new(@fraud_connection)
|
41
|
+
@impersonation = StytchB2B::Impersonation.new(@connection)
|
40
42
|
@m2m = Stytch::M2M.new(@connection, @project_id, @is_b2b_client)
|
41
43
|
@magic_links = StytchB2B::MagicLinks.new(@connection)
|
42
44
|
@oauth = StytchB2B::OAuth.new(@connection)
|
data/lib/stytch/b2b_discovery.rb
CHANGED
@@ -237,7 +237,7 @@ module StytchB2B
|
|
237
237
|
# The type of this field is nilable +String+.
|
238
238
|
# allowed_auth_methods::
|
239
239
|
# An array of allowed authentication methods. This list is enforced when `auth_methods` is set to `RESTRICTED`.
|
240
|
-
# The list's accepted values are: `sso`, `magic_link`, `password`, `google_oauth`, and `
|
240
|
+
# The list's accepted values are: `sso`, `magic_link`, `email_otp`, `password`, `google_oauth`, `microsoft_oauth`, `slack_oauth`, `github_oauth`, and `hubspot_oauth`.
|
241
241
|
#
|
242
242
|
# The type of this field is nilable list of +String+.
|
243
243
|
# mfa_policy::
|
@@ -0,0 +1,76 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
# !!!
|
4
|
+
# WARNING: This file is autogenerated
|
5
|
+
# Only modify code within MANUAL() sections
|
6
|
+
# or your changes may be overwritten later!
|
7
|
+
# !!!
|
8
|
+
|
9
|
+
require_relative 'request_helper'
|
10
|
+
|
11
|
+
module StytchB2B
|
12
|
+
class Impersonation
|
13
|
+
include Stytch::RequestHelper
|
14
|
+
|
15
|
+
def initialize(connection)
|
16
|
+
@connection = connection
|
17
|
+
end
|
18
|
+
|
19
|
+
# Authenticate an impersonation token to impersonate a. This endpoint requires an impersonation token that is not expired or previously used.
|
20
|
+
# A Stytch session will be created for the impersonated member with a 60 minute duration. Impersonated sessions cannot be extended.
|
21
|
+
#
|
22
|
+
# == Parameters:
|
23
|
+
# impersonation_token::
|
24
|
+
# The User Impersonation token to authenticate.
|
25
|
+
# The type of this field is +String+.
|
26
|
+
#
|
27
|
+
# == Returns:
|
28
|
+
# An object with the following fields:
|
29
|
+
# request_id::
|
30
|
+
# 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.
|
31
|
+
# The type of this field is +String+.
|
32
|
+
# member_id::
|
33
|
+
# Globally unique UUID that identifies a specific Member.
|
34
|
+
# The type of this field is +String+.
|
35
|
+
# organization_id::
|
36
|
+
# 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.
|
37
|
+
# The type of this field is +String+.
|
38
|
+
# member::
|
39
|
+
# The [Member object](https://stytch.com/docs/b2b/api/member-object)
|
40
|
+
# The type of this field is +Member+ (+object+).
|
41
|
+
# session_token::
|
42
|
+
# A secret token for a given Stytch Session.
|
43
|
+
# The type of this field is +String+.
|
44
|
+
# session_jwt::
|
45
|
+
# The JSON Web Token (JWT) for a given Stytch Session.
|
46
|
+
# The type of this field is +String+.
|
47
|
+
# organization::
|
48
|
+
# The [Organization object](https://stytch.com/docs/b2b/api/organization-object).
|
49
|
+
# The type of this field is +Organization+ (+object+).
|
50
|
+
# intermediate_session_token::
|
51
|
+
# Successfully authenticating an impersonation token will never result in an intermediate session. If the token is valid, a full session will be created.
|
52
|
+
# The type of this field is +String+.
|
53
|
+
# member_authenticated::
|
54
|
+
# The member will always be fully authenticated if an impersonation token is successfully authenticated.
|
55
|
+
# The type of this field is +Boolean+.
|
56
|
+
# status_code::
|
57
|
+
# 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.
|
58
|
+
# The type of this field is +Integer+.
|
59
|
+
# member_session::
|
60
|
+
# The [Session object](https://stytch.com/docs/b2b/api/session-object) for the impersonated Member.
|
61
|
+
# The type of this field is nilable +MemberSession+ (+object+).
|
62
|
+
# mfa_required::
|
63
|
+
# MFA will not be required when authenticating impersonation tokens.
|
64
|
+
# The type of this field is nilable +MfaRequired+ (+object+).
|
65
|
+
def authenticate(
|
66
|
+
impersonation_token:
|
67
|
+
)
|
68
|
+
headers = {}
|
69
|
+
request = {
|
70
|
+
impersonation_token: impersonation_token
|
71
|
+
}
|
72
|
+
|
73
|
+
post_request('/v1/b2b/impersonation/authenticate', request, headers)
|
74
|
+
end
|
75
|
+
end
|
76
|
+
end
|
@@ -120,7 +120,7 @@ module StytchB2B
|
|
120
120
|
# The type of this field is nilable +String+.
|
121
121
|
# allowed_auth_methods::
|
122
122
|
# An array of allowed authentication methods. This list is enforced when `auth_methods` is set to `RESTRICTED`.
|
123
|
-
# The list's accepted values are: `sso`, `magic_link`, `password`, `google_oauth`, and `
|
123
|
+
# The list's accepted values are: `sso`, `magic_link`, `email_otp`, `password`, `google_oauth`, `microsoft_oauth`, `slack_oauth`, `github_oauth`, and `hubspot_oauth`.
|
124
124
|
#
|
125
125
|
# The type of this field is nilable list of +String+.
|
126
126
|
# mfa_policy::
|
@@ -334,7 +334,7 @@ module StytchB2B
|
|
334
334
|
# The type of this field is nilable +String+.
|
335
335
|
# allowed_auth_methods::
|
336
336
|
# An array of allowed authentication methods. This list is enforced when `auth_methods` is set to `RESTRICTED`.
|
337
|
-
# The list's accepted values are: `sso`, `magic_link`, `password`, `google_oauth`, and `
|
337
|
+
# The list's accepted values are: `sso`, `magic_link`, `email_otp`, `password`, `google_oauth`, `microsoft_oauth`, `slack_oauth`, `github_oauth`, and `hubspot_oauth`.
|
338
338
|
#
|
339
339
|
#
|
340
340
|
# If this field is provided and a session header is passed into the request, the Member Session must have permission to perform the `update.settings.allowed-auth-methods` action on the `stytch.organization` Resource.
|
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: 10.
|
4
|
+
version: 10.3.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-01-
|
11
|
+
date: 2025-01-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: faraday
|
@@ -126,6 +126,7 @@ files:
|
|
126
126
|
- lib/stytch.rb
|
127
127
|
- lib/stytch/b2b_client.rb
|
128
128
|
- lib/stytch/b2b_discovery.rb
|
129
|
+
- lib/stytch/b2b_impersonation.rb
|
129
130
|
- lib/stytch/b2b_magic_links.rb
|
130
131
|
- lib/stytch/b2b_oauth.rb
|
131
132
|
- lib/stytch/b2b_organizations.rb
|