Skip to content

Commit

Permalink
Stop validating api key (#506)
Browse files Browse the repository at this point in the history
  • Loading branch information
mbianco-stripe authored Jun 16, 2022
1 parent 29080aa commit 56c1c5a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
7 changes: 4 additions & 3 deletions app/controllers/api/configurations_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ def post_install
report_edge_case("updating api key for user, but is already set")
end

if request.headers[SALESFORCE_INSTANCE_TYPE_HEADER].blank? || request.headers[SALESFORCE_PACKAGE_NAMESPACE_HEADER]
if request.headers[SALESFORCE_INSTANCE_TYPE_HEADER].blank? || request.headers[SALESFORCE_PACKAGE_NAMESPACE_HEADER].nil?
report_edge_case("important headers are blank on post install")
end

Expand Down Expand Up @@ -161,8 +161,9 @@ def update

if @user.salesforce_organization_key != salesforce_api_key
log.error 'api key does not match user'
head :not_found
return
# TODO until the issue with the package is resolved, this needs to stay the way it is
# head :not_found
# return
end

set_error_context(user: @user)
Expand Down
2 changes: 2 additions & 0 deletions test/controllers/test_configurations_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,8 @@ class Critic::ConfigurationsControllerTest < ApplicationIntegrationTest
# DB enforces that SF org IDs must be unique

it 'throws an error if the api key does not match' do
skip("disabled until package is fixed and users are upgraded")

get api_configuration_path, params: {}, headers: authentication_headers.merge(
SALESFORCE_KEY_HEADER => SecureRandom.alphanumeric(16)
)
Expand Down

0 comments on commit 56c1c5a

Please sign in to comment.