Class: CloudConvert::SignedUrl
- Inherits:
-
Object
- Object
- CloudConvert::SignedUrl
- Defined in:
- lib/cloudconvert/signed_url.rb
Class Method Summary collapse
-
.sign(base, signing_secret, job, cache_key = nil) ⇒ String
The signed URL.
Class Method Details
.sign(base, signing_secret, job, cache_key = nil) ⇒ String
Returns The signed URL.
9 10 11 12 13 14 15 16 17 18 19 20 21 |
# File 'lib/cloudconvert/signed_url.rb', line 9 def sign(base, signing_secret, job, cache_key = nil) url = base url += "?job=" + Base64.urlsafe_encode64(job.to_json, padding: false) unless cache_key.nil? url += "&cache_key=" + cache_key end url += "&s=" + OpenSSL::HMAC.hexdigest("SHA256", signing_secret, url) url end |