mirror of
https://github.com/tiennm99/litellm.git
synced 2026-07-15 18:21:44 +00:00
Substring matching for user_id and key_alias on /key/list is now gated by caller role (admin only) rather than by whether user_id was auto-set. This closes the gap where a non-admin explicitly passing their own user_id still got contains-based filtering, which could surface keys belonging to other users with overlapping IDs. Adds three unit tests covering the substring, exact-match, and default code paths in _build_key_filter_conditions. Restores the existing member-team test to assert exact matching as a security regression guard.
In total litellm runs 1000+ tests
[02/20/2025] Update:
To make it easier to contribute and map what behavior is tested,
we've started mapping the litellm directory in tests/test_litellm
This folder can only run mock tests.