You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@reqsign.apache.org by "unconsolable (via GitHub)" <gi...@apache.org> on 2026/10/10 15:47:55 UTC
[I] feat(aws): support configurable Single/Double URI encoding in AWS SigV4 [reqsign]
unconsolable opened a new issue, #911:
URL: https://github.com/apache/reqsign/issues/911
# Problem
**reqsign-aws-v4 currently has no option to choose the canonical URI encoding mode.** The shared canonical_uri helper splits the wire path on '/', percent-decodes each segment, then encodes it once. That does not provide the extra encoding required when signing requests for services such as API Gateway (execute-api) and the Amazon S3 Tables Iceberg REST endpoint.
https://github.com/apache/reqsign/blob/main/services/aws-core/src/signing.rs#L197-L209
https://github.com/apache/reqsign/blob/main/services/aws-v4/src/sign_request.rs
**The official aws-sigv4 crate exposes PercentEncodingMode::{Single, Double}, separately from URI path normalization.** Double re-encodes the existing wire path when building the canonical request.
https://github.com/awslabs/aws-sdk-rust/blob/main/sdk/aws-sigv4/src/http_request/settings.rs
https://github.com/awslabs/aws-sdk-rust/blob/main/sdk/aws-sigv4/src/http_request/canonical_request.rs
# Downstream context
- Lance [#7099](https://github.com/lance-format/lance/pull/7099) reports that migrating from aws-sigv4 to reqsign matched simple paths, but failed for percent-encoded names because a double-encoding option was missing:
https://github.com/lance-format/lance/pull/7099#discussion_r3576839262
- The older Iceberg Rust [#2311](https://github.com/apache/iceberg-rust/pull/2311) used reqsign with a temporary URI-patching workaround to support double URL encoding. That PR was closed without merging:
https://github.com/apache/iceberg-rust/pull/2311
- Iceberg Rust [#3082](https://github.com/apache/iceberg-rust/pull/3082) has now merged using aws-sigv4, including double URL encoding:
https://github.com/apache/iceberg-rust/pull/3082
# Proposed design
- Add an explicit Single/Double setting to the AWS V4 request signer.
- Keep Single as the default to preserve its existing behavior for compatibility.
- In Double mode, encode the original wire path once more for canonicalization, preserving structural '/' separators. Do not decode the path first.
- Apply the selected encoding mode consistently to both header signing and presigning. Preserve the original request path; presigning should only append authentication fields to the query string.
For example, a wire path `/a%20b/c%2Fd` should produce `/a%2520b/c%252Fd` in Double mode. Existing escape spelling also matters: %2f becomes %252f, and %7E becomes %257E.
# Tests
Cover spaces, encoded slashes, literal percent signs, non-ASCII names, lowercase escapes, and encoded unreserved characters. Check header and presigned signatures against aws-sigv4 with path normalization disabled and matching signing settings. Add regression tests for unchanged Single behavior and unchanged wire path/query bytes.
The shared helpers also serve SigV4a, so the implementation should avoid changing its existing behavior accidentally.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@reqsign.apache.org.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@reqsign.apache.org
For additional commands, e-mail: commits-help@reqsign.apache.org
Re: [I] feat(aws): support configurable Single/Double URI encoding in AWS SigV4 [reqsign]
Posted by "Xuanwo (via GitHub) via commits" <co...@reqsign.apache.org>.
Xuanwo closed issue #911: feat(aws): support configurable Single/Double URI encoding in AWS SigV4
URL: https://github.com/apache/reqsign/issues/911
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@reqsign.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@reqsign.apache.org
For additional commands, e-mail: commits-help@reqsign.apache.org