Class: X::Authenticator

Inherits:
Object
  • Object
show all
Defined in:
lib/x/authenticator.rb

Overview

Base class for authentication

API:

  • public

Constant Summary collapse

AUTHENTICATION_HEADER =

The HTTP header name for authentication

API:

  • public

"Authorization".freeze

Instance Method Summary collapse

Instance Method Details

#header(_request) ⇒ Hash{String => String}

Generate the authentication header for a request

Examples:

Generate an empty authentication header

authenticator = X::Authenticator.new
authenticator.header(request)

Parameters:

  • the HTTP request

Returns:

  • the authentication header

API:

  • public



17
18
19
# File 'lib/x/authenticator.rb', line 17

def header(_request)
  {AUTHENTICATION_HEADER => ""}
end