Skip to content

reqsign-google: add built-in provider for static OAuth access token #694

@Xuanwo

Description

@Xuanwo

Problem

reqsign-google currently has:

  • DefaultCredentialProvider for ADC/env/well-known/vm metadata
  • StaticCredentialProvider for JSON credentials (service account / external account)
  • Credential::with_token(Token { ... }) data model

But it does not provide a built-in ProvideCredential implementation for a raw OAuth access token string.

In OpenDAL GCS migration to reqsign v2, this gap requires a local custom provider (e.g. StaticTokenCredentialProvider) only to bridge token config into Signer<Credential>.

Why this matters

  • Users often already have a short-lived access token and want to sign requests directly.
  • Without a built-in provider, each integrator must re-implement the same tiny adapter.
  • It makes migration from legacy integrations noisier than necessary.

Proposal

Add a built-in provider in reqsign-google, for example:

  • StaticTokenCredentialProvider::new(access_token)
  • Optional helpers for expiration:
    • with_expires_at(Timestamp)
    • with_expires_in(Duration)

Implementation can return Credential::with_token(Token { ... }).

Compatibility

This is additive and backward compatible.

Extra note

A related gap is VM metadata service-account selection (service_account path segment), but this issue focuses only on static token provider.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions