Class: BasicAndNego::Request

Inherits:
Rack::Auth::AbstractRequest
  • Object
show all
Defined in:
lib/basic_and_nego/request.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#credentialsObject (readonly)

Returns the value of attribute credentials.



4
5
6
# File 'lib/basic_and_nego/request.rb', line 4

def credentials
  @credentials
end

Instance Method Details

#authenticatorObject



6
7
8
9
10
11
12
13
14
# File 'lib/basic_and_nego/request.rb', line 6

def authenticator
  if !provided?
    BasicAndNego::Auth::None
  elsif supported_auth?
    BasicAndNego::Auth.const_get(scheme.to_s.capitalize)
  else
    BasicAndNego::Auth::Unsupported
  end
end

#usernameObject



20
21
22
# File 'lib/basic_and_nego/request.rb', line 20

def username
  credentials.first
end