From efe813cbd595302bf922ed43209fc674bfc46077 Mon Sep 17 00:00:00 2001 From: Morkevicius Saulius Date: Wed, 17 Aug 2022 16:50:35 +0300 Subject: [PATCH] Update auth.rb presumably bug fix, this makes it calculate the signing key the same way as js version does --- lib/escher/auth.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/escher/auth.rb b/lib/escher/auth.rb index 45437e5..26a81c2 100644 --- a/lib/escher/auth.rb +++ b/lib/escher/auth.rb @@ -199,7 +199,7 @@ def generate_signature(api_secret, body, headers, method, signed_headers, path, string_to_sign = get_string_to_sign(canonicalized_request, current_time) signing_key = OpenSSL::HMAC.digest(@algo, @algo_prefix + api_secret, short_date(current_time)) - @credential_scope.split('/').each { |data| + @credential_scope.split('/', -1).each { |data| signing_key = OpenSSL::HMAC.digest(@algo, signing_key, data) }