Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
* [#531](https://github.com/workos/workos-ruby/pull/531) fix(generated): regenerate from spec

**Features**
* **[pipes](https://workos.com/docs/reference/pipes)**:
* Added `config` to `DataIntegrationsGetDataIntegrationAuthorizeUrlRequest`
* Added `client_credentials` to `DataIntegrationAuthMethods`
* Added `client_credentials` to `DataIntegrationsListResponseDataAuthMethods`
* Added `client_credentials` to `DataIntegrationsListResponseDataConnectedAccountAuthMethod`
* Added `config` to Pipes models
* **[connect](https://workos.com/docs/reference/workos-connect/standalone)**:
* Added `client_credentials` to `ConnectedAccountAuthMethod`

**Fixes**
* **[user_management](https://workos.com/docs/reference/authkit/user)**:
* Changed errors for endpoint `POST /user_management/invitations`
* Changed errors for endpoint `POST /user_management/invitations/{id}/resend`
* Changed errors for endpoint `POST /user_management/magic_auth`
* Changed errors for endpoint `POST /user_management/authenticate`
2 changes: 1 addition & 1 deletion .last-synced-sha
Original file line number Diff line number Diff line change
@@ -1 +1 @@
f40851a620a1ba0badec95e80faac475382c8dd0
904c5bccd2c6d0511ad2d0760e57d139143f1773
8 changes: 7 additions & 1 deletion lib/workos/pipes.rb
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ def list_data_integrations(
# @param enabled [Boolean, nil] Whether the Data Integration is enabled. Defaults to `false`.
# @param scopes [Array<String>, nil] The OAuth scopes to request for the Data Integration. Defaults to the provider's configured scopes when omitted.
# @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).
# @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.
# @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"]`.
# @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.
# @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.
Expand All @@ -71,6 +72,7 @@ def create_data_integration(
enabled: nil,
scopes: WorkOS::OMIT,
auth_methods: nil,
config: nil,
credentials: nil,
api_key: nil,
custom_provider: nil,
Expand All @@ -80,6 +82,7 @@ def create_data_integration(
"provider" => provider,
"enabled" => enabled,
"auth_methods" => auth_methods,
"config" => config,
"credentials" => credentials,
"api_key" => api_key,
"custom_provider" => custom_provider
Expand Down Expand Up @@ -210,19 +213,22 @@ def update_data_integration_api_key(
# @param user_id [String] The ID of the user to authorize.
# @param organization_id [String, nil] An organization ID to scope the authorization to a specific organization.
# @param return_to [String, nil] The URL to redirect the user to after authorization.
# @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.
# @param request_options [Hash] (see WorkOS::Types::RequestOptions)
# @return [WorkOS::DataIntegrationAuthorizeUrlResponse]
def authorize_data_integration(
slug:,
user_id:,
organization_id: nil,
return_to: nil,
config: nil,
request_options: {}
)
body = {
"user_id" => user_id,
"organization_id" => organization_id,
"return_to" => return_to
"return_to" => return_to,
"config" => config
}.compact
response = @client.request(
method: :post,
Expand Down
3 changes: 3 additions & 0 deletions lib/workos/pipes/create_data_integration.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ class CreateDataIntegration < WorkOS::Types::BaseModel
enabled: :enabled,
scopes: :scopes,
auth_methods: :auth_methods,
config: :config,
credentials: :credentials,
api_key: :api_key,
custom_provider: :custom_provider
Expand All @@ -21,6 +22,7 @@ class CreateDataIntegration < WorkOS::Types::BaseModel
:enabled,
:scopes,
:auth_methods,
:config,
:credentials,
:api_key,
:custom_provider
Expand All @@ -32,6 +34,7 @@ def initialize(json)
@enabled = hash[:enabled]
@scopes = hash[:scopes] || []
@auth_methods = hash[:auth_methods] || []
@config = hash[:config] || {}
@credentials = hash[:credentials] ? WorkOS::DataIntegrationCredentialsInput.new(hash[:credentials]) : nil
@api_key = hash[:api_key] ? WorkOS::ApiKeyInstallation.new(hash[:api_key]) : nil
@custom_provider = hash[:custom_provider] ? WorkOS::CustomProviderDefinition.new(hash[:custom_provider]) : nil
Expand Down
3 changes: 3 additions & 0 deletions lib/workos/pipes/data_integration.rb
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ class DataIntegration < WorkOS::Types::BaseModel
auth_methods: :auth_methods,
credentials: :credentials,
installation: :installation,
config: :config,
custom_provider: :custom_provider,
created_at: :created_at,
updated_at: :updated_at
Expand All @@ -35,6 +36,7 @@ class DataIntegration < WorkOS::Types::BaseModel
:auth_methods,
:credentials,
:installation,
:config,
:custom_provider,
:created_at,
:updated_at
Expand All @@ -53,6 +55,7 @@ def initialize(json)
@auth_methods = hash[:auth_methods] || []
@credentials = hash[:credentials] ? WorkOS::DataIntegrationCredential.new(hash[:credentials]) : nil
@installation = hash[:installation] ? WorkOS::DataIntegrationInstallation.new(hash[:installation]) : nil
@config = hash[:config] || {}
@custom_provider = hash[:custom_provider] ? WorkOS::DataIntegrationCustomProvider.new(hash[:custom_provider]) : nil
@created_at = hash[:created_at]
@updated_at = hash[:updated_at]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,19 +7,22 @@ class DataIntegrationsGetDataIntegrationAuthorizeUrlRequest < WorkOS::Types::Bas
HASH_ATTRS = {
user_id: :user_id,
organization_id: :organization_id,
return_to: :return_to
return_to: :return_to,
config: :config
}.freeze

attr_accessor \
:user_id,
:organization_id,
:return_to
:return_to,
:config

def initialize(json)
hash = self.class.normalize(json)
@user_id = hash[:user_id]
@organization_id = hash[:organization_id]
@return_to = hash[:return_to]
@config = hash[:config] || {}
end
end
end
5 changes: 4 additions & 1 deletion lib/workos/pipes_provider.rb
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ def list_organization_data_integration_configurations(
# @param scopes [Array<String>, nil] The OAuth scopes to request for the organization. Pass `null` to inherit the provider scopes.
# @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.
# @param client_secret [String, nil] The OAuth client secret of the organization's own application. Must be provided together with `client_id`.
# @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.
# @param request_options [Hash] (see WorkOS::Types::RequestOptions)
# @return [WorkOS::DataIntegrationConfigurationResponse]
def update_organization_data_integration_configuration(
Expand All @@ -45,12 +46,14 @@ def update_organization_data_integration_configuration(
scopes: WorkOS::OMIT,
client_id: nil,
client_secret: nil,
config: nil,
request_options: {}
)
body = {
"enabled" => enabled,
"client_id" => client_id,
"client_secret" => client_secret
"client_secret" => client_secret,
"config" => config
}.compact
body["scopes"] = scopes unless scopes.equal?(WorkOS::OMIT)
response = @client.request(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,21 +8,24 @@ class ConfigureDataIntegrationBody < WorkOS::Types::BaseModel
enabled: :enabled,
scopes: :scopes,
client_id: :client_id,
client_secret: :client_secret
client_secret: :client_secret,
config: :config
}.freeze

attr_accessor \
:enabled,
:scopes,
:client_id,
:client_secret
:client_secret,
:config

def initialize(json)
hash = self.class.normalize(json)
@enabled = hash[:enabled]
@scopes = hash[:scopes] || []
@client_id = hash[:client_id]
@client_secret = hash[:client_secret]
@config = hash[:config] || {}
end
end
end
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ class DataIntegrationConfigurationResponse < WorkOS::Types::BaseModel
name: :name,
enabled: :enabled,
scopes: :scopes,
config: :config,
created_at: :created_at,
updated_at: :updated_at,
credentials: :credentials
Expand All @@ -25,6 +26,7 @@ class DataIntegrationConfigurationResponse < WorkOS::Types::BaseModel
:name,
:enabled,
:scopes,
:config,
:created_at,
:updated_at,
:credentials
Expand All @@ -38,6 +40,7 @@ def initialize(json)
@name = hash[:name]
@enabled = hash[:enabled]
@scopes = hash[:scopes] || []
@config = hash[:config] || {}
@created_at = hash[:created_at]
@updated_at = hash[:updated_at]
@credentials = hash[:credentials] ? WorkOS::DataIntegrationCredentials.new(hash[:credentials]) : nil
Expand Down
3 changes: 2 additions & 1 deletion lib/workos/types/connected_account_auth_method.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ module Types
class ConnectedAccountAuthMethod
OAUTH = "oauth"
API_KEY = "api_key"
ALL = [OAUTH, API_KEY].freeze
CLIENT_CREDENTIALS = "client_credentials"
ALL = [OAUTH, API_KEY, CLIENT_CREDENTIALS].freeze
end
end
end
6 changes: 5 additions & 1 deletion lib/workos/types/create_data_integration_auth_methods.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@

module WorkOS
module Types
CreateDataIntegrationAuthMethods = ConnectedAccountAuthMethod
class CreateDataIntegrationAuthMethods
OAUTH = "oauth"
API_KEY = "api_key"
ALL = [OAUTH, API_KEY].freeze
end
end
end
6 changes: 6 additions & 0 deletions rbi/workos/configure_data_integration_body.rbi
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,12 @@ module WorkOS
sig { params(value: T.nilable(String)).returns(T.nilable(String)) }
def client_secret=(value); end

sig { returns(T.nilable(T::Hash[String, String])) }
def config; end

sig { params(value: T.nilable(T::Hash[String, String])).returns(T.nilable(T::Hash[String, String])) }
def config=(value); end

sig { returns(T::Hash[Symbol, T.untyped]) }
def to_h; end

Expand Down
6 changes: 6 additions & 0 deletions rbi/workos/create_data_integration.rbi
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,12 @@ module WorkOS
sig { params(value: T.nilable(T::Array[String])).returns(T.nilable(T::Array[String])) }
def auth_methods=(value); end

sig { returns(T.nilable(T::Hash[String, String])) }
def config; end

sig { params(value: T.nilable(T::Hash[String, String])).returns(T.nilable(T::Hash[String, String])) }
def config=(value); end

sig { returns(T.nilable(WorkOS::DataIntegrationCredentialsInput)) }
def credentials; end

Expand Down
6 changes: 6 additions & 0 deletions rbi/workos/data_integration.rbi
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,12 @@ module WorkOS
sig { params(value: T.nilable(WorkOS::DataIntegrationInstallation)).returns(T.nilable(WorkOS::DataIntegrationInstallation)) }
def installation=(value); end

sig { returns(T::Hash[String, String]) }
def config; end

sig { params(value: T::Hash[String, String]).returns(T::Hash[String, String]) }
def config=(value); end

sig { returns(T.nilable(WorkOS::DataIntegrationCustomProvider)) }
def custom_provider; end

Expand Down
6 changes: 6 additions & 0 deletions rbi/workos/data_integration_configuration_response.rbi
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,12 @@ module WorkOS
sig { params(value: T.nilable(T::Array[String])).returns(T.nilable(T::Array[String])) }
def scopes=(value); end

sig { returns(T::Hash[String, String]) }
def config; end

sig { params(value: T::Hash[String, String]).returns(T::Hash[String, String]) }
def config=(value); end

sig { returns(String) }
def created_at; end

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,12 @@ module WorkOS
sig { params(value: T.nilable(String)).returns(T.nilable(String)) }
def return_to=(value); end

sig { returns(T.nilable(T::Hash[String, String])) }
def config; end

sig { params(value: T.nilable(T::Hash[String, String])).returns(T.nilable(T::Hash[String, String])) }
def config=(value); end

sig { returns(T::Hash[Symbol, T.untyped]) }
def to_h; end

Expand Down
6 changes: 4 additions & 2 deletions rbi/workos/pipes.rbi
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,14 @@ module WorkOS
enabled: T.nilable(T::Boolean),
scopes: T.nilable(T::Array[String]),
auth_methods: T.nilable(T::Array[String]),
config: T.nilable(T::Hash[String, String]),
credentials: T.nilable(WorkOS::DataIntegrationCredentialsInput),
api_key: T.nilable(WorkOS::ApiKeyInstallation),
custom_provider: T.nilable(WorkOS::CustomProviderDefinition),
request_options: T::Hash[Symbol, T.untyped]
).returns(WorkOS::DataIntegration)
end
def create_data_integration(provider:, description:, enabled:, scopes:, auth_methods:, credentials:, api_key:, custom_provider:, request_options:); end
def create_data_integration(provider:, description:, enabled:, scopes:, auth_methods:, config:, credentials:, api_key:, custom_provider:, request_options:); end

sig do
params(
Expand Down Expand Up @@ -82,10 +83,11 @@ module WorkOS
user_id: String,
organization_id: T.nilable(String),
return_to: T.nilable(String),
config: T.nilable(T::Hash[String, String]),
request_options: T::Hash[Symbol, T.untyped]
).returns(WorkOS::DataIntegrationAuthorizeUrlResponse)
end
def authorize_data_integration(slug:, user_id:, organization_id:, return_to:, request_options:); end
def authorize_data_integration(slug:, user_id:, organization_id:, return_to:, config:, request_options:); end

sig do
params(
Expand Down
3 changes: 2 additions & 1 deletion rbi/workos/pipes_provider.rbi
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,11 @@ module WorkOS
scopes: T.nilable(T::Array[String]),
client_id: T.nilable(String),
client_secret: T.nilable(String),
config: T.nilable(T::Hash[String, String]),
request_options: T::Hash[Symbol, T.untyped]
).returns(WorkOS::DataIntegrationConfigurationResponse)
end
def update_organization_data_integration_configuration(organization_id:, slug:, enabled:, scopes:, client_id:, client_secret:, request_options:); end
def update_organization_data_integration_configuration(organization_id:, slug:, enabled:, scopes:, client_id:, client_secret:, config:, request_options:); end

end
end
5 changes: 4 additions & 1 deletion test/workos/test_pipes_model_round_trip.rb
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ def test_create_data_integration_round_trip
"enabled" => true,
"scopes" => nil,
"auth_methods" => [],
"config" => {},
"credentials" => {},
"api_key" => {},
"custom_provider" => {}
Expand Down Expand Up @@ -135,6 +136,7 @@ def test_data_integration_round_trip
"auth_methods" => [],
"credentials" => {},
"installation" => nil,
"config" => {},
"custom_provider" => nil,
"created_at" => "stub",
"updated_at" => "stub"
Expand Down Expand Up @@ -364,7 +366,8 @@ def test_data_integrations_get_data_integration_authorize_url_request_round_trip
fixture = {
"user_id" => "stub",
"organization_id" => "stub",
"return_to" => "stub"
"return_to" => "stub",
"config" => {}
}
model = WorkOS::DataIntegrationsGetDataIntegrationAuthorizeUrlRequest.new(fixture.to_json)
json = model.to_h
Expand Down
4 changes: 3 additions & 1 deletion test/workos/test_pipes_provider_model_round_trip.rb
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ def test_data_integration_configuration_response_round_trip
"name" => "stub",
"enabled" => true,
"scopes" => nil,
"config" => {},
"created_at" => "stub",
"updated_at" => "stub",
"credentials" => {}
Expand Down Expand Up @@ -65,7 +66,8 @@ def test_configure_data_integration_body_round_trip
"enabled" => true,
"scopes" => nil,
"client_id" => "stub",
"client_secret" => "stub"
"client_secret" => "stub",
"config" => {}
}
model = WorkOS::ConfigureDataIntegrationBody.new(fixture.to_json)
json = model.to_h
Expand Down
Loading