lib/ey-hmac/adapter.rb in ey-hmac-0.1.2 vs lib/ey-hmac/adapter.rb in ey-hmac-0.1.3

- old
+ new

@@ -10,10 +10,12 @@ # @param [Object] request signer-specific request implementation # @option options [Integer] :version signature version # @option options [String] :authorization_header ('Authorization') Authorization header key. # @option options [String] :server ('EyHmac') service name prefixed to {#authorization}. set to {#service} + # @option options [Symbol] :sign_with (:sha_256) outgoing signature digest algorithm. See {OpenSSL::Digest#new} + # @option options [Array] :accepted_digests ([:sha_256]) accepted incoming signature digest algorithm. See {OpenSSL::Digest#new} def initialize(request, options={}) @request, @options = request, options @authorization_header = options[:authorization_header] || 'Authorization' @service = options[:service] || 'EyHmac' @@ -120,10 +122,10 @@ end calculated_signatures = self.accept_digests.map { |ad| signature(key_secret, ad) } unless calculated_signatures.any? { |cs| secure_compare(signature_value, cs) } - raise(Ey::Hmac::SignatureMismatch, "Calculated siganature #{signature_value} does not match #{calculated_signatures.inspect} using #{canonicalize.inspect}") + raise(Ey::Hmac::SignatureMismatch, "Calculated signature #{signature_value} does not match #{calculated_signatures.inspect} using #{canonicalize.inspect}") end true end alias authenticate! authenticated!