Class: Rack::Auth::Basic::Request
Instance Method Summary
collapse
#initialize, #params, #parts, #provided?, #request, #scheme, #valid?
Instance Method Details
#basic? ⇒ Boolean
46
47
48
|
# File 'lib/rack/auth/basic.rb', line 46
def basic?
"basic" == scheme && credentials.length == 2
end
|
#credentials ⇒ Object
50
51
52
|
# File 'lib/rack/auth/basic.rb', line 50
def credentials
@credentials ||= Base64.decode64(params).split(':', 2)
end
|
#username ⇒ Object
54
55
56
|
# File 'lib/rack/auth/basic.rb', line 54
def username
credentials.first
end
|