Class: Uploadcare::Param::Upload::SignatureGenerator
- Inherits:
-
Object
- Object
- Uploadcare::Param::Upload::SignatureGenerator
- Defined in:
- lib/uploadcare/param/upload/signature_generator.rb
Overview
This class generates signatures for protected uploads
Class Method Summary collapse
-
.call ⇒ Hash
Signature and its expiration time.
Class Method Details
.call ⇒ Hash
Returns signature and its expiration time.
12 13 14 15 16 17 18 19 20 |
# File 'lib/uploadcare/param/upload/signature_generator.rb', line 12 def self.call expires_at = Time.now.to_i + Uploadcare.config.upload_signature_lifetime to_sign = Uploadcare.config.secret_key + expires_at.to_s signature = Digest::MD5.hexdigest(to_sign) { signature: signature, expire: expires_at } end |