Class: X::Authenticator

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

Overview

Base class for authentication

Constant Summary collapse

AUTHENTICATION_HEADER =

The HTTP header name for authentication

"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:

  • _request (Net::HTTPRequest)

    the HTTP request

Returns:

  • (Hash{String => String})

    the authentication header



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

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