From 56c1c5a097c51b385bab4785a3761a8e321a4ba9 Mon Sep 17 00:00:00 2001 From: mbianco-stripe <45374579+mbianco-stripe@users.noreply.github.com> Date: Thu, 16 Jun 2022 16:51:53 -0700 Subject: [PATCH] Stop validating api key (#506) --- app/controllers/api/configurations_controller.rb | 7 ++++--- test/controllers/test_configurations_controller.rb | 2 ++ 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/app/controllers/api/configurations_controller.rb b/app/controllers/api/configurations_controller.rb index 4a3c2102b2..9352d1dfae 100644 --- a/app/controllers/api/configurations_controller.rb +++ b/app/controllers/api/configurations_controller.rb @@ -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 @@ -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) diff --git a/test/controllers/test_configurations_controller.rb b/test/controllers/test_configurations_controller.rb index 374e369c30..77d791702f 100644 --- a/test/controllers/test_configurations_controller.rb +++ b/test/controllers/test_configurations_controller.rb @@ -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) )