litellm/tests/unit/llms/custom_httpx
yucheng-berri a9562ecfe2
feat(proxy)!: require a LITELLM_SALT_KEY of at least 112 bits to start in fips_mode (#52099)
* feat(proxy)!: refuse to start in fips_mode without a hex salt key

With general_settings.fips_mode on, the proxy now refuses to start unless
the key it encrypts stored secrets with (LITELLM_SALT_KEY, or the master
key when LITELLM_SALT_KEY is not set) is at least 32 bytes of hex. The
fips_mode key derivations already need that shape, so a deployment with
any other key used to boot and then fail on its first secret write.

The hex pattern moves to fips.py so the boot gate and the KBKDF helper
share one definition. Standard mode is unchanged.

* feat(proxy)!: refuse fips_mode salt keys under 112 bits instead of non-hex keys

The fips_mode boot gate, derive_key_from_salt_key and their tests now share
key_derivation_key: a salt key of 32+ bytes of hex (optionally sk-) is decoded
as before, any other key is taken as its UTF-8 bytes, and a key under 14 bytes
is refused. The refusal names the master key when LITELLM_SALT_KEY is not set.

* fix(proxy): keep the raw salt key out of the frames that raise fips_mode refusals

derive_key_from_salt_key no longer binds LITELLM_SALT_KEY to a local before
refusing it, and enforce_fips_mode now takes get_salt_key instead of the key
itself, so only fips_mode_refusal sees the key and it returns before the raise.
An error reporter that captures frame locals can no longer pick up the key from
a refused boot or a refused key derivation.

* feat(proxy)!: derive fips_mode keys from the salt key's own bytes, without decoding hex

fips_mode is only for new deployments, so there is no derived key to keep
byte-identical with main. key_derivation_key now always takes the UTF-8 bytes
of the salt key and only enforces the 112-bit floor.

* feat(proxy)!: require LITELLM_SALT_KEY to start in fips_mode

The master key no longer stands in for a missing salt key. It also signs UI
session tokens, and NIST SP 800-108r1 section 5 says a key-derivation key is
used for nothing else. enforce_fips_mode and fips_mode_refusal go back to
main's one-argument signatures and read LITELLM_SALT_KEY themselves.
2026-11-17 12:58:59 -08:00
..
__init__.py test: move tests/test_litellm/llms into tests/unit/llms (#43191) 2026-09-25 12:43:23 -07:00
test_aiohttp_cleanup_closed.py refactor(llms): expose public names for private provider helpers (#45037) 2026-10-07 08:49:25 -07:00
test_aiohttp_handler.py fix(http): diagnose aiohttp connection pool saturation (#49499) 2026-10-31 16:12:30 -07:00
test_aiohttp_so_keepalive.py refactor(llms): expose public names for private provider helpers (#45037) 2026-10-07 08:49:25 -07:00
test_aiohttp_transport.py fix(aiohttp): reset the upstream connection when a stream closes early, so aborted Bedrock Invoke streams stop (#50657) 2026-11-14 12:08:03 -05:00
test_asgi_handler.py test: move tests/test_litellm/llms into tests/unit/llms (#43191) 2026-09-25 12:43:23 -07:00
test_async_client_cleanup.py test: move 76 live top-level tests to offline unit and integration coverage (#45352) 2026-10-08 10:33:35 -07:00
test_container_handler.py test: catch regressions in the validation lines #44798 added (#47420) 2026-10-20 01:06:37 +00:00
test_credential_leak_prevention.py test: move tests/test_litellm/llms into tests/unit/llms (#43191) 2026-09-25 12:43:23 -07:00
test_gemini_session_leak.py test(unit): stop test modules from putting their own directory on sys.path (#43421) 2026-09-28 12:20:20 -07:00
test_http2_connection_spread.py feat(vertex_ai)!: use HTTP/2 httpx client for search_api vector store (#40631) 2026-10-29 10:31:18 -07:00
test_http_handler.py feat(proxy)!: require a LITELLM_SALT_KEY of at least 112 bits to start in fips_mode (#52099) 2026-11-17 12:58:59 -08:00
test_llm_http_handler.py feat(tts)!: stream audio from the provider as it arrives on /v1/audio/speech (#46222) 2026-11-17 15:03:12 +00:00
test_mock_transport.py test: move tests/test_litellm/llms into tests/unit/llms (#43191) 2026-09-25 12:43:23 -07:00
test_sse_lines.py fix(streaming): keep merged think tags balanced and split SSE lines only on CR/LF (#48755) 2026-10-28 17:00:29 -07:00