Azure / Azure/azure-cli

Stop using deprecated `backend` argument in `cryptography`

Open
#29,454 1 comment 0 reactions 1 assignee Claimed by @evelyn-ys View on GitHub
act-platform-engineering-squad Azure CLI Team Core feature-request
Dominant language
Python
Stars
4.6k
Forks
3.5k
Avg merge
3d 2h
Merged PRs (30d)
60

Description

Per

- https://cryptography.io/en/latest/changelog/#v36-0-0
- https://cryptography.io/en/latest/faq/#faq-missing-backend

> `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

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.