cloud_front_signing 0.0.1 → 0.0.2

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 533dc16e38e6e6070fcc4ce38371ce6621e6cf0b
4
- data.tar.gz: 86f74303db860f93ce74fd17f4d8fbb19204e835
3
+ metadata.gz: 650d5f0750ac311f7d89c59ffa0666b2b6aa170c
4
+ data.tar.gz: 4513982945f2b94557900b050666711dd296fa1d
5
5
  SHA512:
6
- metadata.gz: 767dcaa5ff05c1a01b485226f71d6c3fd753d38fe1b13d469bcb0c329ab881151d13138e044f69e0ef9f8509d2f7be61c24d19b2ccfc0106f981e4cfa0de186b
7
- data.tar.gz: e90308082eb4fe4cb5ef705a30c87fcf3383b5f5586e67ad0f1882c77996f88339ad5188fad21c6f8bf0391069b5e377f7f928877ae8cbbd1dce75777c042ac5
6
+ metadata.gz: 3d5d740bbb77992f384fed8d2fd43c83404cb159d0cfb614d1bf419f9bbc74b09b0263accf4403bd9d389c3f31a1547909ebd29abc6abf1edf2688d56366f57f
7
+ data.tar.gz: 8c08b82c76608d512425d8cab57fc48feb7f8122625a385fc0abf16e577d2c4f4b9cb391d7df1e3195a24c171cd38585b1e35a543398a3823314fb3c6b93e6dc
@@ -28,6 +28,14 @@ module CloudFrontSigning
28
28
  Yajl.dump(object, pretty: false, indent: '')
29
29
  end
30
30
 
31
+ def ending
32
+ @ending ||= begin
33
+ raise ArgumentError, 'missing :ending option' unless options[:ending]
34
+ epoch_time(options[:ending])
35
+ end
36
+ end
37
+
38
+
31
39
  private
32
40
 
33
41
  def conditions
@@ -53,13 +61,6 @@ module CloudFrontSigning
53
61
  @starting ||= epoch_time(options[:starting])
54
62
  end
55
63
 
56
- def ending
57
- @ending ||= begin
58
- raise ArgumentError, 'missing :ending option' unless options[:ending]
59
- epoch_time(options[:ending])
60
- end
61
- end
62
-
63
64
  def resource
64
65
  @resource ||= options[:resource] or raise ArgumentError, 'missing :resource option'
65
66
  end
@@ -27,8 +27,10 @@ module CloudFrontSigning
27
27
  'Signature' => signature,
28
28
  'Key-Pair-Id' => key_pair_id,
29
29
  }
30
- unless policy.canned?
30
+ if policy.canned?
31
31
  # shorter URL if canned (no need to include the encoded policy)
32
+ params['Expires'] = policy.ending
33
+ else
32
34
  params['Policy'] = encoded_policy
33
35
  end
34
36
  u.query_values = (u.query_values || {}).merge(params)
@@ -1,3 +1,3 @@
1
1
  module CloudFrontSigning
2
- VERSION = "0.0.1"
2
+ VERSION = "0.0.2"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cloud_front_signing
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ronny Haryanto