fix(utils.py): make sure redis caching works with aws kms encryption

This commit is contained in:
Krrish Dholakia 2024-06-10 16:42:19 -07:00
parent e4dbb9b2db
commit 8f140cb5ee
2 changed files with 4 additions and 1 deletions

View file

@ -56,10 +56,11 @@ router_settings:
litellm_settings: litellm_settings:
success_callback: ["langfuse"] success_callback: ["langfuse"]
cache: True
general_settings: general_settings:
alerting: ["email"] alerting: ["email"]
key_management_system: "aws_kms" key_management_system: "aws_kms"
key_management_settings: key_management_settings:
hosted_keys: ["LITELLM_MASTER_KEY", "DATABASE_URL"] hosted_keys: ["LITELLM_MASTER_KEY", "DATABASE_URL", "REDIS_SSL_URL", "REDIS_HOST", "REDIS_PORT", "REDIS_PASSWORD"]

View file

@ -10263,6 +10263,8 @@ def get_secret(
# Extract and decode the plaintext # Extract and decode the plaintext
plaintext = response["Plaintext"] plaintext = response["Plaintext"]
secret = plaintext.decode("utf-8") secret = plaintext.decode("utf-8")
if isinstance(secret, str):
secret = secret.strip()
elif key_manager == KeyManagementSystem.AWS_SECRET_MANAGER.value: elif key_manager == KeyManagementSystem.AWS_SECRET_MANAGER.value:
try: try:
get_secret_value_response = client.get_secret_value( get_secret_value_response = client.get_secret_value(