simple_worker 0.0.9 → 0.0.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/lib/http_enabled.rb +7 -3
- metadata +1 -1
data/lib/http_enabled.rb
CHANGED
@@ -99,11 +99,15 @@ module SimpleWorker
|
|
99
99
|
return gmtime.strftime("%Y-%m-%dT%H:%M:%SZ")
|
100
100
|
end
|
101
101
|
|
102
|
-
def generate_signature_v0(operation, timestamp,
|
102
|
+
def generate_signature_v0(operation, timestamp, secret_key)
|
103
|
+
HttpEnabled.generate_signature_v0(operation, timestamp, secret_key)
|
104
|
+
end
|
105
|
+
|
106
|
+
def self.generate_signature_v0(operation, timestamp, secret_key)
|
103
107
|
if USE_EMBEDDED_HMAC
|
104
|
-
my_sha_hmac = HMAC::SHA1.digest(
|
108
|
+
my_sha_hmac = HMAC::SHA1.digest(secret_key, operation + timestamp)
|
105
109
|
else
|
106
|
-
my_sha_hmac = Digest::HMAC.digest(operation + timestamp,
|
110
|
+
my_sha_hmac = Digest::HMAC.digest(operation + timestamp, secret_key, Digest::SHA1)
|
107
111
|
end
|
108
112
|
my_b64_hmac_digest = Base64.encode64(my_sha_hmac).strip
|
109
113
|
return my_b64_hmac_digest
|