Skip to content

[litellm-agent] Staging → litellm_internal_staging (5/7/2026) - #27422

Merged
Sameerlite merged 3 commits into
litellm_internal_stagingfrom
shin_agent_oss_staging_05_07_2026
May 11, 2026
Merged

[litellm-agent] Staging → litellm_internal_staging (5/7/2026)#27422
Sameerlite merged 3 commits into
litellm_internal_stagingfrom
shin_agent_oss_staging_05_07_2026

Conversation

@oss-pr-review-agent-shin

Copy link
Copy Markdown
Contributor

Automated staging PR created by litellm-agent.

This branch collects PRs approved by the agent on 5/7/2026.

Squash-merged by litellm-agent from oss-pr-review-agent-shin[bot]'s PR.
@oss-pr-review-agent-shin

Copy link
Copy Markdown
Contributor Author

@greptile please review

@CLAassistant

CLAassistant commented May 7, 2026

Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you all sign our Contributor License Agreement before we can accept your contribution.
2 out of 3 committers have signed the CLA.

✅ milan-berri
✅ Sameerlite
❌ oss-pr-review-agent-shin[bot]
You have signed the CLA already but the status is still pending? Let us recheck it.

@codecov

codecov Bot commented May 7, 2026

Copy link
Copy Markdown

…26325)

Squash-merged by litellm-agent from milan-berri's PR.
@oss-pr-review-agent-shin

Copy link
Copy Markdown
Contributor Author

@greptile please review

@greptile-apps

greptile-apps Bot commented May 7, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This staging PR aggregates five independent feature/fix branches into litellm_internal_staging. The changes touch OAuth redirect-URI validation (same-origin support for the proxy UI), JWT routing overrides (new scope selector with space-delimited parsing), SSO team-ID consolidation from singular + plural JWT fields, multi-pod guardrail reconciliation with source tracking, a model deployment disambiguation fix in the health endpoint, date-range filtering for /tag/list, and several UI polishes.

  • OAuth / MCP: validate_trusted_redirect_uri replaces the loopback-only guard in the discoverable OAuth proxy endpoints, adding same-origin (proxy's own HTTPS origin) acceptance for the UI callback flow while keeping loopback for native MCP clients.
  • JWT routing: JWTRoutingOverride gains an optional scope selector with space-delimited claim splitting; get_all_jwt_team_ids merges the singular and plural JWT team-ID fields into one deduplicated list for SSO callbacks.
  • Guardrails: InMemoryGuardrailHandler now tracks whether each in-memory entry was loaded from the DB or config, enabling a reconcile_db_guardrails pass that evicts stale DB-backed entries on other pods' deletes.

Confidence Score: 5/5

Safe to merge — all changes are additive or narrowly scoped fixes with no backwards-incompatible behavior changes on existing flows.

The auth changes (same-origin redirect validation, scope routing selector, team-ID consolidation) each extend previously-broken behavior in ways that are strictly more permissive for legitimate callers and no less restrictive for attackers. The guardrail reconciliation is append-only to the registry API and isolated behind the polling tick. The health-endpoint and tag-list changes are pure additions guarded by optional parameters. Every changed path has accompanying mock-only unit tests with good case coverage.

No files require special attention.

Important Files Changed

Filename Overview
litellm/proxy/_experimental/mcp_server/oauth_utils.py Adds get_request_base_url (moved from discoverable_endpoints.py) and new validate_trusted_redirect_uri that accepts same-origin or loopback URIs; edge cases are guarded and fall through to the more-restrictive loopback check.
litellm/proxy/_experimental/mcp_server/discoverable_endpoints.py Migrates get_request_base_url to oauth_utils, adds request: Request parameter to callback and _get_validated_client_redirect_uri, and switches both sinks to validate_trusted_redirect_uri.
litellm/proxy/auth/user_api_key_auth.py Adds scope selector to JWT routing override matching with space-delimited splitting; wildcard patterns on non-scope claims reject whitespace-containing claim strings.
litellm/proxy/auth/handle_jwt.py Adds get_all_jwt_team_ids that merges singular team_id_jwt_field and plural team_ids_jwt_field claims into a deduplicated list, intentionally excluding team_id_default.
litellm/proxy/guardrails/guardrail_registry.py Adds _sources dict for db/config provenance tracking, get_source, and reconcile_db_guardrails that evicts stale DB-backed entries without touching config entries.
litellm/proxy/guardrails/guardrail_endpoints.py List endpoint filters out in-memory entries tagged source='db' (stale); info endpoint 404s stale DB-backed entries instead of returning them as config guardrails.
litellm/proxy/health_endpoints/_health_endpoints.py Prioritizes deployment lookup by model_info.id via get_deployment() before falling back to model_name search, fixing the disambiguation bug for wildcard deployments.
litellm/proxy/management_endpoints/tag_management_endpoints.py Adds optional start_date/end_date query params to /tag/list; validation helper enforces YYYY-MM-DD format, mutual presence, and start <= end.
litellm/proxy/proxy_server.py Adds reconcile_db_guardrails call after the DB polling loop; stale in-memory DB entries are evicted per polling cycle.
litellm/proxy/management_endpoints/ui_sso.py Replaces get_team_ids_from_jwt with get_all_jwt_team_ids in both SSO branches so the singular team_id JWT field is merged into team membership.
litellm/proxy/_types.py Adds optional scope field to JWTRoutingOverride and updates the docstring to clarify wildcard semantics and scope-specific space-delimited tokenization.
ui/litellm-dashboard/src/components/networking.tsx Extends tagListCall with optional startTime/endTime Date parameters and appends start_date/end_date query params to the /tag/list request.
ui/litellm-dashboard/src/components/UsagePage/components/UsagePageView.tsx Refactors tag fetching into a date-range-aware useEffect with cancellation token; re-fetches whenever accessToken, startTime, or endTime changes.
ui/litellm-dashboard/src/components/model_info_view.tsx Forwards model_info.id to the test-connection backend call so the health endpoint can disambiguate wildcard deployments with the same model_name.
ui/litellm-dashboard/src/components/templates/key_info_view.tsx Fixes layout: outer container switches from h-screen to h-full overflow-y-auto; Settings tab Card removes the max-h-[65vh] constraint.

Reviews (2): Last reviewed commit: "fix(auth): harden JWT routing wildcard i..." | Re-trigger Greptile

Comment thread litellm/proxy/auth/user_api_key_auth.py
Comment thread litellm/proxy/auth/handle_jwt.py
Reject fnmatch wildcards on non-scope claims when the claim string contains
whitespace so malformed iss values cannot match patterns like trusted.*.

Merge every entry when team_id_jwt_field resolves to a list instead of
keeping only the first element.

Co-authored-by: Cursor <cursoragent@cursor.com>
@Sameerlite

Copy link
Copy Markdown
Contributor

@greptile please review

@Sameerlite
Sameerlite merged commit 9ed9903 into litellm_internal_staging May 11, 2026
41 checks passed
@Sameerlite
Sameerlite deleted the shin_agent_oss_staging_05_07_2026 branch May 11, 2026 06:28
fzowl pushed a commit to fzowl/litellm that referenced this pull request Jun 24, 2026
…05_07_2026

[litellm-agent] Staging → litellm_internal_staging (5/7/2026)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants