From 7aed815971aa07d56e0ac9d6456f12ac0728dd6d Mon Sep 17 00:00:00 2001 From: Daniel DeLeo Date: Fri, 26 Feb 2010 10:25:02 -0800 Subject: repro the bug in PL-450 as a spec test --- spec/mixlib/authentication/mixlib_authentication_spec.rb | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'spec') diff --git a/spec/mixlib/authentication/mixlib_authentication_spec.rb b/spec/mixlib/authentication/mixlib_authentication_spec.rb index 3423f10..1b94d9b 100644 --- a/spec/mixlib/authentication/mixlib_authentication_spec.rb +++ b/spec/mixlib/authentication/mixlib_authentication_spec.rb @@ -89,6 +89,22 @@ describe "Mixlib::Authentication::SignedHeaderAuth" do #$stderr.puts "res.inspect = #{res.inspect}" res.should == EXPECTED_SIGN_RESULT end + + it "should not choke when signing a request for a resource with a long name" do + args = { + :body => BODY, + :user_id => USER_ID, + :http_method => :put, + :timestamp => TIMESTAMP_ISO8601, # fixed timestamp so we get back the same answer each time. + :file => MockFile.new, + :path => PATH + "/nodes/#{"A" * 100}"} + + private_key = OpenSSL::PKey::RSA.new(PRIVATE_KEY) + + signing_obj = Mixlib::Authentication::SignedHeaderAuth.signing_object(args) + + lambda { signing_obj.sign(private_key) }.should_not raise_error + end end describe "Mixlib::Authentication::SignatureVerification" do -- cgit v1.2.1