Xuanwo opened a new pull request, #9444: URL: https://github.com/apache/opendal/pull/9444
# Which issue does this PR close? Part of apache/reqsign#685. # Rationale for this change `reqsign-dropbox` 1.0.0 can set the bearer header for Dropbox storage requests. Adopting its refresh provider would also change OAuth form encoding, refresh-token rotation, and which errors callers can retry. For example, the provider treats the tested HTTP 429 and 503 responses as retryable. OpenDAL reports permanent JSON deserialization errors for those responses. Keeping the exchange in OpenDAL preserves the request bytes and error handling callers see today. # What changes are included in this PR? OpenDAL passes `/2/files/*` requests on both `api.dropboxapi.com` and `content.dropboxapi.com` to the Reqsign signer. The Dropbox session sends the unsigned `POST /oauth2/token` through the HTTP transport of the operation that triggers refresh. Operator clones share the session. It serializes refresh so concurrent operations can reuse one token even when they use different transports. The triggering request uses the freshly exchanged token. The session calculates when to refresh again from `expires_in`, with the existing two-minute early refresh window. The next refresh reuses the same grant through the triggering operation’s transport. The public `Operator` capture matched 95 ordered records between signed commit `54ddaadd3ca51de2c75172fadc2a89c5e3f92bd0` and its parent `ee8afced8a1361d5b52fd9e8c4847d18dc41241b` (51 HTTP requests, 26 successful outcomes or observations, and 18 errors). It compared methods, URIs, headers, body bytes, operation extensions, and caller-visible outcomes. It also exercised concurrent refresh across clones. The capture ran offline with synthetic HTTP inputs and responses. The repository’s live Dropbox fixture is disabled. Wasm verification covered compilation for `wasm32-unknown-unknown` only. Independent review covered `4f2dd4db346363db3036f9607dba559efbf55c0e`. The three changed Dropbox service files in the signed candidate are byte-identical to the reviewed versions. # Are there any user-facing changes? Separately from the 95 matches, six malformed-token cases now return a permanent `Unexpected` error before OpenDAL sends the storage request. For all three refreshed-token cases, OpenDAL still completes the OAuth exchange first. | Access token tested | Parent behavior | | --- | --- | | Explicit token containing an embedded space | Sent the storage request | | Explicit token containing an embedded tab | Sent the storage request | | Explicit token containing a newline | Panicked | | Empty refreshed token | Sent the storage request | | Refreshed token containing an embedded space | Sent the storage request | | Refreshed token containing a newline | Panicked | An explicitly configured empty access token still triggers the existing empty-grant exchange. The tested UTF-8 token without whitespace produced identical authorization header bytes on both revisions. # Breaking changes # AI Usage Statement | Harness | Model | Effort | Role | | --- | --- | --- | --- | | Pi | `magpie/codex/gpt-6.2-sol` | `max` | Implementation, mechanical replay onto the current parent, and verification of the signed candidate | | Pi | `magpie/codex/gpt-6.2-astra` | `high` | Design and PR writing, including this revision | | Pi | `magpie/kimi-code-cn/k3.1-pro` | `high` | Independent review of `4f2dd4db34` | | Pi | `magpie/codex/gpt-6.2-sol` | `high` | Independently reviewed signed `54ddaadd3c` and checked that 14 configuration and registration observations matched on its integration tree with `f4860ce2f5` | -- 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]
