litellm/tests/unit/proxy/auth
yucheng-berri b4abb2a27c
fix(proxy)!: compute every HS256/384/512 JWT with the FIPS provider's HMAC service in fips_mode (#50875)
* fix(mcp)!: refuse HMAC JWT algorithms at the MCP client assertion and JWT signer in fips_mode

PyJWT computes HS256/384/512 with hmac.new, which does not use the OpenSSL FIPS provider's HMAC service. With
general_settings.fips_mode on, the MCP client assertion (client_assertion_signing_alg) and the MCP JWT signer's
incoming-token check now accept only RS/PS/ES 256/384/512 and EdDSA. Standard mode is unchanged.

* test(mcp): type the fips_mode JWT algorithm tests and serve the JWKS over HTTP

* fix(mcp)!: compute HS256/384/512 with the FIPS provider's HMAC service in fips_mode

Replaces the fips_mode JWT algorithm allowlist at the MCP client assertion and the MCP JWT signer. PyJWT's
hmac.new builds HMAC outside the provider's MAC service; in fips_mode both sites now use a PyJWT whose HS*
algorithms call hmac.digest, and refuse HMAC keys under 112 bits. EdDSA, ES521 and HS* with adequate keys work
again in fips_mode. Standard mode is unchanged.

* test(mcp): record the fips_mode hmac.digest call with a wrapping mock

* fix(mcp): pass the digest name to hmac.digest so every supported Python takes OpenSSL's one-shot HMAC

* fix(proxy)!: compute every HS256/384/512 JWT with the FIPS provider's HMAC service in fips_mode

fips_mode now swaps HS* on PyJWT's registry for the whole process instead of at the two MCP sites, so the UI
session cookie, onboarding, BYOK, MCP session and Lens tokens take the same route and the same 112-bit key
floor. The Moyai connect code uses the one-shot HMAC in every mode. Standard mode keeps PyJWT's own HMAC.

* fix(proxy): leave PyJWT's registry alone unless fips_mode swaps an algorithm

* test(mcp): mint the short-key token with stock PyJWT so the check under test is the verifier

