Xuanwo opened a new pull request, #9431:
URL: https://github.com/apache/opendal/pull/9431

   # Which issue does this PR close?
   
   Closes #8879.
   
   # Rationale for this change
   
   Gdrive currently puts the refresh token and client secret in the token 
endpoint URL, where HTTP logs can capture them. Gdrive also needs Google 
Application Default Credentials (ADC), including the metadata server path used 
by GKE Workload Identity.
   
   # What changes are included in this PR?
   
   Gdrive moves authentication to `reqsign-google` 4.0.0. The OAuth refresh 
request carries its parameters in a JSON POST body. Path lookups, metadata 
operations, and streaming requests share the signer for the operation's HTTP 
transport. Each transport has its own credential and exchanged-token caches, 
and also handles the token exchange.
   
   The final candidate (`c855494d1c`) passed all 136 behavior tests on My Drive 
with the existing user refresh-token fixture. This includes historical reads 
and metadata lookups after overwrite, and `NotFound` for a revision belonging 
to another file. An offline comparison with `ccbba108a6` matched the Drive 
request methods, URLs, Range headers, and bearer values.
   
   Controlled tests exercised the inline and file-based service-account 
exchanges, the ADC sources, and the default and custom Drive scopes. Live 
verification is outstanding for service-account credentials and ADC, including 
listing and reading a shared drive from GKE with Workload Identity.
   
   # Are there any user-facing changes?
   
   Gdrive selects the first configured source in the following order.
   
   1. A custom Google credential provider on the Rust builder.
   2. An explicit `access_token` or `refresh_token`.
   3. Base64-encoded credentials JSON in `credential`.
   4. A local JSON file in `credential_path` on native targets. A load error is 
returned to the caller.
   5. ADC. Native builds try `GOOGLE_APPLICATION_CREDENTIALS`, the well-known 
gcloud ADC file, then the metadata server. On WebAssembly, the ADC chain uses 
only the metadata provider.
   
   A custom provider takes precedence even when explicit token settings 
conflict or refresh settings are incomplete. When the builder selects an 
explicit token, it rejects simultaneous access and refresh tokens and requires 
both `client_id` and `client_secret` for a refresh token. With no explicit 
credential source, the operator uses ADC when it signs a request.
   
   The new `scope` option defaults to `https://www.googleapis.com/auth/drive` 
and applies to Google token exchanges that accept a scope. Explicit access and 
refresh tokens retain the scopes already granted to them. Service-account key 
signing requires the `reqsign-rustcrypto` feature or a process-wide Reqsign 
crypto provider.
   
   # Breaking changes
   
   # AI Usage Statement
   
   - Pi with `magpie/codex/gpt-6.2-sol` at `max` implemented and verified the 
migration and the provider precedence fix.
   - Pi with `magpie/kimi-code-cn/k3.1-pro` at `high` reviewed the earlier 
candidate and identified the precedence issue.
   - Pi with `magpie/codex/gpt-6.2-astra` at `high` evaluated the 4.0.0 
integration, reproduced the precedence issue, and drafted this description.
   - Pi with `magpie/agy-cli/gemini-4-neon` at `high` prototyped the migration 
and identified the earlier Wasm dependency incompatibility.
   


-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to