fix(encryption): resolve SECRET_KEY lazily to fix silent re-encrypt-secrets failures (#37982)

This commit is contained in:
Ujjwaljain16
2026-02-21 03:40:09 +05:30
committed by GitHub
parent 6f34ba7d4a
commit 2d44f52ad1
2 changed files with 76 additions and 2 deletions

View File

@@ -54,7 +54,7 @@ class SQLAlchemyUtilsAdapter( # pylint: disable=too-few-public-methods
**kwargs: Optional[dict[str, Any]],
) -> TypeDecorator:
if app_config:
return EncryptedType(*args, app_config["SECRET_KEY"], **kwargs)
return EncryptedType(*args, lambda: app_config["SECRET_KEY"], **kwargs)
raise Exception( # pylint: disable=broad-exception-raised
"Missing app_config kwarg"