change condition for render endpoint in specific envinronment

This commit is contained in:
olegphenomenon 2022-03-09 15:26:05 +02:00
parent 72f184d9b0
commit 44296ab045
5 changed files with 17 additions and 4 deletions

View file

@ -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

View file

@ -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'

View file

@ -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

View file

@ -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

View file

@ -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'