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

[ResponseOps][Alerting] action validators should be passed allow-list config utils #139438

Merged

Conversation

doakalexi
Copy link
Contributor

@doakalexi doakalexi commented Aug 24, 2022

Resolves #64659

Summary

  • Updated the validator type to validate the schema and then allow for a custom validation function.
  • Add an optional validatorServices parameter object to all the validators - config, secrets, params. Validators that need to whitelist will then just get the APIs needed to do the check in that object, without having to curry.
  • Updated validation to pass in the configurationUtilities from the action type registry

Checklist

To verify

  • Try to create connectors and verify that you can make them, and that validation still works as expected
  • Use those connectors in rules, and verify that the rules run as expected.

@doakalexi doakalexi changed the title Alerting/pass allow list config utils [ResponseOps][Alerting] action validators should be passed allow-list config utils Aug 25, 2022
@doakalexi doakalexi added Team:ResponseOps Label for the ResponseOps team (formerly the Cases and Alerting teams) release_note:skip Skip the PR/issue when compiling release notes labels Aug 25, 2022
@doakalexi doakalexi marked this pull request as ready for review August 25, 2022 15:53
@doakalexi doakalexi requested a review from a team as a code owner August 25, 2022 15:53
@elasticmachine
Copy link
Contributor

Pinging @elastic/response-ops (Team:ResponseOps)

Copy link
Contributor

@ymao1 ymao1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Left a comment about another test and would like @cnasikas to review if he gets a chance to

*/
subActionParams: schema.object({}, { unknowns: 'allow' }),
}),
config: {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@cnasikas Wanted to flag these changes for your review since you are most familiar with the subaction framework. Would you mind giving it a review?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you @ymao1! I will take a look tomorrow.

@kibana-ci
Copy link
Collaborator

💚 Build Succeeded

Metrics [docs]

✅ unchanged

History

To update your PR or re-run it, just comment with:
@elasticmachine merge upstream

@doakalexi doakalexi merged commit 50c0077 into elastic:main Aug 30, 2022
@kibanamachine kibanamachine added v8.5.0 backport:skip This commit does not require backporting labels Aug 30, 2022
Mpdreamz pushed a commit to Mpdreamz/kibana that referenced this pull request Sep 6, 2022
… config utils (elastic#139438)

* Updating email first

* Updating the other connector types

* Fixing types

* Fixing functional tests

* Updating validators

* Updating to throw errors

* Adding new tests
@doakalexi doakalexi deleted the alerting/pass-allow-list-config-utils branch December 6, 2022 19:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport:skip This commit does not require backporting release_note:skip Skip the PR/issue when compiling release notes Team:ResponseOps Label for the ResponseOps team (formerly the Cases and Alerting teams) v8.5.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Alerting] action validators should be passed allow-list config utils
6 participants