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:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 650d5f0750ac311f7d89c59ffa0666b2b6aa170c
|
|
4
|
+
data.tar.gz: 4513982945f2b94557900b050666711dd296fa1d
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
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
|
-
|
|
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)
|