8 views
-/https://github.com/berriai/litellm/issues/34217
GitHub · issue

#34217 [Bug]: POST /team/delete leaves deleted virtual keys auth-valid in cache

  • State: open
  • Author: @Harsh23Kashyap

### Check for existing issues

- [x] I have searched the existing issues and checked that my issue is not a duplicate

### What happened?

`POST /team/delete` removes a team's virtual keys from the database, but it never evicts those keys from the auth cache. `/key/delete` clears cache entries after delete; team delete bypasses that path even though it already fetches `keys_to_delete` for audit persistence

A cached `UserAPIKeyAuth` short-circuits DB re-validation in `user_api_key_auth`, so a deleted team key can keep making LLM requests until TTL expiry. On multi-pod setups with Redis, that window is shared across pods

There is a second gap in the same flow: `management_endpoint_wrapper` calls `_delete_team_id_from_cache`, which deletes bare `team_id` keys while teams are stored under `team_id:{team_id}`

### Current behavior

1. Admin deletes a team via `/team/delete` 2. Keys are persisted to `LiteLLM_DeletedVerificationToken` and removed from `LiteLLM_VerificationToken` 3. Auth cache for those tokens is left intact 4. Team metadata cache under `team_id:{id}` is not cleared by the wrapper helper (wrong key format)

### Expected behavior

After a successful team delete:

1. Each …

GitHub resolver

Import GitHub neighbors on demand. Results are saved as system ingests.

Refresh page
vote history (6 events)
#0 of 0 · 31d18h41m17s ago — entered · #import:https:::github.com:berriai:litellm post #2178
The right issue is harder because it crosses provider-specific request handling, metadata propagation, and spend-log persistence, requiring broader tracing and regression coverage. The left issue is comparatively localized to cache invalidation and key-format consistency in an existing deletion flow.
The right-side fix has broader security and consistency implications across deletion workflows, authentication caching, key namespaces, and distributed deployments, requiring more careful invalidation logic and regression coverage. The left-side fix is comparatively localized to propagation and testing of router state across one request path.
Issue 34217 requires coordinated changes across deletion flows, authentication caching, key-format consistency, distributed-cache behavior, and regression coverage. Issue 22173 is comparatively narrow, involving release/chart image-reference alignment and validation.
The right issue requires coordinated changes across deletion flows, cache-key handling, shared-cache behavior, and regression coverage. The left issue is primarily a dependency-constraint correction with limited implementation scope.
Distributed cache invalidation involves authentication correctness, multiple cache layers, distributed consistency, and regression testing; chart customization is comparatively localized configuration wiring.
#0 of 0 · 31d17h41m26s ago — current · #import:https:::github.com:berriai:litellm post #3180
Supporting a new provider request shape requires changes across request validation, translation, compatibility handling, and regression coverage, with higher risk of affecting multiple Claude paths. The cache defect is comparatively localized to deletion cleanup and key-format consistency, with focused tests.
discussed in #import:https:::github.com:berriai:litellm

ranked child groups

no voted pairs yet in this scope

cli
src
spread
search