From c59cece9d70752f5a33ff308ad840a1a9453755c Mon Sep 17 00:00:00 2001 From: arashnd Date: Fri, 14 Oct 2022 16:59:06 +0500 Subject: [PATCH] Add encryption headers for customer-provided keys --- blob/lib/azure/storage/blob/blob_service.rb | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/blob/lib/azure/storage/blob/blob_service.rb b/blob/lib/azure/storage/blob/blob_service.rb index c9f13966..73d3b80d 100755 --- a/blob/lib/azure/storage/blob/blob_service.rb +++ b/blob/lib/azure/storage/blob/blob_service.rb @@ -688,6 +688,12 @@ def add_blob_conditional_headers(options, headers) # Conditional headers for append blob StorageService.with_header headers, "x-ms-blob-condition-maxsize", options[:max_size] StorageService.with_header headers, "x-ms-blob-condition-appendpos", options[:append_position] + + # Encryption headers for customer-provided keys https://learn.microsoft.com/en-us/azure/storage/blobs/encryption-customer-provided-keys + StorageService.with_header headers, "x-ms-encryption-key", options[:encryption_key] + StorageService.with_header headers, "x-ms-encryption-key-sha256", options[:encryption_key_sha256] + StorageService.with_header headers, "x-ms-encryption-algorithm", options[:encryption_algorithm] + StorageService.with_header headers, "x-ms-encryption-scope", options[:encryption_scope] end # Get the content type according to the blob content type header and request body.