* fix(proxy): leave the Moyai connect code HMAC as it is on main
2026-12-04 17:03:14 -08:00
..
host fix(proxy): reserve the end user's max budget on master key requests (#56314) 2026-12-04 20:22:00 +00:00
__init__.py ci: move tests/proxy_unit_tests to tests/unit/proxy and run the proxy-db shards from litellm-tests (#42903) 2026-09-24 22:59:11 +00:00
_user_table.py refactor(rust): rename the compiled module _native to _rust (#55198) 2026-12-01 07:08:38 -08:00
conftest.py refactor(rust): rename the compiled module _native to _rust (#55198) 2026-12-01 07:08:38 -08:00
test_access_group_rules.py refactor(auth_cache): type auth cache keys and keep the cache always native (#51130) 2026-11-21 17:20:30 +09:00
test_admin_viewer_handler_access.py test(proxy): move auth, hooks, policy_engine and client tests into tests/unit/proxy (#43998) 2026-10-01 10:11:45 -07:00
test_app_auth.py feat(proxy): add app groups with shared budgets and usage (#53232) 2026-11-21 12:50:58 -08:00
test_auth_checks.py feat(proxy): require customer headers by gateway, team, or key (#53045) 2026-11-21 20:20:26 +00:00
test_auth_checks_object_access_and_lookup.py feat(mcp): read profile grants from caller permissions (#53674) 2026-12-03 23:42:40 -08:00
test_auth_exception_handler.py fix(prometheus): read the proxy failure hook's client ip and user agent from litellm_metadata (#55070) 2026-11-30 11:29:09 +09:00
test_auth_hot_path_network_requests.py refactor(auth_cache): type auth cache keys and keep the cache always native (#51130) 2026-11-21 17:20:30 +09:00
test_auth_object_prefetch.py refactor(rust): rename the compiled module _native to _rust (#55198) 2026-12-01 07:08:38 -08:00
test_auth_utils.py fix(proxy): refuse throttle_on_budget_exceeded inside key metadata for non-admins (#56304) 2026-12-04 19:38:29 +00:00
test_authorization.py fix(proxy): share ownership permissions for spend logs and traces (#44239) 2026-10-03 01:38:54 +00:00
test_banned_params_extra_body.py test(proxy): move auth, hooks, policy_engine and client tests into tests/unit/proxy (#43998) 2026-10-01 10:11:45 -07:00
test_budget_refusal_alert.py fix(alerts): isolate budget delivery by destination (#55641) 2026-12-04 12:33:43 -08:00
test_cli_auth.py test(proxy): move auth, hooks, policy_engine and client tests into tests/unit/proxy (#43998) 2026-10-01 10:11:45 -07:00
test_core.py refactor(rust): rename the compiled module _native to _rust (#55198) 2026-12-01 07:08:38 -08:00
test_custom_auth_end_user_budget.py refactor(auth_cache): type auth cache keys and keep the cache always native (#51130) 2026-11-21 17:20:30 +09:00
test_customer_hierarchy_auth.py feat(proxy): opt-in response headers for app customer org and member budgets per window (#54483) 2026-11-25 13:18:53 -08:00
test_customer_member_auto_create.py fix(proxy): register new customer org aliases one at a time per worker so a burst of first requests is served (#52080) 2026-11-16 14:00:04 -08:00
test_customer_provisioning.py feat(proxy): require customer headers by gateway, team, or key (#53045) 2026-11-21 20:20:26 +00:00
test_customer_spend.py fix(proxy): enforce settled customer budgets across workers (#51568) 2026-11-13 07:33:24 -08:00
test_default_end_user_budget_simple.py refactor(auth_cache): type auth cache keys and keep the cache always native (#51130) 2026-11-21 17:20:30 +09:00
test_denial.py refactor(rust): rename the compiled module _native to _rust (#55198) 2026-12-01 07:08:38 -08:00
test_dpop.py fix(proxy): accept a DPoP proof for the https form of the URL behind a TLS-ending proxy (#56378) 2026-12-04 17:03:10 -08:00
test_fallback_budget.py fix(proxy): enforce model_max_budget set on organizations, tags, and projects (#56069) 2026-12-04 19:08:29 +00:00
test_fallback_model_access.py fix(router): substitute wildcard asterisks once and stop captures at newlines (#55727) 2026-12-02 13:00:18 -08:00
test_fallback_rate_limit.py feat(callbacks-parallel-request-limiter): port parallel request limiter v3 to a rust callback (#51537) 2026-11-16 22:56:38 -08:00
test_fallback_rate_limit_rust.py feat(callbacks-parallel-request-limiter): port parallel request limiter v3 to a rust callback (#51537) 2026-11-16 22:56:38 -08:00
test_impersonation.py feat(proxy)!: let every key read its own spend logs and return 403 for filters outside the caller's scope (#52449) 2026-11-19 03:14:35 +00:00
test_info_routes.py test(proxy): move auth, hooks, policy_engine and client tests into tests/unit/proxy (#43998) 2026-10-01 10:11:45 -07:00
test_jwt.py refactor(rust): rename the compiled module _native to _rust (#55198) 2026-12-01 07:08:38 -08:00
test_legacy_empty_models_check.py Serialize legacy empty model boot counts (#52378) 2026-11-18 04:31:46 +00:00
test_litellm_license.py fix(proxy): stop logging license values during verification (#44956) 2026-10-06 17:05:07 -07:00
test_login_utils.py refactor(auth_cache): type auth cache keys and keep the cache always native (#51130) 2026-11-21 17:20:30 +09:00
test_master_key_boot_check.py ci(unit): cut unit check time with cheaper per-test resets and fewer non-unit tests (#51864) 2026-11-14 15:41:30 -08:00
test_mcp_ip_filtering.py refactor(mcp): drop the experimental label from the MCP server and client paths (#48513) 2026-10-27 17:47:50 +00:00
test_model_access_group_budgets.py refactor(auth_cache): type auth cache keys and keep the cache always native (#51130) 2026-11-21 17:20:30 +09:00
test_model_checks.py fix(proxy): make litellm --test pick a served model, and send the master key only to a local proxy (#53866) 2026-11-24 04:17:02 +00:00
test_model_checks_fallbacks.py refactor(router): route the router family through RoutingContext and close the outside surface (#49118) 2026-10-30 19:18:54 -07:00
test_models_fallback_endpoint.py refactor(router): move router callers onto the entry points and invert the proxy imports (#48847) 2026-10-29 17:26:33 +00:00
test_multi_budget_windows.py feat(proxy): support budget_limits windows on internal users (#51763) 2026-11-14 07:44:35 -05:00
test_multipart_bypass_repro.py ci: move tests/proxy_unit_tests to tests/unit/proxy and run the proxy-db shards from litellm-tests (#42903) 2026-09-24 22:59:11 +00:00
test_network.py test(proxy): move auth, hooks, policy_engine and client tests into tests/unit/proxy (#43998) 2026-10-01 10:11:45 -07:00
test_oauth2_proxy_hook.py test(proxy): move auth, hooks, policy_engine and client tests into tests/unit/proxy (#43998) 2026-10-01 10:11:45 -07:00
test_object_permission_loading.py refactor(auth-store): shape the cached virtual key in Rust and load it through one Python path (#53325) 2026-11-21 22:06:13 +09:00
test_onboarding.py fix(proxy)!: compute every HS256/384/512 JWT with the FIPS provider's HMAC service in fips_mode (#50875) 2026-12-04 17:03:14 -08:00
test_organization_budget_enforcement.py fix(proxy): enforce model_max_budget set on organizations, tags, and projects (#56069) 2026-12-04 19:08:29 +00:00
test_password_hashing.py test(proxy): move auth, hooks, policy_engine and client tests into tests/unit/proxy (#43998) 2026-10-01 10:11:45 -07:00
test_password_policy.py feat(proxy): hash UI passwords with PBKDF2 in FIPS mode (#49874) 2026-11-06 01:31:59 -08:00
test_personal_key_team_model_access.py refactor(auth_cache): type auth cache keys and keep the cache always native (#51130) 2026-11-21 17:20:30 +09:00
test_proxy_routes.py test(realtime): fix three unit tests left red by the GPT-Live attach routes (#53574) 2026-11-22 17:49:14 +00:00
test_rds_iam_token.py fix(proxy): preserve AWS session tokens for RDS IAM auth (#46559) 2026-10-15 22:51:39 +00:00
test_resolvers_exceptions.py fix(auth): return a generic 401 for an unknown key (#39787) 2026-10-15 01:05:25 -07:00
test_resolvers_grants.py refactor(auth_cache): type auth cache keys and keep the cache always native (#51130) 2026-11-21 17:20:30 +09:00
test_resolvers_models.py test(proxy): move auth, hooks, policy_engine and client tests into tests/unit/proxy (#43998) 2026-10-01 10:11:45 -07:00
test_resolvers_seam.py test(proxy): move auth, hooks, policy_engine and client tests into tests/unit/proxy (#43998) 2026-10-01 10:11:45 -07:00
test_resolvers_store.py refactor(auth_cache): type auth cache keys and keep the cache always native (#51130) 2026-11-21 17:20:30 +09:00
test_route_checks.py fix(auth)!: require allowed_passthrough_routes for the /fal_ai pass-through (#56050) 2026-12-04 22:14:13 +00:00
test_router_override_fallback_auth.py refactor(proxy): expose public names for private proxy helpers (#45170) 2026-10-07 18:59:27 -07:00
test_scalar_budget_windows.py feat(db): rust repositories for user, end user and budget auth objects (#52170) 2026-11-18 22:32:05 +00:00
test_search_tool_deny_by_default.py refactor(auth_cache): type auth cache keys and keep the cache always native (#51130) 2026-11-21 17:20:30 +09:00
test_team_grants.py test(proxy): move auth, hooks, policy_engine and client tests into tests/unit/proxy (#43998) 2026-10-01 10:11:45 -07:00
test_team_member_budget.py fix(proxy): cap a temp-increase team member at the temp amount when the team member budget is 0 or null (#55938) 2026-12-03 17:28:10 +00:00
test_unmapped_model_budget_enforcement.py refactor(router): delete the python router core, the rust core is the only core (#50178) 2026-11-05 10:40:46 -08:00
test_user_api_key_auth.py refactor(auth): end every JWT not mapped to a key as its identity (#54098) 2026-11-29 16:44:49 +09:00
test_user_api_key_auth_deployment_profile.py refactor(auth_cache): type auth cache keys and keep the cache always native (#51130) 2026-11-21 17:20:30 +09:00
test_user_api_key_auth_request_flow.py fix(proxy): keep the caller's trace id in failure callbacks for keys rate limited before the body is read (#56285) 2026-12-04 11:26:03 -08:00
test_vector_store_access_groups.py refactor(auth_cache): type auth cache keys and keep the cache always native (#51130) 2026-11-21 17:20:30 +09:00