Class: Sumologic::Http::Authenticator
- Inherits:
-
Object
- Object
- Sumologic::Http::Authenticator
- Defined in:
- lib/sumologic/http/authenticator.rb
Overview
Handles authentication header generation for Sumo Logic API
Instance Method Summary collapse
- #auth_header ⇒ Object
-
#initialize(access_id:, access_key:) ⇒ Authenticator
constructor
A new instance of Authenticator.
Constructor Details
#initialize(access_id:, access_key:) ⇒ Authenticator
Returns a new instance of Authenticator.
9 10 11 12 |
# File 'lib/sumologic/http/authenticator.rb', line 9 def initialize(access_id:, access_key:) @access_id = access_id @access_key = access_key end |
Instance Method Details
#auth_header ⇒ Object
14 15 16 17 |
# File 'lib/sumologic/http/authenticator.rb', line 14 def auth_header encoded = Base64.strict_encode64("#{@access_id}:#{@access_key}") "Basic #{encoded}" end |