azure-sdk-for-js icon indicating copy to clipboard operation
azure-sdk-for-js copied to clipboard

Integrity Checks

Open elizabethhalper opened this issue 2 years ago • 4 comments

Is your feature request related to a problem? Please describe. We have multiple customers who are asking that integrity checks are performed on data transferred to and from blob storage. We have learned from an engineer on this SDK team that "the SDK itself doesn't do any integrity checks. Storage service provided integrity checks properties, you can save checksums of the content in uploading and validate the content checksum in downloading."

Describe the solution you'd like We'd like there to be integrity checks within the SDK itself

Describe alternatives you've considered We've considered saving the checksums of the properties, however, the customer leverages multiple Azure SDK's, some of which do integrity checks and others that don't so it would be inconsistent within their service.

Additional context Add any other context or screenshots about the feature request here.

elizabethhalper avatar Oct 11 '22 15:10 elizabethhalper

@elizabethhalper If I understand you correctly, is the request that the SDK validate blob contents were uploaded successfully and provide some kind of thrown error if this doesn't happen from the upload operations?

xirzec avatar Oct 11 '22 17:10 xirzec

@elizabethhalper ,

There are two levels of integrity, using uploading as an example:

  1. Transactional integrity check: this could be used in PageBlobClient.uploadPages, BlockBlobClient.stageBlock, AppendBlobClient.appendBlock. There's a header to set checksum for a request, storage service will compare the checksum in the header with the one it calculated from the request body and throw out an error if not match.
  2. Whole file content integrity check: this could be used in interfaces like: BlockBlobClient.upload, BlockBlobClient.uploadFile.
    Customer could put a checksum for the whole file content in blob's properties. When downloading the blob, customer can check the checksum in properties with the one calculated from the downloaded content.

From customer's scenario, which way would customer need?

EmmaZhu avatar Oct 12 '22 01:10 EmmaZhu

We use BlockBlobClient.uploadData

Could that be prioritized?

sachabrants avatar Oct 12 '22 08:10 sachabrants

I have add the feature request into backlog, and we'd need to discuss about the feature internally.

EmmaZhu avatar Oct 13 '22 06:10 EmmaZhu