workos 10.0.0 → 10.1.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/.claude/CLAUDE.md +38 -0
- data/.last-synced-sha +1 -1
- data/.release-please-manifest.json +1 -1
- data/AGENTS.md +1 -0
- data/CHANGELOG.md +31 -0
- data/Gemfile.lock +2 -2
- data/lib/workos/pipes/create_data_integration.rb +3 -0
- data/lib/workos/pipes/data_integration.rb +3 -0
- data/lib/workos/pipes/data_integrations_get_data_integration_authorize_url_request.rb +5 -2
- data/lib/workos/pipes.rb +7 -1
- data/lib/workos/pipes_provider/configure_data_integration_body.rb +5 -2
- data/lib/workos/pipes_provider/data_integration_configuration_response.rb +3 -0
- data/lib/workos/pipes_provider.rb +4 -1
- data/lib/workos/sso/connection.rb +0 -3
- data/lib/workos/sso.rb +73 -26
- data/lib/workos/types/connected_account_auth_method.rb +2 -1
- data/lib/workos/types/create_data_integration_auth_methods.rb +5 -1
- data/lib/workos/user_management.rb +90 -44
- data/lib/workos/version.rb +1 -1
- data/rbi/workos/configure_data_integration_body.rbi +6 -0
- data/rbi/workos/connection.rbi +0 -6
- data/rbi/workos/create_data_integration.rbi +6 -0
- data/rbi/workos/data_integration.rbi +6 -0
- data/rbi/workos/data_integration_configuration_response.rbi +6 -0
- data/rbi/workos/data_integrations_get_data_integration_authorize_url_request.rbi +6 -0
- data/rbi/workos/pipes.rbi +4 -2
- data/rbi/workos/pipes_provider.rbi +2 -1
- data/rbi/workos/sso.rbi +26 -0
- data/rbi/workos/user_management.rbi +30 -0
- data/test/workos/test_authkit_helpers.rb +22 -10
- data/test/workos/test_pipes_model_round_trip.rb +4 -1
- data/test/workos/test_pipes_provider_model_round_trip.rb +3 -1
- data/test/workos/test_shared_model_round_trip.rb +0 -62
- data/test/workos/test_sso_model_round_trip.rb +0 -1
- metadata +3 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 4ed7a1c92c327c1fe2a2f2a582be522670e33f085ca6b7b44f8cb3c968e231bf
|
|
4
|
+
data.tar.gz: d78826116d38974783cb835dd51890b7aa98dbb2fab67a4a9bc00b8e691c3f0b
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: fa5d2429aa5a63556852efadafb0c01cd2d9d26500513cbe520d4501fb8ade808423a7245f302726d295c24b4a9f7714c280a955964b5bf401bdc2d17be18b9e
|
|
7
|
+
data.tar.gz: 061b36f82c50b4a2e5c0f8ba94777f1dac191ceddc3206683d472f28775979a10161bd926cf902c618cfddb22bce50f5706bee986a7088dc7678af2dcfe6a59e
|
data/.claude/CLAUDE.md
ADDED
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
# WorkOS Ruby SDK — Agent Context
|
|
2
|
+
|
|
3
|
+
Most code in this repository is **auto-generated**. It is emitted by the
|
|
4
|
+
oagen pipeline from the WorkOS OpenAPI spec. It is not hand-written here,
|
|
5
|
+
and most bugs in it cannot be fixed here.
|
|
6
|
+
|
|
7
|
+
## The generation pipeline
|
|
8
|
+
|
|
9
|
+
| Repo | Role |
|
|
10
|
+
| --- | --- |
|
|
11
|
+
| [workos/openapi-spec](https://github.com/workos/openapi-spec) | Source of truth for the API surface (the OpenAPI spec, exported by the WorkOS API) and the orchestration entrypoint for all SDK generation |
|
|
12
|
+
| [workos/oagen](https://github.com/workos/oagen) | The generator engine (spec → IR → code) |
|
|
13
|
+
| [workos/oagen-emitters](https://github.com/workos/oagen-emitters) | The per-language emitters, including the Ruby emitter that produces this repo's code |
|
|
14
|
+
|
|
15
|
+
Regeneration runs from a checkout of `openapi-spec`, never from this repo:
|
|
16
|
+
|
|
17
|
+
```bash
|
|
18
|
+
npm run sdk:generate -- --lang ruby --output workos-ruby
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
## Generated vs. hand-maintained code
|
|
22
|
+
|
|
23
|
+
- Generated files begin with the header `# This file is auto-generated by oagen. Do not edit.` — treat them as build artifacts.
|
|
24
|
+
- Hand-maintained code is fenced with `@oagen-ignore-start` / `@oagen-ignore-end` markers, or lives in files marked `@oagen-ignore-file`. Only this code is editable in this repo.
|
|
25
|
+
|
|
26
|
+
## Where to fix an issue
|
|
27
|
+
|
|
28
|
+
| Symptom | Fix it in |
|
|
29
|
+
| --- | --- |
|
|
30
|
+
| Wrong or missing endpoint, field, type, or enum value | [workos/openapi-spec](https://github.com/workos/openapi-spec) (or the WorkOS API that exports the spec) |
|
|
31
|
+
| Generated Ruby code is broken or un-idiomatic | [workos/oagen-emitters](https://github.com/workos/oagen-emitters) |
|
|
32
|
+
| Generator behavior: naming, IR, pagination, compat checks | [workos/oagen](https://github.com/workos/oagen) |
|
|
33
|
+
| Code inside `@oagen-ignore` fences or ignore-marked files | This repo — edit normally |
|
|
34
|
+
|
|
35
|
+
Don't hand-edit a file that has the generated header — the next
|
|
36
|
+
`sdk:generate` run silently overwrites it. Instead, fix the emitter or the
|
|
37
|
+
spec upstream and regenerate. If a requested fix lands in a generated file,
|
|
38
|
+
say so and point at the upstream repo rather than patching it here.
|
data/.last-synced-sha
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
ae3ebbb08d9b4bf9b2391558e820b7eb6f511fb9
|
data/AGENTS.md
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.claude/CLAUDE.md
|
data/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,36 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [10.1.0](https://github.com/workos/workos-ruby/compare/v10.0.0...v10.1.0) (2026-07-28)
|
|
4
|
+
|
|
5
|
+
### Features
|
|
6
|
+
|
|
7
|
+
* replace hand-written URL builders with generated ones ([b162486](https://github.com/workos/workos-ruby/commit/b1624866137d8364dda1726b0302b70bed00a75c))
|
|
8
|
+
|
|
9
|
+
* [#531](https://github.com/workos/workos-ruby/pull/531) fix(generated): regenerate from spec
|
|
10
|
+
|
|
11
|
+
**Features**
|
|
12
|
+
* **[pipes](https://workos.com/docs/reference/pipes)**:
|
|
13
|
+
* Added `config` to `DataIntegrationsGetDataIntegrationAuthorizeUrlRequest`
|
|
14
|
+
* Added `client_credentials` to `DataIntegrationAuthMethods`
|
|
15
|
+
* Added `client_credentials` to `DataIntegrationsListResponseDataAuthMethods`
|
|
16
|
+
* Added `client_credentials` to `DataIntegrationsListResponseDataConnectedAccountAuthMethod`
|
|
17
|
+
* Added `config` to Pipes models
|
|
18
|
+
* **[connect](https://workos.com/docs/reference/workos-connect/standalone)**:
|
|
19
|
+
* Added `client_credentials` to `ConnectedAccountAuthMethod`
|
|
20
|
+
|
|
21
|
+
**Fixes**
|
|
22
|
+
* **[user_management](https://workos.com/docs/reference/authkit/user)**:
|
|
23
|
+
* Changed errors for endpoint `POST /user_management/invitations`
|
|
24
|
+
* Changed errors for endpoint `POST /user_management/invitations/{id}/resend`
|
|
25
|
+
* Changed errors for endpoint `POST /user_management/magic_auth`
|
|
26
|
+
* Changed errors for endpoint `POST /user_management/authenticate`
|
|
27
|
+
|
|
28
|
+
* [#532](https://github.com/workos/workos-ruby/pull/532) fix(generated): regenerate from spec
|
|
29
|
+
|
|
30
|
+
**Fixes**
|
|
31
|
+
* **[sso](https://workos.com/docs/reference/sso)**:
|
|
32
|
+
* Removed `callback_endpoint` from `Connection`
|
|
33
|
+
|
|
3
34
|
## [10.0.0](https://github.com/workos/workos-ruby/compare/v9.5.0...v10.0.0) (2026-07-22)
|
|
4
35
|
|
|
5
36
|
### Bug Fixes
|
data/Gemfile.lock
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
PATH
|
|
2
2
|
remote: .
|
|
3
3
|
specs:
|
|
4
|
-
workos (10.
|
|
4
|
+
workos (10.1.0)
|
|
5
5
|
jwt (~> 3.1)
|
|
6
6
|
logger (~> 1.7)
|
|
7
7
|
zeitwerk (~> 2.6)
|
|
@@ -153,7 +153,7 @@ CHECKSUMS
|
|
|
153
153
|
unicode-emoji (4.2.0) sha256=519e69150f75652e40bf736106cfbc8f0f73aa3fb6a65afe62fefa7f80b0f80f
|
|
154
154
|
webmock (3.26.2) sha256=774556f2ea6371846cca68c01769b2eac0d134492d21f6d0ab5dd643965a4c90
|
|
155
155
|
webrick (1.9.2) sha256=beb4a15fc474defed24a3bda4ffd88a490d517c9e4e6118c3edce59e45864131
|
|
156
|
-
workos (10.
|
|
156
|
+
workos (10.1.0)
|
|
157
157
|
yard (0.9.44) sha256=eb087e9b631ccd887b049f303d489963945452d5e2a7eb49a5a74a7cf6887f28
|
|
158
158
|
yard-markdown (0.7.1) sha256=06c378632dfe7ba053be9ba469eb4701aa0470e36bcf7e5546f353eb90c1bfd1
|
|
159
159
|
zeitwerk (2.7.5) sha256=d8da92128c09ea6ec62c949011b00ed4a20242b255293dd66bf41545398f73dd
|
|
@@ -10,6 +10,7 @@ module WorkOS
|
|
|
10
10
|
enabled: :enabled,
|
|
11
11
|
scopes: :scopes,
|
|
12
12
|
auth_methods: :auth_methods,
|
|
13
|
+
config: :config,
|
|
13
14
|
credentials: :credentials,
|
|
14
15
|
api_key: :api_key,
|
|
15
16
|
custom_provider: :custom_provider
|
|
@@ -21,6 +22,7 @@ module WorkOS
|
|
|
21
22
|
:enabled,
|
|
22
23
|
:scopes,
|
|
23
24
|
:auth_methods,
|
|
25
|
+
:config,
|
|
24
26
|
:credentials,
|
|
25
27
|
:api_key,
|
|
26
28
|
:custom_provider
|
|
@@ -32,6 +34,7 @@ module WorkOS
|
|
|
32
34
|
@enabled = hash[:enabled]
|
|
33
35
|
@scopes = hash[:scopes] || []
|
|
34
36
|
@auth_methods = hash[:auth_methods] || []
|
|
37
|
+
@config = hash[:config] || {}
|
|
35
38
|
@credentials = hash[:credentials] ? WorkOS::DataIntegrationCredentialsInput.new(hash[:credentials]) : nil
|
|
36
39
|
@api_key = hash[:api_key] ? WorkOS::ApiKeyInstallation.new(hash[:api_key]) : nil
|
|
37
40
|
@custom_provider = hash[:custom_provider] ? WorkOS::CustomProviderDefinition.new(hash[:custom_provider]) : nil
|
|
@@ -17,6 +17,7 @@ module WorkOS
|
|
|
17
17
|
auth_methods: :auth_methods,
|
|
18
18
|
credentials: :credentials,
|
|
19
19
|
installation: :installation,
|
|
20
|
+
config: :config,
|
|
20
21
|
custom_provider: :custom_provider,
|
|
21
22
|
created_at: :created_at,
|
|
22
23
|
updated_at: :updated_at
|
|
@@ -35,6 +36,7 @@ module WorkOS
|
|
|
35
36
|
:auth_methods,
|
|
36
37
|
:credentials,
|
|
37
38
|
:installation,
|
|
39
|
+
:config,
|
|
38
40
|
:custom_provider,
|
|
39
41
|
:created_at,
|
|
40
42
|
:updated_at
|
|
@@ -53,6 +55,7 @@ module WorkOS
|
|
|
53
55
|
@auth_methods = hash[:auth_methods] || []
|
|
54
56
|
@credentials = hash[:credentials] ? WorkOS::DataIntegrationCredential.new(hash[:credentials]) : nil
|
|
55
57
|
@installation = hash[:installation] ? WorkOS::DataIntegrationInstallation.new(hash[:installation]) : nil
|
|
58
|
+
@config = hash[:config] || {}
|
|
56
59
|
@custom_provider = hash[:custom_provider] ? WorkOS::DataIntegrationCustomProvider.new(hash[:custom_provider]) : nil
|
|
57
60
|
@created_at = hash[:created_at]
|
|
58
61
|
@updated_at = hash[:updated_at]
|
|
@@ -7,19 +7,22 @@ module WorkOS
|
|
|
7
7
|
HASH_ATTRS = {
|
|
8
8
|
user_id: :user_id,
|
|
9
9
|
organization_id: :organization_id,
|
|
10
|
-
return_to: :return_to
|
|
10
|
+
return_to: :return_to,
|
|
11
|
+
config: :config
|
|
11
12
|
}.freeze
|
|
12
13
|
|
|
13
14
|
attr_accessor \
|
|
14
15
|
:user_id,
|
|
15
16
|
:organization_id,
|
|
16
|
-
:return_to
|
|
17
|
+
:return_to,
|
|
18
|
+
:config
|
|
17
19
|
|
|
18
20
|
def initialize(json)
|
|
19
21
|
hash = self.class.normalize(json)
|
|
20
22
|
@user_id = hash[:user_id]
|
|
21
23
|
@organization_id = hash[:organization_id]
|
|
22
24
|
@return_to = hash[:return_to]
|
|
25
|
+
@config = hash[:config] || {}
|
|
23
26
|
end
|
|
24
27
|
end
|
|
25
28
|
end
|
data/lib/workos/pipes.rb
CHANGED
|
@@ -60,6 +60,7 @@ module WorkOS
|
|
|
60
60
|
# @param enabled [Boolean, nil] Whether the Data Integration is enabled. Defaults to `false`.
|
|
61
61
|
# @param scopes [Array<String>, nil] The OAuth scopes to request for the Data Integration. Defaults to the provider's configured scopes when omitted.
|
|
62
62
|
# @param auth_methods [Array<WorkOS::Types::CreateDataIntegrationAuthMethods>, nil] How accounts authenticate with the provider. Defaults to `["oauth"]`. Use `["api_key"]` to declare an API key integration; `credentials` is then not required and keys are supplied per-tenant (optionally via `api_key` on this request).
|
|
63
|
+
# @param config [Hash{String => String}, nil] Provider-specific config values (e.g. a Snowflake `account_identifier`), keyed by the config field. Only fields the built-in provider declares are accepted.
|
|
63
64
|
# @param credentials [WorkOS::DataIntegrationCredentialsInput, nil] The OAuth credentials to configure for the Data Integration. Required for OAuth integrations; omit when `auth_methods` is `["api_key"]`.
|
|
64
65
|
# @param api_key [WorkOS::ApiKeyInstallation, nil] An optional API key to install for the first tenant on an `api_key` integration. Omit to declare a keyless integration; tenants can be added later via the per-installation API key path.
|
|
65
66
|
# @param custom_provider [WorkOS::CustomProviderDefinition, nil] The OAuth definition for a custom provider. Supply this to define a custom provider; omit it to create an integration for a built-in provider.
|
|
@@ -71,6 +72,7 @@ module WorkOS
|
|
|
71
72
|
enabled: nil,
|
|
72
73
|
scopes: WorkOS::OMIT,
|
|
73
74
|
auth_methods: nil,
|
|
75
|
+
config: nil,
|
|
74
76
|
credentials: nil,
|
|
75
77
|
api_key: nil,
|
|
76
78
|
custom_provider: nil,
|
|
@@ -80,6 +82,7 @@ module WorkOS
|
|
|
80
82
|
"provider" => provider,
|
|
81
83
|
"enabled" => enabled,
|
|
82
84
|
"auth_methods" => auth_methods,
|
|
85
|
+
"config" => config,
|
|
83
86
|
"credentials" => credentials,
|
|
84
87
|
"api_key" => api_key,
|
|
85
88
|
"custom_provider" => custom_provider
|
|
@@ -210,6 +213,7 @@ module WorkOS
|
|
|
210
213
|
# @param user_id [String] The ID of the user to authorize.
|
|
211
214
|
# @param organization_id [String, nil] An organization ID to scope the authorization to a specific organization.
|
|
212
215
|
# @param return_to [String, nil] The URL to redirect the user to after authorization.
|
|
216
|
+
# @param config [Hash{String => String}, nil] Connect-time config values for the provider-declared `installation`-scope fields (e.g. a Zendesk `subdomain`), keyed by the config field. Only fields the provider declares may be supplied, and required fields must be provided unless already pinned on the integration.
|
|
213
217
|
# @param request_options [Hash] (see WorkOS::Types::RequestOptions)
|
|
214
218
|
# @return [WorkOS::DataIntegrationAuthorizeUrlResponse]
|
|
215
219
|
def authorize_data_integration(
|
|
@@ -217,12 +221,14 @@ module WorkOS
|
|
|
217
221
|
user_id:,
|
|
218
222
|
organization_id: nil,
|
|
219
223
|
return_to: nil,
|
|
224
|
+
config: nil,
|
|
220
225
|
request_options: {}
|
|
221
226
|
)
|
|
222
227
|
body = {
|
|
223
228
|
"user_id" => user_id,
|
|
224
229
|
"organization_id" => organization_id,
|
|
225
|
-
"return_to" => return_to
|
|
230
|
+
"return_to" => return_to,
|
|
231
|
+
"config" => config
|
|
226
232
|
}.compact
|
|
227
233
|
response = @client.request(
|
|
228
234
|
method: :post,
|
|
@@ -8,14 +8,16 @@ module WorkOS
|
|
|
8
8
|
enabled: :enabled,
|
|
9
9
|
scopes: :scopes,
|
|
10
10
|
client_id: :client_id,
|
|
11
|
-
client_secret: :client_secret
|
|
11
|
+
client_secret: :client_secret,
|
|
12
|
+
config: :config
|
|
12
13
|
}.freeze
|
|
13
14
|
|
|
14
15
|
attr_accessor \
|
|
15
16
|
:enabled,
|
|
16
17
|
:scopes,
|
|
17
18
|
:client_id,
|
|
18
|
-
:client_secret
|
|
19
|
+
:client_secret,
|
|
20
|
+
:config
|
|
19
21
|
|
|
20
22
|
def initialize(json)
|
|
21
23
|
hash = self.class.normalize(json)
|
|
@@ -23,6 +25,7 @@ module WorkOS
|
|
|
23
25
|
@scopes = hash[:scopes] || []
|
|
24
26
|
@client_id = hash[:client_id]
|
|
25
27
|
@client_secret = hash[:client_secret]
|
|
28
|
+
@config = hash[:config] || {}
|
|
26
29
|
end
|
|
27
30
|
end
|
|
28
31
|
end
|
|
@@ -12,6 +12,7 @@ module WorkOS
|
|
|
12
12
|
name: :name,
|
|
13
13
|
enabled: :enabled,
|
|
14
14
|
scopes: :scopes,
|
|
15
|
+
config: :config,
|
|
15
16
|
created_at: :created_at,
|
|
16
17
|
updated_at: :updated_at,
|
|
17
18
|
credentials: :credentials
|
|
@@ -25,6 +26,7 @@ module WorkOS
|
|
|
25
26
|
:name,
|
|
26
27
|
:enabled,
|
|
27
28
|
:scopes,
|
|
29
|
+
:config,
|
|
28
30
|
:created_at,
|
|
29
31
|
:updated_at,
|
|
30
32
|
:credentials
|
|
@@ -38,6 +40,7 @@ module WorkOS
|
|
|
38
40
|
@name = hash[:name]
|
|
39
41
|
@enabled = hash[:enabled]
|
|
40
42
|
@scopes = hash[:scopes] || []
|
|
43
|
+
@config = hash[:config] || {}
|
|
41
44
|
@created_at = hash[:created_at]
|
|
42
45
|
@updated_at = hash[:updated_at]
|
|
43
46
|
@credentials = hash[:credentials] ? WorkOS::DataIntegrationCredentials.new(hash[:credentials]) : nil
|
|
@@ -36,6 +36,7 @@ module WorkOS
|
|
|
36
36
|
# @param scopes [Array<String>, nil] The OAuth scopes to request for the organization. Pass `null` to inherit the provider scopes.
|
|
37
37
|
# @param client_id [String, nil] The OAuth client ID of the organization's own application. Must be provided together with `client_secret`, and only for providers whose credentials are supplied by the organization.
|
|
38
38
|
# @param client_secret [String, nil] The OAuth client secret of the organization's own application. Must be provided together with `client_id`.
|
|
39
|
+
# @param config [Hash{String => String}, nil] Provider-specific config values to set for the organization, keyed by config field. Only fields the provider declares are accepted, and each value must match that field's pattern. Accepted only for providers whose credentials are organization-managed; for shared or custom credential providers, config belongs on the integration itself (via the data-integrations API) and supplying it here is rejected.
|
|
39
40
|
# @param request_options [Hash] (see WorkOS::Types::RequestOptions)
|
|
40
41
|
# @return [WorkOS::DataIntegrationConfigurationResponse]
|
|
41
42
|
def update_organization_data_integration_configuration(
|
|
@@ -45,12 +46,14 @@ module WorkOS
|
|
|
45
46
|
scopes: WorkOS::OMIT,
|
|
46
47
|
client_id: nil,
|
|
47
48
|
client_secret: nil,
|
|
49
|
+
config: nil,
|
|
48
50
|
request_options: {}
|
|
49
51
|
)
|
|
50
52
|
body = {
|
|
51
53
|
"enabled" => enabled,
|
|
52
54
|
"client_id" => client_id,
|
|
53
|
-
"client_secret" => client_secret
|
|
55
|
+
"client_secret" => client_secret,
|
|
56
|
+
"config" => config
|
|
54
57
|
}.compact
|
|
55
58
|
body["scopes"] = scopes unless scopes.equal?(WorkOS::OMIT)
|
|
56
59
|
response = @client.request(
|
|
@@ -13,7 +13,6 @@ module WorkOS
|
|
|
13
13
|
state: :state,
|
|
14
14
|
status: :status,
|
|
15
15
|
domains: :domains,
|
|
16
|
-
callback_endpoint: :callback_endpoint,
|
|
17
16
|
created_at: :created_at,
|
|
18
17
|
updated_at: :updated_at
|
|
19
18
|
}.freeze
|
|
@@ -29,7 +28,6 @@ module WorkOS
|
|
|
29
28
|
:name,
|
|
30
29
|
:state,
|
|
31
30
|
:domains,
|
|
32
|
-
:callback_endpoint,
|
|
33
31
|
:created_at,
|
|
34
32
|
:updated_at
|
|
35
33
|
|
|
@@ -50,7 +48,6 @@ module WorkOS
|
|
|
50
48
|
@state = hash[:state]
|
|
51
49
|
@status = hash[:status]
|
|
52
50
|
@domains = (hash[:domains] || []).map { |item| item ? WorkOS::ConnectionDomain.new(item) : nil }
|
|
53
|
-
@callback_endpoint = hash[:callback_endpoint]
|
|
54
51
|
@created_at = hash[:created_at]
|
|
55
52
|
@updated_at = hash[:updated_at]
|
|
56
53
|
end
|
data/lib/workos/sso.rb
CHANGED
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
# This file is auto-generated by oagen. Do not edit.
|
|
4
4
|
|
|
5
5
|
require "json"
|
|
6
|
+
require "uri"
|
|
6
7
|
|
|
7
8
|
module WorkOS
|
|
8
9
|
class SSO
|
|
@@ -106,6 +107,74 @@ module WorkOS
|
|
|
106
107
|
nil
|
|
107
108
|
end
|
|
108
109
|
|
|
110
|
+
# Initiate SSO
|
|
111
|
+
# Builds the URL client-side; no HTTP request is made.
|
|
112
|
+
# @param provider_scopes [Array<String>, nil] Additional scopes to request from the identity provider. Applicable when using OAuth or OpenID Connect connections.
|
|
113
|
+
# @param provider_query_params [Hash{String => String}, nil] Key/value pairs of query parameters to pass to the OAuth provider. Only applicable when using OAuth connections.
|
|
114
|
+
# @param client_id [String, nil] The unique identifier of the WorkOS environment client. Defaults to the client's configured client_id.
|
|
115
|
+
# @param domain [String, nil] Deprecated. Use `connection` or `organization` instead. Used to initiate SSO for a connection by domain. The domain must be associated with a connection in your WorkOS environment.
|
|
116
|
+
# @param provider [WorkOS::Types::SSOProvider, nil] Used to initiate OAuth authentication with various providers.
|
|
117
|
+
# @param redirect_uri [String] Where to redirect the user after they complete the authentication process. You must use one of the redirect URIs configured via the [Redirects](https://dashboard.workos.com/redirects) page on the dashboard.
|
|
118
|
+
# @param state [String, nil] An optional parameter that can be used to encode arbitrary information to help restore application state between redirects. If included, the redirect URI received from WorkOS will contain the exact `state` that was passed.
|
|
119
|
+
# @param connection [String, nil] Used to initiate SSO for a connection. The value should be a WorkOS connection ID. You can persist the WorkOS connection ID with application user or team identifiers. WorkOS will use the connection indicated by the connection parameter to direct the user to the corresponding IdP for authentication.
|
|
120
|
+
# @param organization [String, nil] Used to initiate SSO for an organization. The value should be a WorkOS organization ID. You can persist the WorkOS organization ID with application user or team identifiers. WorkOS will use the organization ID to determine the appropriate connection and the IdP to direct the user to for authentication.
|
|
121
|
+
# @param domain_hint [String, nil] Can be used to pre-fill the domain field when initiating authentication with Microsoft OAuth or with a Google SAML connection type.
|
|
122
|
+
# @param login_hint [String, nil] Can be used to pre-fill the username/email address field of the IdP sign-in page for the user, if you know their username ahead of time. Currently supported for OAuth, OpenID Connect, Okta, Entra ID, and custom SAML connections.
|
|
123
|
+
# @param nonce [String, nil] A random string generated by the client that is used to mitigate replay attacks.
|
|
124
|
+
# @param prompt [String, nil] If set to `login`, forces re-authentication at the identity provider. For supported SAML providers this sets `ForceAuthn="true"` in the SAML request; providers that don't support it are unaffected.
|
|
125
|
+
# @return [String]
|
|
126
|
+
def get_authorization_url(
|
|
127
|
+
redirect_uri:,
|
|
128
|
+
provider_scopes: nil,
|
|
129
|
+
provider_query_params: nil,
|
|
130
|
+
client_id: nil,
|
|
131
|
+
domain: nil,
|
|
132
|
+
provider: nil,
|
|
133
|
+
state: nil,
|
|
134
|
+
connection: nil,
|
|
135
|
+
organization: nil,
|
|
136
|
+
domain_hint: nil,
|
|
137
|
+
login_hint: nil,
|
|
138
|
+
nonce: nil,
|
|
139
|
+
prompt: nil
|
|
140
|
+
)
|
|
141
|
+
params = {
|
|
142
|
+
"provider_scopes" => provider_scopes,
|
|
143
|
+
"provider_query_params" => provider_query_params,
|
|
144
|
+
"client_id" => client_id,
|
|
145
|
+
"domain" => domain,
|
|
146
|
+
"provider" => provider,
|
|
147
|
+
"redirect_uri" => redirect_uri,
|
|
148
|
+
"state" => state,
|
|
149
|
+
"connection" => connection,
|
|
150
|
+
"organization" => organization,
|
|
151
|
+
"domain_hint" => domain_hint,
|
|
152
|
+
"login_hint" => login_hint,
|
|
153
|
+
"nonce" => nonce,
|
|
154
|
+
"prompt" => prompt
|
|
155
|
+
}.compact
|
|
156
|
+
params["provider_scopes"] = provider_scopes.join(",") unless provider_scopes.nil?
|
|
157
|
+
params["provider_query_params"] = JSON.generate(provider_query_params) unless provider_query_params.nil?
|
|
158
|
+
params["response_type"] = "code"
|
|
159
|
+
params["client_id"] = @client.client_id if !params.key?("client_id") && !@client.client_id.nil?
|
|
160
|
+
uri = URI.join(@client.base_url, "/sso/authorize")
|
|
161
|
+
uri.query = URI.encode_www_form(params) unless params.empty?
|
|
162
|
+
uri.to_s
|
|
163
|
+
end
|
|
164
|
+
|
|
165
|
+
# Logout Redirect
|
|
166
|
+
# Builds the URL client-side; no HTTP request is made.
|
|
167
|
+
# @param token [String] The logout token returned from the [Logout Authorize](https://workos.com/docs/reference/sso/logout/authorize) endpoint.
|
|
168
|
+
# @return [String]
|
|
169
|
+
def get_logout_url(token:)
|
|
170
|
+
params = {
|
|
171
|
+
"token" => token
|
|
172
|
+
}
|
|
173
|
+
uri = URI.join(@client.base_url, "/sso/logout")
|
|
174
|
+
uri.query = URI.encode_www_form(params) unless params.empty?
|
|
175
|
+
uri.to_s
|
|
176
|
+
end
|
|
177
|
+
|
|
109
178
|
# Logout Authorize
|
|
110
179
|
# @param profile_id [String] The unique ID of the profile to log out.
|
|
111
180
|
# @param request_options [Hash] (see WorkOS::Types::RequestOptions)
|
|
@@ -171,32 +240,10 @@ module WorkOS
|
|
|
171
240
|
end
|
|
172
241
|
|
|
173
242
|
# @oagen-ignore-start — non-spec helpers (hand-maintained)
|
|
174
|
-
# H14
|
|
175
|
-
#
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
login_hint: nil, nonce: nil, provider_scopes: nil,
|
|
179
|
-
provider_query_params: nil, **)
|
|
180
|
-
cid = client_id || @client.client_id
|
|
181
|
-
raise ArgumentError, "client_id is required (set on Client or pass explicitly)" if cid.nil? || cid.empty?
|
|
182
|
-
params = {
|
|
183
|
-
"client_id" => cid,
|
|
184
|
-
"redirect_uri" => redirect_uri,
|
|
185
|
-
"response_type" => "code",
|
|
186
|
-
"state" => state,
|
|
187
|
-
"connection" => connection,
|
|
188
|
-
"organization" => organization,
|
|
189
|
-
"provider" => provider,
|
|
190
|
-
"domain_hint" => domain_hint,
|
|
191
|
-
"login_hint" => login_hint,
|
|
192
|
-
"nonce" => nonce
|
|
193
|
-
}.compact
|
|
194
|
-
params["provider_scopes"] = Array(provider_scopes).join(",") if provider_scopes
|
|
195
|
-
if provider_query_params.is_a?(Hash) && !provider_query_params.empty?
|
|
196
|
-
params["provider_query_params"] = JSON.generate(provider_query_params)
|
|
197
|
-
end
|
|
198
|
-
build_url("/sso/authorize", params)
|
|
199
|
-
end
|
|
243
|
+
# H14 (sso_authorization_url) is provided by the generated
|
|
244
|
+
# `get_authorization_url` url-builder method, which accepts an optional
|
|
245
|
+
# per-call `client_id` override falling back to the client's configured
|
|
246
|
+
# value; no hand-maintained override is needed here.
|
|
200
247
|
|
|
201
248
|
# H15 — SSO authorization URL with auto-generated PKCE pair + state.
|
|
202
249
|
# Returns [url, code_verifier, state].
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
# This file is auto-generated by oagen. Do not edit.
|
|
4
4
|
|
|
5
5
|
require "json"
|
|
6
|
+
require "uri"
|
|
6
7
|
|
|
7
8
|
module WorkOS
|
|
8
9
|
class UserManagement
|
|
@@ -515,6 +516,70 @@ module WorkOS
|
|
|
515
516
|
WorkOS::AuthenticateResponse.new(response.body)
|
|
516
517
|
end
|
|
517
518
|
|
|
519
|
+
# Get an authorization URL
|
|
520
|
+
# Builds the URL client-side; no HTTP request is made.
|
|
521
|
+
# @param code_challenge_method [String, nil] The only valid PKCE code challenge method is `"S256"`. Required when specifying a `code_challenge`.
|
|
522
|
+
# @param code_challenge [String, nil] Code challenge derived from the code verifier used for the PKCE flow.
|
|
523
|
+
# @param domain_hint [String, nil] A domain hint for SSO connection lookup.
|
|
524
|
+
# @param connection_id [String, nil] The ID of an SSO connection to use for authentication.
|
|
525
|
+
# @param provider_query_params [Hash{String => String}, nil] Key/value pairs of query parameters to pass to the OAuth provider.
|
|
526
|
+
# @param provider_scopes [Array<String>, nil] Additional OAuth scopes to request from the identity provider.
|
|
527
|
+
# @param invitation_token [String, nil] A token representing a user invitation to redeem during authentication.
|
|
528
|
+
# @param max_age [Integer, nil] Maximum allowable elapsed time, in seconds, since the user last actively authenticated. If the last authentication is older than this value, the user is prompted to re-authenticate; a value of `0` forces re-authentication. Only supported when the provider is `authkit`.
|
|
529
|
+
# @param screen_hint [WorkOS::Types::UserManagementAuthenticationScreenHint, nil] Used to specify which screen to display when the provider is `authkit`.
|
|
530
|
+
# @param login_hint [String, nil] A hint to the authorization server about the login identifier the user might use.
|
|
531
|
+
# @param provider [WorkOS::Types::UserManagementAuthenticationProvider, nil] The OAuth provider to authenticate with (e.g., GoogleOAuth, MicrosoftOAuth, GitHubOAuth).
|
|
532
|
+
# @param prompt [String, nil] Controls the authentication flow behavior for the user.
|
|
533
|
+
# @param state [String, nil] An opaque value used to maintain state between the request and the callback.
|
|
534
|
+
# @param organization_id [String, nil] The ID of the organization to authenticate the user against.
|
|
535
|
+
# @param redirect_uri [String] The callback URI where the authorization code will be sent after authentication.
|
|
536
|
+
# @param client_id [String, nil] The unique identifier of the WorkOS environment client. Defaults to the client's configured client_id.
|
|
537
|
+
# @return [String]
|
|
538
|
+
def get_authorization_url(
|
|
539
|
+
redirect_uri:,
|
|
540
|
+
code_challenge_method: nil,
|
|
541
|
+
code_challenge: nil,
|
|
542
|
+
domain_hint: nil,
|
|
543
|
+
connection_id: nil,
|
|
544
|
+
provider_query_params: nil,
|
|
545
|
+
provider_scopes: nil,
|
|
546
|
+
invitation_token: nil,
|
|
547
|
+
max_age: nil,
|
|
548
|
+
screen_hint: nil,
|
|
549
|
+
login_hint: nil,
|
|
550
|
+
provider: nil,
|
|
551
|
+
prompt: nil,
|
|
552
|
+
state: nil,
|
|
553
|
+
organization_id: nil,
|
|
554
|
+
client_id: nil
|
|
555
|
+
)
|
|
556
|
+
params = {
|
|
557
|
+
"code_challenge_method" => code_challenge_method,
|
|
558
|
+
"code_challenge" => code_challenge,
|
|
559
|
+
"domain_hint" => domain_hint,
|
|
560
|
+
"connection_id" => connection_id,
|
|
561
|
+
"provider_query_params" => provider_query_params,
|
|
562
|
+
"provider_scopes" => provider_scopes,
|
|
563
|
+
"invitation_token" => invitation_token,
|
|
564
|
+
"max_age" => max_age,
|
|
565
|
+
"screen_hint" => screen_hint,
|
|
566
|
+
"login_hint" => login_hint,
|
|
567
|
+
"provider" => provider,
|
|
568
|
+
"prompt" => prompt,
|
|
569
|
+
"state" => state,
|
|
570
|
+
"organization_id" => organization_id,
|
|
571
|
+
"redirect_uri" => redirect_uri,
|
|
572
|
+
"client_id" => client_id
|
|
573
|
+
}.compact
|
|
574
|
+
params["provider_query_params"] = JSON.generate(provider_query_params) unless provider_query_params.nil?
|
|
575
|
+
params["provider_scopes"] = provider_scopes.join(",") unless provider_scopes.nil?
|
|
576
|
+
params["response_type"] = "code"
|
|
577
|
+
params["client_id"] = @client.client_id if !params.key?("client_id") && !@client.client_id.nil?
|
|
578
|
+
uri = URI.join(@client.base_url, "/user_management/authorize")
|
|
579
|
+
uri.query = URI.encode_www_form(params) unless params.empty?
|
|
580
|
+
uri.to_s
|
|
581
|
+
end
|
|
582
|
+
|
|
518
583
|
# Get device authorization URL
|
|
519
584
|
# @param client_id [String] The WorkOS client ID for your application.
|
|
520
585
|
# @param request_options [Hash] (see WorkOS::Types::RequestOptions)
|
|
@@ -592,6 +657,24 @@ module WorkOS
|
|
|
592
657
|
result
|
|
593
658
|
end
|
|
594
659
|
|
|
660
|
+
# Logout
|
|
661
|
+
# Builds the URL client-side; no HTTP request is made.
|
|
662
|
+
# @param session_id [String] The ID of the session. This can be extracted from the `sid` claim of the access token.
|
|
663
|
+
# @param return_to [String, nil] The URL to redirect the user to after logout.
|
|
664
|
+
# @return [String]
|
|
665
|
+
def get_logout_url(
|
|
666
|
+
session_id:,
|
|
667
|
+
return_to: nil
|
|
668
|
+
)
|
|
669
|
+
params = {
|
|
670
|
+
"session_id" => session_id,
|
|
671
|
+
"return_to" => return_to
|
|
672
|
+
}.compact
|
|
673
|
+
uri = URI.join(@client.base_url, "/user_management/sessions/logout")
|
|
674
|
+
uri.query = URI.encode_www_form(params) unless params.empty?
|
|
675
|
+
uri.to_s
|
|
676
|
+
end
|
|
677
|
+
|
|
595
678
|
# Revoke Session
|
|
596
679
|
# @param session_id [String] The ID of the session to revoke. This can be extracted from the `sid` claim of the access token.
|
|
597
680
|
# @param request_options [Hash] (see WorkOS::Types::RequestOptions)
|
|
@@ -1690,32 +1773,10 @@ module WorkOS
|
|
|
1690
1773
|
URI.join(base, "/sso/jwks/#{WorkOS::Util.encode_path(cid)}").to_s
|
|
1691
1774
|
end
|
|
1692
1775
|
|
|
1693
|
-
# H09
|
|
1694
|
-
#
|
|
1695
|
-
|
|
1696
|
-
|
|
1697
|
-
state: nil, screen_hint: nil, code_challenge: nil,
|
|
1698
|
-
code_challenge_method: nil, prompt: nil, **)
|
|
1699
|
-
cid = client_id || @client.client_id
|
|
1700
|
-
raise ArgumentError, "client_id is required (set on Client or pass explicitly)" if cid.nil? || cid.empty?
|
|
1701
|
-
raise ArgumentError, "provider, connection_id, or organization_id required" if provider.nil? && connection_id.nil? && organization_id.nil?
|
|
1702
|
-
params = {
|
|
1703
|
-
"client_id" => cid,
|
|
1704
|
-
"redirect_uri" => redirect_uri,
|
|
1705
|
-
"response_type" => "code",
|
|
1706
|
-
"provider" => provider,
|
|
1707
|
-
"connection_id" => connection_id,
|
|
1708
|
-
"organization_id" => organization_id,
|
|
1709
|
-
"domain_hint" => domain_hint,
|
|
1710
|
-
"login_hint" => login_hint,
|
|
1711
|
-
"state" => state,
|
|
1712
|
-
"screen_hint" => screen_hint,
|
|
1713
|
-
"code_challenge" => code_challenge,
|
|
1714
|
-
"code_challenge_method" => code_challenge_method,
|
|
1715
|
-
"prompt" => prompt
|
|
1716
|
-
}.compact
|
|
1717
|
-
build_url("/user_management/authorize", params)
|
|
1718
|
-
end
|
|
1776
|
+
# H09 (authkit_authorization_url) is provided by the generated
|
|
1777
|
+
# `get_authorization_url` url-builder method, which accepts an optional
|
|
1778
|
+
# per-call `client_id` override falling back to the client's configured
|
|
1779
|
+
# value; no hand-maintained override is needed here.
|
|
1719
1780
|
|
|
1720
1781
|
# H10 — AuthKit authorization URL with auto-generated PKCE + state.
|
|
1721
1782
|
# Returns [url, code_verifier, state].
|
|
@@ -1773,24 +1834,9 @@ module WorkOS
|
|
|
1773
1834
|
# `authenticate_with_device_code` method (wraps /user_management/authenticate);
|
|
1774
1835
|
# no hand-maintained override is needed here.
|
|
1775
1836
|
|
|
1776
|
-
#
|
|
1777
|
-
#
|
|
1778
|
-
#
|
|
1779
|
-
# @return [String]
|
|
1780
|
-
def get_logout_url(session_id:, return_to: nil)
|
|
1781
|
-
params = {"session_id" => session_id}
|
|
1782
|
-
params["return_to"] = return_to if return_to
|
|
1783
|
-
build_url("/user_management/sessions/logout", params)
|
|
1784
|
-
end
|
|
1785
|
-
|
|
1786
|
-
private
|
|
1787
|
-
|
|
1788
|
-
def build_url(path, params)
|
|
1789
|
-
base = @client.base_url
|
|
1790
|
-
uri = URI.join(base, path)
|
|
1791
|
-
uri.query = URI.encode_www_form(params)
|
|
1792
|
-
uri.to_s
|
|
1793
|
-
end
|
|
1837
|
+
# The AuthKit logout redirect URL is provided by the generated
|
|
1838
|
+
# `get_logout_url` url-builder method; no hand-maintained override is
|
|
1839
|
+
# needed here.
|
|
1794
1840
|
# @oagen-ignore-end
|
|
1795
1841
|
end
|
|
1796
1842
|
end
|
data/lib/workos/version.rb
CHANGED
|
@@ -33,6 +33,12 @@ module WorkOS
|
|
|
33
33
|
sig { params(value: T.nilable(String)).returns(T.nilable(String)) }
|
|
34
34
|
def client_secret=(value); end
|
|
35
35
|
|
|
36
|
+
sig { returns(T.nilable(T::Hash[String, String])) }
|
|
37
|
+
def config; end
|
|
38
|
+
|
|
39
|
+
sig { params(value: T.nilable(T::Hash[String, String])).returns(T.nilable(T::Hash[String, String])) }
|
|
40
|
+
def config=(value); end
|
|
41
|
+
|
|
36
42
|
sig { returns(T::Hash[Symbol, T.untyped]) }
|
|
37
43
|
def to_h; end
|
|
38
44
|
|
data/rbi/workos/connection.rbi
CHANGED
|
@@ -57,12 +57,6 @@ module WorkOS
|
|
|
57
57
|
sig { params(value: T::Array[WorkOS::ConnectionDomain]).returns(T::Array[WorkOS::ConnectionDomain]) }
|
|
58
58
|
def domains=(value); end
|
|
59
59
|
|
|
60
|
-
sig { returns(T.nilable(String)) }
|
|
61
|
-
def callback_endpoint; end
|
|
62
|
-
|
|
63
|
-
sig { params(value: T.nilable(String)).returns(T.nilable(String)) }
|
|
64
|
-
def callback_endpoint=(value); end
|
|
65
|
-
|
|
66
60
|
sig { returns(String) }
|
|
67
61
|
def created_at; end
|
|
68
62
|
|
|
@@ -39,6 +39,12 @@ module WorkOS
|
|
|
39
39
|
sig { params(value: T.nilable(T::Array[String])).returns(T.nilable(T::Array[String])) }
|
|
40
40
|
def auth_methods=(value); end
|
|
41
41
|
|
|
42
|
+
sig { returns(T.nilable(T::Hash[String, String])) }
|
|
43
|
+
def config; end
|
|
44
|
+
|
|
45
|
+
sig { params(value: T.nilable(T::Hash[String, String])).returns(T.nilable(T::Hash[String, String])) }
|
|
46
|
+
def config=(value); end
|
|
47
|
+
|
|
42
48
|
sig { returns(T.nilable(WorkOS::DataIntegrationCredentialsInput)) }
|
|
43
49
|
def credentials; end
|
|
44
50
|
|
|
@@ -81,6 +81,12 @@ module WorkOS
|
|
|
81
81
|
sig { params(value: T.nilable(WorkOS::DataIntegrationInstallation)).returns(T.nilable(WorkOS::DataIntegrationInstallation)) }
|
|
82
82
|
def installation=(value); end
|
|
83
83
|
|
|
84
|
+
sig { returns(T::Hash[String, String]) }
|
|
85
|
+
def config; end
|
|
86
|
+
|
|
87
|
+
sig { params(value: T::Hash[String, String]).returns(T::Hash[String, String]) }
|
|
88
|
+
def config=(value); end
|
|
89
|
+
|
|
84
90
|
sig { returns(T.nilable(WorkOS::DataIntegrationCustomProvider)) }
|
|
85
91
|
def custom_provider; end
|
|
86
92
|
|
|
@@ -51,6 +51,12 @@ module WorkOS
|
|
|
51
51
|
sig { params(value: T.nilable(T::Array[String])).returns(T.nilable(T::Array[String])) }
|
|
52
52
|
def scopes=(value); end
|
|
53
53
|
|
|
54
|
+
sig { returns(T::Hash[String, String]) }
|
|
55
|
+
def config; end
|
|
56
|
+
|
|
57
|
+
sig { params(value: T::Hash[String, String]).returns(T::Hash[String, String]) }
|
|
58
|
+
def config=(value); end
|
|
59
|
+
|
|
54
60
|
sig { returns(String) }
|
|
55
61
|
def created_at; end
|
|
56
62
|
|
|
@@ -27,6 +27,12 @@ module WorkOS
|
|
|
27
27
|
sig { params(value: T.nilable(String)).returns(T.nilable(String)) }
|
|
28
28
|
def return_to=(value); end
|
|
29
29
|
|
|
30
|
+
sig { returns(T.nilable(T::Hash[String, String])) }
|
|
31
|
+
def config; end
|
|
32
|
+
|
|
33
|
+
sig { params(value: T.nilable(T::Hash[String, String])).returns(T.nilable(T::Hash[String, String])) }
|
|
34
|
+
def config=(value); end
|
|
35
|
+
|
|
30
36
|
sig { returns(T::Hash[Symbol, T.untyped]) }
|
|
31
37
|
def to_h; end
|
|
32
38
|
|
data/rbi/workos/pipes.rbi
CHANGED
|
@@ -27,13 +27,14 @@ module WorkOS
|
|
|
27
27
|
enabled: T.nilable(T::Boolean),
|
|
28
28
|
scopes: T.nilable(T::Array[String]),
|
|
29
29
|
auth_methods: T.nilable(T::Array[String]),
|
|
30
|
+
config: T.nilable(T::Hash[String, String]),
|
|
30
31
|
credentials: T.nilable(WorkOS::DataIntegrationCredentialsInput),
|
|
31
32
|
api_key: T.nilable(WorkOS::ApiKeyInstallation),
|
|
32
33
|
custom_provider: T.nilable(WorkOS::CustomProviderDefinition),
|
|
33
34
|
request_options: T::Hash[Symbol, T.untyped]
|
|
34
35
|
).returns(WorkOS::DataIntegration)
|
|
35
36
|
end
|
|
36
|
-
def create_data_integration(provider:, description:, enabled:, scopes:, auth_methods:, credentials:, api_key:, custom_provider:, request_options:); end
|
|
37
|
+
def create_data_integration(provider:, description:, enabled:, scopes:, auth_methods:, config:, credentials:, api_key:, custom_provider:, request_options:); end
|
|
37
38
|
|
|
38
39
|
sig do
|
|
39
40
|
params(
|
|
@@ -82,10 +83,11 @@ module WorkOS
|
|
|
82
83
|
user_id: String,
|
|
83
84
|
organization_id: T.nilable(String),
|
|
84
85
|
return_to: T.nilable(String),
|
|
86
|
+
config: T.nilable(T::Hash[String, String]),
|
|
85
87
|
request_options: T::Hash[Symbol, T.untyped]
|
|
86
88
|
).returns(WorkOS::DataIntegrationAuthorizeUrlResponse)
|
|
87
89
|
end
|
|
88
|
-
def authorize_data_integration(slug:, user_id:, organization_id:, return_to:, request_options:); end
|
|
90
|
+
def authorize_data_integration(slug:, user_id:, organization_id:, return_to:, config:, request_options:); end
|
|
89
91
|
|
|
90
92
|
sig do
|
|
91
93
|
params(
|
|
@@ -25,10 +25,11 @@ module WorkOS
|
|
|
25
25
|
scopes: T.nilable(T::Array[String]),
|
|
26
26
|
client_id: T.nilable(String),
|
|
27
27
|
client_secret: T.nilable(String),
|
|
28
|
+
config: T.nilable(T::Hash[String, String]),
|
|
28
29
|
request_options: T::Hash[Symbol, T.untyped]
|
|
29
30
|
).returns(WorkOS::DataIntegrationConfigurationResponse)
|
|
30
31
|
end
|
|
31
|
-
def update_organization_data_integration_configuration(organization_id:, slug:, enabled:, scopes:, client_id:, client_secret:, request_options:); end
|
|
32
|
+
def update_organization_data_integration_configuration(organization_id:, slug:, enabled:, scopes:, client_id:, client_secret:, config:, request_options:); end
|
|
32
33
|
|
|
33
34
|
end
|
|
34
35
|
end
|
data/rbi/workos/sso.rbi
CHANGED
|
@@ -40,6 +40,32 @@ module WorkOS
|
|
|
40
40
|
end
|
|
41
41
|
def delete_connection(id:, request_options:); end
|
|
42
42
|
|
|
43
|
+
sig do
|
|
44
|
+
params(
|
|
45
|
+
redirect_uri: String,
|
|
46
|
+
provider_scopes: T.nilable(T::Array[String]),
|
|
47
|
+
provider_query_params: T.nilable(T::Hash[String, String]),
|
|
48
|
+
client_id: T.nilable(String),
|
|
49
|
+
domain: T.nilable(String),
|
|
50
|
+
provider: T.nilable(String),
|
|
51
|
+
state: T.nilable(String),
|
|
52
|
+
connection: T.nilable(String),
|
|
53
|
+
organization: T.nilable(String),
|
|
54
|
+
domain_hint: T.nilable(String),
|
|
55
|
+
login_hint: T.nilable(String),
|
|
56
|
+
nonce: T.nilable(String),
|
|
57
|
+
prompt: T.nilable(String)
|
|
58
|
+
).returns(String)
|
|
59
|
+
end
|
|
60
|
+
def get_authorization_url(redirect_uri:, provider_scopes:, provider_query_params:, client_id:, domain:, provider:, state:, connection:, organization:, domain_hint:, login_hint:, nonce:, prompt:); end
|
|
61
|
+
|
|
62
|
+
sig do
|
|
63
|
+
params(
|
|
64
|
+
token: String
|
|
65
|
+
).returns(String)
|
|
66
|
+
end
|
|
67
|
+
def get_logout_url(token:); end
|
|
68
|
+
|
|
43
69
|
sig do
|
|
44
70
|
params(
|
|
45
71
|
profile_id: String,
|
|
@@ -62,6 +62,28 @@ module WorkOS
|
|
|
62
62
|
end
|
|
63
63
|
def create_authenticate(client_id:, grant_type:, code:, client_secret:, code_verifier:, invitation_token:, ip_address:, device_id:, user_agent:, signals_id:, request_options:); end
|
|
64
64
|
|
|
65
|
+
sig do
|
|
66
|
+
params(
|
|
67
|
+
redirect_uri: String,
|
|
68
|
+
code_challenge_method: T.nilable(String),
|
|
69
|
+
code_challenge: T.nilable(String),
|
|
70
|
+
domain_hint: T.nilable(String),
|
|
71
|
+
connection_id: T.nilable(String),
|
|
72
|
+
provider_query_params: T.nilable(T::Hash[String, String]),
|
|
73
|
+
provider_scopes: T.nilable(T::Array[String]),
|
|
74
|
+
invitation_token: T.nilable(String),
|
|
75
|
+
max_age: T.nilable(Integer),
|
|
76
|
+
screen_hint: T.nilable(String),
|
|
77
|
+
login_hint: T.nilable(String),
|
|
78
|
+
provider: T.nilable(String),
|
|
79
|
+
prompt: T.nilable(String),
|
|
80
|
+
state: T.nilable(String),
|
|
81
|
+
organization_id: T.nilable(String),
|
|
82
|
+
client_id: T.nilable(String)
|
|
83
|
+
).returns(String)
|
|
84
|
+
end
|
|
85
|
+
def get_authorization_url(redirect_uri:, code_challenge_method:, code_challenge:, domain_hint:, connection_id:, provider_query_params:, provider_scopes:, invitation_token:, max_age:, screen_hint:, login_hint:, provider:, prompt:, state:, organization_id:, client_id:); end
|
|
86
|
+
|
|
65
87
|
sig do
|
|
66
88
|
params(
|
|
67
89
|
client_id: String,
|
|
@@ -90,6 +112,14 @@ module WorkOS
|
|
|
90
112
|
end
|
|
91
113
|
def get_radar_challenge(id:, request_options:); end
|
|
92
114
|
|
|
115
|
+
sig do
|
|
116
|
+
params(
|
|
117
|
+
session_id: String,
|
|
118
|
+
return_to: T.nilable(String)
|
|
119
|
+
).returns(String)
|
|
120
|
+
end
|
|
121
|
+
def get_logout_url(session_id:, return_to:); end
|
|
122
|
+
|
|
93
123
|
sig do
|
|
94
124
|
params(
|
|
95
125
|
session_id: String,
|
|
@@ -26,19 +26,21 @@ class AuthKitHelpersTest < Minitest::Test
|
|
|
26
26
|
assert_equal "/user_management/authorize", parsed.path
|
|
27
27
|
end
|
|
28
28
|
|
|
29
|
-
def
|
|
29
|
+
def test_get_authorization_url_omits_client_id_when_unconfigured
|
|
30
30
|
client = WorkOS::Client.new(api_key: "k", client_id: nil)
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
assert_match(/client_id is required/, err.message)
|
|
31
|
+
url = client.user_management.get_authorization_url(redirect_uri: "x", provider: "GoogleOAuth")
|
|
32
|
+
params = URI.decode_www_form(URI.parse(url).query).to_h
|
|
33
|
+
refute params.key?("client_id")
|
|
35
34
|
end
|
|
36
35
|
|
|
37
|
-
def
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
36
|
+
def test_get_authorization_url_explicit_client_id_overrides_configured
|
|
37
|
+
url = @um.get_authorization_url(
|
|
38
|
+
redirect_uri: "https://app.example.com/cb",
|
|
39
|
+
provider: "GoogleOAuth",
|
|
40
|
+
client_id: "client_override"
|
|
41
|
+
)
|
|
42
|
+
params = URI.decode_www_form(URI.parse(url).query).to_h
|
|
43
|
+
assert_equal "client_override", params["client_id"]
|
|
42
44
|
end
|
|
43
45
|
|
|
44
46
|
# H10
|
|
@@ -57,6 +59,16 @@ class AuthKitHelpersTest < Minitest::Test
|
|
|
57
59
|
assert_equal expected_challenge, params["code_challenge"]
|
|
58
60
|
end
|
|
59
61
|
|
|
62
|
+
def test_get_authorization_url_with_pkce_forwards_client_id_override
|
|
63
|
+
url, _verifier, _state = @um.get_authorization_url_with_pkce(
|
|
64
|
+
redirect_uri: "https://app.example.com/cb",
|
|
65
|
+
provider: "GoogleOAuth",
|
|
66
|
+
client_id: "client_override"
|
|
67
|
+
)
|
|
68
|
+
params = URI.decode_www_form(URI.parse(url).query).to_h
|
|
69
|
+
assert_equal "client_override", params["client_id"]
|
|
70
|
+
end
|
|
71
|
+
|
|
60
72
|
# H11
|
|
61
73
|
def test_authenticate_with_code_pkce_posts_correct_body
|
|
62
74
|
stub = stub_request(:post, "https://api.workos.com/user_management/authenticate")
|
|
@@ -61,6 +61,7 @@ class PipesModelRoundTripTest < Minitest::Test
|
|
|
61
61
|
"enabled" => true,
|
|
62
62
|
"scopes" => nil,
|
|
63
63
|
"auth_methods" => [],
|
|
64
|
+
"config" => {},
|
|
64
65
|
"credentials" => {},
|
|
65
66
|
"api_key" => {},
|
|
66
67
|
"custom_provider" => {}
|
|
@@ -135,6 +136,7 @@ class PipesModelRoundTripTest < Minitest::Test
|
|
|
135
136
|
"auth_methods" => [],
|
|
136
137
|
"credentials" => {},
|
|
137
138
|
"installation" => nil,
|
|
139
|
+
"config" => {},
|
|
138
140
|
"custom_provider" => nil,
|
|
139
141
|
"created_at" => "stub",
|
|
140
142
|
"updated_at" => "stub"
|
|
@@ -364,7 +366,8 @@ class PipesModelRoundTripTest < Minitest::Test
|
|
|
364
366
|
fixture = {
|
|
365
367
|
"user_id" => "stub",
|
|
366
368
|
"organization_id" => "stub",
|
|
367
|
-
"return_to" => "stub"
|
|
369
|
+
"return_to" => "stub",
|
|
370
|
+
"config" => {}
|
|
368
371
|
}
|
|
369
372
|
model = WorkOS::DataIntegrationsGetDataIntegrationAuthorizeUrlRequest.new(fixture.to_json)
|
|
370
373
|
json = model.to_h
|
|
@@ -32,6 +32,7 @@ class PipesProviderModelRoundTripTest < Minitest::Test
|
|
|
32
32
|
"name" => "stub",
|
|
33
33
|
"enabled" => true,
|
|
34
34
|
"scopes" => nil,
|
|
35
|
+
"config" => {},
|
|
35
36
|
"created_at" => "stub",
|
|
36
37
|
"updated_at" => "stub",
|
|
37
38
|
"credentials" => {}
|
|
@@ -65,7 +66,8 @@ class PipesProviderModelRoundTripTest < Minitest::Test
|
|
|
65
66
|
"enabled" => true,
|
|
66
67
|
"scopes" => nil,
|
|
67
68
|
"client_id" => "stub",
|
|
68
|
-
"client_secret" => "stub"
|
|
69
|
+
"client_secret" => "stub",
|
|
70
|
+
"config" => {}
|
|
69
71
|
}
|
|
70
72
|
model = WorkOS::ConfigureDataIntegrationBody.new(fixture.to_json)
|
|
71
73
|
json = model.to_h
|
|
@@ -16,39 +16,6 @@ class SharedModelRoundTripTest < Minitest::Test
|
|
|
16
16
|
fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
|
|
17
17
|
end
|
|
18
18
|
|
|
19
|
-
def test_object_summary_round_trip
|
|
20
|
-
fixture = {
|
|
21
|
-
"id" => "stub",
|
|
22
|
-
"name" => "stub",
|
|
23
|
-
"updated_at" => nil
|
|
24
|
-
}
|
|
25
|
-
model = WorkOS::ObjectSummary.new(fixture.to_json)
|
|
26
|
-
json = model.to_h
|
|
27
|
-
assert_kind_of Hash, json
|
|
28
|
-
assert_equal fixture["id"], json[:id]
|
|
29
|
-
assert_equal fixture["name"], json[:name]
|
|
30
|
-
fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
|
|
31
|
-
end
|
|
32
|
-
|
|
33
|
-
def test_object_version_round_trip
|
|
34
|
-
fixture = {
|
|
35
|
-
"created_at" => "stub",
|
|
36
|
-
"current_version" => true,
|
|
37
|
-
"etag" => "stub",
|
|
38
|
-
"id" => "stub",
|
|
39
|
-
"size" => 1
|
|
40
|
-
}
|
|
41
|
-
model = WorkOS::ObjectVersion.new(fixture.to_json)
|
|
42
|
-
json = model.to_h
|
|
43
|
-
assert_kind_of Hash, json
|
|
44
|
-
assert_equal fixture["created_at"], json[:created_at]
|
|
45
|
-
assert_equal fixture["current_version"], json[:current_version]
|
|
46
|
-
assert_equal fixture["etag"], json[:etag]
|
|
47
|
-
assert_equal fixture["id"], json[:id]
|
|
48
|
-
assert_equal fixture["size"], json[:size]
|
|
49
|
-
fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
|
|
50
|
-
end
|
|
51
|
-
|
|
52
19
|
def test_connect_application_oauth_round_trip
|
|
53
20
|
fixture = {
|
|
54
21
|
"object" => "connect_application",
|
|
@@ -195,24 +162,6 @@ class SharedModelRoundTripTest < Minitest::Test
|
|
|
195
162
|
fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
|
|
196
163
|
end
|
|
197
164
|
|
|
198
|
-
def test_event_schema_round_trip
|
|
199
|
-
fixture = {
|
|
200
|
-
"object" => "event",
|
|
201
|
-
"id" => "stub",
|
|
202
|
-
"event" => "stub",
|
|
203
|
-
"data" => {},
|
|
204
|
-
"created_at" => "stub",
|
|
205
|
-
"context" => {}
|
|
206
|
-
}
|
|
207
|
-
model = WorkOS::EventSchema.new(fixture.to_json)
|
|
208
|
-
json = model.to_h
|
|
209
|
-
assert_kind_of Hash, json
|
|
210
|
-
assert_equal fixture["id"], json[:id]
|
|
211
|
-
assert_equal fixture["event"], json[:event]
|
|
212
|
-
assert_equal fixture["created_at"], json[:created_at]
|
|
213
|
-
fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
|
|
214
|
-
end
|
|
215
|
-
|
|
216
165
|
def test_agent_registration_claim_attempt_created_round_trip
|
|
217
166
|
fixture = {
|
|
218
167
|
"object" => "event",
|
|
@@ -838,17 +787,6 @@ class SharedModelRoundTripTest < Minitest::Test
|
|
|
838
787
|
fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
|
|
839
788
|
end
|
|
840
789
|
|
|
841
|
-
def test_event_list_list_metadata_round_trip
|
|
842
|
-
fixture = {
|
|
843
|
-
"after" => nil
|
|
844
|
-
}
|
|
845
|
-
model = WorkOS::EventListListMetadata.new(fixture.to_json)
|
|
846
|
-
json = model.to_h
|
|
847
|
-
assert_kind_of Hash, json
|
|
848
|
-
assert_nil json[:after]
|
|
849
|
-
fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
|
|
850
|
-
end
|
|
851
|
-
|
|
852
790
|
def test_event_context_google_analytics_session_round_trip
|
|
853
791
|
fixture = {
|
|
854
792
|
"containerId" => "stub",
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: workos
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 10.
|
|
4
|
+
version: 10.1.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- WorkOS
|
|
@@ -128,6 +128,7 @@ executables: []
|
|
|
128
128
|
extensions: []
|
|
129
129
|
extra_rdoc_files: []
|
|
130
130
|
files:
|
|
131
|
+
- ".claude/CLAUDE.md"
|
|
131
132
|
- ".github/CODEOWNERS"
|
|
132
133
|
- ".github/pull_request_template.md"
|
|
133
134
|
- ".github/workflows/block-generated-edits.yml"
|
|
@@ -144,6 +145,7 @@ files:
|
|
|
144
145
|
- ".ruby-version"
|
|
145
146
|
- ".standard.yml"
|
|
146
147
|
- ".yardopts"
|
|
148
|
+
- AGENTS.md
|
|
147
149
|
- CHANGELOG.md
|
|
148
150
|
- Gemfile
|
|
149
151
|
- Gemfile.lock
|