diff options
author | Pratik Naik <pratiknaik@gmail.com> | 2009-08-31 22:11:50 +0100 |
---|---|---|
committer | Pratik Naik <pratiknaik@gmail.com> | 2009-08-31 22:11:50 +0100 |
commit | bae00bb1cc392e1cf408369809b9cf85468bef42 (patch) | |
tree | 17103af6eeb5de96c72beda1debce28950cc7fea /actionpack/lib/action_dispatch/vendor/rack-1.1.pre/rack/auth/abstract | |
parent | 93c76b2fb08668bc4b8364cc8051476e6d1d15ba (diff) | |
parent | ffd2cf167040b60c26d97c01598560c87bd4b2d3 (diff) | |
download | rails-bae00bb1cc392e1cf408369809b9cf85468bef42.tar.gz rails-bae00bb1cc392e1cf408369809b9cf85468bef42.tar.bz2 rails-bae00bb1cc392e1cf408369809b9cf85468bef42.zip |
Merge commit 'mainstream/master'
Diffstat (limited to 'actionpack/lib/action_dispatch/vendor/rack-1.1.pre/rack/auth/abstract')
-rw-r--r-- | actionpack/lib/action_dispatch/vendor/rack-1.1.pre/rack/auth/abstract/handler.rb | 37 | ||||
-rw-r--r-- | actionpack/lib/action_dispatch/vendor/rack-1.1.pre/rack/auth/abstract/request.rb | 37 |
2 files changed, 0 insertions, 74 deletions
diff --git a/actionpack/lib/action_dispatch/vendor/rack-1.1.pre/rack/auth/abstract/handler.rb b/actionpack/lib/action_dispatch/vendor/rack-1.1.pre/rack/auth/abstract/handler.rb deleted file mode 100644 index 214df6299e..0000000000 --- a/actionpack/lib/action_dispatch/vendor/rack-1.1.pre/rack/auth/abstract/handler.rb +++ /dev/null @@ -1,37 +0,0 @@ -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 diff --git a/actionpack/lib/action_dispatch/vendor/rack-1.1.pre/rack/auth/abstract/request.rb b/actionpack/lib/action_dispatch/vendor/rack-1.1.pre/rack/auth/abstract/request.rb deleted file mode 100644 index 1d9ccec685..0000000000 --- a/actionpack/lib/action_dispatch/vendor/rack-1.1.pre/rack/auth/abstract/request.rb +++ /dev/null @@ -1,37 +0,0 @@ -module Rack - module Auth - class AbstractRequest - - def initialize(env) - @env = env - end - - def provided? - !authorization_key.nil? - end - - def parts - @parts ||= @env[authorization_key].split(' ', 2) - end - - def scheme - @scheme ||= parts.first.downcase.to_sym - end - - def params - @params ||= parts.last - end - - - private - - AUTHORIZATION_KEYS = ['HTTP_AUTHORIZATION', 'X-HTTP_AUTHORIZATION', 'X_HTTP_AUTHORIZATION'] - - def authorization_key - @authorization_key ||= AUTHORIZATION_KEYS.detect { |key| @env.has_key?(key) } - end - - end - - end -end |