Skip to content

feat: add support for nested list handling in webhook request content mapping#15

Open
Qoyyuum wants to merge 1 commit into
dfir-iris:masterfrom
Qoyyuum:fix/issue-6
Open

feat: add support for nested list handling in webhook request content mapping#15
Qoyyuum wants to merge 1 commit into
dfir-iris:masterfrom
Qoyyuum:fix/issue-6

Conversation

@Qoyyuum
Copy link
Copy Markdown

@Qoyyuum Qoyyuum commented Oct 24, 2025

This PR fixes #14

Comment on lines 492 to 510
@@ -498,6 +508,10 @@ def map_request_content(self, request_content, data):
nested_value = self.get_nested(data, keys)
result[key] = nested_value if nested_value is not None else ""

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

This comment is directed at any maintainer looking to merge this.

This section of original code still causes a bug where simple string values in dicts in a list such as Slack Blocks formatting get dropped.

For example:

"request_body": {
               "text": "[${{alerts.severity.severity_name}}] ${{alerts.alert_title}}",
                "blocks": [
                    {
                        "type": "header",
                        "text": {
                            "type": "plain_text",
                            "text": "[${{alerts.severity.severity_name}}] ${{alerts.alert_title}}"
                        }
                    },
...

Leads to parsed value of

{"text" : "[Low] Test Alert", "blocks": [{"type": "", "text": {"type": "", "text": "[Low] Test Alert"}}] ...}

Removing this entire section fixes the issue and I'm not even clear why this section is here as it seems unnecessary given that the expectation is the config should be valid JSON and should not be trying to interpret "some.key" as a path rather than a simple JSON key name.

Otherwise, this patch seems to work correctly and solved my problem with this module.

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.

'list' object has no attribute 'split' on sending webhook event

2 participants