From d632f19d0f2b92d2ae0fdfa4b782e08a0672ab56 Mon Sep 17 00:00:00 2001 From: Tim Pansino Date: Tue, 22 Oct 2024 11:45:38 -0700 Subject: [PATCH] Add high security mode test for global custom logging attrs --- tests/agent_features/test_log_events.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/tests/agent_features/test_log_events.py b/tests/agent_features/test_log_events.py index d005484db..8cb121710 100644 --- a/tests/agent_features/test_log_events.py +++ b/tests/agent_features/test_log_events.py @@ -475,3 +475,17 @@ def test_global_custom_attribute_forwarding(): common = session.get_log_events_common_block() # Both attrs should appear, and the 2nd attr should be truncated to the max user attribute length assert common == {"custom_attr_1": "value", "custom_attr_2": "a" * 255} + + +@override_application_settings({ + "high_security": True, + "application_logging.forwarding.custom_attributes": [("custom_attr_1", "value"), ("custom_attr_2", "a" * 256)], +}) +@background_task() +def test_global_custom_attribute_forwarding_high_security_enabled(): + txn = current_transaction() + session = list(txn.application._agent._applications.values())[0]._active_session + + common = session.get_log_events_common_block() + # No custom attrs should be attached with high security enabled + assert common == {}