aws4_signer 0.2.0 → 0.2.1

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: 432614434e71166bf50ad3588c95cdd18fc71c63
4
- data.tar.gz: a907bf8eb98ffb2218eadb207b57d1760ca5e88f
3
+ metadata.gz: 73f2f262a5e3544302890e97359f2fa459b53faf
4
+ data.tar.gz: 16a5da8d1acfe08f28e83b02b81c968c94b98438
5
5
  SHA512:
6
- metadata.gz: 9bb2184b312e4f6cbb4112e0114bfdb6a51ff2e8de7378cbf0c81cc57ed29e52ac479eac8af02af34701256687ac98b6460a1c1981046c4ef588f0c61ce8f730
7
- data.tar.gz: 95cbcdc3f383db2cbb028c68d2e7f9167f6d703efd8846cea658257561f13d9e690fb458c3fb4286ab7996538e2ae274a406539d4f57ff30f81c5cb39347f288
6
+ metadata.gz: ea64fbe3754d7e8c65e390f7bc8521f41e4226dab10549e7d49484f2ff443dd3695bce6ff420923e332d94cf0b76902f142017709ec8c8a8cb5ae9f73b6f7e79
7
+ data.tar.gz: c9cdc195759195ba4b9e6f7305aeee82c02c3176887b1258de17022cf7231d7a8fb82cd92abd66631c03bc4efa7a5a190c1b89d1d53691a5499bb6334e3e8bf2
@@ -87,7 +87,8 @@ class Aws4Signer
87
87
  @canonical_request ||= [
88
88
  @verb.upcase,
89
89
  @uri.path,
90
- @uri.query,
90
+ @uri.query&.split('&').map { |x| x.split('=') }.sort_by(&:first)
91
+ .map { |x| x.join('=') }.join('&'),
91
92
  canonical_headers,
92
93
  signed_headers,
93
94
  hashed_payload,
@@ -1,3 +1,3 @@
1
1
  class Aws4Signer
2
- VERSION = "0.2.0"
2
+ VERSION = "0.2.1"
3
3
  end
@@ -178,6 +178,26 @@ host;x-amz-date;x-foo
178
178
  #{Digest::SHA2.hexdigest('hello', 256)}
179
179
  EXPECTED
180
180
  end
181
+
182
+ describe "when request has multiple URL query parameters" do
183
+ let(:uri) { URI('https://example.org/foo/bar?b=blah&a=blah') }
184
+
185
+ it "sorts URL query parameter" do
186
+ canonical_request = signature.canonical_request
187
+
188
+ assert_equal <<-EXPECTED.chomp, canonical_request
189
+ PUT
190
+ /foo/bar
191
+ a=blah&b=blah
192
+ host:example.org
193
+ x-amz-date:20140222T070605Z
194
+ x-foo:bar
195
+
196
+ host;x-amz-date;x-foo
197
+ #{Digest::SHA2.hexdigest('hello', 256)}
198
+ EXPECTED
199
+ end
200
+ end
181
201
  end
182
202
 
183
203
  describe "#scope" do
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: aws4_signer
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Shota Fukumori (sora_h)
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-07-18 00:00:00.000000000 Z
11
+ date: 2017-09-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -107,7 +107,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
107
107
  version: '0'
108
108
  requirements: []
109
109
  rubyforge_project:
110
- rubygems_version: 2.2.2
110
+ rubygems_version: 2.6.13
111
111
  signing_key:
112
112
  specification_version: 4
113
113
  summary: Simple signer module implements AWS4 signature