Class: Apadmi::Grout::BasicAuthService

Inherits:
Object
  • Object
show all
Defined in:
lib/apadmi/grout/utils/basic_auth_service.rb,
lib/apadmi/grout/service/basic_auth_service.rb

Overview

Handles returning a basic auth header

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(username, password) ⇒ BasicAuthService

Returns a new instance of BasicAuthService.



9
10
11
12
# File 'lib/apadmi/grout/utils/basic_auth_service.rb', line 9

def initialize(username, password)
  auth_str = "#{username}:#{password}"
  @auth_header = "Basic #{Base64.strict_encode64(auth_str)}"
end

Instance Attribute Details

#auth_headerObject (readonly)

Returns the value of attribute auth_header.



14
15
16
# File 'lib/apadmi/grout/utils/basic_auth_service.rb', line 14

def auth_header
  @auth_header
end