From 02a0dc1480754f12c3244d4ce866bb3fe9af4ba0 Mon Sep 17 00:00:00 2001 From: Yuneng Jiang Date: Tue, 29 Sep 2026 15:34:34 -0700 Subject: [PATCH] chore(lint): scope a TRY004 suppression to the bearer-token salt key check This line's ruff strict budget has no headroom for the one TRY004 the backport adds; the raise reports missing configuration, not a bad type. --- litellm/proxy/common_utils/encrypt_decrypt_utils.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/litellm/proxy/common_utils/encrypt_decrypt_utils.py b/litellm/proxy/common_utils/encrypt_decrypt_utils.py index 6b4b7a14721..0219c406032 100644 --- a/litellm/proxy/common_utils/encrypt_decrypt_utils.py +++ b/litellm/proxy/common_utils/encrypt_decrypt_utils.py @@ -105,7 +105,7 @@ def encrypt_bearer_token(value: str, prefix: str) -> str: """AES-256-GCM as unpadded base64url behind ``prefix``, which is also the AAD so a token can't change kind.""" salt_key: Final = _get_salt_key() if not isinstance(salt_key, str): - raise ValueError("Set LITELLM_SALT_KEY or a master key to mint bearer tokens") + raise ValueError("Set LITELLM_SALT_KEY or a master key to mint bearer tokens") # noqa: TRY004 # missing config, not a bad argument type sealed: Final = _seal_aes_gcm(value=value, signing_key=salt_key, aad=prefix.encode("utf-8")) return prefix + base64.urlsafe_b64encode(sealed).decode("ascii").rstrip("=")