github-actions[bot] commented on code in PR #70657:
URL: https://github.com/apache/doris/pull/70657#discussion_r4610411728


##########
common/cpp/obj-storage/client/azure_obj_storage_client.cpp:
##########
@@ -436,9 +580,9 @@ ObjStorageResponse 
AzureObjStorageClient::delete_objects(const ObjStoragePath& o
         std::advance(chunk_end,
                      std::min(batch_size, 
static_cast<size_t>(std::distance(begin, end))));
 
-        auto deleter = AzureBatchDeleter(_client.get(), opts, *begin, 
_config.tls_debug_context);
-        std::ranges::for_each(std::ranges::subrange(begin, chunk_end),
-                              [&](const std::string& obj) { 
deleter.delete_blob(obj); });
+        auto container = _service.GetBlobContainerClient(opts.bucket);
+        auto deleter = AzureBatchDeleter(&container, opts, *begin, 
_config.tls_debug_context);

Review Comment:
   [P2] Preserve delete-only SAS permissions for bulk deletion
   
   For a client created with a valid container SAS (`sr=c&sp=dl`), individual 
`DeleteBlob` calls are authorized, but this path always submits a Blob Batch, 
even for one key. Azure requires `w` for the parent [Blob Batch 
request](https://learn.microsoft.com/en-us/rest/api/storageservices/blob-batch#authorization),
 whereas [individual deletion requires 
`d`](https://learn.microsoft.com/en-us/rest/api/storageservices/delete-blob#authorization).
 Thus the newly supported SAS client returns HTTP 403 from `delete_objects()` 
and `delete_objects_recursively()` for cleanup allowed by the credential. This 
fails at parent authorization, before deferred responses. Provide 
individual-delete handling when SAS cannot authorize batching, including 
stored-policy SAS whose effective permissions are not in the token.



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


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to