mirror of
https://github.com/BerriAI/litellm.git
synced 2026-08-28 05:25:59 +00:00
`ProxyConfig.get_config()` walked the parsed config and replaced every `os.environ/<KEY>` string with `get_secret(value)` before anything initialized the secret manager, so a key held only by the manager resolved to `None` and that `None` was written back into the config. The later fallback in `load_config` could not recover it, because the key now existed with a `None` value. Hoist the initialization into `get_config()`, ahead of the resolution pass, so every entrypoint gets it: the CLI already did this itself, but the microservice entrypoints (`gateway/main.py`, `backend/main.py`) uvicorn the app directly and bypass the CLI. `load_config`'s own call is now redundant and is dropped, so startup builds the manager once instead of building one and discarding it. `get_config()` also runs on management-endpoint request paths, so this returns early once a manager exists rather than rebuilding the client per request. Also warn when a reference the manager would have been asked for resolves to `None`. The reporter had no log line at all to work from. `get_secret` only reaches the manager when reads are enabled and the name is in `hosted_keys`, so `secret_manager_would_be_consulted` mirrors that gate and keeps the warning off env-only references, which are expected rather than an error. |
||
|---|---|---|
| .. | ||
| test_aws_secret_manager_replication.py | ||
| test_aws_secret_manager_rotation.py | ||
| test_aws_secret_manager_v2.py | ||
| test_base_secret_manager.py | ||
| test_custom_secret_manager.py | ||
| test_get_azure_ad_token_provider.py | ||
| test_secret_managers_main.py | ||