Class: Sumologic::Http::Authenticator

Inherits:
Object
  • Object
show all
Defined in:
lib/sumologic/http/authenticator.rb

Overview

Handles authentication header generation for Sumo Logic API

Instance Method Summary collapse

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_headerObject



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