From 591b752b6dcc5640f289f58603908abc2e2c5b19 Mon Sep 17 00:00:00 2001 From: yucheng Date: Thu, 8 Oct 2026 02:10:06 +0000 Subject: [PATCH] refactor(proxy): drop routine docstrings from encryption helpers Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> --- litellm/proxy/common_utils/credential_hydration.py | 2 -- litellm/proxy/common_utils/encrypt_decrypt_utils.py | 3 --- 2 files changed, 5 deletions(-) diff --git a/litellm/proxy/common_utils/credential_hydration.py b/litellm/proxy/common_utils/credential_hydration.py index 7f4819b49fb..a1c6ea906b7 100644 --- a/litellm/proxy/common_utils/credential_hydration.py +++ b/litellm/proxy/common_utils/credential_hydration.py @@ -68,13 +68,11 @@ def decrypted_or_stored(key: str, value: str) -> str | None: def decrypted_values(values: Mapping[str, str]) -> Mapping[str, str]: - """``values`` with every entry decrypted, plaintext entries kept, and unreadable legacy entries dropped.""" resolved: Final = {key: decrypted_or_stored(key, value) for key, value in values.items()} return MappingProxyType({key: value for key, value in resolved.items() if value is not None}) def _decrypted(db_credential: CredentialItem) -> CredentialItem: - """The stored credential with every value decrypted, leaving already-plaintext values alone.""" return CredentialItem( credential_name=db_credential.credential_name, credential_values=decrypted_values(db_credential.credential_values), # pyright: ignore[reportArgumentType] # declared dict[str, str], and pydantic copies this mapping into one on validation; LIT002 rules out building that dict here diff --git a/litellm/proxy/common_utils/encrypt_decrypt_utils.py b/litellm/proxy/common_utils/encrypt_decrypt_utils.py index 66e09159de4..1c31a8da9c4 100644 --- a/litellm/proxy/common_utils/encrypt_decrypt_utils.py +++ b/litellm/proxy/common_utils/encrypt_decrypt_utils.py @@ -270,9 +270,6 @@ def legacy_unreadable(value: object) -> bool: def decrypt_for_rewrite(value: str, key: str) -> str | None: - """Decrypt a value a config writer submitted for storage: ciphertext read back from the store or a first-write - plaintext. Without PyNaCl an unprefixed value cannot be told apart from plaintext, so it is kept as submitted - instead of being dropped.""" if legacy_unreadable(value): return value return decrypt_value_helper(value=value, key=key, return_original_value=True)