Add djblets.secrets, for AES crypto helpers and token generation.

Review Request #12369 — Created June 13, 2022 and submitted — Latest diff uploaded

Information

Djblets
release-3.x

Reviewers

This introduces a new djblets.secrets module, which will be the home
of any future crypto/secrets-related work going forward.

This currently contains djblets.secrets.crypto, a collection of AES
encryption/decryption utilities that wrap the cryptography module.
This is a near-straight port of reviewboard.scmtools.crypto_utils,
with the exception that encrypt_password() has been renamed to
aes_encrypt_base64() and decrypt_password() has been renamed to
aes_decrypt_base64(). This is to help make it clear what form of
encryption and results are expected, and to allow room for other similar
utilities in the future.

cryptography is now a hard dependency of Djblets, rather than a soft
dependency, as Djblets-shipped code will be making use of this module in
the future.

Unit tests pass.

Diff Revision 2

This is not the most recent revision of the diff. The latest diff is revision 4. See what's changed.

orig
1
2
3
4

Commits

First Last Summary ID Author
Add djblets.secrets, for AES crypto helpers and token generation.
This introduces a new `djblets.secrets` module, which will be the home of any future crypto/secrets-related work going forward. This currently contains `djblets.secrets.crypto`, a collection of AES encryption/decryption utilities that wrap the `cryptography` module. This is a near-straight port of `reviewboard.scmtools.crypto_utils`, with the exception that `encrypt_password()` has been renamed to `aes_encrypt_base64()` and `decrypt_password()` has been renamed to `aes_decrypt_base64()`. This is to help make it clear what form of encryption and results are expected, and to allow room for other similar utilities in the future. `cryptography` is now a hard dependency of Djblets, rather than a soft dependency, as Djblets-shipped code will be making use of this module in the future.
be8fa78185e07949c2b8a45e83905988f6bb22f0 Christian Hammond
README.rst
djblets/dependencies.py
djblets/secrets/__init__.py
djblets/secrets/crypto.py
djblets/secrets/tests/__init__.py
djblets/secrets/tests/test_crypto_utils.py
docs/djblets/coderef/index.rst
Loading...