From bc9016f0e3d4d195d96cff256bd5e74b9cbee326 Mon Sep 17 00:00:00 2001 From: Ben Marini Date: Mon, 31 May 2010 00:06:49 -0700 Subject: [PATCH] Add failing test to http token authentication Method that parses authentication header attributes incorrectly removes '=' inside of attribute values: signature="wOJIO9A2W5mFwDgiDvZbTSMK/PY=" becomes {"signature" => "wOJIO9A2W5mFwDgiDvZbTSMK/PY"} --- .../controller/http_token_authentication_test.rb | 7 +++++++ 1 files changed, 7 insertions(+), 0 deletions(-) diff --git a/actionpack/test/controller/http_token_authentication_test.rb b/actionpack/test/controller/http_token_authentication_test.rb index 3dfccae..aef228b 100644 --- a/actionpack/test/controller/http_token_authentication_test.rb +++ b/actionpack/test/controller/http_token_authentication_test.rb @@ -105,6 +105,13 @@ class HttpTokenAuthenticationTest < ActionController::TestCase assert_equal 'Definitely Maybe', @response.body end + test "base64 encoded authorization attributes" do + args = [ "vF9dft4qmT", { :signature => "wOJIO9A2W5mFwDgiDvZbTSMK/PY=" } ] + @request.env['HTTP_AUTHORIZATION'] = encode_credentials(*args) + token, options = ActionController::HttpAuthentication::Token.token_and_options(@request) + assert_equal args[1][:signature], options[:signature] + end + private def encode_credentials(token, options = {}) -- 1.7.0.6