summaryrefslogtreecommitdiff
path: root/lib/mixlib/authentication/signedheaderauth.rb
diff options
context:
space:
mode:
authorJay Mundrawala <jdmundrawala@gmail.com>2015-12-05 15:13:30 -0800
committerJay Mundrawala <jdmundrawala@gmail.com>2015-12-05 15:14:42 -0800
commitfa50296d60b66c03087fa57e4771eb8bedef2d29 (patch)
treefe65f439cc925c91ac98bf9ee0313a5cee2900dd /lib/mixlib/authentication/signedheaderauth.rb
parent366fcfb07938576128c9bffb0d5ea2056e9e0cbe (diff)
downloadmixlib-authentication-fa50296d60b66c03087fa57e4771eb8bedef2d29.tar.gz
Update 1.3 message to match the new one proposed from the RFC processjdm/v1.3-rfc
We no longer has user id and path as it is not required.
Diffstat (limited to 'lib/mixlib/authentication/signedheaderauth.rb')
-rw-r--r--lib/mixlib/authentication/signedheaderauth.rb8
1 files changed, 5 insertions, 3 deletions
diff --git a/lib/mixlib/authentication/signedheaderauth.rb b/lib/mixlib/authentication/signedheaderauth.rb
index e0a5a7f..0b5f923 100644
--- a/lib/mixlib/authentication/signedheaderauth.rb
+++ b/lib/mixlib/authentication/signedheaderauth.rb
@@ -196,9 +196,9 @@ module Mixlib
when "1.3"
[
"Method:#{http_method.to_s.upcase}",
- "Hashed Path:#{digester.hash_string(digest, canonical_path)}",
+ "Path:#{canonical_path}",
"X-Ops-Content-Hash:#{hashed_body(digest)}",
- "X-Ops-Sign:algorithm=#{sign_algorithm};version=#{sign_version}",
+ "X-Ops-Sign:version=#{sign_version}",
"X-Ops-Timestamp:#{canonical_time}",
"X-Ops-UserId:#{canonical_x_ops_user_id}",
"X-Ops-Server-API-Version:#{server_api_version}",
@@ -216,9 +216,11 @@ module Mixlib
def canonicalize_user_id(user_id, proto_version, digest=OpenSSL::Digest::SHA1)
case proto_version
- when "1.1", "1.3"
+ when "1.1"
+ # and 1.2 if that ever gets implemented
digester.hash_string(digest, user_id)
else
+ # versions 1.0 and 1.3
user_id
end
end