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

x-ms-immutability-policy-mode does not respect ImmutabilityPolicyMode values #21685

Closed
KastenMike opened this issue Oct 4, 2023 · 5 comments
Closed
Assignees
Labels
AzBlob Client This issue points to a problem in the data-plane of the library. customer-reported Issues that are reported by GitHub users external to the Azure organization. needs-team-attention Workflow: This issue needs attention from Azure service team or SDK team question The issue doesn't require a change to the product in order to be resolved. Most issues start as that Service Attention Workflow: This issue is responsible by Azure service team. Storage Storage Service (Queues, Blobs, Files)

Comments

@KastenMike
Copy link
Contributor

KastenMike commented Oct 4, 2023

Whatever service is returning the calls I guess has different consts to this repo or uses strings.ToLower().

getPropertiesHandleResponse (generated) is assigning resp.Header.Get("x-ms-immutability-policy-mode") to ImmutabilityPolicyMode. In this repo ImmutabilityPolicyModeLocked is "Locked" but calls like NewBlobClient(blob).GetProperties(ctx, nil) are returning &ImmutabilityPolicyMode("locked") which is not ideal because ImmutabilityPolicyMode("locked") == ImmutabilityPolicyModeLocked is false meaning we can't use these types for checking and instead need to do something like strings.EqualFold(string(ImmutabilityPolicyMode("locked")), string(ImmutabilityPolicyModeLocked)).

@github-actions github-actions bot added customer-reported Issues that are reported by GitHub users external to the Azure organization. needs-triage Workflow: This is a new issue that needs to be triaged to the appropriate team. question The issue doesn't require a change to the product in order to be resolved. Most issues start as that labels Oct 4, 2023
@KastenMike
Copy link
Contributor Author

KastenMike commented Oct 4, 2023

Oh it seems the returned value is BlobImmutabilityPolicyModeType although it's cast to ImmutabilityPolicyMode

@KastenMike
Copy link
Contributor Author

Maybe the swagger or whatever is generating the client was set to ImmutabilityPolicyMode by mistake and should instead be BlobImmutabilityPolicyModeType?

@jhendrixMSFT jhendrixMSFT added Storage Storage Service (Queues, Blobs, Files) and removed needs-triage Workflow: This is a new issue that needs to be triaged to the appropriate team. labels Oct 4, 2023
@github-actions github-actions bot added the needs-team-attention Workflow: This issue needs attention from Azure service team or SDK team label Oct 4, 2023
@RickWinter RickWinter added the Service Attention Workflow: This issue is responsible by Azure service team. label Oct 4, 2023
@github-actions
Copy link

github-actions bot commented Oct 4, 2023

Thanks for the feedback! We are routing this to the appropriate team for follow-up. cc @xgithubtriage.

@RickWinter RickWinter added the Client This issue points to a problem in the data-plane of the library. label Oct 4, 2023
@vibhansa-msft vibhansa-msft added this to the Storage-Dec-23 milestone Oct 11, 2023
@vibhansa-msft
Copy link
Member

These values are as per the return values coming back from backend. SDK is just using the same value while returning back status.

@KastenMike
Copy link
Contributor Author

So it's a mistake on the backend then? If the expected type is "Locked" but "locked" is returned

@github-actions github-actions bot locked and limited conversation to collaborators Apr 2, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
AzBlob Client This issue points to a problem in the data-plane of the library. customer-reported Issues that are reported by GitHub users external to the Azure organization. needs-team-attention Workflow: This issue needs attention from Azure service team or SDK team question The issue doesn't require a change to the product in order to be resolved. Most issues start as that Service Attention Workflow: This issue is responsible by Azure service team. Storage Storage Service (Queues, Blobs, Files)
Projects
None yet
Development

No branches or pull requests

6 participants