Class: Utcp::Auth::Basic
Instance Method Summary collapse
- #apply_headers(h) ⇒ Object
-
#initialize(username:, password:) ⇒ Basic
constructor
A new instance of Basic.
Methods inherited from Base
Constructor Details
#initialize(username:, password:) ⇒ Basic
44 45 46 |
# File 'lib/utcp/auth.rb', line 44 def initialize(username:, password:) @cred = Base64.strict_encode64("#{Utils::Subst.apply(username)}:#{Utils::Subst.apply(password)}") end |
Instance Method Details
#apply_headers(h) ⇒ Object
48 49 50 51 |
# File 'lib/utcp/auth.rb', line 48 def apply_headers(h) h["Authorization"] = "Basic #{@cred}" h end |