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 disable normalize path as default for s3 signing #2849

Merged
merged 5 commits into from
Jun 29, 2023
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
4 changes: 3 additions & 1 deletion gems/aws-sdk-core/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
Unreleased Changes
------------------

* Issue - Fix signing for S3/S3 Control and `aws-crt` gem for certain object keys (#2849).

* Issue - Ensure `SSOCredentials` `#expiration` is a `Time` (#2874)

3.176.0 (2023-06-28)
------------------

* Feature - Add :expiration accessor to `CredentialProvider` and do not refresh credentials when checking expiration.
* Feature - Add :expiration accessor to `CredentialProvider` and do not refresh credentials when checking expiration (#2872).

3.175.0 (2023-06-15)
------------------
Expand Down
6 changes: 5 additions & 1 deletion gems/aws-sdk-core/lib/aws-sdk-core/endpoints.rb
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,11 @@ def default_auth_scheme(context)
auth_scheme = { 'name' => 'sigv4' }
merge_signing_defaults(auth_scheme, context.config)
when 's3', 's3v4'
auth_scheme = { 'name' => 'sigv4', 'disableDoubleEncoding' => true }
auth_scheme = {
'name' => 'sigv4',
'disableDoubleEncoding' => true,
'disableNormalizePath' => true
}
merge_signing_defaults(auth_scheme, context.config)
when 'bearer'
{ 'name' => 'bearer' }
Expand Down
1 change: 1 addition & 0 deletions gems/aws-sdk-core/lib/aws-sdk-core/plugins/sign.rb
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,7 @@ def initialize(auth_scheme, config, region_override = nil)
credentials_provider: config.credentials,
signing_algorithm: scheme_name.to_sym,
uri_escape_path: !!!auth_scheme['disableDoubleEncoding'],
normalize_path: !!!auth_scheme['disableNormalizePath'],
unsigned_headers: %w[content-length user-agent x-amzn-trace-id]
)
rescue Aws::Sigv4::Errors::MissingCredentialsError
Expand Down
8 changes: 7 additions & 1 deletion gems/aws-sdk-core/spec/aws/endpoints_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,13 @@ def expect_auth_scheme(auth_scheme)
let(:signature_version) { auth_type }

it 'signs with sigv4 with double encoding' do
expect_auth_scheme({ 'name' => 'sigv4', 'disableDoubleEncoding' => true })
expect_auth_scheme(
{
'name' => 'sigv4',
'disableDoubleEncoding' => true,
'disableNormalizePath' => true
}
)
client.operation
end
end
Expand Down