Class: Xenon::BasicAuth
- Inherits:
-
Object
- Object
- Xenon::BasicAuth
- Defined in:
- lib/xenon/auth.rb
Instance Attribute Summary collapse
-
#auth_params ⇒ Object
readonly
Returns the value of attribute auth_params.
Instance Method Summary collapse
- #call(request) ⇒ Object
-
#initialize(auth_params = {}, &store) ⇒ BasicAuth
constructor
A new instance of BasicAuth.
- #scheme ⇒ Object
Constructor Details
#initialize(auth_params = {}, &store) ⇒ BasicAuth
Returns a new instance of BasicAuth.
49 50 51 52 |
# File 'lib/xenon/auth.rb', line 49 def initialize(auth_params = {}, &store) @auth_params = auth_params @store = store end |
Instance Attribute Details
#auth_params ⇒ Object (readonly)
Returns the value of attribute auth_params.
47 48 49 |
# File 'lib/xenon/auth.rb', line 47 def auth_params @auth_params end |
Instance Method Details
#call(request) ⇒ Object
58 59 60 61 |
# File 'lib/xenon/auth.rb', line 58 def call(request) header = request.header('Authorization') rescue nil @store.call(header.credentials) if header && header.credentials.is_a?(BasicCredentials) end |
#scheme ⇒ Object
54 55 56 |
# File 'lib/xenon/auth.rb', line 54 def scheme 'Basic' end |