litellm/tests/test_litellm/proxy/auth
Ishaan Jaff 2ea9e207bd
Litellm ishaan march 20 (#24303)
* feat(redis): add circuit breaker to RedisCache to fast-fail when Redis is down (#24181)

* feat(redis): add circuit breaker env var constants

* feat(redis): add RedisCircuitBreaker and apply guard decorator to all async ops

* fix(dual_cache): fall back to L1 instead of re-raising on Redis increment failures

* test(caching): add circuit breaker unit tests

* fix(redis): fast-fail concurrent HALF_OPEN probes — only one probe at a time

* fix(dual_cache): return None fallback when in_memory_cache is absent and Redis fails

* test(caching): add regression tests for HALF_OPEN concurrency and None fallback

* Fix blocking sync next in __anext__ (#24177)

* Fix blocking sync next

* Update tests/test_litellm/litellm_core_utils/test_streaming_handler.py

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* fix PEP 479 regression in __anext__ sync iterator exhaustion

asyncio.to_thread re-raises thread exceptions inside a coroutine, where
PEP 479 converts StopIteration to RuntimeError before any except clause
can catch it. Add _next_sync_or_exhausted() module-level helper that
catches StopIteration in the thread and returns a sentinel instead, then
raise StopAsyncIteration in the coroutine.

Also rewrites the non-blocking test to use asyncio.gather() instead of
asyncio.create_task() (which returned None on Python 3.9 / pytest-asyncio
in CI), and adds an exhaustion regression test that drains the wrapper
fully and asserts no RuntimeError leaks out.

---------

Co-authored-by: Emerson Gomes <emerson.gomes@thalesgroup.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* feat: add git-subdir source type to claude-code/plugins API (#24223)

Support a third plugin source type `git-subdir` alongside the existing
`github` and `url` types, as documented in the official Claude Code
plugin marketplaces spec.

New format: {"source": "git-subdir", "url": "...", "path": "subdir/path"}

- Validates url and path fields are present and non-empty
- Rejects absolute paths, '..' segments, backslashes, and percent-encoded
  traversal sequences (including double-encoded variants via regex check)
- Extracts path validation into _validate_git_subdir_path() helper
- Updates Pydantic field description to document all three source types
- Adds isValidUrl() check for url/git-subdir source types in the UI form
- Adds "Git Subdir" option to the UI form with a required Path field
- Adds unit tests covering success, update, missing/empty fields,
  path traversal variants, and unknown source type

Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>

* [FEAT] add extract_header and extract_footer to Mistral OCR supported params (#24213)

* docs: add git-subdir source type to claude-code plugin marketplace docs (#24289)

* fix(ui): swap J/K keyboard navigation in log details drawer (#24279) (#24286)

J should navigate down (next) and K should navigate up (previous),
matching vim/standard conventions.

* fix: use async_set_cache in user_api_key_auth hot path (#24302)

* fix: use async_set_cache in auth hot path to avoid blocking event loop

* test: assert no blocking set_cache call in _user_api_key_auth_builder

* test: broaden blocking call check to all sync DualCache methods

* test: fix regression test to actually catch blocking cache calls

* fix: ruff lint unused variable + UI build MessageManager error

- litellm/caching/redis_cache.py: remove unused variable 'e' in circuit
  breaker exception handler (F841)
- add_plugin_form.tsx: use MessageManager.error() instead of undefined
  message.error() for git URL validation

Co-authored-by: Ishaan Jaff <ishaan-jaff@users.noreply.github.com>

* docs: add REDIS_CIRCUIT_BREAKER env vars to config_settings reference

Add REDIS_CIRCUIT_BREAKER_FAILURE_THRESHOLD and
REDIS_CIRCUIT_BREAKER_RECOVERY_TIMEOUT to the environment variables
reference table so test_env_keys.py passes.

Co-authored-by: Ishaan Jaff <ishaan-jaff@users.noreply.github.com>

---------

Co-authored-by: Emerson Gomes <emerson.gomes@thalesgroup.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Vincenzo Barrea <manamana88@users.noreply.github.com>
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-authored-by: Robert Kirscht <rkirscht242@gmail.com>
Co-authored-by: Imgyu Kim <kimimgo@gmail.com>
Co-authored-by: Cursor Agent <cursoragent@cursor.com>
Co-authored-by: Ishaan Jaff <ishaan-jaff@users.noreply.github.com>
2026-03-21 12:40:11 -07:00
..
test_auth_checks.py feat(proxy): include user_email in jwt upsert user creation (#22915) 2026-03-05 10:55:11 -08:00
test_auth_exception_handler.py Litellm fix GitHub action testing (#11163) 2025-05-26 14:41:42 -07:00
test_auth_hot_path_network_requests.py fix: update docker test file to right path 2026-02-19 18:44:28 +05:30
test_auth_utils.py fix: guard empty-dict team limits and malformed int in deployment default limits 2026-03-19 07:40:47 -04:00
test_cli_auth.py Fix team cli auth flow (#19666) 2026-01-28 08:52:52 -08:00
test_custom_auth_end_user_budget.py fix(proxy): make common_checks opt-in for custom auth via custom_auth_run_common_checks 2026-03-03 22:50:34 +05:30
test_handle_jwt.py fix: apply same AsyncMock pattern to remaining OIDC discovery test 2026-03-03 19:56:51 -03:00
test_info_routes.py test: add unit tests for /v2/user/info endpoint and route checks 2026-03-12 07:46:31 +00:00
test_litellm_license.py Show remaining users on UI (#11568) 2025-06-09 22:04:45 -07:00
test_login_utils.py remove key blocking 2026-01-31 16:46:17 -08:00
test_mcp_ip_filtering.py Return Clear error message why no tools are available / IP Filtering occured 2026-02-26 09:56:44 +05:30
test_model_checks.py Reapply "feat: add model_cost aliases expansion support" 2026-03-12 13:36:57 -03:00
test_model_checks_fallbacks.py feat: extended /v1/models endpoint, now it returns with fallbacks on demand (#12811) 2025-07-22 23:16:46 -07:00
test_object_permission_loading.py Fix:test_get_key_object_loads_object_permission 2026-02-18 19:18:15 +05:30
test_onboarding.py fix(onboarding): prevent invite link reuse for password reset 2026-02-28 17:39:03 -08:00
test_organization_budget_enforcement.py Fix/organization max budget not enforced (#17334) 2025-12-02 22:46:03 -08:00
test_route_checks.py Allow proxy_admin_viewer to access audit log endpoints 2026-03-11 20:07:51 -07:00
test_team_member_budget.py 3[Fix] CI/CD - logging_testing (#18204) 2025-12-18 10:52:24 -08:00
test_user_api_key_auth.py Litellm ishaan march 20 (#24303) 2026-03-21 12:40:11 -07:00