diff options
Diffstat (limited to 'lib/mixlib/authentication/http_authentication_request.rb')
-rw-r--r-- | lib/mixlib/authentication/http_authentication_request.rb | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/lib/mixlib/authentication/http_authentication_request.rb b/lib/mixlib/authentication/http_authentication_request.rb index 68a2611..3522149 100644 --- a/lib/mixlib/authentication/http_authentication_request.rb +++ b/lib/mixlib/authentication/http_authentication_request.rb @@ -24,10 +24,11 @@ module Mixlib MANDATORY_HEADERS = [:x_ops_sign, :x_ops_userid, :x_ops_timestamp, :host, :x_ops_content_hash] + attr_reader :request + def initialize(request) @request = request @request_signature = nil - assert_required_headers_present end def headers @@ -70,9 +71,8 @@ module Mixlib @request_signature end - private - def assert_required_headers_present + def validate_headers! missing_headers = MANDATORY_HEADERS - headers.keys unless missing_headers.empty? missing_headers.map! { |h| h.to_s.upcase } @@ -80,6 +80,7 @@ module Mixlib end end + end end end |