Skip to content

Validate Blob Batch response IDs and multipart content type - #7466

Merged
JinmingHu (Jinming-Hu) merged 3 commits into
Azure:mainfrom
Jinming-Hu:private-blob-batch-review
Oct 16, 2026
Merged

JinmingHu (Jinming-Hu) merged 3 commits into
Azure:mainfrom
Jinming-Hu:private-blob-batch-review

Conversation

@Jinming-Hu

Copy link
Copy Markdown
Member

Validate Blob Batch response Content-ID values against submitted requests. Reject negative, malformed, overflowing, duplicate, out-of-range, and incomplete mappings with controlled errors, while preserving valid reversed response order and batch-level errors. Validate multipart Content-Type before parsing responses.

Add 24 mocked SubmitBatch regression tests and register them with the unit-test target.

Validation: MSVC C++14 Debug production build succeeded; all 24 batch regressions passed at 27f427f35145d69eda2132a69c999741cb64128c. Changed production lines and the new test file were validated with clang-format 20. git diff --check e0016580d2e7c30aeb1d3bc50cba7b570d72621b HEAD passed. Full unrelated SDK and live tests were not run.

Pull Request Checklist

Please leverage this checklist as a reminder to address commonly occurring feedback when submitting a pull request to make sure your PR can be reviewed quickly:

See the detailed list in the contributing guide.

  • C++ Guidelines
  • Doxygen docs
  • Unit tests
  • No unwanted commits/changes
  • Descriptive title/description
    • PR is single purpose
    • Related issue listed
  • Comments in source
  • No typos
  • Update changelog
  • Not work-in-progress
  • External references or docs updated
  • Self review of PR done
  • Any breaking changes?

Reject malformed, duplicate and incomplete response mappings before dispatch. Preserve batch-level failures and add mocked submit-path regressions for service and container batches.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Report missing, truncated and mismatched Content-Type headers through StorageException while retaining HTTP batch errors and valid multipart responses.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 1 pipeline(s).
9 pipeline(s) were filtered out due to trigger conditions.
There may be pipelines that require an authorized user to comment /azp run to run.

@github-actions github-actions Bot added the Storage Storage Service (Queues, Blobs, Files) label Oct 15, 2026
@Jinming-Hu
JinmingHu (Jinming-Hu) marked this pull request as ready for review October 15, 2026 02:44
Copilot AI balanced review requested due to automatic review settings October 15, 2026 02:44
@Jinming-Hu

Copy link
Copy Markdown
Member Author

/azp run cpp - storage

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 1 pipeline(s).

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

The new Content-Type comparison rejects valid mixed-case media types and parameter names.

1 open finding
What changed in this PR

Hardens Blob Batch response parsing to validate request-response mappings and multipart content types.

Changes:

  • Rejects invalid, duplicate, out-of-range, and incomplete Content-ID mappings.
  • Adds multipart validation while preserving reversed responses and batch errors.
  • Registers 24 mocked service/container regression tests.
File Description
sdk/​storage/​azure-storage-blobs/​test/​ut/​CMakeLists.txt Registers batch response tests.
sdk/​storage/​azure-storage-blobs/​test/​ut/​blob_batch_response_test.cpp Tests malformed responses and valid mappings.
sdk/​storage/​azure-storage-blobs/​src/​blob_batch.cpp Validates multipart responses and Content-ID mappings.

🧠 Review effort: Balanced

Comment thread sdk/storage/azure-storage-blobs/src/blob_batch.cpp Outdated
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@Jinming-Hu

Copy link
Copy Markdown
Member Author

/azp run cpp - storage

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 1 pipeline(s).

@Jinming-Hu
JinmingHu (Jinming-Hu) merged commit d72e13a into Azure:main Oct 16, 2026
97 checks passed
@Jinming-Hu
JinmingHu (Jinming-Hu) deleted the private-blob-batch-review branch October 16, 2026 22:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Storage Storage Service (Queues, Blobs, Files)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants