mirror of
https://github.com/internetee/registry.git
synced 2025-07-31 06:56:23 +02:00
fixed zeitwerk load file issue
This commit is contained in:
parent
e0e9c43575
commit
f384520cbf
5 changed files with 72 additions and 69 deletions
|
@ -3,8 +3,8 @@ require 'auth_token/auth_token_decryptor'
|
|||
module Api
|
||||
module V1
|
||||
module AccreditationCenter
|
||||
if Feature.allow_accr_endspoints?
|
||||
class BaseController < ActionController::API
|
||||
if Feature.allow_accr_endspoints?
|
||||
rescue_from ActiveRecord::RecordNotFound, with: :show_not_found_error
|
||||
rescue_from ActiveRecord::RecordInvalid, with: :show_invalid_record_error
|
||||
rescue_from(ActionController::ParameterMissing) do |parameter_missing_exception|
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
module Repp
|
||||
module V1
|
||||
module Registrar
|
||||
if Feature.allow_accr_endspoints?
|
||||
class AccreditationInfoController < BaseController
|
||||
if Feature.allow_accr_endspoints?
|
||||
api :GET, 'repp/v1/registrar/accreditation/get_info'
|
||||
desc 'check login user and return data'
|
||||
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
module Repp
|
||||
module V1
|
||||
module Registrar
|
||||
if Feature.allow_accr_endspoints?
|
||||
class AccreditationResultsController < ActionController::API
|
||||
if Feature.allow_accr_endspoints?
|
||||
before_action :authenticate_shared_key
|
||||
|
||||
TEMPORARY_SECRET_KEY = ENV['accreditation_secret'].freeze
|
||||
|
@ -26,7 +26,6 @@ module Repp
|
|||
user = ApiUser.find_by(username: username)
|
||||
|
||||
raise ActiveRecord::RecordNotFound if user.nil?
|
||||
|
||||
user.accreditation_date = DateTime.current
|
||||
user.accreditation_expire_date = user.accreditation_date + EXPIRE_DEADLINE
|
||||
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
require 'test_helper'
|
||||
|
||||
class ReppV1AccreditationInfoTest < ActionDispatch::IntegrationTest
|
||||
if Feature.allow_accr_endspoints?
|
||||
def setup
|
||||
@user = users(:api_bestnames)
|
||||
token = Base64.encode64("#{@user.username}:#{@user.plain_text_password}")
|
||||
|
@ -33,3 +34,4 @@ class ReppV1AccreditationInfoTest < ActionDispatch::IntegrationTest
|
|||
assert_equal json[:message], 'Invalid authorization information'
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
require 'test_helper'
|
||||
|
||||
class ReppV1AccreditationResultsTest < ActionDispatch::IntegrationTest
|
||||
if Feature.allow_accr_endspoints?
|
||||
TEMPORARY_SECRET_KEY = ENV['accreditation_secret'].freeze
|
||||
|
||||
def setup
|
||||
|
@ -50,3 +51,4 @@ class ReppV1AccreditationResultsTest < ActionDispatch::IntegrationTest
|
|||
assert_equal json[:message], "Object 'chungachanga' does not exist"
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue