litellm/tests/code_coverage_tests
yucheng-berri 5d42cb7cfa
fix(guardrails): encrypt guardrail litellm_params secrets at rest (#43627)
* fix(guardrails): encrypt guardrail litellm_params secrets at rest

* fix(guardrails): keep salt-key encryption on master key rotation and retry rows edited mid-rotation

- rotate guardrail params under LITELLM_SALT_KEY when set, matching the key reads decrypt with
- re-read and retry a row whose updated_at moved during rotation, up to GUARDRAIL_ROTATION_ATTEMPTS
- build decrypted Guardrail rows and the rotation count without mutating locals

* refactor(guardrails): retry guardrail rotation by bounded recursion instead of a rebound cursor

- each attempt re-reads the row and recurses with attempts_left - 1, so no loop variable is rebound
- cover the give-up path after GUARDRAIL_ROTATION_ATTEMPTS writes

* test(guardrails): drive the real guardrail rotator from the master key rotation test

- inject an encrypted guardrail row through the prisma client instead of replacing the GuardrailRegistry method
- assert the written params decrypt under the new master key

* Annotate guardrail param encryption collections for type-discipline gate

* Type guardrail param recursion through validated JSON containers

* Type guardrail registry test helpers and drop section comment

* Reject client-supplied encrypted values in guardrail litellm_params

* Allow depth-bounded contains_encrypted_marker in the recursion detector

* Keep a loaded guardrail when its DB params do not decrypt with the current key

* Apply other DB edits while keeping loaded values that do not decrypt, including PATCH models

* Keep the loaded guardrail when an undecryptable param has no loaded value

* Drop suppressions the type discipline gate on main now reports as unused

* Assert what the reinitialized guardrail holds after an edit to an undecryptable one

* Drive the rotation sync tests through a registered guardrail instead of patching reinitialize

* Type the rotation test helpers and drop the new test docstrings

* fix(guardrails): refuse to approve a submission whose params do not decrypt

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

---------

Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-10-02 22:49:41 -07:00
..
azure_client_usage_test.py
ban_constant_numbers.py
ban_copy_deepcopy_kwargs.py
bedrock_pricing.py
callback_manager_test.py
check_data_replace_usage.py
check_e2e_no_raw_requests.py
check_endpoint_coverage.py
check_fastuuid_usage.py
check_get_model_cost_key_performance.py
check_guardrail_apply_decorator.py
check_licenses.py
check_migrations_no_data_rewrites.py fix(proxy-extras): build the SpendLogs indexes in the migration job instead of in migrations (#43948) 2026-10-01 14:12:22 -07:00
check_prisma_binary_cache.py
check_provider_folders_documented.py feat: add litellm.agent() to run claude code, codex, opencode and deep agents through the ai gateway (#43885) 2026-10-01 22:27:49 +00:00
check_py310_typing_imports.py
check_spanattributes_value_usage.py
check_unbounded_in_lists.py ci: fail on new unbounded SQL IN lists and add a Prisma chunking helper (#42629) 2026-09-26 13:40:44 -07:00
check_unsafe_enterprise_import.py
check_workflow_job_name_collisions.py
check_workflow_startup_safety.py
code_qa_check_tests.py test: move tests/test_litellm root and small trees into tests/unit (#43186) 2026-09-25 11:30:43 -07:00
enforce_llms_folder_style.py
ensure_async_clients_test.py refactor(lens)!: rename internal engine code and API (#44034) 2026-10-01 11:02:14 -07:00
info_log_check.py
liccheck.ini chore(deps): drop unused pytest-postgresql dev dependency (#44056) 2026-10-01 18:53:54 +00:00
license_cache.json
litellm_logging_code_coverage.py
log.txt
memory_test.py
pass_through_code_coverage.py
prevent_key_leaks_in_exceptions.py
recursive_detector.py fix(guardrails): encrypt guardrail litellm_params secrets at rest (#43627) 2026-10-02 22:49:41 -07:00
router_code_coverage.py test: remove 130 legacy tests owned by stronger unit proofs (#44157) 2026-10-02 10:18:50 -07:00
router_enforce_line_length.py
test_aio_http_image_conversion.py
test_ban_set_verbose.py
test_chat_completion_imports.py
test_e2e_changed_gate.py fix(e2e-stack): print add-mask lines only under GitHub Actions (#42423) 2026-09-21 22:42:13 -07:00
test_e2e_idp_stack.py
test_e2e_junit_report.py test(e2e): typed per-test metadata for the e2e suite (#42044) 2026-09-30 21:03:21 -07:00
test_e2e_metadata.py test(e2e): typed per-test metadata for the e2e suite (#42044) 2026-09-30 21:03:21 -07:00
test_merge_smoke.py ci: add merge smoke checks workflow with loopback-only harness and 11 curated cases (#42709) 2026-09-23 11:01:08 -07:00
test_no_hardcoded_secrets.py
test_provider_cache.py
test_provider_replay_harness.py
test_proxy_types_import.py
test_router_strategy_async.py
test_workflow_job_name_collisions.py
unbounded_in_baseline.txt fix(proxy): share ownership permissions for spend logs and traces (#44239) 2026-10-03 01:38:54 +00:00
user_api_key_auth_code_coverage.py ci: move tests/proxy_unit_tests to tests/unit/proxy and run the proxy-db shards from litellm-tests (#42903) 2026-09-24 22:59:11 +00:00