Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prevents invalid metadata names in Blob APIs #2453

Merged
merged 3 commits into from
Aug 28, 2024

Conversation

benny-n
Copy link
Contributor

@benny-n benny-n commented Aug 22, 2024

Fixes #2451

This PR also follows the suggestion to fix all the blob APIs, not just putBlob.

To make sure this is always checked, we check for valid metadata names in the conversion function instead of in each API individually.

Thanks for contribution! Please go through following checklist before sending PR.

PR Branch Destination

  • For Azurite V3, please send PR to main branch.
  • For legacy Azurite V2, please send PR to legacy-dev branch.

Always Add Test Cases

Make sure test cases are added to cover the code change.

Add Change Log

Add change log for the code change in Upcoming Release section in ChangeLog.md.

Development Guideline

Please go to CONTRIBUTION.md for steps about setting up development environment and recommended Visual Studio Code extensions.

@benny-n
Copy link
Contributor Author

benny-n commented Aug 22, 2024 via email

@@ -496,6 +496,31 @@ describe("BlobAPIs", () => {

});

it("should fail when upload has metadata names that are invalid C# identifiers @loki @sql", async () => {
Copy link
Member

Choose a reason for hiding this comment

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

It would be great if all related API can be covered by test cases.

Copy link
Member

@blueww blueww left a comment

Choose a reason for hiding this comment

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

Thanks for the contribution!
The PR generally look great to me!

Only one comment for more test coverage.

@benny-n
Copy link
Contributor Author

benny-n commented Aug 23, 2024

@blueww Thanks for the review!

Added more test coverage as requested.

@benny-n benny-n force-pushed the disallow-invalid-metadata-in-blob-apis branch from 06c3b4a to 939c71f Compare August 23, 2024 10:40
@benny-n benny-n requested a review from blueww August 28, 2024 10:17
@blueww blueww merged commit 76f6262 into Azure:main Aug 28, 2024
34 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

PutBlob API allows invalid metadata name with hyphen
3 participants