Class: Apadmi::Grout::BasicAuthService
- Inherits:
-
Object
- Object
- Apadmi::Grout::BasicAuthService
- 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
-
#auth_header ⇒ Object
readonly
Returns the value of attribute auth_header.
Instance Method Summary collapse
-
#initialize(username, password) ⇒ BasicAuthService
constructor
A new instance of BasicAuthService.
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_header ⇒ Object (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 |