Closes #21702: Include originating HTTP request in outbound webhook context data (#21726)

Adds a `request` key to the webhook data if a request is associated with the origination of the webhook.

Note: We're not attaching a complete representation of the request in the interest of both security and brevity.
This commit is contained in:
Jeremy Stretch
2026-03-24 18:00:21 -04:00
committed by GitHub
parent b8ce81c8fe
commit bc66d9f136
3 changed files with 14 additions and 2 deletions

View File

@@ -90,4 +90,4 @@ The following context variables are available to the text and link templates.
| `snapshots` | Pre- and post-change snapshots of the object |
!!! warning "Deprecation of legacy fields"
The `request_id` and `username` fields in the webhook payload above are deprecated and should no longer be used. Support for them will be removed in NetBox v4.7.0. Use `request.user.username` and `request.request_id` from the `request` object included in the callback context instead.
The `request_id` and `username` fields in the webhook payload above are deprecated and should no longer be used. Support for them will be removed in NetBox v4.7.0. Use `request.user` and `request.id` from the `request` object included in the callback context instead. (Note that `request` is populated in the context only when the webhook is associated with a triggering request.)