Azure / azure-cli

Azure Command-Line Interface
MIT License
3.96k stars 2.94k forks source link

Stop using deprecated `backend` argument in `cryptography` #29454

Open jiasli opened 1 month ago

jiasli commented 1 month ago

Per

cryptography stopped requiring the use of backend arguments in version 3.1 and deprecated their use in version 36.0. If you are on an older version that requires these arguments please view the appropriate documentation version or upgrade to the latest release.

Note that for forward compatibility backend is still silently accepted by functions that previously required it, but it is ignored and no longer documented.

A lot of code in Azure CLI (mainly keyvault module) still uses backend argument in cryptography:

https://github.com/Azure/azure-cli/blob/47823b5782343aa9c6dd146a64b6f21c36ff5bb0/src/azure-cli/azure/cli/command_modules/keyvault/custom.py#L1324

https://github.com/Azure/azure-cli/blob/47823b5782343aa9c6dd146a64b6f21c36ff5bb0/src/azure-cli/azure/cli/command_modules/keyvault/custom.py#L1414

The best practice is to bump cryptography to newer versions (>=3.1):

https://github.com/Azure/azure-cli/blob/fbe0addc214c857fc67d89266aede50c21970705/src/azure-cli-core/setup.py#L49

and stop using deprecated backend argument, just in case cryptography totally removes backend one day.

Additional context Related issue in Azure Python SDK repo: https://github.com/Azure/azure-sdk-for-python/issues/36579

yonzhan commented 1 month ago

Thank you for opening this issue, we will look into it.