diff options
author | Daniel DeLeo <dan@opscode.com> | 2010-02-26 10:25:02 -0800 |
---|---|---|
committer | Daniel DeLeo <dan@opscode.com> | 2010-02-26 10:25:02 -0800 |
commit | 7aed815971aa07d56e0ac9d6456f12ac0728dd6d (patch) | |
tree | 6818536e0acfc3127c8ed67e0ab8f2ece6bc0408 | |
parent | 93b628728ef6b9e396c0174187790f969130cf63 (diff) | |
download | mixlib-authentication-7aed815971aa07d56e0ac9d6456f12ac0728dd6d.tar.gz |
repro the bug in PL-450 as a spec test
-rw-r--r-- | spec/mixlib/authentication/mixlib_authentication_spec.rb | 16 |
1 files changed, 16 insertions, 0 deletions
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 |