Skip to content

fix(core): request uncompressed credential responses from reqsign - #8421

Merged
Xuanwo merged 3 commits into
apache:mainfrom
ump45nose:fix/8418-credential-identity-encoding
Nov 1, 2026
Merged

Xuanwo merged 3 commits into
apache:mainfrom
ump45nose:fix/8418-credential-identity-encoding

Conversation

@ump45nose

Copy link
Copy Markdown
Contributor

Which issue does this PR close?

Closes #8418.

Rationale for this change

reqsign sends its credential requests (the GCS token exchange for credential_path, metadata/STS calls for other services) through the operator's HttpTransporter, so they use the user's HTTP client. reqsign reads those responses as raw bytes and parses them as JSON; it never checks Content-Encoding.

The client in the issue sends Accept-Encoding: gzip as a default header and turns off reqwest's automatic decompression, because the application handles compression of object data itself. Google's token endpoint honours that header, so reqsign gets a gzip body and fails with failed to parse token response. The reporter says the same client setup worked on 0.55.

What changes are included in this PR?

  • impl reqsign_core::HttpSend for HttpTransporter now sets Accept-Encoding: identity on the request when reqsign has not set an Accept-Encoding header itself. reqwest only adds a default header when the request does not already have it, so this header wins over the client's default gzip, while ordinary object requests (which don't go through HttpSend) keep the user's headers.
  • Two unit tests with a recording transport: one checks that identity is sent, one checks that an explicit Accept-Encoding from reqsign is left as is. The first fails without the fix.

Tests run locally (from core/):

  • cargo test -p opendal-core --features reqsign --lib (238 passed)
  • cargo clippy -p opendal-core --features reqsign --all-targets -- -D warnings and cargo fmt -p opendal-core -- --check
  • A throwaway program (not part of this PR) using ReqwestTransport with a client that has Accept-Encoding: gzip as a default header, against a local server that returns a Content-Encoding: gzip body only when gzip is accepted: before the change http_send returned the compressed bytes, after it returned the plain JSON.

I did not test against the real Google token endpoint.

Are there any user-facing changes?

Credential requests made by reqsign through OpenDAL's transport now carry Accept-Encoding: identity unless reqsign sets the header. Users whose HTTP client requests compressed responses without decoding them can use credential loaders again. No API changes.

Breaking changes

AI Usage Statement

  • Harness: Grok Bot (agent harness; it does not expose the underlying model name or effort setting)
  • Model: not exposed by the harness
  • Effort: not exposed by the harness
  • Role: Helped trace the failure to the HttpSend bridge, write the fix and the unit tests, run the local end-to-end check described above, and draft this description. I reviewed the diff. The behaviour against Google's real token endpoint is inferred from the issue report, not tested.

@ump45nose
ump45nose requested a review from Xuanwo as a code owner October 21, 2026 07:06
@github-actions github-actions Bot added core releases-note/fix The PR fixes a bug or has a title that begins with "fix" size:M This PR changes 30-99 lines, ignoring generated files. labels Oct 21, 2026
@Xuanwo
Xuanwo merged commit 1c5647d into apache:main Nov 1, 2026
383 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

core releases-note/fix The PR fixes a bug or has a title that begins with "fix" size:M This PR changes 30-99 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

bug: GCS Operator credential_path broken when I use a client that reads raw gzip

2 participants