Class: MistApi::CsrfToken
- Inherits:
-
CoreLibrary::HeaderAuth
- Object
- CoreLibrary::HeaderAuth
- MistApi::CsrfToken
- Defined in:
- lib/mist_api/http/auth/csrf_token.rb
Overview
Utility class for custom header authorization.
Instance Method Summary collapse
-
#error_message ⇒ Object
Display error message on occurrence of authentication failure.
-
#initialize(csrf_token_credentials) ⇒ CsrfToken
constructor
Initialization constructor.
Constructor Details
#initialize(csrf_token_credentials) ⇒ CsrfToken
Initialization constructor.
16 17 18 19 20 21 22 |
# File 'lib/mist_api/http/auth/csrf_token.rb', line 16 def initialize(csrf_token_credentials) auth_params = {} auth_params['X-CSRFToken'] = csrf_token_credentials.x_csrf_token unless csrf_token_credentials.nil? || csrf_token_credentials.x_csrf_token.nil? super auth_params end |
Instance Method Details
#error_message ⇒ Object
Display error message on occurrence of authentication failure.
11 12 13 |
# File 'lib/mist_api/http/auth/csrf_token.rb', line 11 def 'CsrfToken: x_csrf_token is undefined.' end |