aboutsummaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
authorChristopher Baines <mail@cbaines.net>2018-07-03 12:51:33 +0100
committerChristopher Baines <mail@cbaines.net>2018-07-03 13:08:34 +0100
commite79624b97279def43e4e7f187c5ed2f5d07fafaa (patch)
tree45e62370551fbf9596db1187dcf2755f10eb012a /app
parent6b466d156932f0f16f2f8ae13a789f51ecece58b (diff)
downloadgovuk-mini-environment-admin-e79624b97279def43e4e7f187c5ed2f5d07fafaa.tar
govuk-mini-environment-admin-e79624b97279def43e4e7f187c5ed2f5d07fafaa.tar.gz
Fix the Terraform HTTP backend in productionrelease_8
Skip the authenticate_user! before action for the Terraform controller methods, and refactor the code to improve readability.
Diffstat (limited to 'app')
-rw-r--r--app/controllers/terraform_http_backend_controller.rb8
1 files changed, 6 insertions, 2 deletions
diff --git a/app/controllers/terraform_http_backend_controller.rb b/app/controllers/terraform_http_backend_controller.rb
index eeff7b0..9e38dc7 100644
--- a/app/controllers/terraform_http_backend_controller.rb
+++ b/app/controllers/terraform_http_backend_controller.rb
@@ -19,7 +19,11 @@
# <http://www.gnu.org/licenses/>.
class TerraformHttpBackendController < ApplicationController
- skip_before_action :verify_authenticity_token, only: %w(create show destroy)
+ # These controller methods are for use by Terraform
+ TERRAFORM_CONTROLLER_METHODS = %w(create show destroy)
+
+ skip_before_action :verify_authenticity_token, only: TERRAFORM_CONTROLLER_METHODS
+ skip_before_action :authenticate_user!, only: TERRAFORM_CONTROLLER_METHODS
def self.credentials
@_credentials ||= begin
@@ -38,7 +42,7 @@ class TerraformHttpBackendController < ApplicationController
http_basic_authenticate_with(
**credentials,
- only: %(create show destroy)
+ only: TERRAFORM_CONTROLLER_METHODS
)
def index