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

Add encryption headers for customer-provided keys #221

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions blob/lib/azure/storage/blob/blob_service.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down