simple_worker 0.0.9 → 0.0.10
Sign up to get free protection for your applications and to get access to all the features.
- 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
|