mirror of
https://github.com/BerriAI/litellm.git
synced 2026-11-30 01:08:33 +00:00
* feat(proxy): synchronize LDAP groups to teams * chore(ui): regenerate LDAP sync API types * fix(proxy): stop LDAP reads when sync jobs time out * refactor(proxy): validate LDAP startup boundaries * refactor(proxy): use a read-only team defaults type * refactor(proxy): preserve team defaults validation behavior * fix(proxy): skip only the LDAP group with a deleted member entry Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> * fix(proxy): harden LDAP snapshots, TLS, and team defaults * fix(proxy): hide LDAP credentials in validation errors * fix(ldap): accept only user members, guard emptied teams, stop between teams on timeout - Member entries must carry a person object class; nested groups of any class skip their group - A group resolving to no LiteLLM users no longer empties a populated team unless allow_empty_groups is set - The run timeout cancels only the directory read; writes stop between teams instead of mid-transaction - Revert the post-commit cache-eviction shield to the plain await used by other key-deletion paths * fix(ldap): require interval_minutes >= 5 so the job lock outlasts a run The lease is interval - 1s and a run can exceed its time budget by one roster transaction (60s timeout), so sub-2-minute intervals let a second replica start while the first is still writing. * perf(ldap): resolve each member once per directory snapshot Users in many groups were looked up once per group; the load test made 2000 lookups for 494 distinct users at 100 groups. Results, including missing-entry errors, are reused within a snapshot only. * refactor(ldap): validate sync settings once and type the job initializer - ldap_sync_settings() validates general_settings.ldap_sync once; both startup sites use it instead of peeking at the raw dict - initialize_ldap_sync takes the validated settings, a typed scheduler Protocol and a non-optional PrismaClient - Drop the runtime scheduler isinstance check and the unreachable database check * fix(ldap): release the job lock when a run finishes; cover configurable match fields - Release cronjob_lock:ldap_team_sync in finally, matching key rotation and budget reset, so a restart right after a run (dry_run -> apply) syncs immediately - Tests: lock held during a run blocks other workers, released after success and failure - Tests: entryUUID/description group attributes, uid user_match_attribute, uniqueMember/roleOccupant, and an end-to-end uid -> sso_user_id sync * fix(ldap): let the job lock expire so one replica syncs per interval Matches the spend capture rate check: the lease (interval - 1s) is not released, so replicas firing later in the interval skip. A restart within the interval applies config changes at the next interval; documented. * fix(ldap): no team write after the run budget; skip validating disabled blocks - Check the run budget after user and team lookups, before any team write, so a slow read never starts a write past the budget (spend log cleanup precedent) - Read only enabled before validating ldap_sync, so a disabled block cannot fail startup - Drop a comment that restated the code * fix(ldap): freeze the enabled-flag settings model * refactor(ldap): build the member lookup map once instead of mutating it Fixes the type discipline gate (LIT001 mutable dict parameter, LIT011 parameter mutation). Lookups and their order are unchanged. * test(ldap): drive time-budget tests with a controlled loop clock and mark test locals Final Replace the real asyncio.sleep calls in the two time-budget tests with a loop clock the stubs skip forward, so worker speed cannot change the outcome (tests/unit/AGENTS.md). Annotate single-assignment locals in the new LDAP tests, and the PR-added ones in test_team_roster_sync.py, with Final (LIT010). * docs(ldap): drop root docs/ldap_sync.md; LDAP sync docs live in litellm-docs main removed the repo-root docs/ directory (#50992), and re-adding it pushes the root past the root-entry-limit check. * test(proxy): fix LDAP sync lint and CI fixtures * test(proxy): exercise LDAP sync at service boundaries --------- Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> |
||
|---|---|---|
| .. | ||
| __init__.py | ||
| team_metadata_validator_impls.py | ||
| test_access_group_key_sync.py | ||
| test_access_group_model_sync.py | ||
| test_access_group_team_sync.py | ||
| test_app_groups.py | ||
| test_apps.py | ||
| test_audit_log_callbacks.py | ||
| test_audit_logs_proxy.py | ||
| test_auto_router_availability.py | ||
| test_auto_router_permissions.py | ||
| test_bulk_user_creation.py | ||
| test_bulk_user_deletion.py | ||
| test_customer_budget_usage.py | ||
| test_customer_hierarchy.py | ||
| test_management_helpers_utils.py | ||
| test_object_permission_utils.py | ||
| test_resource_display_names.py | ||
| test_team_list_sorting.py | ||
| test_team_member_permission_checks.py | ||
| test_team_metadata_validation.py | ||
| test_team_roster_sync.py | ||
| test_user_list_sorting.py | ||