Class: Manceps::Auth::ApiKeyHeader
- Inherits:
-
Object
- Object
- Manceps::Auth::ApiKeyHeader
- Defined in:
- lib/manceps/auth/api_key_header.rb
Overview
Authenticates requests with a custom API key header.
Instance Method Summary collapse
- #apply(headers) ⇒ Object
-
#initialize(header_name, key) ⇒ ApiKeyHeader
constructor
A new instance of ApiKeyHeader.
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 |