Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Alerting] url collision between pre-registered actions and existing GET urls #63130

Closed
pmuellr opened this issue Apr 9, 2020 · 2 comments · Fixed by #65936
Closed

[Alerting] url collision between pre-registered actions and existing GET urls #63130

pmuellr opened this issue Apr 9, 2020 · 2 comments · Fixed by #65936
Assignees
Labels
Feature:Alerting Team:ResponseOps Label for the ResponseOps team (formerly the Cases and Alerting teams) v7.8.0

Comments

@pmuellr
Copy link
Member

pmuellr commented Apr 9, 2020

With the new support for pre-registered actions added in PR #62382, there is now a potential for URL collision with GET requests.

Here's a table of all the current endpoints supported by actions: (the base uri is /api/action)

method uri description
POST / create
DELETE /{id} delete
POST /{id}/_execute execute
GET /{id} get
GET /_getAll get_all
GET /types list_action_types
PUT /{id} update

So the problem is with the GET requests. A pre-registered id of _getAll or types could end up matching the get_all or list_action_types endpoints, OR trying to do a GET on a pre-registered action with that id would return the existing function. Not clear which would win, but they are both wrong.

Black-listing pre-registered ids is possible, but problematic, as we'd have to keep the black-listed id's up-to-date with our endpoints, and if we forgot when we added a new GET endpoint ... we'd have a problem. I'm sure we'd forget :-)

One way to fix this would be to require a new prefix on the get function, changing the uri from /{id} to /object/{id} instead (probably not object, but a fixed prefix of some kind).

As a side note, the _getAll uri looks a little out-of-place - should it be getAll or get_all? The /types uri is also implemented (equivalently) in alerts, so any changes to should probably be reflected there. We don't currently have thoughts on creating pre-registered alerts soon, but perhaps we should look at that URI structure as well. I wonder if we should have the "get_all" functionality implemented as GET /?

@pmuellr pmuellr added Feature:Alerting Team:ResponseOps Label for the ResponseOps team (formerly the Cases and Alerting teams) v7.8.0 labels Apr 9, 2020
@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-alerting-services (Team:Alerting Services)

@mikecote
Copy link
Contributor

mikecote commented May 5, 2020

Should be done at the same time / person as #59799.

@YulNaumenko YulNaumenko self-assigned this May 5, 2020
@kobelb kobelb added the needs-team Issues missing a team label label Jan 31, 2022
@botelastic botelastic bot removed the needs-team Issues missing a team label label Jan 31, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature:Alerting Team:ResponseOps Label for the ResponseOps team (formerly the Cases and Alerting teams) v7.8.0
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants