Class: UntitledApi::CustomHeaderAuthentication

Inherits:
CoreLibrary::HeaderAuth
  • Object
show all
Defined in:
lib/untitled_api/http/auth/custom_header_authentication.rb

Overview

Utility class for custom header authorization.

Instance Method Summary collapse

Constructor Details

#initialize(custom_header_authentication_credentials) ⇒ CustomHeaderAuthentication

Initialization constructor.



16
17
18
19
20
21
22
# File 'lib/untitled_api/http/auth/custom_header_authentication.rb', line 16

def initialize(custom_header_authentication_credentials)
  auth_params = {}
  auth_params['Authorization'] = custom_header_authentication_credentials.authorization unless
    custom_header_authentication_credentials.nil? || custom_header_authentication_credentials.authorization.nil?

  super auth_params
end

Instance Method Details

#error_messageObject

Display error message on occurrence of authentication failure.



11
12
13
# File 'lib/untitled_api/http/auth/custom_header_authentication.rb', line 11

def error_message
  'CustomHeaderAuthentication: authorization is undefined.'
end