Skip to content

Commit

Permalink
Merge pull request #15918 from CartoDB/bug/ch116888/dryrun-endpoint-f…
Browse files Browse the repository at this point in the history
…ails-for-organization-routes

Whitelist dryrun connector parameters
  • Loading branch information
jgoizueta committed Nov 6, 2020
2 parents 95ac1a7 + 9e40865 commit 1469a4e
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
1 change: 1 addition & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ Development
- None yet

### Features
* Fix dryrun connector end-point for org users ([#15918](https://github.com/CartoDB/cartodb/pull/15918))
* Fix column sanitization for connector syncs ([#15885](https://github.com/CartoDB/cartodb/pull/15885))
* Load config files as ERB templates to allow reading ENV values ([#15881](https://github.com/CartoDB/cartodb/pull/15881))
* Add public website DO catalog integration ([#15908](https://github.com/CartoDB/cartodb/pull/15908), [#15911](https://github.com/CartoDB/cartodb/pull/15911), [#15912](https://github.com/CartoDB/cartodb/pull/15912))
Expand Down
10 changes: 6 additions & 4 deletions app/controllers/carto/api/connectors_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -159,9 +159,7 @@ def build_connection_parameters(provider_id, request_params)
if provider_information[:parameters]["connection"].present?
parameters[:connection] = {}
provider_information[:parameters]["connection"].each do |key, _value|
if request_params[key.to_sym].present?
parameters[:connection][key.to_sym] = request_params[key.to_sym]
end
parameters[:connection][key.to_sym] = request_params[key.to_sym] if request_params[key.to_sym].present?
end
end
parameters
Expand All @@ -174,7 +172,11 @@ def build_connector_parameters(provider_id, request_params)
raise Carto::Connector::InvalidParametersError.new(message: "Provider doesn't match")
end
parameters[:provider] = provider_id
parameters.merge! request_params.except(:provider_id, :format, :controller, :action, :api_key)
provider_information = Carto::Connector.information(provider_id)
provider_information[:parameters].each do |key, _value|
parameters[key.to_sym] = request_params[key.to_sym] if request_params[key.to_sym].present?
end
parameters
end

def check_availability
Expand Down

0 comments on commit 1469a4e

Please sign in to comment.