Xuanwo opened a new pull request, #9441: URL: https://github.com/apache/opendal/pull/9441
# Which issue does this PR close? Part of apache/reqsign#685. # Rationale for this change Aliyun Drive can use Reqsign to set the bearer header on first-party API requests. OpenDAL keeps the OAuth exchange and session cache because the released Reqsign refresh provider and cache have different expiry, refresh-grant rotation, and error semantics. # What changes are included in this PR? - Use `RequestSigner` from `reqsign-aliyun-drive` 1.0.0 with `reqsign-core` 4.0.0 for first-party requests, starting with `getDriveInfo`. Download GETs and multipart upload PUTs use the full server-issued URLs, including their query strings, without adding a bearer header. - Keep nonempty explicit access tokens first in credential selection. When a refresh is needed, OpenDAL uses the current operation’s HTTP transport, computes expiry from receipt of the OAuth response, and preserves the exchange’s error details and retryability. Operator clones share the drive ID, access token, expiry, and rotated refresh grant across transport changes. An offline comparison of `ca1ccec4bbae1c4ded05a0de76091b7f4b5e4484` with its parent `4228f3bcaef0e6b0e352e8ba9fbcca352f08e5b7` matched all **59 requests and 23 caller outcomes** in order on the supported paths. It covered drive selection, file operations, unsigned data transfers, grant rotation across transports, cache reuse across clones, and HTTP, transport, and response-body errors. The capture used synthetic responses. The Aliyun Drive fixture is disabled, so there is no live-service coverage. Wasm coverage was limited to a minimal `wasm32-unknown-unknown` compile check. The candidate merges cleanly with `ee8afced8a`. # Are there any user-facing changes? Builder acceptance stays the same. Reqsign validates the access token when signing the first-party request and requires a nonempty token made of visible ASCII characters. The seven malformed-token probes below were compared separately from the counts above. | Access token | Previous behavior | Behavior with Reqsign | | --- | --- | --- | | Explicit token containing a space, tab, or non-ASCII character | Sent the token in the API request. | Signing fails before any HTTP request. | | Explicit token containing a newline | Panicked while building the header. | Signing fails before any HTTP request. | | OAuth response with a space in the access token | Sent the token in the API request after the exchange. | Signing fails after the exchange, before the API request. | | OAuth response with an empty access token | Returned OpenDAL’s empty-token header error after the exchange. | Signing fails after the exchange, before the API request. | | OAuth response with a newline in the access token | Panicked while building the header after the exchange. | Signing fails after the exchange, before the API request. | Each signing failure above returns a permanent `Unexpected` error with `reqsign::Sign` operation context. A missing `expires_in` still fails OAuth response decoding and leaves the previous grant in place. A valid response with an empty rotated refresh grant still stores that grant for the next exchange. # Breaking changes # AI Usage Statement | Harness | Model | Effort | Role | | --- | --- | --- | --- | | Pi | `magpie/codex/gpt-6.2-astra` | high | Designed the migration and wrote and updated the PR description. | | Pi | `magpie/codex/gpt-6.2-sol` | max | Implemented the signer migration, replayed the offline comparison on the candidate and its parent, and ran the compiler checks. | | Pi | `magpie/kimi-code-cn/k3.1-pro` | high | Independently reviewed `8b88b677ec` and reproduced its offline comparison. The current candidate has byte-identical Aliyun Drive service files. | -- 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]
