litellm/litellm-rust/crates/secrets/PARITY.md
yuneng-jiang 7248fd8328
chore: backport CI fixes, #43206 and Rust changes to rc/1.104.0 (#43338)
* feat(model-catalog): add Rust registry validation (#43136)

* doc

* feat(model-catalog): add Rust registry validation

* test(model-catalog): ignore integration tests

* docs(model-catalog): fix validation note grammar

---------

Co-authored-by: Yujong Lee <yujong@berri.ai>
(cherry picked from commit c289d5d6fb)

* test(rust): reorganize core crate tests and split cache and OCR suites (#43177)

* test(rust): group cache tests under cache/ and fold test_ocr.py into ocr/

The two failure cases in test_ocr.py duplicated the upstream-500 and timeout rows
of PUBLIC_FAILURES, so only the file-input encoding case moves to ocr/test_requests.py

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

* test(rust): split the response cache suite into one file per backend

test_response_cache.py grew to 2400 lines. Each backend now has its own file, shared
fixtures live in cache/conftest.py and shared helpers in support/cache.py. The helpers
alias the private native test handles once, dropping the per-call reportPrivateUsage hits

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

* split tokenizer test

* test(core): consolidate route integration tests under tests/ with rstest and wiremock

Moves the public-API OCR route tests out of src/ocr/route.rs and document.rs into
tests/ocr/, split per provider plus lifecycle, machine, and document tests, merging
the duplicated pairs. Messages, audio transcription, and chat completions share one
wiremock-based upstream and recording secret source in tests/support, and gain
table-driven cases for auth, routing, upstream errors, streaming, and declines.
Tests of litellm-llms items move to that crate.

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

* test(messages): keep the stream relay test independent of the stream head contents

The stream head carries no headers on main, so the relay test asserts the
open-then-deliver order and the relayed body instead of header hand-off.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>

---------

Co-authored-by: Yujong Lee <yujong@berri.ai>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
(cherry picked from commit 10413796c6)

* feat(rust): hand upstream response headers to the native Messages stream (#43178)

* ci: drop the ocr_testing job now that tests/ocr_tests is gone

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

* test(ocr): restore the live OCR matrix and the ocr_testing job

The public litellm.ocr / aocr / Router interface is unchanged by the Rust
migration, so the live provider matrix still applies. Drops the stale VCR skip
list for the deleted test_rust_bridge.py.

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

* test(messages): show streamed upstream headers never reach the native stream

The Python handler puts the upstream response headers on the stream's
_hidden_params before the first chunk so the proxy can forward them as
llm_provider-* headers. The native route drops them, and this test fails
on the Rust path while passing on Python.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>

* feat(messages): hand upstream response headers to the native stream before its first chunk

The Messages route fills MessagesStreamHead from the upstream response and
yields it on Open. The Python driver converts it through the protocol host
and hands it to Stream and SyncStream as their _hidden_params, so a
streamed native call carries additional_headers the same way the Python
handler does and the proxy can forward them as llm_provider-* headers.

The relay contract lives in the core crate test, the hand-off in the
host-python driver test, and the header projection in the route host test,
so the recording-server test that showed the gap is dropped.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>

* wip

---------

Co-authored-by: Yujong Lee <yujong@berri.ai>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
(cherry picked from commit 081f73f021)

* feat(testkit): agent clients for Claude Code, Codex and opencode (#43181)

* feat(testkit): install and configure Claude Code, Codex and opencode against a gateway

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>

* refactor(testkit): derive targets from target-lexicon and split agents behind a trait

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>

* refactor(testkit): group sources into agent and install folders

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>

* feat(testkit): split agents into install, configure and drive with semver-aware launch

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>

* style(testkit): drop a needless borrow

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>

---------

Co-authored-by: Yujong Lee <yujong@berri.ai>
Co-authored-by: Claude Sonnet 5 <noreply@anthropic.com>
(cherry picked from commit 9c10e0f985)

* ci: run migrated unit selections on every event in legacy GHA shards (#43182)

* ci: run the unit_selection.sh shard files on every event instead of only fork pull requests

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

* ci: rename fork-flag to unit-flag now that it applies on every event

---------

Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
(cherry picked from commit 694783ebbe)

* test: move tests/test_litellm root and small trees into tests/unit (#43186)

* ci: run the unit_selection.sh shard files on every event instead of only fork pull requests

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

* ci: rename fork-flag to unit-flag now that it applies on every event

* test: move tests/test_litellm root and small trees into tests/unit

Pure renames, no content changes. Follow-up commits in this PR fix
references, merge the three files that already existed in tests/unit,
keep live-provider tests in tests/test_litellm and wire CI.

* test: carry tests/test_litellm conftest isolation into tests/unit

Callback lists, routing fallbacks, cached HTTP clients, logger state, AWS,
proxy-URL and keychain env, and session-end client cleanup now reset for
unit tests too. The environment isolation owns its MonkeyPatch so a test's
own monkeypatch is undone before the model-cost teardown runs.

* test: merge, split and prune the moved root and small-tree tests

Merge batches/test_batch_utils.py and the chat_completions and messages
dispatch tests into the files that already existed in tests/unit. Keep
the live Gemini interactions tests, the async image-fetch format test and
the OpenAI embedding scorer test in tests/test_litellm since they need
real network or keys. Put test_router.py under tests/unit/test_router so
the existing package no longer shadows it. Delete eight tests the audit
found superseded by stronger ones kept in this move.

* ci: run the moved root and small-tree tests under their legacy flags

Add the misc and responses-caching-types flags to unit_selection.sh and
CircleCI, extend enterprise-routing and mcp-integration, and point the
legacy GHA shards, Makefile, redis-compat workflow, merge smoke manifest
and change classifier at the new paths.

* test: make the new tests/unit directories packages

tests/unit/test_package_layout.py requires every directory to carry an
__init__.py, and without one the moved and retained
test_litellm_responses_bridge.py modules collide on import.

* test: scope the unit socket block to tests/unit in shared sessions

The GHA shards collect the legacy test-path and the unit selection in one
pytest session. The unit conftest's loopback-only block leaked into legacy
modules that reach the network at import. The legacy conftest now lifts the
restriction at collect and setup time, and the unit conftest re-applies it
when collecting its own modules.

* test: give the shard-script tests their own GITHUB_OUTPUT

They only passed where the runner set it. The CircleCI unit job's env
allowlist drops it, so the script's redirect failed there.

* test: point the router and module-deletion checks at tests/unit

router_code_coverage and code_qa_check_tests only searched tests/test_litellm,
so the moved router tests no longer counted. The two silent-experiment tests
the audit deleted were the only direct callers of those methods; they are
replaced with tests that assert the forwarded shadow request and the
recursion guard.

---------

Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
(cherry picked from commit f6882246d4)

* refactor(framer): replace Framer trait with tokio-util codecs (#43193)

* refactor(framer): replace Framer trait with tokio-util codecs

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

* refactor(framer): port SSE and AWS event stream framing to codecs

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

* fix(rust): drop clone on Copy capabilities in messages request test

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

* fix(rust): use field init shorthand in messages request test

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

---------

Co-authored-by: Yujong Lee <yujong@berri.ai>
Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
(cherry picked from commit 3c93ea1697)

* test: move tests/test_litellm/llms into tests/unit/llms (#43191)

* ci: run the unit_selection.sh shard files on every event instead of only fork pull requests

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

* ci: rename fork-flag to unit-flag now that it applies on every event

* test: move tests/test_litellm root and small trees into tests/unit

Pure renames, no content changes. Follow-up commits in this PR fix
references, merge the three files that already existed in tests/unit,
keep live-provider tests in tests/test_litellm and wire CI.

* test: carry tests/test_litellm conftest isolation into tests/unit

Callback lists, routing fallbacks, cached HTTP clients, logger state, AWS,
proxy-URL and keychain env, and session-end client cleanup now reset for
unit tests too. The environment isolation owns its MonkeyPatch so a test's
own monkeypatch is undone before the model-cost teardown runs.

* test: merge, split and prune the moved root and small-tree tests

Merge batches/test_batch_utils.py and the chat_completions and messages
dispatch tests into the files that already existed in tests/unit. Keep
the live Gemini interactions tests, the async image-fetch format test and
the OpenAI embedding scorer test in tests/test_litellm since they need
real network or keys. Put test_router.py under tests/unit/test_router so
the existing package no longer shadows it. Delete eight tests the audit
found superseded by stronger ones kept in this move.

* ci: run the moved root and small-tree tests under their legacy flags

Add the misc and responses-caching-types flags to unit_selection.sh and
CircleCI, extend enterprise-routing and mcp-integration, and point the
legacy GHA shards, Makefile, redis-compat workflow, merge smoke manifest
and change classifier at the new paths.

* test: make the new tests/unit directories packages

tests/unit/test_package_layout.py requires every directory to carry an
__init__.py, and without one the moved and retained
test_litellm_responses_bridge.py modules collide on import.

* test: scope the unit socket block to tests/unit in shared sessions

The GHA shards collect the legacy test-path and the unit selection in one
pytest session. The unit conftest's loopback-only block leaked into legacy
modules that reach the network at import. The legacy conftest now lifts the
restriction at collect and setup time, and the unit conftest re-applies it
when collecting its own modules.

* test: move tests/test_litellm/llms into tests/unit/llms

Rename-only. Moves the provider tests and the fine-tuning fixtures they
load, mirroring the old paths. Follow-up commits merge, split and wire them.

* test: merge, split and prune the moved llms tests

Merges the Databricks chat transformation tests into the existing unit
file, keeps the tests that need real keys or the network in
tests/test_litellm, deletes the audited tests a stronger unit test
already covers, and points imports at tests.unit.llms.

* ci: run the moved llms tests under their legacy flags

The Vertex AI and All Other Providers shards keep their legacy test-path
for the retained files and add the llm-vertex-ai and llm-other-providers
unit selections. CircleCI gets matching unit jobs.

* test: make the tests/unit/llms directories packages

Adds __init__.py to the moved dirs and drops the legacy ones whose
directories no longer hold tests.

* test: drop script runners and path hacks the llms split left dangling

The __main__ runners in the split openai_like files and the Databricks e2e
runner called tests that now live in the other half of the split or were
deleted. The retained legacy halves also no longer need sys.path edits.

* test: give the shard-script tests their own GITHUB_OUTPUT

They only passed where the runner set it. The CircleCI unit job's env
allowlist drops it, so the script's redirect failed there.

* test: point the router and module-deletion checks at tests/unit

router_code_coverage and code_qa_check_tests only searched tests/test_litellm,
so the moved router tests no longer counted. The two silent-experiment tests
the audit deleted were the only direct callers of those methods; they are
replaced with tests that assert the forwarded shadow request and the
recursion guard.

* test: keep the Databricks manual e2e runner and fix the SageMaker Nova run path

The Databricks e2e file is a manual script whose main() calls the tests
that were pruned, so pruning them broke the documented run. It is back to
its main version. The SageMaker Nova docstring now points at the file's
real location in tests/local_testing.

* test: keep the job's UNIT_FLAG out of the shard-script tests

---------

Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
(cherry picked from commit 5e6dc89ba1)

* test: move tests/test_litellm integrations and secret_managers into tests/unit (#43194)

* ci: run the unit_selection.sh shard files on every event instead of only fork pull requests

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

* ci: rename fork-flag to unit-flag now that it applies on every event

* test: move tests/test_litellm root and small trees into tests/unit

Pure renames, no content changes. Follow-up commits in this PR fix
references, merge the three files that already existed in tests/unit,
keep live-provider tests in tests/test_litellm and wire CI.

* test: carry tests/test_litellm conftest isolation into tests/unit

Callback lists, routing fallbacks, cached HTTP clients, logger state, AWS,
proxy-URL and keychain env, and session-end client cleanup now reset for
unit tests too. The environment isolation owns its MonkeyPatch so a test's
own monkeypatch is undone before the model-cost teardown runs.

* test: merge, split and prune the moved root and small-tree tests

Merge batches/test_batch_utils.py and the chat_completions and messages
dispatch tests into the files that already existed in tests/unit. Keep
the live Gemini interactions tests, the async image-fetch format test and
the OpenAI embedding scorer test in tests/test_litellm since they need
real network or keys. Put test_router.py under tests/unit/test_router so
the existing package no longer shadows it. Delete eight tests the audit
found superseded by stronger ones kept in this move.

* ci: run the moved root and small-tree tests under their legacy flags

Add the misc and responses-caching-types flags to unit_selection.sh and
CircleCI, extend enterprise-routing and mcp-integration, and point the
legacy GHA shards, Makefile, redis-compat workflow, merge smoke manifest
and change classifier at the new paths.

* test: make the new tests/unit directories packages

tests/unit/test_package_layout.py requires every directory to carry an
__init__.py, and without one the moved and retained
test_litellm_responses_bridge.py modules collide on import.

* test: scope the unit socket block to tests/unit in shared sessions

The GHA shards collect the legacy test-path and the unit selection in one
pytest session. The unit conftest's loopback-only block leaked into legacy
modules that reach the network at import. The legacy conftest now lifts the
restriction at collect and setup time, and the unit conftest re-applies it
when collecting its own modules.

* test: move tests/test_litellm/llms into tests/unit/llms

Rename-only. Moves the provider tests and the fine-tuning fixtures they
load, mirroring the old paths. Follow-up commits merge, split and wire them.

* test: merge, split and prune the moved llms tests

Merges the Databricks chat transformation tests into the existing unit
file, keeps the tests that need real keys or the network in
tests/test_litellm, deletes the audited tests a stronger unit test
already covers, and points imports at tests.unit.llms.

* ci: run the moved llms tests under their legacy flags

The Vertex AI and All Other Providers shards keep their legacy test-path
for the retained files and add the llm-vertex-ai and llm-other-providers
unit selections. CircleCI gets matching unit jobs.

* test: make the tests/unit/llms directories packages

Adds __init__.py to the moved dirs and drops the legacy ones whose
directories no longer hold tests.

* test: drop script runners and path hacks the llms split left dangling

The __main__ runners in the split openai_like files and the Databricks e2e
runner called tests that now live in the other half of the split or were
deleted. The retained legacy halves also no longer need sys.path edits.

* test: give the shard-script tests their own GITHUB_OUTPUT

They only passed where the runner set it. The CircleCI unit job's env
allowlist drops it, so the script's redirect failed there.

* test: point the router and module-deletion checks at tests/unit

router_code_coverage and code_qa_check_tests only searched tests/test_litellm,
so the moved router tests no longer counted. The two silent-experiment tests
the audit deleted were the only direct callers of those methods; they are
replaced with tests that assert the forwarded shadow request and the
recursion guard.

* test: move tests/test_litellm integrations and secret_managers into tests/unit

Rename-only. Mirrors the old paths, including the directory conftests
and the prompt and JSON fixtures. Follow-up commits prune and wire them.

* test: prune and repoint the moved integrations tests

Deletes the 7 audited tests a stronger test in the same tree already
covers, imports the TLS sink helpers from their new conftest path, and
restores os.environ after each integrations test. Some presets write
OTEL_EXPORTER_OTLP_HEADERS straight into os.environ, and without the
legacy tree's test ordering that header leaked into the AgentOps tests.

* ci: run the moved integrations tests under their legacy flag

The integrations GHA shard and a new CircleCI job run the integrations
unit selection. secret_managers joins the misc selection.

* docs: point integrations and secret_managers references at tests/unit

* test: make the moved integrations directories packages

* test: keep the Databricks manual e2e runner and fix the SageMaker Nova run path

The Databricks e2e file is a manual script whose main() calls the tests
that were pruned, so pruning them broke the documented run. It is back to
its main version. The SageMaker Nova docstring now points at the file's
real location in tests/local_testing.

* test: keep the job's UNIT_FLAG out of the shard-script tests

---------

Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
(cherry picked from commit cf491d1df9)

* fix(tests): drop the repeated UNIT_FLAG key in test_unit_shard_missing_paths (#43212)

Co-authored-by: mateo-berri <277851410+mateo-berri@users.noreply.github.com>
(cherry picked from commit 25de1ab2b0)

* fix(jwt): let x-litellm-team-id select DB membership teams when the token also carries a team claim (#43206)

* fix(jwt): let x-litellm-team-id select DB membership teams when the token also carries a team claim

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

* docs(jwt): describe header team selection under fallback_to_db_teams

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

---------

Co-authored-by: yassin <yassin@berri.ai>
Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
(cherry picked from commit 7b4fd47c6e)

* test: move tests/test_litellm core utils, routing, responses, caching and rust_bridge into tests/unit (#43199)

* ci: run the unit_selection.sh shard files on every event instead of only fork pull requests

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

* ci: rename fork-flag to unit-flag now that it applies on every event

* test: move tests/test_litellm root and small trees into tests/unit

Pure renames, no content changes. Follow-up commits in this PR fix
references, merge the three files that already existed in tests/unit,
keep live-provider tests in tests/test_litellm and wire CI.

* test: carry tests/test_litellm conftest isolation into tests/unit

Callback lists, routing fallbacks, cached HTTP clients, logger state, AWS,
proxy-URL and keychain env, and session-end client cleanup now reset for
unit tests too. The environment isolation owns its MonkeyPatch so a test's
own monkeypatch is undone before the model-cost teardown runs.

* test: merge, split and prune the moved root and small-tree tests

Merge batches/test_batch_utils.py and the chat_completions and messages
dispatch tests into the files that already existed in tests/unit. Keep
the live Gemini interactions tests, the async image-fetch format test and
the OpenAI embedding scorer test in tests/test_litellm since they need
real network or keys. Put test_router.py under tests/unit/test_router so
the existing package no longer shadows it. Delete eight tests the audit
found superseded by stronger ones kept in this move.

* ci: run the moved root and small-tree tests under their legacy flags

Add the misc and responses-caching-types flags to unit_selection.sh and
CircleCI, extend enterprise-routing and mcp-integration, and point the
legacy GHA shards, Makefile, redis-compat workflow, merge smoke manifest
and change classifier at the new paths.

* test: make the new tests/unit directories packages

tests/unit/test_package_layout.py requires every directory to carry an
__init__.py, and without one the moved and retained
test_litellm_responses_bridge.py modules collide on import.

* test: scope the unit socket block to tests/unit in shared sessions

The GHA shards collect the legacy test-path and the unit selection in one
pytest session. The unit conftest's loopback-only block leaked into legacy
modules that reach the network at import. The legacy conftest now lifts the
restriction at collect and setup time, and the unit conftest re-applies it
when collecting its own modules.

* test: move tests/test_litellm/llms into tests/unit/llms

Rename-only. Moves the provider tests and the fine-tuning fixtures they
load, mirroring the old paths. Follow-up commits merge, split and wire them.

* test: merge, split and prune the moved llms tests

Merges the Databricks chat transformation tests into the existing unit
file, keeps the tests that need real keys or the network in
tests/test_litellm, deletes the audited tests a stronger unit test
already covers, and points imports at tests.unit.llms.

* ci: run the moved llms tests under their legacy flags

The Vertex AI and All Other Providers shards keep their legacy test-path
for the retained files and add the llm-vertex-ai and llm-other-providers
unit selections. CircleCI gets matching unit jobs.

* test: make the tests/unit/llms directories packages

Adds __init__.py to the moved dirs and drops the legacy ones whose
directories no longer hold tests.

* test: drop script runners and path hacks the llms split left dangling

The __main__ runners in the split openai_like files and the Databricks e2e
runner called tests that now live in the other half of the split or were
deleted. The retained legacy halves also no longer need sys.path edits.

* test: give the shard-script tests their own GITHUB_OUTPUT

They only passed where the runner set it. The CircleCI unit job's env
allowlist drops it, so the script's redirect failed there.

* test: point the router and module-deletion checks at tests/unit

router_code_coverage and code_qa_check_tests only searched tests/test_litellm,
so the moved router tests no longer counted. The two silent-experiment tests
the audit deleted were the only direct callers of those methods; they are
replaced with tests that assert the forwarded shadow request and the
recursion guard.

* test: move tests/test_litellm integrations and secret_managers into tests/unit

Rename-only. Mirrors the old paths, including the directory conftests
and the prompt and JSON fixtures. Follow-up commits prune and wire them.

* test: prune and repoint the moved integrations tests

Deletes the 7 audited tests a stronger test in the same tree already
covers, imports the TLS sink helpers from their new conftest path, and
restores os.environ after each integrations test. Some presets write
OTEL_EXPORTER_OTLP_HEADERS straight into os.environ, and without the
legacy tree's test ordering that header leaked into the AgentOps tests.

* ci: run the moved integrations tests under their legacy flag

The integrations GHA shard and a new CircleCI job run the integrations
unit selection. secret_managers joins the misc selection.

* docs: point integrations and secret_managers references at tests/unit

* test: make the moved integrations directories packages

* test: keep the Databricks manual e2e runner and fix the SageMaker Nova run path

The Databricks e2e file is a manual script whose main() calls the tests
that were pruned, so pruning them broke the documented run. It is back to
its main version. The SageMaker Nova docstring now points at the file's
real location in tests/local_testing.

* test: move tests/test_litellm core utils, routing, responses, caching and rust_bridge into tests/unit

Rename-only. Mirrors the old paths, including fixtures, the stubtest config
and the native-route wheel script. Two files that collide with existing unit
files are merged in a follow-up commit.

* test: merge, prune and repoint the moved core, routing, responses, caching and rust_bridge tests

Merges the two files that collided with existing unit files, folding the
legacy extra case into test_is_chat_completion_cached_dict, and deletes the
9 audited tests a stronger test in the same file already covers.

Keeps what needs the network in tests/test_litellm: test_tokenizers pulls a
tokenizer from the Hugging Face hub, and the gpt2 and r50k_base tokenizer
cases download their BPE files. The unit core_utils conftest points
TIKTOKEN_CACHE_DIR at litellm's bundled encodings so the rest never depend on
import order to stay offline, and FakeSecretVault moves to a shared module
so both trees can build it.

* ci: run the moved core, routing, responses, caching and rust_bridge tests under their flags

core_utils gets a core-utils flag and CircleCI job, and its GHA shard keeps
the legacy path for the retained network tests. router_utils and
router_strategy join enterprise-routing, responses joins
responses-caching-types (minus responses/mcp, which mcp-integration owns),
caching joins caching-local and rust_bridge joins misc. The redis-compat,
test-rust, stubtest and merge-smoke paths follow the move.

* docs: point the Rust crate references at tests/unit

* test: make the moved core, routing and rust_bridge directories packages

* test: keep the no-loop DualCache batch_get_cache regression test

It runs the sync path outside any event loop, which the inside-loop test
cannot, so a change that picks the Redis client by loop state would only
show up there.

* test: keep the job's UNIT_FLAG out of the shard-script tests

* fix(url_utils): block 192.0.0.0/24 on every Python patch release

* test: move the new budget limiter tests into tests/unit/router_strategy

* test: move the new sentry scrubbing tests into tests/unit/litellm_core_utils

* test: move the new zerobus tests into tests/unit/integrations

* test: make tests/unit/integrations/zerobus a package

* test: load litellm's own tiktoken cache setup once instead of resetting it per test

---------

Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
(cherry picked from commit a11a93f44a)

* refactor(rust): move credential inheritance and the SDK limits out of the legacy callback crate into a driver preflight (#43259)

The legacy callback crate carried two rewrites that have nothing to do with the
Logging contract: litellm_credential_name inheritance and the max_budget and
num_retries_per_request checks. Any later callback host would need them
unchanged, which is the smell the crate's AGENTS.md now names. They are now a
Preflight the driver in litellm-host-python runs on the keyword view begin
returned, before the host projects from it, supplied by python-bridge and passed
through run_legacy_call. The call order is unchanged (setup, deployment hook,
credentials, limits) and a rejection still fails the call as a host failure, so
the failure callbacks run as before. The preflight rewrites the adapter's own
copy in place, so no extra dict copy and no new lifecycle method

Co-authored-by: Yujong Lee <yujong@berri.ai>
Co-authored-by: Claude Fable 5.1 <noreply@anthropic.com>
(cherry picked from commit e9491d31b5)

* refactor(http): hand out an owned Client and route all providers through the pool (#43245)

* refactor(messages): take the provider client from the injected HTTP pool

The messages route kept its own process-wide reqwest client, so it ignored
ssl_verify, CA bundles, client certs, proxies and every other setting that
litellm-http resolves. The machine now takes the HttpClientPool and the
call's HttpClientConfig, as OCR does, and the bridge passes its shared pool.

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

* refactor(http): hand out an owned Client and move chat, audio and OIDC onto the pool

HttpClientPool now returns litellm_http::Client, a newtype only crates/http
can build, so every provider client carries the resolved TLS, proxy and
timeout settings. Chat completions and audio transcription drop their
process-wide reqwest clients and take the pool and call config like
messages; their 600s ceiling moves to the request. OidcResolver takes its
client instead of building one, and the bridge hands it the pooled one.

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

* refactor(secrets): build Google, Azure and CyberArk manager clients from the pool

The native secret managers built bare reqwest clients, so they ignored the
host's TLS and proxy settings. load_native_manager now takes the pool and
the host config and hands each manager a pooled client.

CyberArk's CYBERARK_SSL_VERIFY and CYBERARK_CLIENT_CERT/KEY become an
override on the host config instead of a hand-built client. To express a
certificate and key in separate files, HttpClientConfig::client_certificate
is now a ClientIdentity that is either one PEM or a split pair.

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

* chore(clippy): only crates/http may build a reqwest client

Fence reqwest::Client, ClientBuilder and the TLS builder methods with
disallowed-types and disallowed-methods so new code takes a
litellm_http::Client from the pool. crates/http is exempt as the one place
clients are built, and testkit as a dev-only installer. Tests move to
litellm_http::Client::plain_for_test or a pooled client.

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

* fix(secrets-cyberark): keep verifying certificates when the host disables it

Python hands CyberArk its own ssl_verify, which wins over the global
setting, so CYBERARK_SSL_VERIFY unset or true still verifies even when the
host sets ssl_verify false. The pooled client copied the host's Disabled
and would send the API key unverified; fall back to the built-in roots
instead.

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

* fix(python-bridge): treat a missing litellm package as no host HTTP settings

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

---------

Co-authored-by: Yujong Lee <yujong@berri.ai>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
(cherry picked from commit 1a58162630)

* refactor(rust): promote anthropic messages out of experimental_pass_through (#43269)

Co-authored-by: Yujong Lee <yujong@berri.ai>
(cherry picked from commit 2ef3250ec3)

* test: stop CI tests from downloading tokenizer files and images (#43257)

* test: load the embedding base image from a committed 100x100 PNG instead of downloading it

* test: move the volcengine embedding test into tests/unit

* test: check gpt2 and r50k_base tokenizer parity against committed tiktoken reference files

* test: check hub tokenizer selection against an in-memory Hugging Face hub

* test: serve image URLs from respx in the gemini tool-result and format-param tests

* ci: drop the emptied legacy core-utils test path

* test: cover the cohere and anthropic tokenizer paths in the hub tokenizer test

* test: fetch every format-param image through respx and check its bytes reach the request

* test: drop the gpt2 and r50k_base parity tests, which no litellm path uses

* test: drop comments that restate assertions in the format-param test

(cherry picked from commit 2530255624)

* fix(rust): preserve nested optional import failures (#43265)

* fix(rust): preserve nested optional import failures

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

* test(rust): restore Python modules after settings tests

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

---------

Co-authored-by: Yujong Lee <yujong@berri.ai>
Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
(cherry picked from commit e1a9378093)

* fix(callbacks-legacy-python): traverse and release the retained headers dict (#43274)

* fix(callbacks-legacy-python): traverse and release the retained headers dict

LegacyLogging keeps the headers dict it hands to pre_call and post_call, but
its traverse never reported that edge to the collector and close never dropped
it. A cycle a callback builds through that dict could not be collected, and a
closed call kept the dict alive until the driver dropped the whole adapter.
Visit and clear headers like body, with regression tests for both

* refactor(callbacks-legacy-python): move the test support module into its own file

---------

Co-authored-by: Yujong Lee <yujong@berri.ai>
(cherry picked from commit 4eb340abe0)

* test(integration): port langfuse callbacks-in-db coverage to the local harness (#43282)

* test(integration): port langfuse callbacks-in-db coverage to the local harness

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

* test(integration): assert the langfuse db rows after the exported span

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

---------

Co-authored-by: yuneng <yuneng@berri.ai>
Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
(cherry picked from commit e11c3f5815)

* test: finish the non-proxy half of tests/test_litellm (#43281)

* test: move key-gated tests/test_litellm SDK tests into tests/llm_translation and drop empty folders

* test: make token counter and health check unit tests run offline

* ci: point unit shards, rust path filter, Makefile and docs at tests/unit

* docs: fix stale test_litellm run paths in moved llm_translation tests

* fix: correct databricks e2e sys.path depth and contributing example path

---------

Co-authored-by: yuneng <yuneng@berri.ai>
Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
(cherry picked from commit 99655b6f86)

* refactor(rust): prepare inference and auth foundations for the gateway (#43287)

* refactor(rust): prepare inference and auth foundations

* fix(rust): keep textract operations parsing from kebab-case model names

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

---------

Co-authored-by: Yujong Lee <yujong@berri.ai>
Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
(cherry picked from commit 7ae721bf79)

* feat(rust): add config router and gateway crates (#43289)

Co-authored-by: Yujong Lee <yujong@berri.ai>
(cherry picked from commit affb547525)

* test(integration): run the Langfuse DB-callback test on its own scratch database (#43288)

* test(integration): run the Langfuse DB-callback test on its own scratch database

The test from #43282 wrote success_callback=langfuse and the LANGFUSE_* env
into the shared integration LiteLLM_Config. The suite's long-running gateway
reloads that table and only ever adds callbacks, so it kept exporting to the
test's closed Langfuse fake for the rest of the shard even after the rows were
restored. The owned proxy now gets a scratch database, which also removes the
snapshot/restore code. scratch_database moves into _support/database.py so
test_cache_and_quota and this test share one copy, and the stock-config guard
now checks the callback settings instead of the raw YAML text.

* test(integration): include failure_callback in the stock-config Langfuse guard

(cherry picked from commit dd63637322)

* refactor(rust): expand logging and test coverage across gateway and Anthropic messages (#43295)

* refactor(rust): prepare inference and auth foundations

* fix(rust): keep textract operations parsing from kebab-case model names

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

* done

* refactor(types): derive Anthropic beta string conversions with Strum

* fix(anthropic): report missing max_tokens as a missing field

* refactor(rust): type Anthropic messages headers and auth after the Python layout

Delete anthropic/messages/headers.rs. Its OAuth handling, credential ladder
and beta merging move to anthropic/common_utils.rs where Python keeps them
(optionally_handle_anthropic_oauth, get_auth_header, _merge_beta_headers),
and the feature beta injection becomes update_headers_with_anthropic_beta on
the messages config, as in Python. The BaseAnthropicMessagesConfig impl is
unchanged apart from the bodies of validate_environment and request_headers

Beta values are now the AnthropicBeta enum and BetaSet, which sort, dedupe
and comma-join by construction. Request params gain typed speed, tools and
context_management through Recognized, so the beta logic matches on enums
instead of string-comparing JSON. OauthToken parses the sk-ant-oat token once
and the chat config shares that detection instead of its own copy

Case-insensitive header helpers move next to has_header in litellm-http.
One deliberate divergence: a Bearer-prefixed OAuth key configured through
api_key or ANTHROPIC_API_KEY is sent with a single Bearer scheme, where
Python would emit "Bearer Bearer"

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>

* done

* fix(rust): repair test compilation and clippy failures

resolve auth before building the outbound request in prepare tests, give the host hook tests their own error type, and drop the disallowed reqwest client and err().expect() from core tests

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

---------

Co-authored-by: Yujong Lee <yujong@berri.ai>
Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Co-authored-by: Claude Fable 5.1 <noreply@anthropic.com>
(cherry picked from commit 90873c46de)

* test(proxy_behavior): scope the management proxy fixture to its package so its spend monitor cannot race the spend tests (#43302)

Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
(cherry picked from commit 115668f43e)

* fix(ci): stop stale CI reds, keep unit tests off the host env, retry CyberArk policy conflicts (#43294)

* fix(ci): stop five stale or flaky CI reds and retry CyberArk policy-load conflicts

The Langfuse redaction unit test exports to a local OTLP capture instead of
polling Langfuse Cloud through a recorded lookup. The passthrough worker-kill
test only requires spend rows for requests the surviving worker served. The
spend-routes sweep treats the intentional /spend/capture_rate 503 as expected.
CyberArk retries a 409 policy load in Python, Rust and the e2e Conjur helper
instead of reading it as "variable exists". The integration egress guard now
matches the script's own cgroup, so it no longer blocks the CircleCI agent,
which runs as the same user.

* fix(ci): keep the policy-load backoff typed as float

* fix(ci): retry CyberArk policy loads without blocking the event loop and tighten the worker-kill and Langfuse tests

* fix(secrets): load CyberArk policy one request at a time per manager

* test(secrets): pin that non-conflict CyberArk policy failures are not retried

* test(unit): run tests/unit with only an allowlisted host environment

CircleCI's unit job inherits every project env var, so real provider keys,
REDIS_HOST, DATABASE_URL and AWS or Azure credentials reached tests that
assume none are set. Locally, litellm's import-time load_dotenv did the same
from any .env up the tree. The unit conftest now drops every variable outside
a small allowlist and disables dotenv before litellm is imported.

* test(e2e): name a failed search and the stuck batch status instead of misattributing them

The websearch session test read an empty web_search_tool_result_error block as a
successful search, so a failing search tool surfaced as a session billing bug.
The batch cancellation timeout now reports the last status the proxy returned.

* fix(ci): scrub the host environment per unit test instead of for the whole pytest process

GHA shards run tests/unit next to other suites in one process, so the import-time
scrub deleted MCP_TEST_PEER_PYTHON before tests/mcp_tests read it and the MCP
upstream fell back to the SDK2 interpreter. The two websearch tests that called
OpenAI and Perplexity live are removed: tests/unit no longer sees their keys.

* fix(ci): scrub only the host variables present before litellm is imported

The per-test scrub also deleted TIKTOKEN_CACHE_DIR, which litellm sets at import to
its bundled encodings, so tokenizer paths tried to download them and hit the
socket guard. The prisma setup test now passes its own database URL instead of
reading one another test leaked into the process environment.

* fix(ci): stop the order-dependent unit reds and settle logging tasks on their own queue

LoggingWorker marked a task done on whichever queue was current when the callback
finished, so a callback that outlived an event-loop change raised "task_done()
called too many times" or undercounted the new loop's queue. It now settles the
queue the task came from.

The rest are test isolation fixes for failures that only appeared when another
file ran first on the same xdist worker: a replaced user_api_key_cache, breaker
metrics unregistered by prometheus tests, semantic_router's health-check filter on
uvicorn.access, logging tasks carried over from bedrock tests, a Router-written
model_cost entry, and a stray post captured by the langflow test. The token
counter check now asserts bounded chunking instead of wall-clock time.

* test(e2e/ui): wait for the logout redirect before visiting a protected page

Logout revokes the session server-side before clearing cookies and navigating, so an immediate page.goto either ran with the cookie still set or was aborted by the logout redirect (net::ERR_ABORTED).

* test(unit): restore the prometheus metrics config per test and settle logs carried from earlier tests in the a2a cost tests

* test(router): pin the router clock in the usage counter tests so a minute rollover cannot empty the read

* test(e2e/ui): wait for logout to clear the token cookie instead of for a login redirect

* test(integration/mcp): answer the model-info probe another test's proxy sends to the model double

(cherry picked from commit 14f4c34c61)

* test(e2e): assert only litellm-owned batch behavior and move the blank S3 env pin to an integration test (#43321)

(cherry picked from commit e53e67ede5)

* ci: drop main and litellm_* branch filters from the CircleCI litellm-main workflows (#43272)

Co-authored-by: yuneng <yuneng@berri.ai>
Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
(cherry picked from commit c822c7fffa)

* test(e2e): accept the otel cost write as a linked root trace (#42931)

* test(e2e): accept the otel cost write as a linked root trace

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

* test(e2e): window and fail-closed the linked otel trace read-back

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

* test(e2e): poll the otel read-back without recursion

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

---------

Co-authored-by: yuneng <yuneng@berri.ai>
Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
(cherry picked from commit 3ebf6a1fd8)

* refactor(rust): exclude gateway and config crates from rc backport

* refactor(rust): exclude router crate from rc backport

---------

Co-authored-by: devin-ai-integration[bot] <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Co-authored-by: Yujong Lee <yujong@berri.ai>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: mateo-berri <277851410+mateo-berri@users.noreply.github.com>
Co-authored-by: yassin <yassin@berri.ai>
2026-09-26 14:26:59 -07:00

36 KiB
Raw Permalink Blame History

Python secret-manager test parity

The inventory covers 132 tests in the secret-manager suites and the legacy secret-manager utility suites. It maps 108 tests to Rust coverage and identifies 24 tests owned by other layers or live environments. Rust tests exercise requests, returned values, caching, routing and failure behavior. Multiple Python tests can map to one parameterized Rust test

Tests of Python extension lifecycle, SDK credential selection in auth-azure, proxy hooks and example subclasses remain at their owning boundary. They are called out below rather than counted as Rust secret-manager coverage. Default AWS partition endpoints are owned by the AWS SDK

Azure callback absence remains None, while a native HTTP 404 still permits environment fallback. azure_callback_absence_preserves_none_but_errors_fall_back and python_read_failures_preserve_provider_fallback_rules cover these distinct results

Native APIs preserve typed errors and explicit absence. Python-compatible reads restore Python fallback, coercion, Google negative caching and missing-value behavior. Vault namespaces use the SDK namespace header instead of Python’s equivalent URL prefix. Rotation verifies fresh provider reads instead of trusting a just-written cache entry, preventing deletion after a failed replacement

Google payload corruption is intentionally rejected: malformed base64 and mismatched CRC32C values fail without populating the cache. failed_or_missing_reads_are_not_cached tests this correction against Python's permissive decoder and omitted checksum validation. See RFC 4648 section 3.3 and Google's integrity guidance

The Python API audit found that earlier AWS fallback tests encoded the wrong expectation. Differential calls to the existing handler show that missing secrets, denied reads, missing string payloads, and missing or empty primary secrets return None; they do not activate environment fallback or defaults. test_aws_absence_and_failed_reads_match_python_without_environment_fallback compares the public getter under both dispatch decisions, including HTTP 500 responses and their exact request counts. Python-compatible AWS reads disable SDK retries, matching Python's single attempt for service errors while retaining the native API's retry configuration. The bridge resolver test aws_read_failure_preserves_absence_without_environment_fallback checks the same rule when environment values exist. test_aws_primary_values_match_python_handler checks typed values, including arbitrary-size integers. test_aws_primary_json_errors_preserve_python_exception_details checks the exception class, arguments, document, and position against Python

Public AWS, Vault, CyberArk, and Google read methods now use catalog selection. AWS, Vault, and CyberArk keep their Python coroutine entrypoints, while Rust receives provider operation contexts. Full API replacement remains incomplete: AWS write/delete/rotation methods still need native bindings. Vault and CyberArk mutations now use native dispatch and share their native read caches. SDK-client configuration capture also needs to preserve explicit credentials, endpoints, and regions. Timeout phase handling, AWS optional-parameter side effects, per-call region selection without a base region, and environment lookup timing need further parity work. The private binding returns a Future, while the public methods retain ordinary Python coroutines as verified by lazy execution and asyncio.create_task tests. This follows the separation described in the PyO3 signature and async guides. The catalog remains Python-only while these gaps are open

Public API audit

The rollout decision comes from catalog.py. All secret-manager rules remain PYTHON_ONLY; LITELLM_RUST does not make these incomplete routes production-ready. Differential tests pass explicit rules into the dispatch boundary

Python entrypoint Native bridge coverage Remaining API work
litellm.get_secret, get_secret_str, get_secret_bool Existing Python entrypoints dispatch supported manager reads SDK-client configuration, environment read timing and complete failure conversion
AWS sync_read_secret, async_read_secret, primary-secret helpers Public signatures and coroutines retained; credentials, absence and typed JSON tested Option consumption, timeout phases and region resolution
AWS async_write_secret, async_delete_secret, async_rotate_secret, async_replicate_secret, async_put_secret_value Rust provider operations exist Public native dispatch, original response fields and Python error contracts
Vault sync_read_secret, async_read_secret Public signatures, nested overrides, namespace and data-key cache isolation tested Complete timeout and initialization error parity
Vault async_write_secret, async_delete_secret, async_rotate_secret Public native dispatch, complete response envelopes, HTTP error dictionaries, timeouts and fresh verification tested Authentication and input-conversion edge cases, transport retries, timeout phases and mutable configuration read points
CyberArk reads, writes, deletes and rotations Public native dispatch, shared cache, coroutine behavior, status errors and request counts tested Other transport failures and client initialization timing
Google get_secret_from_google_secret_manager Public native dispatch and distinct initial/cached missing results Credential configuration and complete error parity
Azure Key Vault, AWS KMS, Google KMS SDK clients Global secret-handler dispatch supports recognized clients Explicit SDK credentials, endpoints, regions and caller-supplied credentials
Custom managers and subclasses Preserve Python callbacks Caller implementations must never be replaced by built-in native managers

_SecretManagerRuntime is a private implementation detail, not a replacement SDK class. Its async methods return Futures; public async def methods retain lazy coroutine creation and asyncio.create_task support. Passing the same names and arguments is insufficient to claim parity until the remaining return-value, error, cache and configuration differences above are closed

tests/unit/secret_managers/test_aws_secret_manager_replication.py

Python test Rust coverage or boundary
test_write_secret_replicates_when_configured creation_replicates_only_to_configured_regions
test_write_secret_no_replication_when_not_configured creation_replicates_only_to_configured_regions
test_replication_failure_does_not_fail_write creation_passes_tags_and_kms_and_survives_replication_failure
test_async_replicate_secret_empty_regions_returns_empty creation_passes_tags_and_kms_and_survives_replication_failure
test_async_replicate_secret_correct_payload direct_replication_returns_response_or_service_error
test_replication_fires_on_create creation_replicates_only_to_configured_regions
test_load_aws_secret_manager_passes_replica_regions creation_replicates_only_to_configured_regions
test_write_secret_http_error_raises create_failure_does_not_overwrite_an_alias_without_a_deletion_date
test_write_secret_timeout_raises write_and_replication_timeouts_remain_errors
test_replicate_secret_http_error_raises direct_replication_returns_response_or_service_error
test_replicate_secret_timeout_raises write_and_replication_timeouts_remain_errors

tests/unit/secret_managers/test_aws_secret_manager_rotation.py

Python test Rust coverage or boundary
test_rotate_secret_same_name_writes_requested_value_in_place same_name_rotation_uses_put_and_returns_its_response
test_rotate_secret_different_names_persists_requested_value_and_deletes_old_alias renamed_rotation_reads_creates_verifies_then_deletes
test_rotate_secret_back_to_name_inside_recovery_window_restores_and_stores_new_value recovery_window_alias_is_restored_updated_and_tagged
test_write_secret_to_name_inside_recovery_window_reschedules_deletion_when_update_fails failed_update_reschedules_deletion_of_a_restored_alias
test_write_secret_to_name_inside_recovery_window_restores_and_stores_new_value recovery_window_alias_is_restored_updated_and_tagged
test_write_secret_to_live_existing_name_still_fails_without_overwriting create_failure_does_not_overwrite_an_alias_without_a_deletion_date

tests/unit/secret_managers/test_aws_secret_manager_v2.py

Python test Rust coverage or boundary
test_create_secret_uses_customer_managed_kms_key_from_settings creation_replicates_only_to_configured_regions
test_create_secret_omits_kms_key_id_when_not_configured write_read_delete_preserves_the_complete_secret_string
test_write_and_read_json_secret write_read_delete_preserves_the_complete_secret_string
test_prepare_request_builds_partition_endpoint AWS SDK owns partition endpoint construction. LiteLLM region selection is exercised by trait_read_uses_the_aws_region_from_its_operation_context; no vendor endpoint table is duplicated
test_prepare_request_explicit_bedrock_runtime_endpoint_param_still_wins endpoint_overrides_replace_the_service_and_override_the_region
test_prepare_request_env_bedrock_runtime_endpoint_still_wins endpoint_overrides_replace_the_service_and_override_the_region

tests/unit/secret_managers/test_base_secret_manager.py

Python test Rust coverage or boundary
test_raise_if_unsafe_secret_name_rejects_traversal_and_line_breaks names_reject_path_traversal_and_control_characters
test_raise_if_unsafe_secret_name_allows_legitimate_aliases names_allow_safe_values

tests/unit/secret_managers/test_custom_secret_manager.py

Python test Rust coverage or boundary
test_custom_secret_manager_initialization Exercises the Python example subclass itself or Python default methods. Caller-authored Python implementations remain Python callbacks; resolver integration is covered by manager_strings_are_coerced_like_literal_eval
test_custom_secret_manager_sync_read Exercises the Python example subclass itself or Python default methods. Caller-authored Python implementations remain Python callbacks; resolver integration is covered by manager_strings_are_coerced_like_literal_eval
test_custom_secret_manager_async_read Exercises the Python example subclass itself or Python default methods. Caller-authored Python implementations remain Python callbacks; resolver integration is covered by manager_strings_are_coerced_like_literal_eval
test_custom_secret_manager_async_write Exercises the Python example subclass itself or Python default methods. Caller-authored Python implementations remain Python callbacks; resolver integration is covered by manager_strings_are_coerced_like_literal_eval
test_custom_secret_manager_async_delete Exercises the Python example subclass itself or Python default methods. Caller-authored Python implementations remain Python callbacks; resolver integration is covered by manager_strings_are_coerced_like_literal_eval
test_custom_secret_manager_integration_with_litellm manager_strings_are_coerced_like_literal_eval
test_minimal_custom_secret_manager Exercises the Python example subclass itself or Python default methods. Caller-authored Python implementations remain Python callbacks; resolver integration is covered by manager_strings_are_coerced_like_literal_eval

tests/unit/secret_managers/test_cyberark_secret_manager.py

Python test Rust coverage or boundary
test_sync_read_matches_parity_fixture secret_names_use_python_quote_encoding
test_async_write_matches_parity_fixture writes_match_python_parity_fixture
test_missing_credentials_raise_value_error new_validates_credentials_before_license_and_configuration

tests/unit/secret_managers/test_get_azure_ad_token_provider.py

Python test Rust coverage or boundary
test_deployment_identity_reaches_workload_and_managed_identity_only Credential-selection contract belongs to litellm-auth-azure, not a secrets crate
test_deployment_identity_survives_a_developer_only_token_credentials_setting Credential-selection contract belongs to litellm-auth-azure, not a secrets crate
test_default_azure_credential_keeps_its_full_chain Credential-selection contract belongs to litellm-auth-azure, not a secrets crate
test_deployment_identity_refuses_to_mint_a_token_for_a_configured_service_principal Credential-selection contract belongs to litellm-auth-azure, not a secrets crate
test_deployment_identity_still_reaches_a_system_assigned_managed_identity Credential-selection contract belongs to litellm-auth-azure, not a secrets crate
test_deployment_identity_keeps_the_user_assigned_identity_under_a_dev_only_setting Credential-selection contract belongs to litellm-auth-azure, not a secrets crate
test_get_azure_ad_token_provider_client_secret_credential Credential-selection contract belongs to litellm-auth-azure, not a secrets crate
test_get_azure_ad_token_provider_managed_identity_credential Credential-selection contract belongs to litellm-auth-azure, not a secrets crate
test_get_azure_ad_token_provider_certificate_credential Credential-selection contract belongs to litellm-auth-azure, not a secrets crate
test_get_azure_ad_token_provider_password_protected_certificate_credential Credential-selection contract belongs to litellm-auth-azure, not a secrets crate
test_get_azure_ad_token_provider_default_azure_credential Credential-selection contract belongs to litellm-auth-azure, not a secrets crate
test_get_azure_ad_token_provider_prefers_workload_identity_over_managed_identity Credential-selection contract belongs to litellm-auth-azure, not a secrets crate
test_get_azure_ad_token_provider_defaults_to_default_azure_credential Credential-selection contract belongs to litellm-auth-azure, not a secrets crate

tests/unit/secret_managers/test_hashicorp_secret_manager.py

Python test Rust coverage or boundary
test_sync_read_uses_login_namespace_for_approle_and_secret_namespace_for_url login_and_secret_namespaces_follow_python_precedence
test_login_header_is_omitted_when_no_namespace_is_configured login_and_secret_namespaces_follow_python_precedence
test_sync_read_per_secret_namespace_overrides_secret_namespace operation_overrides_isolate_cached_targets_and_apply_to_writes_and_deletes
test_sync_read_caches_per_resolved_target operation_overrides_isolate_cached_targets_and_apply_to_writes_and_deletes
test_sync_read_caches_per_data_key_for_the_same_secret_path reads_cache_each_data_key_for_the_same_vault_path
test_async_delete_evicts_every_cached_field_of_the_secret_path write_and_delete_invalidate_the_read_cache
test_async_read_uses_secret_namespace_and_login_namespace login_and_secret_namespaces_follow_python_precedence
test_async_write_and_read_share_the_secret_namespace_target write_and_delete_invalidate_the_read_cache
test_tls_login_uses_login_namespace tls_login_posts_the_role_and_uses_the_client_identity
test_configuration_matches_native_parity_fixture configuration_matches_python_parity_fixture

tests/unit/secret_managers/test_secret_manager_handler.py

Python test Rust coverage or boundary
test_azure_key_vault_matches_rust_parity_fixture parity_fixture_matches_python_backend_contract

tests/unit/secret_managers/test_secret_managers_main.py

Python test Rust coverage or boundary
test_oidc_google_success google_expiry_caps_cache_and_preserves_audience
test_oidc_google_cached google_expiry_caps_cache_and_preserves_audience
test_oidc_google_cache_ttl_capped_by_token_exp google_tokens_expire_at_the_python_cache_deadline
test_oidc_google_expired_token_not_cached google_expiry_caps_cache_and_preserves_audience
test_oidc_google_long_lived_token_still_capped_at_default_ttl google_tokens_expire_at_the_python_cache_deadline
test_oidc_google_non_jwt_token_keeps_default_ttl google_tokens_expire_at_the_python_cache_deadline
test_oidc_google_failure google_oidc_failures_are_not_cached_or_hidden_by_defaults
test_oidc_circleci_success environment_sources_resolve_expected_value
test_oidc_circleci_failure missing_oidc_environment_is_an_error
test_oidc_github_success github_requests_are_authenticated_cached_and_revalidate_environment
test_oidc_github_missing_env github_requests_are_authenticated_cached_and_revalidate_environment
test_oidc_azure_file_success file_allowlist_resolves_symlinks_while_environment_paths_remain_explicit
test_oidc_azure_ad_token_success azure_oidc_acquires_the_requested_scope_and_preserves_failures
test_oidc_file_success file_allowlist_resolves_symlinks_while_environment_paths_remain_explicit
test_oidc_file_rejects_path_outside_allowlist file_allowlist_resolves_symlinks_while_environment_paths_remain_explicit
test_oidc_file_rejects_relative_path file_allowlist_resolves_symlinks_while_environment_paths_remain_explicit
test_oidc_env_success environment_sources_resolve_expected_value
test_oidc_env_path_success file_allowlist_resolves_symlinks_while_environment_paths_remain_explicit
test_unsupported_oidc_provider invalid_references_fail_before_environment_lookup
test_normalize_nonempty_secret_str normalization_matches_python_without_changing_embedded_whitespace
test_secret_manager_would_be_consulted_matches_get_secret gating_prediction_matches_actual_lookup
test_secret_manager_would_be_consulted_is_false_without_a_client prefix_is_removed_once_and_resolved_from_environment

tests/litellm_utils_tests/test_secret_manager.py

Python test Rust coverage or boundary
test_aws_secret_manager write_read_delete_preserves_the_complete_secret_string
test_oidc_google google_expiry_caps_cache_and_preserves_audience
test_oidc_github github_requests_are_authenticated_cached_and_revalidate_environment
test_oidc_circleci environment_sources_resolve_expected_value
test_oidc_circleci_v2 environment_sources_resolve_expected_value
test_oidc_circleci_with_azure Quarantined live Azure token exchange, outside secrets crates. CircleCI token retrieval is covered by environment_sources_resolve_expected_value
test_oidc_circle_v1_with_amazon Quarantined live AWS token exchange, outside secrets crates. Token retrieval and STS forwarding are covered independently
test_oidc_env_variable environment_sources_resolve_expected_value
test_oidc_file file_allowlist_resolves_symlinks_while_environment_paths_remain_explicit
test_oidc_env_path file_allowlist_resolves_symlinks_while_environment_paths_remain_explicit
test_google_secret_manager successful_reads_use_auth_latest_version_and_cache_including_empty_values
test_google_secret_manager_read_in_memory python_reads_reuse_cached_absence_until_expiry
test_should_read_secret_from_secret_manager gating_prediction_matches_actual_lookup
test_get_secret_with_access_mode gating_prediction_matches_actual_lookup
test_key_management_settings_defaults config_preserves_defaults_nulls_and_serialized_names
test_key_management_settings_custom_values config_preserves_defaults_nulls_and_serialized_names
test_async_write_secret_receives_description_and_tags Proxy hook behavior stays in Python. Native write metadata is covered by trait_write_uses_typed_write_context
test_key_management_settings_serialization_roundtrip config_preserves_defaults_nulls_and_serialized_names

tests/litellm_utils_tests/test_get_secret.py

Python test Rust coverage or boundary
test_azure_kms azure_handler_reads_missing_and_failed_secrets

tests/litellm_utils_tests/test_aws_secret_manager.py

Python test Rust coverage or boundary
test_write_and_read_simple_secret write_read_delete_preserves_the_complete_secret_string
test_write_and_read_json_secret write_read_delete_preserves_the_complete_secret_string
test_read_nonexistent_secret failed_read_returns_none_but_invalid_primary_json_is_an_error
test_primary_secret_functionality primary_lookup_preserves_read_semantics
test_write_secret_with_description_and_tags creation_passes_tags_and_kms_and_survives_replication_failure
test_secret_manager_with_iam_role_settings configured_sts_credentials_sign_the_secret_request
test_secret_manager_with_cross_account_settings configured_sts_credentials_sign_the_secret_request
test_secret_manager_with_irsa_settings configured_sts_credentials_sign_the_secret_request
test_secret_manager_with_custom_sts_endpoint configured_sts_credentials_sign_the_secret_request
test_secret_manager_with_aws_profile configured_profile_credentials_override_static_environment_credentials
test_load_aws_secret_manager_with_settings creation_replicates_only_to_configured_regions
test_end_to_end_iam_role_secret_write Live AWS account test, not a unit test. Offline STS signing and secret writes are covered without account assumptions

tests/litellm_utils_tests/test_hashicorp.py

Python test Rust coverage or boundary
test_hashicorp_secret_manager_get_secret token_reads_use_vault_headers_and_cache_values
test_hashicorp_secret_manager_write_secret write_and_delete_invalidate_the_read_cache
test_hashicorp_secret_manager_write_secret_with_team_overrides operation_overrides_isolate_cached_targets_and_apply_to_writes_and_deletes
test_hashicorp_secret_manager_delete_secret write_and_delete_invalidate_the_read_cache
test_hashicorp_secret_manager_delete_secret_with_team_overrides operation_overrides_isolate_cached_targets_and_apply_to_writes_and_deletes
test_hashicorp_secret_manager_tls_cert_auth tls_login_posts_the_role_and_uses_the_client_identity
test_hashicorp_secret_manager_approle_auth approle_login_uses_namespace_and_reuses_the_token
test_hashicorp_custom_mount_and_prefix namespace_mount_and_prefix_are_sanitized_in_the_url
test_hashicorp_get_url_rejects_path_traversal no_auth_and_invalid_names_fail_without_requests
test_hashicorp_secret_manager_rotate_secret_different_names rotation_applies_timeout_to_each_request
test_hashicorp_secret_manager_rotate_secret_same_name same_name_rotation_keeps_the_replacement
test_hashicorp_secret_manager_rotate_secret_current_not_found missing_old_or_new_value_stops_rotation_before_deletion
test_hashicorp_secret_manager_rotate_secret_write_fails provider_failures_stop_rotation_before_retirement
test_hashicorp_secret_manager_rotate_secret_with_team_overrides rotation_applies_timeout_to_each_request
test_hashicorp_secret_manager_rotate_secret_value_mismatch a_different_replacement_never_deletes_the_current_secret

tests/litellm_utils_tests/test_cyberark.py

Python test Rust coverage or boundary
test_cyberark_write_secret_rejects_yaml_injection unsafe_names_fail_before_http_calls
test_cyberark_ensure_variable_exists_escapes_yaml_metacharacters policy_writes_preserve_yaml_metacharacters_as_one_variable
test_cyberark_write_and_read_secret writes_tolerate_policy_status_and_cache_value
test_cyberark_rotate_secret rotation_stores_the_replacement_and_retains_other_aliases
test_cyberark_rotate_secret_with_new_alias rotation_stores_the_replacement_and_retains_other_aliases

Public provider read boundary

test_public_aws_reads_preserve_coroutines_and_per_call_credentials verifies lazy coroutine execution, asyncio.create_task, positional and keyword calls, request payloads, and per-call credentials, region, and endpoint overrides. test_public_aws_primary_reads_ignore_operation_overrides_like_python retains Python's ignored primary-read overrides. Bootstrap keys bypass only synchronous reads, including native backend initialization

Real HTTP timeouts are swallowed by AWS reads because LiteLLM's standard HTTP handler raises litellm.Timeout; tests that inject httpx.TimeoutException bypass that wrapping. test_public_aws_read_timeouts_follow_the_python_http_handler compares both implementations against delayed responses

Vault reads retain nested overrides, Python string conversion, and cache isolation. CyberArk reuses authentication and preserves raw secret text in its cache. Python's shared cache JSON-decodes CyberArk values on subsequent reads, corrupting quoted strings and changing types. The native behavior intentionally fixes this corruption, with the Python difference shown in test_public_cyberark_reads_reuse_authentication_and_cached_values

Google's first missing-secret read raises, while a cached miss returns None. python_reads_reuse_cached_absence_until_expiry and python_cached_absence_expires_and_allows_recovery retain both outcomes

Public CyberArk mutation boundary

Public writes, deletes, and rotations retain the Python method signatures and coroutine entrypoints. Write and delete results preserve Python's status/message dictionaries. Unsupported deletion clears the shared native read cache without a provider request. Authentication and write HTTP failures preserve Python's messages and request counts, including the ignored initial authentication failure while ensuring a policy. Python-compatible reads and writes do not retry HTTP 401; native Rust retry policies remain unchanged

The bridge compares connection-refused errors against Python and builds HTTP status messages through HTTPX. Other transport failures and client-initialization timing still need a complete API audit; these checks do not establish full error parity

test_public_cyberark_writes_and_deletes_share_the_read_cache verifies real HTTP writes followed by sync and async cached reads and deletion invalidation. test_public_cyberark_write_errors_match_python_without_http_retries, test_public_cyberark_connection_errors_match_python, and test_cyberark_handler_errors_match_python_after_cached_authentication_is_denied compare error results against Python. Missing-extension selection remains covered for each mutation

Rotation preserves the documented fresh-read safeguard. Python's base rotation checks a cache populated by the write and does not compare the stored value, so a successful response can conceal a missing or incorrect replacement. test_public_cyberark_rotation_requires_a_fresh_matching_replacement rejects both cases and verifies the old cache remains intact. test_public_cyberark_rotation_stops_after_a_failed_write preserves the old value and returns the write error without further requests. Conjur retains the old provider alias because its deletion API is unsupported

Public Vault mutation boundary

Public Vault writes, deletes and rotation now use catalog selection. Their Python signatures and coroutine entrypoints stay unchanged. Native operations use the Vault SDK request types and authenticated client while retaining the complete response bytes for Python JSON conversion. This preserves additional response fields, key order and arbitrary-size integers. Python-compatible writes make one provider attempt; the existing native API keeps its CAS recovery behavior

test_public_vault_writes_preserve_complete_responses_and_request_fields checks the response envelope, nested operation settings, payload and ignored tags. test_public_vault_mutation_http_errors_match_python_without_retry compares write/delete error dictionaries, including namespace URLs and exact request counts. Rotation tests compare current-secret failures, ordered request paths, write failures, failed verification, mismatched values, malformed verification shapes, same-name updates and best-effort old-alias deletion. A successful HTTP response containing status: error stops rotation and returns the original response. Verification fields remain raw JSON until Python error conversion, preserving large integers, nested values and the distinction between integer and floating-point type errors. Unsupported extension selection is checked separately for write, delete and rotate

test_public_vault_mutation_timeouts_match_python compares operation-specific timeout messages. The elapsed duration in a POST error is measured independently, so the test checks its structure and lower bound rather than requiring two independent requests to have identical elapsed time. Phase-specific connect/read/write/pool deadlines and cached Python transport configuration still need broader parity checks

Native writes retain two documented correctness safeguards. Python's async_write_secret does not invalidate the read cache, so a later read can return a value from before a successful write. test_public_native_vault_write_invalidates_stale_cached_values verifies that the native public API returns the updated provider value. Python also overwrites the secret when both the data key and description field are named description. test_public_native_vault_write_rejects_description_overwriting_the_secret rejects that collision before any request. These corrections do not change Python

The raw response path does not yet establish complete Vault API parity. SDK authentication payload parsing, argument conversion, connection retry behavior, non-HTTP transport errors, nonstandard JSON encodings during rotation and configuration changes during rotation remain under audit. The catalog stays Python-only

The Vault boundary update passed 317 provider and bridge tests, including 191 bridge cases. With the extension unavailable, 35 passed and 156 native-only cases skipped. Seven targeted mutations compiled and failed their regression tests: stripped response envelopes, ignored HTTP 400 failures, skipped replacement equality, skipped current-secret checks, stale write caches, fatal old-secret deletion failures and ignored write-error responses. The restored extension passed again. Five additional differential cases reproduced lossy large-integer error conversion before the raw-JSON correction and pass afterward. Live public native reads, writes, deletes and same-name/new-alias rotations passed against local Vault 1.20 with token and AppRole authentication, with Python HTTP construction forbidden