litellm/tests/test_litellm/proxy/management_helpers
yucheng-berriai f2d7cb152a refactor(proxy): type object_permission dict with ObjectPermissionDict
Replace bare Optional[dict] on the object_permission validator surfaces with
a typed TypedDict mirror of LiteLLM_ObjectPermissionBase. The TypedDict shape
matches the Pydantic model field-for-field and supports .get() and item
assignment, so the mutation in _rewrite_object_permission_mcp_identifiers
continues to work at runtime (TypedDict is a plain dict).

Propagated through the surfaces this PR touches: _object_permission_to_dict,
_validate_mcp_servers_for_key_update, validate_key_mcp_servers_against_team,
validate_key_search_tools_against_team, validate_key_vector_stores_against
_team, the five _extract_requested_* helpers, and the two
_rewrite_object_permission_mcp_* mutators. attach_object_permission_to_dict,
handle_update_object_permission_common, and _set_object_permission keep
their wider dict typing because they handle the full key/team data_json,
which is a superset of ObjectPermissionDict and pre-dates this PR.

No behavior change. 373 tests pass; ruff strict + type discipline gates
green.
2026-06-27 19:47:14 -07:00
..
test_audit_log_callbacks.py decouple S3 audit-log config via s3_audit_callback_params 2026-05-05 13:23:32 -07:00
test_management_helpers_utils.py fix(team): persist budget_duration on /team/member_add member budgets (#31443) 2026-06-26 12:59:30 -07:00
test_object_permission_utils.py refactor(proxy): type object_permission dict with ObjectPermissionDict 2026-06-27 19:47:14 -07:00
test_team_member_permission_checks.py fix(proxy): reject team-scoped object_permission on personal keys for non-admins 2026-06-27 19:47:14 -07:00