Class: Rack::Auth::AbstractRequest
Relationships & Source Files | |
Extension / Inclusion / Inheritance Descendants | |
Subclasses:
|
|
Inherits: | Object |
Defined in: | lib/rack/auth/abstract/request.rb |
Constant Summary
-
AUTHORIZATION_KEYS =
# File 'lib/rack/auth/abstract/request.rb', line 42['HTTP_AUTHORIZATION', 'X-HTTP_AUTHORIZATION', 'X_HTTP_AUTHORIZATION']
Class Method Summary
- .new(env) ⇒ AbstractRequest constructor
Instance Attribute Summary
- #provided? ⇒ Boolean readonly
- #valid? ⇒ Boolean readonly
Instance Method Summary
- #params
- #parts
- #request
- #scheme
- #authorization_key private
Constructor Details
.new(env) ⇒ AbstractRequest
# File 'lib/rack/auth/abstract/request.rb', line 10
def initialize(env) @env = env end
Instance Attribute Details
#provided? ⇒ Boolean
(readonly)
[ GitHub ]
# File 'lib/rack/auth/abstract/request.rb', line 19
def provided? ! .nil? && valid? end
#valid? ⇒ Boolean
(readonly)
[ GitHub ]
# File 'lib/rack/auth/abstract/request.rb', line 23
def valid? !@env[ ].nil? end
Instance Method Details
#authorization_key (private)
[ GitHub ]# File 'lib/rack/auth/abstract/request.rb', line 44
def @authorization_key ||= AUTHORIZATION_KEYS.detect { |key| @env.has_key?(key) } end
#params
[ GitHub ]# File 'lib/rack/auth/abstract/request.rb', line 35
def params @params ||= parts.last end
#parts
[ GitHub ]# File 'lib/rack/auth/abstract/request.rb', line 27
def parts @parts ||= @env[ ].split(' ', 2) end
#request
[ GitHub ]#scheme
[ GitHub ]# File 'lib/rack/auth/abstract/request.rb', line 31
def scheme @scheme ||= parts.first&.downcase end