There should be a way to re-hydrate an instance of BlobSASPermissions from JSON #9714
Labels
APIChange
This PR contains an addition or change to the API signature and must be reviewed by an architect.
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.
feature-request
This issue requires a new behavior in the product in order be resolved.
Storage
Storage Service (Queues, Blobs, Files)
Milestone
Is your feature request related to a problem? Please describe.
Our current solution stores an instance of BlobSasPermissions to CosmosDB in the form of JSON. See an example below:
The reason this happens is because we store it as part of an object hierarchy that looks like this:
We run into an issue when calling generateBlobSASQueryParameters with a re-hydrated version of BlobSasPermissions from this JSON format as it loses it's toString() implementation in the process (and there is no way to instantiate BlobSasPermission from anything other than the simple permission string format eg. 'rwx'). So passing our re-hydrated BlobSasPermissions causes generateBlobSASQueryParameters to throw an Invalid Permissions exception.
Describe the solution you'd like
It would be ideal for us to be able to call generateBlobSASQueryParameters with the following:
Or even:
Describe alternatives you've considered
Since we want to retain our database structure (for backwards compatibility), it is not desirable to change how we serialize BlobSasPermission. Right now we just recreate the BlobSasPermission.toString method in our codebase to work with an external object (remember that obj below does not have toString() since it was re-hydrated from JSON):
Additional context
None.
The text was updated successfully, but these errors were encountered: