From 0dc8305f71095075c82d92180423f78c776b70ba Mon Sep 17 00:00:00 2001 From: Daniel Grittner Date: Wed, 21 Aug 2024 22:22:11 +0200 Subject: [PATCH] fix: ruff formatting --- admyral/config/config.py | 6 ++++-- tests/utils/test_crypto.py | 12 +++++++++--- 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/admyral/config/config.py b/admyral/config/config.py index 659b1df1..61973851 100644 --- a/admyral/config/config.py +++ b/admyral/config/config.py @@ -165,14 +165,16 @@ def get_temporal_daemon_log_file() -> str: ENV_ADMYRAL_WEBHOOK_SIGNING_SECRET = "ADMYRAL_WEBHOOK_SIGNING_SECRET" WEBHOOK_SIGNING_SECRET = bytes.fromhex( os.getenv( - ENV_ADMYRAL_WEBHOOK_SIGNING_SECRET, "ebedd9f0c10b01acb9fd097cdf34a2b38bb554f2c7f68f0d9f534eff5c6ef5d9" + ENV_ADMYRAL_WEBHOOK_SIGNING_SECRET, + "ebedd9f0c10b01acb9fd097cdf34a2b38bb554f2c7f68f0d9f534eff5c6ef5d9", ) ) ENV_ADMYRAL_SECRETS_ENCRYPTION_KEY = "ADMYRAL_SECRETS_ENCRYPTION_KEY" SECRETS_ENCRYPTION_KEY = bytes.fromhex( os.getenv( - ENV_ADMYRAL_SECRETS_ENCRYPTION_KEY, "834f01cf391c972f1e6def3d7f315f8194bb10048e5cf282aa4cba63b239d8fb" + ENV_ADMYRAL_SECRETS_ENCRYPTION_KEY, + "834f01cf391c972f1e6def3d7f315f8194bb10048e5cf282aa4cba63b239d8fb", ) ) diff --git a/tests/utils/test_crypto.py b/tests/utils/test_crypto.py index aef1f950..1e626b07 100644 --- a/tests/utils/test_crypto.py +++ b/tests/utils/test_crypto.py @@ -1,16 +1,22 @@ from admyral.utils.crypto import encrypt_aes256_gcm, decrypt_aes256_gcm, _generate_hs256 -TEST_SECRET = bytes.fromhex("834f01cf391c972f1e6def3d7f315f8194bb10048e5cf282aa4cba63b239d8fb") +TEST_SECRET = bytes.fromhex( + "834f01cf391c972f1e6def3d7f315f8194bb10048e5cf282aa4cba63b239d8fb" +) def test_encrypt_decrypt(): msg = "this is my encrypted message - hello world!" - ciphertext = encrypt_aes256_gcm(TEST_SECRET, "this is my encrypted message - hello world!") + ciphertext = encrypt_aes256_gcm( + TEST_SECRET, "this is my encrypted message - hello world!" + ) deciphered = decrypt_aes256_gcm(TEST_SECRET, ciphertext) assert deciphered == msg def test_hs256(): - h = _generate_hs256(TEST_SECRET, "this is my securely hashed message - hello world!") + h = _generate_hs256( + TEST_SECRET, "this is my securely hashed message - hello world!" + ) assert h is not None