Class: Rack::Auth::Basic::Request

Inherits:
AbstractRequest show all
Defined in:
lib/rack/auth/basic.rb

Instance Method Summary collapse

Methods inherited from AbstractRequest

#initialize, #params, #parts, #provided?, #request, #scheme, #valid?

Constructor Details

This class inherits a constructor from Rack::Auth::AbstractRequest

Instance Method Details

#basic?Boolean


45
46
47
# File 'lib/rack/auth/basic.rb', line 45

def basic?
  "basic" == scheme
end

#credentialsObject


49
50
51
# File 'lib/rack/auth/basic.rb', line 49

def credentials
  @credentials ||= params.unpack("m*").first.split(/:/, 2)
end

#usernameObject


53
54
55
# File 'lib/rack/auth/basic.rb', line 53

def username
  credentials.first
end