Class: Jsapi::Controller::Authentication::Credentials::HTTP::Basic
- Defined in:
- lib/jsapi/controller/authentication/credentials/http/basic.rb
Overview
Holds a username and password passed according to HTTP Basic Authentication.
Instance Attribute Summary collapse
-
#password ⇒ Object
readonly
The decoded password.
-
#username ⇒ Object
readonly
The decoded username.
Attributes inherited from Base
Instance Method Summary collapse
-
#initialize(authorization) ⇒ Basic
constructor
A new instance of Basic.
-
#well_formed? ⇒ Boolean
:nodoc:.
Constructor Details
#initialize(authorization) ⇒ Basic
Returns a new instance of Basic.
19 20 21 22 23 24 |
# File 'lib/jsapi/controller/authentication/credentials/http/basic.rb', line 19 def initialize() super @username, @password = Base64.decode64(auth_param).split(':', 2) \ if auth_scheme == 'Basic' && auth_param.present? end |
Instance Attribute Details
#password ⇒ Object (readonly)
The decoded password.
14 15 16 |
# File 'lib/jsapi/controller/authentication/credentials/http/basic.rb', line 14 def password @password end |
#username ⇒ Object (readonly)
The decoded username.
17 18 19 |
# File 'lib/jsapi/controller/authentication/credentials/http/basic.rb', line 17 def username @username end |
Instance Method Details
#well_formed? ⇒ Boolean
:nodoc:
26 27 28 |
# File 'lib/jsapi/controller/authentication/credentials/http/basic.rb', line 26 def well_formed? # :nodoc: !username.nil? && !password.nil? end |