refactor(services/gcs): migrate to reqsign v2#7229
Merged
Conversation
tisonkun
approved these changes
Feb 26, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Which issue does this PR close?
Part of #6553.
Rationale for this change
GCS service was still using reqsign v1 APIs (
GoogleCredentialLoader/GoogleTokenLoader/GoogleSigner) while other services are being migrated to reqsign v2.This PR migrates GCS to reqsign v2 with
Signer<Credential>and keeps existing behavior for credential priority, anonymous mode, and service-account selection for VM metadata.What changes are included in this PR?
services/gcsdependencies fromreqsignv1 to reqsign v2 crates:reqsign-corereqsign-googlereqsign-file-read-tokioreqsign-http-send-reqwestContext + ProvideCredentialChain<Credential> + Signer<Credential>.Request -> Request) for both normal sign and presign query sign.allow_anonymousbehavior by allowingCredentialInvalidfrom reqsign and continuing unsigned.service_accountbehavior for VM metadata by adding an internal credential provider that requests token from:/computeMetadata/v1/instance/service-accounts/<service_account>/tokencredential_provider(...)credential_provider_chain(...)Also opened upstream reqsign issue for a built-in static access token provider:
Are there any user-facing changes?
Yes.
GcsBuilder::customized_token_loader(...)is replaced by provider-chain based APIs:GcsBuilder::credential_provider(...)GcsBuilder::credential_provider_chain(...)Configuration keys and existing auth precedence are preserved.
AI Usage Statement
This PR was implemented with Codex (GPT-5) for code migration, refactoring, and validation command preparation.