Class: CtdDocumentation::CustomHeaderAuth

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

Overview

Utility class for custom header authorization.

Instance Method Summary collapse

Constructor Details

#initialize(authorization) ⇒ CustomHeaderAuth

Initialization constructor.



16
17
18
19
20
21
22
23
# File 'lib/ctd_documentation/http/auth/custom_header_auth.rb', line 16

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

  super auth_params

  @_authorization = authorization
end

Instance Method Details

#error_messageObject

Display error message on occurrence of authentication failure in CustomAuthentication.



11
12
13
# File 'lib/ctd_documentation/http/auth/custom_header_auth.rb', line 11

def error_message
  'CustomHeaderAuthentication: authorization is undefined.'
end