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

Inherits:
AbstractRequest show all
Defined in:
lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/rack-2.2.5/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

Returns:

  • (Boolean)


46
47
48
# File 'lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/rack-2.2.5/lib/rack/auth/basic.rb', line 46

def basic?
  "basic" == scheme && credentials.length == 2
end

#credentialsObject



50
51
52
# File 'lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/rack-2.2.5/lib/rack/auth/basic.rb', line 50

def credentials
  @credentials ||= Base64.decode64(params).split(':', 2)
end

#usernameObject



54
55
56
# File 'lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/rack-2.2.5/lib/rack/auth/basic.rb', line 54

def username
  credentials.first
end