diff --git a/app/controllers/api/v1/accreditation_center/base_controller.rb b/app/controllers/api/v1/accreditation_center/base_controller.rb index 77f3b0338..05b809006 100644 --- a/app/controllers/api/v1/accreditation_center/base_controller.rb +++ b/app/controllers/api/v1/accreditation_center/base_controller.rb @@ -3,7 +3,7 @@ require 'auth_token/auth_token_decryptor' module Api module V1 module AccreditationCenter - if Rails.env.development? || Rails.env.staging? || Rails.env.test? + if Feature.allow_accr_endspoints? class BaseController < ActionController::API rescue_from ActiveRecord::RecordNotFound, with: :show_not_found_error rescue_from ActiveRecord::RecordInvalid, with: :show_invalid_record_error diff --git a/app/controllers/repp/v1/registrar/accreditation_info_controller.rb b/app/controllers/repp/v1/registrar/accreditation_info_controller.rb index 5e3524c92..1d3065062 100644 --- a/app/controllers/repp/v1/registrar/accreditation_info_controller.rb +++ b/app/controllers/repp/v1/registrar/accreditation_info_controller.rb @@ -1,7 +1,7 @@ module Repp module V1 module Registrar - if Rails.env.development? || Rails.env.staging? || Rails.env.test? + if Feature.allow_accr_endspoints? class AccreditationInfoController < BaseController api :GET, 'repp/v1/registrar/accreditation/get_info' desc 'check login user and return data' diff --git a/app/controllers/repp/v1/registrar/accreditation_results_controller.rb b/app/controllers/repp/v1/registrar/accreditation_results_controller.rb index 4b5c40467..cbc39b063 100644 --- a/app/controllers/repp/v1/registrar/accreditation_results_controller.rb +++ b/app/controllers/repp/v1/registrar/accreditation_results_controller.rb @@ -1,7 +1,7 @@ module Repp module V1 module Registrar - if Rails.env.development? || Rails.env.staging? || Rails.env.test? + if Feature.allow_accr_endspoints? class AccreditationResultsController < ActionController::API before_action :authenticate_shared_key diff --git a/app/models/feature.rb b/app/models/feature.rb index 7a0d6d78b..ed7ae12fd 100644 --- a/app/models/feature.rb +++ b/app/models/feature.rb @@ -4,4 +4,18 @@ class Feature ENV['billing_system_integrated'] || false end + # def self.obj_and_extensions_statuses_enabled? + # return false if ENV['obj_and_extensions_prohibited'] == 'false' + # + # ENV['obj_and_extensions_prohibited'] || false + # end + # + # def self.enable_lock_domain_with_new_statuses? + # return false if ENV['enable_lock_domain_with_new_statuses'] == 'false' + # + # ENV['enable_lock_domain_with_new_statuses'] || false + # end + def self.allow_accr_endspoints? + ENV['allow_accr_endspoints'] == 'true' + end end diff --git a/config/application.yml.sample b/config/application.yml.sample index b25b09fa8..acc5ab6b4 100644 --- a/config/application.yml.sample +++ b/config/application.yml.sample @@ -242,4 +242,3 @@ billing_system_integrated: 'true' secret_access_word: 'please-Give-Me-accesS' secret_word: 'this-secret-should-be-change' allow_accr_endspoints: 'true' -