Class: ActionHook::Security::Authentication::Basic
- Defined in:
- lib/actionhook/security/authentication.rb
Instance Attribute Summary collapse
-
#password ⇒ Object
Returns the value of attribute password.
-
#username ⇒ Object
Returns the value of attribute username.
Instance Method Summary collapse
- #header_value ⇒ Object
-
#initialize(username:, password:) ⇒ Basic
constructor
A new instance of Basic.
Methods inherited from Base
Constructor Details
#initialize(username:, password:) ⇒ Basic
Returns a new instance of Basic.
35 36 37 38 |
# File 'lib/actionhook/security/authentication.rb', line 35 def initialize(username:, password:) @username = username @password = password end |
Instance Attribute Details
#password ⇒ Object
Returns the value of attribute password.
33 34 35 |
# File 'lib/actionhook/security/authentication.rb', line 33 def password @password end |
#username ⇒ Object
Returns the value of attribute username.
33 34 35 |
# File 'lib/actionhook/security/authentication.rb', line 33 def username @username end |
Instance Method Details
#header_value ⇒ Object
40 41 42 43 |
# File 'lib/actionhook/security/authentication.rb', line 40 def header_value encoded = Base64.strict_encode64("#{username}:#{password}") "Basic #{encoded}" end |