-
Notifications
You must be signed in to change notification settings - Fork 8k
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
[Connectors] Use Connector API to manage connector filtering #183148
[Connectors] Use Connector API to manage connector filtering #183148
Conversation
@@ -495,13 +495,7 @@ export function registerConnectorRoutes({ router, log }: RouteDependencies) { | |||
elasticsearchErrorHandler(log, async (context, request, response) => { | |||
const { client } = (await context.core).elasticsearch; | |||
const { connectorId } = request.params; | |||
const { advanced_snippet, filtering_rules } = request.body; |
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.
I'm confused whats happening with these parameters now, we still have advanced_snippet
& filtering_rules
on the request body but we're ignoring them now?
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.
I should have been clearer about this change. Those values correspond to values populated in draft
filtering. Before we would take the draft
advanced_snippet
and filtering_rules
and pass them to active
filtering object. Now this copy-paste logic lives in ES, so we can just call _activate
and it will lookup current draft in connector doc, and try to activate (with appropriate validation logc) whatever is listed as a draft rule.
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.
Ahh, I forgot to clean up unused params from the request handler and associated logic, addressed it now :)
Co-authored-by: Rodney Norris <rodney@tattdcodemonkey.com>
Co-authored-by: Rodney Norris <rodney@tattdcodemonkey.com>
…:jedrazb/kibana into connector-api-use-for-filtering-endpoint
@elasticmachine merge upstream |
filtering_rules: filteringRules, | ||
}), | ||
}); | ||
return await HttpLogic.values.http.put(route); |
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.
The route still has validation that requires the body do this request. Which means this call will always fail?
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.
Marked body as optional to preserve backwards compatibility in 0de6d2f
@elasticmachine merge upstream |
💚 Build Succeeded
Metrics [docs]Public APIs missing comments
Async chunks
History
To update your PR or re-run it, just comment with: |
Summary
Use Connector API update filtering endpoint to manage connector filtering in Kibana.
I manually verified that the filtering management works as expected, and the error handling remains unchanged.
The types returned by internal kibana actions remain unchanged.
Also added missing unit tests
Checklist
Delete any items that are not applicable to this PR.