Class: Spikard::ApiKeyConfig
- Inherits:
-
Object
- Object
- Spikard::ApiKeyConfig
- Defined in:
- lib/spikard/config.rb
Overview
API key authentication configuration.
Validates API keys from request headers. Keys are matched exactly.
Instance Attribute Summary collapse
-
#header_name ⇒ Object
Returns the value of attribute header_name.
-
#keys ⇒ Object
Returns the value of attribute keys.
Instance Method Summary collapse
-
#initialize(keys:, header_name: 'X-API-Key') ⇒ ApiKeyConfig
constructor
A new instance of ApiKeyConfig.
Constructor Details
#initialize(keys:, header_name: 'X-API-Key') ⇒ ApiKeyConfig
Returns a new instance of ApiKeyConfig.
104 105 106 107 |
# File 'lib/spikard/config.rb', line 104 def initialize(keys:, header_name: 'X-API-Key') @keys = keys @header_name = header_name end |
Instance Attribute Details
#header_name ⇒ Object
Returns the value of attribute header_name.
100 101 102 |
# File 'lib/spikard/config.rb', line 100 def header_name @header_name end |
#keys ⇒ Object
Returns the value of attribute keys.
100 101 102 |
# File 'lib/spikard/config.rb', line 100 def keys @keys end |