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> |
||
|---|---|---|
| .. | ||
| html_forms | ||
| __init__.py | ||
| test_admin_ui_utils.py | ||
| test_budget_alerts.py | ||
| test_cache_aware_routing.py | ||
| test_cache_codec.py | ||
| test_cache_invalidation_pubsub.py | ||
| test_callback_config_validation.py | ||
| test_callback_lifecycle.py | ||
| test_callback_utils.py | ||
| test_check_batch_cost.py | ||
| test_check_responses_cost.py | ||
| test_codex_catalog_source.py | ||
| test_codex_model_catalog.py | ||
| test_codex_model_translation.py | ||
| test_codex_version.py | ||
| test_config_sync_pubsub.py | ||
| test_credential_hydration.py | ||
| test_custom_openapi_spec.py | ||
| test_customer_usage.py | ||
| test_debug_utils.py | ||
| test_discoverable_model_filter.py | ||
| test_encrypt_decrypt_utils.py | ||
| test_error_body_call_id.py | ||
| test_expired_ui_session_key_cleanup_manager.py | ||
| test_fips.py | ||
| test_get_routes.py | ||
| test_hook_cache.py | ||
| test_http_parsing_utils.py | ||
| test_json_merge_patch.py | ||
| test_key_expiry_alert_manager.py | ||
| test_key_rotation_e2e.py | ||
| test_key_rotation_integration.py | ||
| test_key_rotation_lock.py | ||
| test_key_rotation_manager.py | ||
| test_ldap_directory.py | ||
| test_ldap_sync.py | ||
| test_load_config_utils.py | ||
| test_model_deprecation.py | ||
| test_model_listing_utils.py | ||
| test_openai_endpoint_utils.py | ||
| test_openai_error_payload.py | ||
| test_openapi_route.py | ||
| test_openapi_schema_compat.py | ||
| test_periodic_reload_schedule.py | ||
| test_proxy_encrypt_decrypt.py | ||
| test_proxy_rate_limit_error.py | ||
| test_rbac_utils.py | ||
| test_realtime_cache.py | ||
| test_registry_read_through.py | ||
| test_request_tag_mappings.py | ||
| test_reset_budget_job.py | ||
| test_resource_ownership.py | ||
| test_scheduled_job_stagger.py | ||
| test_semantic_text_index.py | ||
| test_slow_gc_logger.py | ||
| test_sse_keepalive.py | ||
| test_static_asset_utils.py | ||
| test_swagger_utils.py | ||
| test_timezone_utils.py | ||
| test_token_count_log.py | ||
| test_token_count_settings.py | ||
| test_upsert_budget_membership.py | ||
| test_user_api_key_cache.py | ||
| test_validation_error_body.py | ||