[ResponseOps][Connectors] Allow additional methods for the Webhook connector#238072
[ResponseOps][Connectors] Allow additional methods for the Webhook connector#238072js-jankisalvi merged 37 commits intoelastic:mainfrom
Conversation
update validation
|
Pinging @elastic/response-ops (Team:ResponseOps) |
There was a problem hiding this comment.
I've created a connector with POST and used it as rule action with a body. I then updated the webhook to use GET instead. The webhook is not being send (which makes sense), but I would have expected to see an error message in the logs and there is nothing. Also, updating back from GET to POST, still contains the body. Shouldn't the body have been deleted when updating to GET? Seems like we might have GET configs with a body. At the same time (thinking out loud) deleting the body when updating from POST to GET could be a huge disaster if someone updates by mistake or not really thinking about it. If we end up deleting the body when updating from POST to GET, should we show a warning message?
Thanks for this @jcger. After your message I had a chat with tia offline. Changing all configured actions if the connector changed was not feasible so we opted for the following solution:
|
jcger
left a comment
There was a problem hiding this comment.
-
Should we also indicate that the body will be ignored?
-
I did not test in latest main, so maybe there is something already in place. What about an intermediate release? I configured a GET and a PATCH webhook, when rolling back, the GET request stops working (GET with body error in the console), PATCH works, so far so good. The problem is that when updating these connectors, I see POST, which is incorrect and would confuse the users
code LGTM
...orm/packages/shared/response-ops/rule_form/src/rule_actions/rule_actions_connectors_body.tsx
Outdated
Show resolved
Hide resolved
We decided not to. It looked a bit awkward with the subtext there.
I created an intermediate release PR only with the changes from the BE #239847 |
## Summary This is an intermediate release for #238072 This PR removes the validation in the webhook connector backend for HTTP method and body. Now, if the method does not require a body, it simply isn't passed. --------- Co-authored-by: Christos Nasikas <xristosnasikas@gmail.com>
## Summary This is an intermediate release for elastic#238072 This PR removes the validation in the webhook connector backend for HTTP method and body. Now, if the method does not require a body, it simply isn't passed. --------- Co-authored-by: Christos Nasikas <xristosnasikas@gmail.com>
| validateParams: ( | ||
| actionParams: ActionParams | ||
| actionParams: ActionParams, | ||
| connectorConfig?: Record<string, unknown> |
There was a problem hiding this comment.
Should we use ActionConfig from the template literal?
There was a problem hiding this comment.
Same question. I think this will allow to avoid type casting in the x-pack/platform/plugins/shared/stack_connectors/public/connector_types/webhook/webhook.tsx where connectorConfig is of a WebhookConfig type.
e40pud
left a comment
There was a problem hiding this comment.
Thanks for addressing all feedback! 🚀
dplumlee
left a comment
There was a problem hiding this comment.
Tested all new methods in the rule edit and create forms, rule management changes LGTM
src/platform/packages/shared/kbn-alerts-ui-shared/src/common/types/action_types.ts
Outdated
Show resolved
Hide resolved
src/platform/packages/shared/response-ops/rule_form/src/rule_actions/rule_actions_item.tsx
Outdated
Show resolved
Hide resolved
x-pack/platform/plugins/shared/stack_connectors/public/connector_types/types.ts
Outdated
Show resolved
Hide resolved
x-pack/platform/plugins/shared/stack_connectors/public/connector_types/webhook/webhook.tsx
Outdated
Show resolved
Hide resolved
...k/platform/plugins/shared/stack_connectors/public/connector_types/webhook/webhook_params.tsx
Outdated
Show resolved
Hide resolved
x-pack/platform/plugins/shared/stack_connectors/public/connector_types/types.ts
Outdated
Show resolved
Hide resolved
...tform/plugins/shared/stack_connectors/public/connector_types/webhook/webhook_params.test.tsx
Show resolved
Hide resolved
janmonschke
left a comment
There was a problem hiding this comment.
kibana-cases changes lgtm
peteharverson
left a comment
There was a problem hiding this comment.
Changes to the AI Infra owned tests LGTM
arturoliduena
left a comment
There was a problem hiding this comment.
LGTM - Obs AI Assistant code review
💚 Build Succeeded
Metrics [docs]Module Count
Public APIs missing comments
Async chunks
Page load bundle
Unknown metric groupsAPI count
History
|
…nnector (elastic#238072) Closes elastic#236398 ## Summary This PR allows the webhook connector to be configured with the `GET`, `PATCH`, and `DELETE` methods. <img width="307" height="309" alt="Screenshot 2025-10-08 at 16 54 52" src="https://github.com/user-attachments/assets/16c99ba6-c75a-4ad6-83d0-045cc132ffa1" /> If the method is one of `GET` or `DELETE`, a rule action using this connector will have `body` parameter as optional. Although the original issue says otherwise, I decided to exclude the body for DELETE requests too. [The documentation says](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Methods/DELETE): > The DELETE method has no defined semantics for the message body, so this should be empty. ## Release Notes The webhook connector now allows the following HTTP request methods: POST(default), PUT, PATCH, GET, or DELETE. --------- Co-authored-by: Janki Salvi <jankigaurav.salvi@elastic.co> Co-authored-by: Janki Salvi <117571355+js-jankisalvi@users.noreply.github.com> Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>

Closes #236398
Summary
This PR allows the webhook connector to be configured with the
GET,PATCH, andDELETEmethods.If the method is one of
GETorDELETE, a rule action using this connector will havebodyparameter as optional.Although the original issue says otherwise, I decided to exclude the body for DELETE requests too. The documentation says:
Release Notes
The webhook connector now allows the following HTTP request methods: POST(default), PUT, PATCH, GET, or DELETE.