Skip to content

Commit

Permalink
Add disableNormalizePath when resolving auth_scheme for s3 (#3072)
Browse files Browse the repository at this point in the history
  • Loading branch information
alextwoods committed Jul 23, 2024
1 parent 8d5d7e1 commit 66bd3d0
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 2 deletions.
2 changes: 2 additions & 0 deletions gems/aws-sdk-core/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
Unreleased Changes
------------------

* Issue - Add `disableNormalizePath` when resolving auth_scheme for S3.

3.201.2 (2024-07-18)
------------------

Expand Down
7 changes: 7 additions & 0 deletions gems/aws-sdk-core/lib/aws-sdk-core/endpoints.rb
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,13 @@ def resolve_auth_scheme(context, endpoint)
def merge_signing_defaults(auth_scheme, config)
if %w[sigv4 sigv4a sigv4-s3express].include?(auth_scheme['name'])
auth_scheme['signingName'] ||= sigv4_name(config)

# back fill disableNormalizePath for S3 until it gets correctly set in the rules
if auth_scheme['signingName'] == 's3' &&
!auth_scheme.include?('disableNormalizePath') &&
auth_scheme.include?('disableDoubleEncoding')
auth_scheme['disableNormalizePath'] = auth_scheme['disableDoubleEncoding']
end
if auth_scheme['name'] == 'sigv4a'
# config option supersedes endpoint properties
auth_scheme['signingRegionSet'] =
Expand Down
4 changes: 2 additions & 2 deletions gems/aws-sigv4/lib/aws-sigv4/signer.rb
Original file line number Diff line number Diff line change
Expand Up @@ -138,8 +138,8 @@ class Signer
# but is treated as "unsigned" and does not contribute
# to the authorization signature.
#
# @option options [Boolean] :normalize_path (true) (Supported only when `aws-crt` is available)
# When `true`, the uri paths will be normalized when building the canonical request
# @option options [Boolean] :normalize_path (true) When `true`, the
# uri paths will be normalized when building the canonical request.
def initialize(options = {})
@service = extract_service(options)
@region = extract_region(options)
Expand Down

0 comments on commit 66bd3d0

Please sign in to comment.