Repository navigation
fix(gateway): treat archived key metadata as absent - #362
Merged
Merged
Conversation
Recognize LiteLLM deletion archives returned with HTTP 200 without treating their old model or budget fields as current key evidence. Preserve active and not-found handling, fail explicitly on malformed deletion metadata, and keep archive retention and cache policy unchanged. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Treat LiteLLM key metadata with a non-null
deleted_atas an absent key.The management API can return HTTP 200 for a deletion archive even when the
live key list is empty and requests using that key are rejected. Reading that
archive as a current key could incorrectly reuse its old model/budget evidence.
Decode the optional deletion timestamp with its actual type, retain the existing
active/404 behavior, and surface malformed deletion metadata as an error. Add
focused HTTP-client tests and document the distinction between archives and
the separate per-replica authentication cache window.
Related issue
Discovered during the authorized AKS validation associated with #354. This is
an independent Gateway API compatibility repair against
main; no separateissue is needed for the already requested validation-and-repair work.
Validation
Offline checks used Go 1.27.3, the pinned local toolchain, an empty kubeconfig,
and
USE_EXISTING_CLUSTER=false.Authorized live protocol observation: exact synthetic Agent aliases had zero
live keys and one archived key with a deletion timestamp after ordinary Agent
deletion. The old key-use probes returned HTTP 401 while
/key/infostillreturned HTTP 200. No live credentials, identifiers, responses or diagnostic
bundle are attached.
Compatibility and operational impact
No CRD, configuration, dependency, grant, retention, or timeout change. Older
responses that omit
deleted_atand active responses withdeleted_at: nullkeep their existing behavior. Archived records remain available for accounting;
the client does not delete or mutate them. This does not claim to eliminate
the Gateway's documented replica cache propagation window.
Checklist