-
Notifications
You must be signed in to change notification settings - Fork 3.3k
Invalid legacy argument for Customer Provided Key #17835
Description
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 :
azure-sdk-for-python/sdk/storage/azure-storage-blob/azure/storage/blob/_blob_client.py
Lines 369 to 370 in e43995b
| 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