litellm/tests/integration/security
Mateo Wang 9007e0fa70
fix(files)!: scope provider and model file lists to the caller's managed files under require_managed_files (#47682)
* test(files): cover owner-scoped file listing under require_managed_files

* fix(files): list only the caller's managed files on every list route under require_managed_files

* fix(files): narrow owner-scoped managed file lists to the named provider or model and page with after_id and before_id

* fix(files): narrow scoped lists the way uploads route, and refuse lists that cannot be scoped

A model name now matches every deployment that serves it, wildcards and
aliases included, and a provider matches deployments by the provider
uploads resolve, so anthropic/* and unprefixed Claude models count. The
OpenAI and Azure lists also return the caller's pass-through uploads.
An unknown provider and different after and after_id cursors answer 400,
and a list with no matching deployment skips the database read.

* fix(files): match stored files by model name and keep flag-off lists as on main

Under require_managed_files, a narrowed list now matches a file's model
mappings by deployment id or model name, so files LiteLLM stores in its own
database show on their model and provider lists. The Anthropic list defaults
to 20 rows when no limit is sent, after_id, before_id and the cursor 400s
apply only under the flag, and an admin keeps the provider list when the
managed files hook is not loaded. List errors are returned as values and
mapped to HTTP errors in one place.

* fix(files): keep admin provider lists and index the owner-scoped walk

Under require_managed_files, an admin keeps the provider list as on main, and
only a non-admin list reads the caller's own and team managed files. A stored
file now also shows on the provider its model name routes to through a
wildcard, with exact model names first, and a list routed to a model takes the
default page size of the provider serving it. A new index on created_by and
created_at keeps each chunk of the walk an index read, and the model check
runs before the file object is parsed.

* fix(files): filter provider and model lists in the query

A non-admin list scoped to a provider or model now asks Postgres only for the
caller's rows that map to one of that scope's deployments or models, or that
live in file storage, instead of reading every owned row and filtering them in
Python. A caller with many files on other providers no longer waits for the
whole set to be read. Team members' files are matched in the same query.

* test(files): type the fake raw query in the files list tests

* refactor(proxy): list managed files through one typed database handle

* fix(files): list alias and routing-group storage uploads on their provider
2026-10-28 13:42:22 -07:00
..
_callback_traffic.py test(integration): callback credential canary slots C1-C3 and D5 (#43630) 2026-09-29 10:49:30 -07:00
_canary.py test(integration): sweep proxy logs, metrics, a Datadog intake and the Logs drawer for credential canaries (#43306) 2026-09-29 17:57:28 +00:00
_sinks.py test(integration): give each owned proxy a private database and Redis by default (#47213) 2026-10-18 03:37:41 +00:00
_sweeps.py perf(ci): isolate and shard integration suites (#44146) 2026-10-10 11:15:19 -07:00
test_air_gapped_boot.py test: migrate local_testing SDK and provider tests out of build_and_test (#45760) 2026-10-10 23:14:25 +00:00
test_api_key_secret_reference.py fix(secret_managers)!: resolve oidc/file and oidc/env refs in admin-configured api_key per request (#47341) 2026-10-20 01:43:59 +00:00
test_callback_credentials.py test(integration): callback credential canary slots C1-C3 and D5 (#43630) 2026-09-29 10:49:30 -07:00
test_config_deployment_key.py test(integration): credential canary suite harness (#43300) 2026-09-28 16:12:08 -07:00
test_config_overrides.py test(integration): cover config_utils endpoint contracts (#44737) 2026-10-14 07:00:23 +00:00
test_container_ownership.py test(integration): cover videos_containers endpoint contracts (#44691) 2026-10-14 03:49:01 +00:00
test_datadog_sink.py test(integration): sweep proxy logs, metrics, a Datadog intake and the Logs drawer for credential canaries (#43306) 2026-09-29 17:57:28 +00:00
test_files_batches_access.py test(files): audit #40621 (#48788) 2026-10-28 04:13:03 -07:00
test_fine_tuning_managed_ids.py fix(managed_files): send provider file ids when creating a fine-tuning job from managed files (#46552) 2026-10-19 14:40:15 -07:00
test_hide_secrets_tool_compatibility.py fix(guardrails)!: redact secrets in tool traffic and system prompts (#47122) 2026-10-27 18:11:03 -07:00
test_hide_secrets_tool_traffic.py fix(guardrails)!: redact secrets in tool traffic and system prompts (#47122) 2026-10-27 18:11:03 -07:00
test_managed_file_listing.py fix(files)!: scope provider and model file lists to the caller's managed files under require_managed_files (#47682) 2026-10-28 13:42:22 -07:00
test_master_key_not_in_db.py test: migrate proxy security, schema migration and MCP legacy tests (#45937) 2026-10-11 16:17:24 -07:00
test_mcp_slots.py test(integration): credential canary slots for MCP and pass-through credentials (#43308) 2026-09-28 17:10:51 -07:00
test_metrics_text.py test(integration): sweep proxy logs, metrics, a Datadog intake and the Logs drawer for credential canaries (#43306) 2026-09-29 17:57:28 +00:00
test_offline_mode.py feat(proxy): add LITELLM_OFFLINE_MODE, one switch for the fetches LiteLLM makes on its own (#48096) 2026-10-23 16:54:19 -07:00
test_passthrough_slots.py test: move routing, caching and callback tests out of local_testing (#45761) 2026-10-10 09:33:09 -07:00
test_proxy_logs.py test(integration): sweep proxy logs, metrics, a Datadog intake and the Logs drawer for credential canaries (#43306) 2026-09-29 17:57:28 +00:00
test_request_path_slots.py test(integration): request-path credential canary slots D1-D4 (#43307) 2026-09-29 10:52:13 -07:00
test_stored_config_slots.py test(integration): cover guardrails_policies endpoint contracts (#44722) 2026-10-14 04:07:26 +00:00
test_sweep_sensitivity.py feat(ui): source Home What's new from day 0 support blog posts (#46260) 2026-10-13 13:11:59 -07:00