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> |
||
|---|---|---|
| .. | ||
| azure_client_usage_test.py | ||
| ban_constant_numbers.py | ||
| ban_copy_deepcopy_kwargs.py | ||
| bedrock_pricing.py | ||
| callback_manager_test.py | ||
| check_data_replace_usage.py | ||
| check_e2e_no_raw_requests.py | ||
| check_endpoint_coverage.py | ||
| check_fastuuid_usage.py | ||
| check_get_model_cost_key_performance.py | ||
| check_guardrail_apply_decorator.py | ||
| check_licenses.py | ||
| check_migrations_lock_timeout.py | ||
| check_migrations_no_data_rewrites.py | ||
| check_no_none_string_error_fields.py | ||
| check_no_publicly_known_master_key.py | ||
| check_prisma_binary_cache.py | ||
| check_provider_folders_documented.py | ||
| check_py310_typing_imports.py | ||
| check_router_constructor_stub.py | ||
| check_spanattributes_value_usage.py | ||
| check_telemetry_imports.py | ||
| check_unbounded_in_lists.py | ||
| check_unsafe_enterprise_import.py | ||
| check_workflow_job_name_collisions.py | ||
| check_workflow_startup_safety.py | ||
| code_qa_check_tests.py | ||
| dependency_license_cache.json | ||
| enforce_llms_folder_style.py | ||
| ensure_async_clients_test.py | ||
| info_log_check.py | ||
| liccheck.ini | ||
| license_cache.json | ||
| litellm_logging_code_coverage.py | ||
| log.txt | ||
| memory_test.py | ||
| prevent_key_leaks_in_exceptions.py | ||
| recursive_detector.py | ||
| router_code_coverage.py | ||
| router_enforce_line_length.py | ||
| router_litellm_globals_check.py | ||
| router_surface_allowlist.json | ||
| router_surface_check.py | ||
| test_aio_http_image_conversion.py | ||
| test_ban_set_verbose.py | ||
| test_chat_completion_imports.py | ||
| test_check_no_none_string_error_fields.py | ||
| test_check_no_publicly_known_master_key.py | ||
| test_e2e_idp_stack.py | ||
| test_e2e_junit_report.py | ||
| test_e2e_metadata.py | ||
| test_generate_provider_endpoints_support.py | ||
| test_merge_smoke.py | ||
| test_no_hardcoded_secrets.py | ||
| test_provider_cache.py | ||
| test_provider_replay_harness.py | ||
| test_proxy_types_import.py | ||
| test_router_strategy_async.py | ||
| test_run_parallel_checks.py | ||
| test_scan_bundled_crypto.py | ||
| test_unit_passed_gate.py | ||
| test_workflow_job_name_collisions.py | ||
| unbounded_in_baseline.txt | ||