Skip to content

Invalid legacy argument for Customer Provided Key #17835

@paulovn

Description

@paulovn

The BlobClient class contains in many of its methods the capability to add a Customer Provided Key for encryption, by supplying a cpk argument that must contain a CustomerProvidedEncryptionKey object. Inside those methods, the CustomerProvidedEncryptionKey is converted into a CpkInfo object, as this seems to be the object that the lower-level method wants.

However apparently the CpkInfo class was modified a while ago, and one of its attributes, encryption_algorithm, was removed, while the code in BlobClient still tries to set it. An example (though it happens several times in the file) can be seen at :

cpk_info = CpkInfo(encryption_key=cpk.key_value, encryption_key_sha256=cpk.key_hash,
encryption_algorithm=cpk.algorithm)

This produces warnings

encryption_algorithm is not a known attribute of class <class 'azure.storage.blob._generated.models._models_py3.CpkInfo'> and will be ignored

.... i.e. it seems that the operation does go through, though the code seems to be a leftover

Metadata

Metadata

Labels

ClientThis issue points to a problem in the data-plane of the library.StorageStorage Service (Queues, Blobs, Files)bugThis issue requires a change to an existing behavior in the product in order to be resolved.customer-reportedIssues that are reported by GitHub users external to the Azure organization.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions