Class: Manceps::Auth::ApiKeyHeader

Inherits:
Object
  • Object
show all
Defined in:
lib/manceps/auth/api_key_header.rb

Overview

Authenticates requests with a custom API key header.

Instance Method Summary collapse

Constructor Details

#initialize(header_name, key) ⇒ ApiKeyHeader

Returns a new instance of ApiKeyHeader.



7
8
9
10
# File 'lib/manceps/auth/api_key_header.rb', line 7

def initialize(header_name, key)
  @header_name = header_name.downcase
  @key = key
end

Instance Method Details

#apply(headers) ⇒ Object



12
13
14
# File 'lib/manceps/auth/api_key_header.rb', line 12

def apply(headers)
  headers[@header_name] = @key
end