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

   # Which issue does this PR close?
   
   Refs #6274.
   
   # Rationale for this change
   
   Azure Storage `Put Blob` stores a blob's `Content-Disposition` property from 
the `x-ms-blob-content-disposition` request header. Previously, 
`AzblobCore::azblob_put_blob_request` did not forward 
`OpWrite::content_disposition()`, so `Operator::presign_write_options` dropped 
`WriteOptions::content_disposition` from the returned `PUT` request.
   
   In a live baseline trial on `e892ab4789` against Azure Storage using Shared 
Key Service SAS, executing the returned `PUT` unchanged created the blob (HTTP 
201) with no stored `Content-Disposition` on independent ETag-matched `HEAD` 
and `GET`. A control presigned `PUT` with the option omitted stored the exact 
requested value when the caller added `x-ms-blob-content-disposition`.
   
   # What changes are included in this PR?
   
   - Forward `OpWrite::content_disposition()` as 
`x-ms-blob-content-disposition` in `AzblobCore::azblob_put_blob_request` 
(`core/services/azblob/src/core.rs`) when set, leaving the header absent when 
unset.
   - Extend 
`backend::tests::presign_shared_key_enables_capability_and_generates_service_sas`
 (`core/services/azblob/src/backend.rs`) to verify that 
`Operator::presign_write_options` returns the exact 
`x-ms-blob-content-disposition` header alongside the existing path and Service 
SAS assertions.
   
   ## Verification and scope
   
   - **Unit regression:** The new assertion failed before the mapping (`left: 
None`, `right: Some("attachment; filename=\"test.txt\"")`) and passes on this 
commit alongside the `opendal-service-azblob` unit suite (44 tests), focused 
Clippy, and formatting checks.
   - **Live Azure Storage trial:** Against Azure Storage using Shared Key 
Service SAS (`reqsign-azure-storage` 3.3.2) with `if_not_exists: true`, 
`Operator::presign_write_options` returned `x-ms-blob-content-disposition: 
attachment; filename="opendal-6274.txt"` when set and omitted it when unset. 
Executing the returned `PUT` unchanged returned HTTP 201, and independent 
Shared Key `HEAD` and `GET` requests (empty query) returned HTTP 200 with the 
PUT's `ETag`, stored `Content-Disposition: attachment; 
filename="opendal-6274.txt"`, and all 36 payload bytes. All six trial blobs 
were deleted using ETag-matched `If-Match` `DELETE` (HTTP 202, 
`x-ms-delete-type-permanent: true`) and confirmed absent via follow-up `HEAD` 
(HTTP 404).
   - **Boundaries:**
     - Shared Key Service SAS in `reqsign-azure-storage` 3.3.2 signs the blob 
resource and SAS fields rather than arbitrary upload request headers; this 
change does not claim SAS binds `x-ms-blob-content-disposition`, and callers 
must send the returned header.
     - `Capability::write_with_content_disposition` remains `false`. Although 
`AzblobCore::azblob_put_blob_request` is shared with ordinary single PUT, 
neither ordinary single PUT nor multipart (`Put Block List`) or append writes 
(which use separate request builders) were verified in this trial.
     - Presigned `GET` `rscd` response-override signature verification is 
separate and remains tracked in #9100.
   
   # Are there any user-facing changes?
   
   Yes. On `azblob`, `Operator::presign_write_options` now includes the 
optional `x-ms-blob-content-disposition` header when 
`WriteOptions::content_disposition` is set (and omits it when unset) so 
executing the returned `PUT` stores the blob's `Content-Disposition` property 
on Azure Storage. Callers must preserve the returned header because Shared Key 
Service SAS does not bind arbitrary upload headers. 
`write_with_content_disposition` remains `false`; ordinary, multipart, and 
append writes are unverified, and presigned `GET` `rscd` overrides remain 
tracked separately in #9100.
   
   # Breaking changes
   
   # AI Usage Statement
   
   - **Harness:** Pi
     - **Model:** `magpie/codex/gpt-6.2-sol`
     - **Effort:** `max`
     - **Role:** Reproduced the baseline drop against Azure Storage, 
implemented `x-ms-blob-content-disposition` forwarding and the unit regression 
test, and verified candidate upload, independent readback, and cleanup against 
Azure Storage.
   - **Harness:** Pi
     - **Model:** `magpie/codex/gpt-6.2-sol`
     - **Effort:** `high`
     - **Role:** Performed independent read-only review of the signed commit, 
local checks, and live verification and cleanup evidence.
   - **Harness:** Pi
     - **Model:** `magpie/codex/gpt-6.2-astra`
     - **Effort:** `high`
     - **Role:** Coordinated scope, live-verification requirements, review 
gating, and publication sequencing.
   - **Harness:** Pi
     - **Model:** `magpie/agy-cli/gemini-4-neon` (Gemini 4 Neon)
     - **Effort:** `high`
     - **Role:** Drafted this PR body from the repository template, commit 
diff, and recorded evidence.
   
   Assumptions and unknowns affecting review:
   
   - Live verification exercised Shared Key Service SAS 
(`reqsign-azure-storage` 3.3.2) via `Operator::presign_write_options` for 
single-object `Put Blob` only; ordinary writes, multipart (`Put Block List`), 
append writes, and other Azure authentication modes were not verified.
   - Continuous automated unit coverage checks the returned 
`x-ms-blob-content-disposition` header and SAS query parameters locally; Azure 
Storage persistence comes from the recorded live trial.


-- 
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