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

Invalid legacy argument for Customer Provided Key #17835

Closed
paulovn opened this issue Apr 6, 2021 · 5 comments · Fixed by #18212
Closed

Invalid legacy argument for Customer Provided Key #17835

paulovn opened this issue Apr 6, 2021 · 5 comments · Fixed by #18212
Assignees
Labels
bug This issue requires a change to an existing behavior in the product in order to be resolved. Client This issue points to a problem in the data-plane of the library. customer-reported Issues that are reported by GitHub users external to the Azure organization. Storage Storage Service (Queues, Blobs, Files)

Comments

@paulovn
Copy link

paulovn commented Apr 6, 2021

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

@ghost ghost added needs-triage Workflow: This is a new issue that needs to be triaged to the appropriate team. customer-reported Issues that are reported by GitHub users external to the Azure organization. question The issue doesn't require a change to the product in order to be resolved. Most issues start as that labels Apr 6, 2021
@kristapratico kristapratico added bug This issue requires a change to an existing behavior in the product in order to be resolved. Client This issue points to a problem in the data-plane of the library. Storage Storage Service (Queues, Blobs, Files) and removed needs-triage Workflow: This is a new issue that needs to be triaged to the appropriate team. question The issue doesn't require a change to the product in order to be resolved. Most issues start as that labels Apr 6, 2021
@kristapratico
Copy link
Member

@paulovn thanks for the feedback, we'll investigate asap.

@xiafu-msft
Copy link
Contributor

xiafu-msft commented Apr 10, 2021

Thanks for reporting this!
It seems @tasherif-msft had an offline sync with Isabella about removing the hard coded encryption_algorithm='AES256' from generated code and add the field encryption_algorithm back to https://github.com/Azure/azure-sdk-for-python/blob/master/sdk/storage/azure-storage-blob/azure/storage/blob/_generated/operations/_block_blob_operations.py#L54

This will be fixed soon! sorry about the inconvenience!

@tasherif-msft
Copy link
Contributor

Yes I will follow up on this internally for our next release @paulovn!

@paulovn
Copy link
Author

paulovn commented Apr 14, 2021

Great, thanks!

@tasherif-msft
Copy link
Contributor

Hi @paulovn the fix has been put out #18212
It will be available in our patch release happening in the next couple of days.

I will close this issue in the meantime. Let me know if you have any further questions.

@github-actions github-actions bot locked and limited conversation to collaborators Apr 12, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug This issue requires a change to an existing behavior in the product in order to be resolved. Client This issue points to a problem in the data-plane of the library. customer-reported Issues that are reported by GitHub users external to the Azure organization. Storage Storage Service (Queues, Blobs, Files)
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants