mirror of
https://github.com/internetee/registry.git
synced 2025-08-11 20:19:34 +02:00
change condition for render endpoint in specific envinronment
This commit is contained in:
parent
72f184d9b0
commit
44296ab045
5 changed files with 17 additions and 4 deletions
|
@ -3,7 +3,7 @@ require 'auth_token/auth_token_decryptor'
|
||||||
module Api
|
module Api
|
||||||
module V1
|
module V1
|
||||||
module AccreditationCenter
|
module AccreditationCenter
|
||||||
if Rails.env.development? || Rails.env.staging? || Rails.env.test?
|
if Feature.allow_accr_endspoints?
|
||||||
class BaseController < ActionController::API
|
class BaseController < ActionController::API
|
||||||
rescue_from ActiveRecord::RecordNotFound, with: :show_not_found_error
|
rescue_from ActiveRecord::RecordNotFound, with: :show_not_found_error
|
||||||
rescue_from ActiveRecord::RecordInvalid, with: :show_invalid_record_error
|
rescue_from ActiveRecord::RecordInvalid, with: :show_invalid_record_error
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
module Repp
|
module Repp
|
||||||
module V1
|
module V1
|
||||||
module Registrar
|
module Registrar
|
||||||
if Rails.env.development? || Rails.env.staging? || Rails.env.test?
|
if Feature.allow_accr_endspoints?
|
||||||
class AccreditationInfoController < BaseController
|
class AccreditationInfoController < BaseController
|
||||||
api :GET, 'repp/v1/registrar/accreditation/get_info'
|
api :GET, 'repp/v1/registrar/accreditation/get_info'
|
||||||
desc 'check login user and return data'
|
desc 'check login user and return data'
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
module Repp
|
module Repp
|
||||||
module V1
|
module V1
|
||||||
module Registrar
|
module Registrar
|
||||||
if Rails.env.development? || Rails.env.staging? || Rails.env.test?
|
if Feature.allow_accr_endspoints?
|
||||||
class AccreditationResultsController < ActionController::API
|
class AccreditationResultsController < ActionController::API
|
||||||
before_action :authenticate_shared_key
|
before_action :authenticate_shared_key
|
||||||
|
|
||||||
|
|
|
@ -4,4 +4,18 @@ class Feature
|
||||||
|
|
||||||
ENV['billing_system_integrated'] || false
|
ENV['billing_system_integrated'] || false
|
||||||
end
|
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
|
end
|
||||||
|
|
|
@ -242,4 +242,3 @@ billing_system_integrated: 'true'
|
||||||
secret_access_word: 'please-Give-Me-accesS'
|
secret_access_word: 'please-Give-Me-accesS'
|
||||||
secret_word: 'this-secret-should-be-change'
|
secret_word: 'this-secret-should-be-change'
|
||||||
allow_accr_endspoints: 'true'
|
allow_accr_endspoints: 'true'
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue