Response have metadata always when using List Containers API
SugaMi opened this issue · comments
Which service(blob, file, queue, table) does this issue concern?
blob service
Which version of the Azurite was used?
Azurite v3.29.0
Where do you get Azurite? (npm, DockerHub, NuGet, Visual Studio Code Extension)
VScode extension
What's the Node.js version?
What problem was encountered?
When we call List Containers API, response body has metadata even if request dosen't have include=metadata.
https://learn.microsoft.com/en-us/rest/api/storageservices/list-containers2?tabs=microsoft-entra-id
Steps to reproduce the issue?
Issue request and response
Request doesn't have include=metadata but response body has metadata
<EnumerationResults ServiceEndpoint="http://127.0.0.1:10000/devstoreaccount1">
<Prefix/>
<MaxResults>5000</MaxResults>
<Containers>
<Container>
<Name>tetete</Name>
<Properties>
<Last-Modified>Wed, 27 Mar 2024 12:52:35 GMT</Last-Modified>
<Etag>"0x1BDDB154194EDE0"</Etag>
<LeaseStatus>unlocked</LeaseStatus>
<LeaseState>available</LeaseState>
<HasImmutabilityPolicy>false</HasImmutabilityPolicy>
<HasLegalHold>false</HasLegalHold>
</Properties>
<Metadata>
<Metadata11111>valueeee</Metadata11111>
</Metadata>
</Container>
</Containers>
<NextMarker/>
</EnumerationResults>
correct request and response (using product
Request doesn't have include=metadata and response body doesn't have metadata.
<Container>
<Name>test</Name>
<Properties>
<Last-Modified>Thu, 28 Mar 2024 00:51:19 GMT</Last-Modified>
<Etag>"0x8DC4EC12E8DA4B5"</Etag>
<LeaseStatus>unlocked</LeaseStatus>
<LeaseState>available</LeaseState>
<DefaultEncryptionScope>$account-encryption-key</DefaultEncryptionScope>
<DenyEncryptionScopeOverride>false</DenyEncryptionScopeOverride>
<HasImmutabilityPolicy>false</HasImmutabilityPolicy>
<HasLegalHold>false</HasLegalHold>
<ImmutableStorageWithVersioningEnabled>false</ImmutableStorageWithVersioningEnabled>
</Properties>
</Container>
Please be sure to remove any PII or sensitive information before sharing!
The debug log will log raw request headers and bodies, so that we can replay these against Azurite using REST and create tests to validate resolution.
Have you found a mitigation/solution?
Thanks for raising this issue!
It looks caused by :in list container API , we don't cleanup container metadata even Request doesn't have include=metadata, before return it in the request responds:
Azurite/src/blob/handlers/ServiceHandler.ts
Line 325 in d544d16
Would you please share you scenario impacted by this issue? Then we can evaluate the priority for this issue accordingly.
Azurite welcome contribution!
It would be great if you can raise a PR to fix it!
Thank you for your cheking.
We cannot share detailed senario but our system use this metadata.
The fix is merged, and normally will be include in the next Azurite release.