Sha256: c8f74954411503afb0d873ba93c473db496bfff956b4623218c8f65777e5e44d

Contents?: true

Size: 550 Bytes

Versions: 48

Compression:

Stored size: 550 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, &authenticator)
        @app, @authenticator = app, authenticator
      end


      private

      def unauthorized(www_authenticate = challenge)
        return [ 401, { 'WWW-Authenticate' => www_authenticate.to_s }, [] ]
      end

      def bad_request
        [ 400, {}, [] ]
      end

    end
  end
end

Version data entries

48 entries across 48 versions & 12 rubygems

Version Path
passenger-2.2.0 vendor/rack-0.9.1/lib/rack/auth/abstract/handler.rb
passenger-2.2.1 vendor/rack-0.9.1/lib/rack/auth/abstract/handler.rb
rack-0.4.0 lib/rack/auth/abstract/handler.rb
rack-0.2.0 lib/rack/auth/abstract/handler.rb
rack-0.9.1 lib/rack/auth/abstract/handler.rb
rack-0.3.0 lib/rack/auth/abstract/handler.rb
rack-0.9.0 lib/rack/auth/abstract/handler.rb
sinatra-0.2.2 vendor/rack/lib/rack/auth/abstract/handler.rb