Class: DigiwinDsp::Authenticator
- Inherits:
-
Object
- Object
- DigiwinDsp::Authenticator
- Defined in:
- lib/digiwin_dsp/authenticator.rb
Constant Summary collapse
- HEADER_NAME =
"DSP-api-key"
Instance Method Summary collapse
-
#auth_headers ⇒ Object
Validation lives in Client#post (called per-request).
-
#initialize(configuration = DigiwinDsp.configuration) ⇒ Authenticator
constructor
A new instance of Authenticator.
Constructor Details
#initialize(configuration = DigiwinDsp.configuration) ⇒ Authenticator
Returns a new instance of Authenticator.
7 8 9 |
# File 'lib/digiwin_dsp/authenticator.rb', line 7 def initialize(configuration = DigiwinDsp.configuration) @configuration = configuration end |
Instance Method Details
#auth_headers ⇒ Object
Validation lives in Client#post (called per-request). Authenticator only ran validate! once per connection lifetime due to Client’s memoized #default_headers, so the redundant call was misleading.
14 15 16 |
# File 'lib/digiwin_dsp/authenticator.rb', line 14 def auth_headers { HEADER_NAME => @configuration.api_key } end |