summaryrefslogtreecommitdiff
path: root/lib/mixlib/authentication/signedheaderauth.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/mixlib/authentication/signedheaderauth.rb')
-rw-r--r--lib/mixlib/authentication/signedheaderauth.rb10
1 files changed, 5 insertions, 5 deletions
diff --git a/lib/mixlib/authentication/signedheaderauth.rb b/lib/mixlib/authentication/signedheaderauth.rb
index ab8d989..f107170 100644
--- a/lib/mixlib/authentication/signedheaderauth.rb
+++ b/lib/mixlib/authentication/signedheaderauth.rb
@@ -263,23 +263,23 @@ module Mixlib
# A Struct-based value object that contains the necessary information to
# generate a request signature. `SignedHeaderAuth.signing_object()`
# provides a more convenient interface to the constructor.
- class SigningObject < Struct.new(:http_method, :path, :body, :host,
+ SigningObject = Struct.new(:http_method, :path, :body, :host,
:timestamp, :user_id, :file, :proto_version,
- :headers)
+ :headers) do
include SignedHeaderAuth
def proto_version
- (self[:proto_version] || DEFAULT_PROTO_VERSION).to_s
+ (self[:proto_version] || SignedHeaderAuth::DEFAULT_PROTO_VERSION).to_s
end
def server_api_version
key = (self[:headers] || {}).keys.select do |k|
- k.downcase == "x-ops-server-api-version"
+ k.casecmp("x-ops-server-api-version").zero?
end.first
if key
self[:headers][key]
else
- DEFAULT_SERVER_API_VERSION
+ SignedHeaderAuth::DEFAULT_SERVER_API_VERSION
end
end
end