You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
SigningRequest should preserve existing raw query when applying signed requests #778
reqsign-core::SigningRequest currently parses the request URI query with form_urlencoded::parse in SigningRequest::build, stores decoded query pairs, and rebuilds the URI query from those pairs in SigningRequest::apply.
This can change the wire representation of query parameters that already existed before signing.
For example, an existing query like:
versionId=a%2Bb%3Dc%2525%26e
can be rebuilt into a raw query like:
versionId=a+b=c%25&e
The rebuilt URI no longer preserves the original encoded value. In particular, the encoded & inside the value can become a query separator, and + can also become ambiguous for form-style query parsers.
This matters for downstream users such as OpenDAL. In apache/opendal#7888, COS requests need to keep an encoded versionId query parameter after signing.
Fixing this in OpenDAL requires service-local query restoration logic, but the root issue appears to be that reqsign-core does not preserve the raw query representation across SigningRequest::build and SigningRequest::apply.
Signing should not rewrite query parameters that already existed in the request URI.
Signers may still parse and canonicalize query parameters for signature calculation. Query-signing implementations may also append authentication query parameters. However, existing raw query parameters should keep their original wire representation unless a signer explicitly updates them.
Scope
This issue is about reqsign-core::SigningRequest, not a COS-specific workaround in OpenDAL.
At least reqsign-tencent-cos is affected because it builds on top of SigningRequest. Other signers using SigningRequest may need to be checked as well.
The reported COS failure is caused by encoded values changing, while parameter reordering is another effect of using the same query representation for canonicalization and the outgoing URI.
My understanding is that preserving the raw query should cover both encoding and order. Do you think parameter order should be handled separately, or would you prefer another approach for separating the canonical query from the wire query?
Activity
erickguan commentedon Jul 14, 2026
Hello! Is this issue about 2 problems?
QuakeWang commentedon Jul 14, 2026
The reported COS failure is caused by encoded values changing, while parameter reordering is another effect of using the same query representation for canonicalization and the outgoing URI.
My understanding is that preserving the raw query should cover both encoding and order. Do you think parameter order should be handled separately, or would you prefer another approach for separating the canonical query from the wire query?
erickguan commentedon Jul 14, 2026
Just want to know what do you want to change :)
I'll have a look. Or some other maintainers might beat me to it.
QuakeWang commentedon Jul 14, 2026
Thanks! The implementation is in #782. Please take a look when you have time.