-
Notifications
You must be signed in to change notification settings - Fork 8.1k
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
[ResponseOps][Rules] Remove unintended internal Find routes API with public access #193757
base: main
Are you sure you want to change the base?
[ResponseOps][Rules] Remove unintended internal Find routes API with public access #193757
Conversation
Pinging @elastic/response-ops (Team:ResponseOps) |
🤖 GitHub commentsExpand to view the GitHub comments
Just comment with:
|
@elasticmachine merge upstream |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you please add a unit test (x-pack/plugins/alerting/server/routes/rule/apis/find/find_rules_route.test.ts
) to be sure we register the correct routes with the correct access
?
@@ -37,15 +38,12 @@ const buildFindRulesRoute = ({ | |||
router, | |||
excludeFromPublicApi = false, | |||
usageCounter, | |||
options: routerOptions, | |||
}: BuildFindRulesRouteParams) => { | |||
router.get( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This call to the router will also be done when calling findInternalRulesRoute
. This will register the GET /internal/alerting/rules/_find
which we do not want. Should we add a check like
if (path !== INTERNAL_ALERTING_API_FIND_RULES_PATH) { /// rouer.get }
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Restructured the if
statement to be an if...else
to handle this
💔 Build FailedFailed CI Steps
Test Failures
Metrics [docs]
History
To update your PR or re-run it, just comment with: |
Summary
Fixes #192957
Removes the
internal/_find
route from public access by moving the hard-codedoptions
into the route builder functions.