From 74d9da7a20c3a078c19c4aeb43f2274007556615 Mon Sep 17 00:00:00 2001 From: ryan Date: Sat, 31 Oct 2026 05:51:46 +0000 Subject: [PATCH] test(responses): enforce managed ownership with unmanaged ID opt-in Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> --- tests/unit/test_responses_id_security.py | 5 +++-- tests/unit/types/test_litellm_params.py | 4 +--- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/tests/unit/test_responses_id_security.py b/tests/unit/test_responses_id_security.py index 6a66d9a5fab..712237d5519 100644 --- a/tests/unit/test_responses_id_security.py +++ b/tests/unit/test_responses_id_security.py @@ -870,10 +870,11 @@ def _comparison_options(data: object, nested: bool) -> Mapping[str, str]: @pytest.mark.asyncio @pytest.mark.parametrize("nested", (False, True)) @pytest.mark.parametrize("stranger", ("user", "team")) +@pytest.mark.parametrize("allow_unmanaged", (False, True)) async def test_regression_comparison_id_reentry_keeps_ownership_after_owner_retry( - salt_key_env: str, nested: bool, stranger: str + salt_key_env: str, nested: bool, stranger: str, allow_unmanaged: bool ) -> None: - hook: Final = ResponsesIDSecurity(general_settings_reader=lambda: {}, signing_key_reader=lambda: salt_key_env) + hook: Final = _hook({"allow_unmanaged_response_ids": allow_unmanaged}, signing_key=salt_key_env) owner: Final = UserAPIKeyAuth(user_id="owner-user", team_id="owner-team") caller: Final = UserAPIKeyAuth( user_id="stranger-user" if stranger == "user" else owner.user_id, diff --git a/tests/unit/types/test_litellm_params.py b/tests/unit/types/test_litellm_params.py index 0cccca4ba57..79ef5256f91 100644 --- a/tests/unit/types/test_litellm_params.py +++ b/tests/unit/types/test_litellm_params.py @@ -24,7 +24,6 @@ from litellm.types import litellm_params from litellm.types import utils as types_utils from litellm.types.caching import DynamicCacheControl from litellm.types.litellm_params import ( - ADDRESSED_COMPARISON_RESPONSE_ID_FIELD, ADDRESSED_RESPONSE_ID_FIELD, LITELLM_OWNED_ROOTS, TRUSTED_CALLBACK_VARS_FIELD, @@ -460,10 +459,9 @@ def test_bedrock_batch_names_concatenate_as_a_tuple() -> None: def test_proxy_stamped_fields_keep_their_wire_names() -> None: - assert (TRUSTED_CALLBACK_VARS_FIELD, ADDRESSED_RESPONSE_ID_FIELD, ADDRESSED_COMPARISON_RESPONSE_ID_FIELD) == ( + assert (TRUSTED_CALLBACK_VARS_FIELD, ADDRESSED_RESPONSE_ID_FIELD) == ( "litellm_trusted_callback_vars", "_litellm_addressed_response_id", - "_litellm_addressed_comparison_response_id", )