Sha256: 4801fd89452d3d195b13e55a9996d617b95398e1c2462ed802d9511a3f167f9b

Contents?: true

Size: 789 Bytes

Versions: 276

Compression:

Stored size: 789 Bytes

Contents

module Rack
  module Auth
    # Rack::Auth::AbstractHandler implements common authentication functionality.
    #
    # +realm+ should be set for all handlers.

    class AbstractHandler

      attr_accessor :realm

      def initialize(app, realm=nil, &authenticator)
        @app, @realm, @authenticator = app, realm, authenticator
      end


      private

      def unauthorized(www_authenticate = challenge)
        return [ 401,
          { 'Content-Type' => 'text/plain',
            'Content-Length' => '0',
            'WWW-Authenticate' => www_authenticate.to_s },
          []
        ]
      end

      def bad_request
        return [ 400,
          { 'Content-Type' => 'text/plain',
            'Content-Length' => '0' },
          []
        ]
      end

    end
  end
end

Version data entries

276 entries across 243 versions & 50 rubygems

Version Path
passenger-2.2.6 vendor/rack-1.0.0-git/lib/rack/auth/abstract/handler.rb
middleman-0.10.17 vendor/gems/gems/rack-1.0.1/lib/rack/auth/abstract/handler.rb
middleman-0.10.16 vendor/gems/gems/rack-1.0.1/lib/rack/auth/abstract/handler.rb
middleman-0.10.15 vendor/gems/gems/rack-1.0.1/lib/rack/auth/abstract/handler.rb
rackjour-0.1.8 vendor/gems/gems/rack-1.0.1/lib/rack/auth/abstract/handler.rb
middleman-0.10.14 vendor/gems/gems/rack-1.0.1/lib/rack/auth/abstract/handler.rb
rack-1.0.1 lib/rack/auth/abstract/handler.rb
hiraku-rack-1.0.0.1 lib/rack/auth/abstract/handler.rb
passenger-2.2.5 vendor/rack-1.0.0-git/lib/rack/auth/abstract/handler.rb
webroar-0.2.2 src/admin_panel/vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0/rack/auth/abstract/handler.rb
passenger-2.2.3 vendor/rack-1.0.0-git/lib/rack/auth/abstract/handler.rb
passenger-2.2.4 vendor/rack-1.0.0-git/lib/rack/auth/abstract/handler.rb
actionpack-2.3.2 lib/action_controller/vendor/rack-1.0/rack/auth/abstract/handler.rb
passenger-2.2.2 vendor/rack-1.0.0-git/lib/rack/auth/abstract/handler.rb
rack-1.0.0 lib/rack/auth/abstract/handler.rb
radiant-0.8.0 vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0/rack/auth/abstract/handler.rb