summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRyan Cragun <me@ryan.ec>2017-04-20 17:04:52 -0700
committerRyan Cragun <me@ryan.ec>2017-04-21 15:02:26 -0700
commit7f02c024fe39308daff5aa8cb06f0ac8807844f2 (patch)
treef38672b2cf5ee5a0cecab01b28c3428952d813fe
parent0c5c683a23b7d4b6fd2cbb61a2010af2e513aacf (diff)
downloadmixlib-authentication-ryan/fix-constant-lookup.tar.gz
Fix SignedObject::DEFAULT_SERVER_API_VERSION constant scoperyan/fix-constant-lookup
The DEFAULT_SERVER_API_VERSION is not a constant of the SignedHeaderAuth module. Rather than forcing the constant lookup in that module we'll remove the namespace and allow the Ruby constant lookup to handle it for us. This resolves a bug where the constant lookup fails when mixlib-authentication is vendored into other projects. Signed-off-by: Ryan Cragun <me@ryan.ec>
-rw-r--r--lib/mixlib/authentication/signedheaderauth.rb3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/mixlib/authentication/signedheaderauth.rb b/lib/mixlib/authentication/signedheaderauth.rb
index f107170..98a8d31 100644
--- a/lib/mixlib/authentication/signedheaderauth.rb
+++ b/lib/mixlib/authentication/signedheaderauth.rb
@@ -266,6 +266,7 @@ module Mixlib
SigningObject = Struct.new(:http_method, :path, :body, :host,
:timestamp, :user_id, :file, :proto_version,
:headers) do
+
include SignedHeaderAuth
def proto_version
@@ -279,7 +280,7 @@ module Mixlib
if key
self[:headers][key]
else
- SignedHeaderAuth::DEFAULT_SERVER_API_VERSION
+ DEFAULT_SERVER_API_VERSION
end
end
end