litellm/litellm-rust/crates
yujonglee 677205b3f5
fix(proxy): share ownership permissions for spend logs and traces (#44239)
* refactor(proxy): extract shared spend log read policy

* test(proxy): use named bindings for spend scope regression

* test(proxy): reuse existing spend log query harness

* test(proxy): cover spend log permission lookup adoption

* chore(proxy): relocate existing spend query baseline

* refactor(proxy): make scope query returns explicit

* refactor(proxy): inject deferred log permission lookup

* test(proxy): cover teamless management compatibility lookup

* refactor(proxy): compose user and team log grants

* refactor(proxy): share generic authorization composition

* refactor(proxy): compose trace read permissions

* refactor(proxy): centralize spend and trace authorization

* refactor(proxy): strengthen spend and trace scope types

* refactor(proxy): flatten log read scope into owned logs

Replace the AnyOf grant tree with a flat OwnedLogs(user_id, team_ids) scope,
and OwnedTraces(logs, api_key_hash) for traces, since every consumer flattened
the tree back into that shape.

A caller with no user id now gets an empty scope instead of matching ownerless
rows through Prisma's IS NULL. The dead request_id guard in ui_view_spend_logs
is removed, and the management facets inject the log team lookup and reuse
read_scope_sql instead of the list shim.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* test(proxy): run spend scope tests through one SQLite emulator

Replace the string-matching payload emulator and the hand-rolled Prisma where
interpreter with one SQLite helper that runs the real scope SQL. Session scope
tests now go through the endpoint, including the no-user caller that must not
match ownerless rows. Drop duplicated lookup-failure and trace mapping cases.

load_permitted_log_team_ids returns no teams without a database instead of
relying on the resolver's broad except.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* fix(proxy): unify log and trace ownership permissions

* test(tracing): align fixtures with ownership read scopes

* refactor(tracing): align query scopes with row ownership

* refactor(spend): make ownership SQL predicates explicit

* test(spend): validate ownership SQL against PostgreSQL

* docs(traces): drop key-row visibility from query help guide

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>

* test(spend): reach the empty-memberships branch in team lookup test

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>

* chore(ui): regenerate dashboard API types

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-10-03 01:38:54 +00:00
..
auth
auth-aws
auth-azure
auth-gcp
auth-types refactor(rust): centralize host execution and compose callbacks (#43515) 2026-09-28 19:20:27 +00:00
cache
cache-azure-blob feat: improve trace ingestion and trace details (#43975) 2026-10-01 13:45:33 -07:00
cache-disk
cache-gcs feat: improve trace ingestion and trace details (#43975) 2026-10-01 13:45:33 -07:00
cache-memory
cache-qdrant-semantic
cache-redis
cache-redis-semantic
cache-response feat: improve trace ingestion and trace details (#43975) 2026-10-01 13:45:33 -07:00
cache-s3 feat: improve trace ingestion and trace details (#43975) 2026-10-01 13:45:33 -07:00
cache-testing
cache-valkey-semantic
callbacks-legacy-python refactor(rust): add shared llms wire type derives (#43730) 2026-09-29 09:19:33 -07:00
config fix(tracing): unify ClickHouse storage configuration (#43941) 2026-10-02 16:31:26 +00:00
core feat: improve trace ingestion and trace details (#43975) 2026-10-01 13:45:33 -07:00
core-utils refactor(rust): add shared llms wire type derives (#43730) 2026-09-29 09:19:33 -07:00
coroutine
cost fix(cost_calculator): bill ultrafast prompts above 272k at the ultrafast long-context rates (#43764) 2026-09-30 07:32:16 -07:00
db
db-testing
framer
gateway feat(rust): add the MCP gateway (#43470) 2026-09-27 19:37:41 -07:00
gateway-auth feat(rust): add the MCP gateway (#43470) 2026-09-27 19:37:41 -07:00
gateway-inference feat: improve trace ingestion and trace details (#43975) 2026-10-01 13:45:33 -07:00
gateway-management
gateway-mcp feat(rust): add the MCP gateway (#43470) 2026-09-27 19:37:41 -07:00
gateway-ui feat(ui): adopt the new LiteLLM logo and monogram (#43913) 2026-09-30 14:51:06 -07:00
host feat(cache): select Rust caching through explicit cache objects (#43601) 2026-09-29 00:01:44 +00:00
host-http refactor(rust): centralize host execution and compose callbacks (#43515) 2026-09-28 19:20:27 +00:00
host-native feat(cache): select Rust caching through explicit cache objects (#43601) 2026-09-29 00:01:44 +00:00
host-python feat: improve trace ingestion and trace details (#43975) 2026-10-01 13:45:33 -07:00
http feat(rust): add the MCP gateway (#43470) 2026-09-27 19:37:41 -07:00
litellm
llms refactor(rust): add shared llms wire type derives (#43730) 2026-09-29 09:19:33 -07:00
llms-types refactor(rust): add shared llms wire type derives (#43730) 2026-09-29 09:19:33 -07:00
migrate feat(rust): embed migration folders with a shared migrate! macro (#44104) 2026-10-01 17:52:54 -07:00
migrate-macros feat(rust): embed migration folders with a shared migrate! macro (#44104) 2026-10-01 17:52:54 -07:00
model-catalog chore(cost-map): add openai gpt-6-astra ultrafast tier prices from the pricing page (#43745) 2026-09-29 19:05:57 +00:00
python-bridge feat(traces): type queries and align read access with log visibility (#44228) 2026-10-02 21:55:42 +00:00
python-compat
router
secrets feat: improve trace ingestion and trace details (#43975) 2026-10-01 13:45:33 -07:00
secrets-aws feat: improve trace ingestion and trace details (#43975) 2026-10-01 13:45:33 -07:00
secrets-azure feat: improve trace ingestion and trace details (#43975) 2026-10-01 13:45:33 -07:00
secrets-cyberark feat: improve trace ingestion and trace details (#43975) 2026-10-01 13:45:33 -07:00
secrets-google feat: improve trace ingestion and trace details (#43975) 2026-10-01 13:45:33 -07:00
secrets-hashicorp feat: improve trace ingestion and trace details (#43975) 2026-10-01 13:45:33 -07:00
secrets-types
storage-clickhouse refactor(traces): type the ClickHouse query help response (#44285) 2026-10-02 18:01:27 -07:00
testkit
token-counter refactor(rust): add shared llms wire type derives (#43730) 2026-09-29 09:19:33 -07:00
token-counter-fast
token-counter-huggingface
token-counter-tiktoken
traces fix(proxy): share ownership permissions for spend logs and traces (#44239) 2026-10-03 01:38:54 +00:00
traces-clickhouse fix(proxy): share ownership permissions for spend logs and traces (#44239) 2026-10-03 01:38:54 +00:00
tracing