aws-sdk-cloudfront 1.128.0 → 1.129.0
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 +4 -4
- data/CHANGELOG.md +5 -0
- data/VERSION +1 -1
- data/lib/aws-sdk-cloudfront/client.rb +1 -1
- data/lib/aws-sdk-cloudfront/customizations.rb +0 -1
- data/lib/aws-sdk-cloudfront/signer.rb +14 -20
- data/lib/aws-sdk-cloudfront.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 96968fbd04594b3497832cfdf34799da384d62b08636dc2ec3c91b31ff754f8b
|
4
|
+
data.tar.gz: e703deb7dd848df7ac8dd6df8872e66f0a65a4d21567d948ed638449aa5791a1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1c249b64d3a44d6155abb2c7bbe48adf3b24522b4d4f38050ee7dff376fd4cc9c2ca30d18f9730bf1f0155ea40b38bc9896db1038891307f045f0acfbee8aeac
|
7
|
+
data.tar.gz: 05057c2b612a1ecf27e9ac6e2bf8e7d2917980c662e3a36da30533a43059d71aaf15c321f854b6fc69b6e2a2ed6f6d34583b956d4b95fb39ee9cd1b392cc4bc4
|
data/CHANGELOG.md
CHANGED
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
1.
|
1
|
+
1.129.0
|
@@ -12296,7 +12296,7 @@ module Aws::CloudFront
|
|
12296
12296
|
tracer: tracer
|
12297
12297
|
)
|
12298
12298
|
context[:gem_name] = 'aws-sdk-cloudfront'
|
12299
|
-
context[:gem_version] = '1.
|
12299
|
+
context[:gem_version] = '1.129.0'
|
12300
12300
|
Seahorse::Client::Request.new(handlers, context)
|
12301
12301
|
end
|
12302
12302
|
|
@@ -7,25 +7,22 @@ require 'openssl'
|
|
7
7
|
|
8
8
|
module Aws
|
9
9
|
module CloudFront
|
10
|
-
|
11
10
|
module Signer
|
12
|
-
|
13
11
|
# @option options [String] :key_pair_id
|
14
12
|
# @option options [String] :private_key
|
15
13
|
# @option options [String] :private_key_path
|
16
14
|
def initialize(options = {})
|
17
15
|
@key_pair_id = key_pair_id(options)
|
18
|
-
@cipher = OpenSSL::Digest
|
19
|
-
@private_key = OpenSSL::PKey
|
16
|
+
@cipher = OpenSSL::Digest.new('SHA1')
|
17
|
+
@private_key = OpenSSL::PKey.read(private_key(options))
|
20
18
|
end
|
21
19
|
|
22
20
|
private
|
23
21
|
|
24
22
|
def scheme_and_uri(url)
|
25
23
|
url_sections = url.split('://', 2)
|
26
|
-
if url_sections.length < 2
|
27
|
-
|
28
|
-
end
|
24
|
+
raise ArgumentError, "Invalid URL:#{url}" if url_sections.length < 2
|
25
|
+
|
29
26
|
scheme = url_sections[0].delete('*')
|
30
27
|
uri = "#{scheme}://#{url_sections[1]}"
|
31
28
|
[scheme, uri]
|
@@ -69,7 +66,7 @@ module Aws
|
|
69
66
|
resource_content
|
70
67
|
end
|
71
68
|
else
|
72
|
-
msg = "Invalid URI scheme:#{scheme}.Scheme must be one of: http, https or rtmp."
|
69
|
+
msg = "Invalid URI scheme:#{scheme}. Scheme must be one of: http, https or rtmp."
|
73
70
|
raise ArgumentError, msg
|
74
71
|
end
|
75
72
|
end
|
@@ -87,7 +84,7 @@ module Aws
|
|
87
84
|
policy = canned_policy(params[:resource], params[:expires])
|
88
85
|
signature_content['Expires'] = params[:expires]
|
89
86
|
else
|
90
|
-
msg =
|
87
|
+
msg = 'Either a policy or a resource with an expiration time must be provided.'
|
91
88
|
raise ArgumentError, msg
|
92
89
|
end
|
93
90
|
|
@@ -106,37 +103,34 @@ module Aws
|
|
106
103
|
json_hash = {
|
107
104
|
'Statement' => [
|
108
105
|
'Resource' => resource,
|
109
|
-
|
110
|
-
'DateLessThan' => {'AWS:EpochTime' => expires}
|
111
|
-
}
|
106
|
+
'Condition' => { 'DateLessThan' => { 'AWS:EpochTime' => expires } }
|
112
107
|
]
|
113
108
|
}
|
114
109
|
Aws::Json.dump(json_hash)
|
115
110
|
end
|
116
111
|
|
117
112
|
def encode(policy)
|
118
|
-
Base64.encode64(policy).gsub(
|
113
|
+
Base64.encode64(policy).gsub(%r{[+=/]}, '+' => '-', '=' => '_', '/' => '~')
|
119
114
|
end
|
120
115
|
|
121
116
|
def key_pair_id(options)
|
122
|
-
if options[:key_pair_id].nil?
|
123
|
-
raise ArgumentError,
|
124
|
-
else
|
125
|
-
options[:key_pair_id]
|
117
|
+
if options[:key_pair_id].nil? || (options[:key_pair_id] == '')
|
118
|
+
raise ArgumentError, ':key_pair_id must not be blank'
|
126
119
|
end
|
120
|
+
|
121
|
+
options[:key_pair_id]
|
127
122
|
end
|
128
123
|
|
129
124
|
def private_key(options)
|
130
125
|
if options[:private_key]
|
131
126
|
options[:private_key]
|
132
127
|
elsif options[:private_key_path]
|
133
|
-
File.open(options[:private_key_path], 'rb'
|
128
|
+
File.open(options[:private_key_path], 'rb', &:read)
|
134
129
|
else
|
135
|
-
msg =
|
130
|
+
msg = ':private_key or :private_key_path should be provided'
|
136
131
|
raise ArgumentError, msg
|
137
132
|
end
|
138
133
|
end
|
139
|
-
|
140
134
|
end
|
141
135
|
end
|
142
136
|
end
|
data/lib/aws-sdk-cloudfront.rb
CHANGED