Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add disableNormalizePath when resolving auth_scheme for s3 #3072

Merged
merged 2 commits into from
Jul 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading