faraday_middleware-aws-signers-v4 0.1.3 → 0.1.4
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4e3a9bbb3bb93756e5c618ba9638f60e606f6bc6
|
4
|
+
data.tar.gz: 2ce7743f98050c5dad4dc57e900743d2137b5935
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e18b946dfcc1b4d5858282549e9c009148fdf111509ec3b72a52d1d75bf70d3bf000197b32046cec8fedec2d94b2a1ca1318797c83798ceb41baf7db458bfeb1
|
7
|
+
data.tar.gz: d1dd306d49c26656c86e0f42874958fd14ed951511846afa710a813de4d3682ac2f602115ec7880e4fcc01862cc7b4f5fe255503d33c82d224f9786f7924485a
|
@@ -0,0 +1,25 @@
|
|
1
|
+
require 'uri'
|
2
|
+
require 'aws-sdk'
|
3
|
+
|
4
|
+
module URI
|
5
|
+
def self.seahorse_encode_www_form(params)
|
6
|
+
params.map {|key, value|
|
7
|
+
encoded_key = encode_www_form_component(key)
|
8
|
+
|
9
|
+
if value.nil?
|
10
|
+
encoded_key
|
11
|
+
elsif value.respond_to?(:to_ary)
|
12
|
+
value.to_ary.map {|v|
|
13
|
+
if v.nil?
|
14
|
+
# bug?
|
15
|
+
#encoded_key
|
16
|
+
else
|
17
|
+
encoded_key + '=' + Seahorse::Util.uri_escape(v)
|
18
|
+
end
|
19
|
+
}.join('&')
|
20
|
+
else
|
21
|
+
encoded_key + '=' + Seahorse::Util.uri_escape(value)
|
22
|
+
end
|
23
|
+
}.join('&')
|
24
|
+
end
|
25
|
+
end
|
@@ -1,3 +1,4 @@
|
|
1
|
+
require 'faraday_middleware/ext/uri_ext'
|
1
2
|
require 'faraday_middleware/aws_signers_v4_ext'
|
2
3
|
|
3
4
|
class FaradayMiddleware::AwsSignersV4 < Faraday::Middleware
|
@@ -32,13 +33,13 @@ class FaradayMiddleware::AwsSignersV4 < Faraday::Middleware
|
|
32
33
|
private
|
33
34
|
|
34
35
|
def re_escape_query!(url)
|
35
|
-
|
36
|
+
params = URI.decode_www_form(url.query)
|
36
37
|
|
37
|
-
if
|
38
|
-
url.query =
|
38
|
+
if params.any? {|k, v| v =~ / / }
|
39
|
+
url.query = URI.seahorse_encode_www_form(params)
|
39
40
|
end
|
40
41
|
end
|
41
|
-
end
|
42
|
+
end # of class Request
|
42
43
|
|
43
44
|
def initialize(app, options = nil)
|
44
45
|
super(app)
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: faraday_middleware-aws-signers-v4
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Genki Sugawara
|
@@ -141,6 +141,7 @@ files:
|
|
141
141
|
- faraday_middleware-aws-signers-v4.gemspec
|
142
142
|
- lib/faraday_middleware/aws_signers_v4.rb
|
143
143
|
- lib/faraday_middleware/aws_signers_v4_ext.rb
|
144
|
+
- lib/faraday_middleware/ext/uri_ext.rb
|
144
145
|
- lib/faraday_middleware/request/aws_signers_v4.rb
|
145
146
|
homepage: https://github.com/winebarrel/faraday_middleware-aws-signers-v4
|
146
147
|
licenses:
|