aws-sigv4 1.2.1 → 1.2.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 +4 -4
- data/lib/aws-sigv4/signer.rb +15 -7
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3f598a45b85be9ca9687eef1ee700397b1a6f273f8633d3c6f5dcc0d5bf6c649
|
4
|
+
data.tar.gz: 15d37434086264b0d6f87b0b77d32cff6a70e13eb5746b1aafa89d2c85d91335
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e9bbfd21088c2ee7821fff70b4d25d21173cecfdeab77e37ea36ce7664ae21aeb2122615ccee12de783116f53d2fc360d82d136d74c98589d595e0522c7d170d
|
7
|
+
data.tar.gz: 94d8676dde1b46f5fb760a29cbac9e16f63ac30e6a08310a91230054e69dfb10f92b1d4470964c427f59c5843b8a6a5abf331df3e86428c757dc386ae9b3b347
|
data/lib/aws-sigv4/signer.rb
CHANGED
@@ -507,18 +507,26 @@ module Aws
|
|
507
507
|
def normalized_querystring(querystring)
|
508
508
|
params = querystring.split('&')
|
509
509
|
params = params.map { |p| p.match(/=/) ? p : p + '=' }
|
510
|
-
#
|
511
|
-
#
|
510
|
+
# From: https://docs.aws.amazon.com/general/latest/gr/sigv4-create-canonical-request.html
|
511
|
+
# Sort the parameter names by character code point in ascending order.
|
512
|
+
# Parameters with duplicate names should be sorted by value.
|
513
|
+
#
|
514
|
+
# Default sort <=> in JRuby will swap members
|
512
515
|
# occasionally when <=> is 0 (considered still sorted), but this
|
513
516
|
# causes our normalized query string to not match the sent querystring.
|
514
|
-
# When names match, we then sort by their
|
515
|
-
|
517
|
+
# When names match, we then sort by their values. When values also
|
518
|
+
# match then we sort by their original order
|
519
|
+
params.each.with_index.sort do |a, b|
|
516
520
|
a, a_offset = a
|
517
|
-
a_name = a.split('=')[0]
|
518
521
|
b, b_offset = b
|
519
|
-
|
522
|
+
a_name, a_value = a.split('=')
|
523
|
+
b_name, b_value = b.split('=')
|
520
524
|
if a_name == b_name
|
521
|
-
|
525
|
+
if a_value == b_value
|
526
|
+
a_offset <=> b_offset
|
527
|
+
else
|
528
|
+
a_value <=> b_value
|
529
|
+
end
|
522
530
|
else
|
523
531
|
a_name <=> b_name
|
524
532
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: aws-sigv4
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.2.
|
4
|
+
version: 1.2.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Amazon Web Services
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-
|
11
|
+
date: 2020-08-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: aws-eventstream
|