Skip to content

Conversation

@rithikanarayan
Copy link
Contributor

@rithikanarayan rithikanarayan commented Nov 21, 2025

What does this PR do?

Updates the asm function get_asm_blocked_response to create a Block_config (from ddtrace.appsec._utils) and pass in the block id as the security_response_id argument to the _get_blocked_template function.

Motivation

dd-trace-py recently updated the function signature of ddtrace.internal.utils.http._get_blocked_template to have an additional argument. We need to update the use of this function in datadog_lambda/asm.py.

Testing Guidelines

CI

Additional Notes

Types of Changes

  • Bug fix
  • New feature
  • Breaking change
  • Misc (docs, refactoring, dependency upgrade, etc.)

Check all that apply

  • This PR's description is comprehensive
  • This PR contains breaking changes that are documented in the description
  • This PR introduces new APIs or parameters that are documented and unlikely to change in the foreseeable future
  • This PR impacts documentation, and it has been updated (or a ticket has been logged)
  • This PR's changes are covered by the automated tests
  • This PR collects user input/sensitive content into Datadog
  • This PR passes the integration tests (ask a Datadog member to run the tests)

@rithikanarayan rithikanarayan marked this pull request as ready for review November 21, 2025 19:49
@rithikanarayan rithikanarayan requested review from a team as code owners November 21, 2025 19:49
@christophe-papazian
Copy link

Can we enable appsec blocking system tests on this CI before merging it?

@rithikanarayan rithikanarayan merged commit f2a704c into main Dec 12, 2025
105 of 106 checks passed
@rithikanarayan rithikanarayan deleted the rithika.narayan/update-asm-blocked-response branch December 12, 2025 16:39
content = http_utils._get_blocked_template(content_type)
content = http_utils._get_blocked_template(
content_type, blocked.get("block_id", "default")
)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This really should have a test. Something to confirm that we're passing the correct values to the _get_blocked_template method.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants