class Rack::Auth::AbstractRequest

Constants

AUTHORIZATION_KEYS

Public Class Methods

new(env) click to toggle source
# File lib/rack/auth/abstract/request.rb, line 10
def initialize(env)
  @env = env
end

Public Instance Methods

params() click to toggle source
# File lib/rack/auth/abstract/request.rb, line 35
def params
  @params ||= parts.last
end
parts() click to toggle source
# File lib/rack/auth/abstract/request.rb, line 27
def parts
  @parts ||= @env[authorization_key].split(' ', 2)
end
provided?() click to toggle source
# File lib/rack/auth/abstract/request.rb, line 19
def provided?
  !authorization_key.nil? && valid?
end
request() click to toggle source
# File lib/rack/auth/abstract/request.rb, line 14
def request
  warn "Rack::Auth::AbstractRequest#request is deprecated and will be removed in a future version of rack.", uplevel: 1
  @request ||= Request.new(@env)
end
scheme() click to toggle source
# File lib/rack/auth/abstract/request.rb, line 31
def scheme
  @scheme ||= parts.first&.downcase
end
valid?() click to toggle source
# File lib/rack/auth/abstract/request.rb, line 23
def valid?
  !@env[authorization_key].nil?
end

Private Instance Methods

authorization_key() click to toggle source
# File lib/rack/auth/abstract/request.rb, line 44
def authorization_key
  @authorization_key ||= AUTHORIZATION_KEYS.detect { |key| @env.has_key?(key) }
end