-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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] refactor action whitelisting functions #66260
Conversation
I have a first pass of the refactoring of the action whitelist validation in commit caeca99c82eed90beb53126c476d93f7fcd96c36 - not finished yet, but the email action has been converted to use new validationService to do the whitelisting, instead of the old way we used to do it. The other actions will also need to be changed, but figured I'd just do that one first, make sure this is headed in the right direction. I ended up making the config, secrets and params types as generic params on action type, which should help to prevent folks from creating invalid validators/schemas due to the previous untyped access for those. Especially since I've added new Why The generic typing of the config, secrets, and params is opt-in at present, as it defaults to |
Pinging @elastic/kibana-alerting-services (Team:Alerting Services) |
I like this approach, I think it's much cleaner and more extensible. Another thought I have is that we now have |
I'm not in love with the name
The way these properties are paralleled looks a bit off to me, but I think it makes for a pretty nice story in the end, for action implementors. Basically, the kibana/x-pack/plugins/actions/server/builtin_action_types/email.ts Lines 98 to 100 in 7707cbd
We can't remove I tried a few things to see if we could keep one structure (instead of having two), and somehow provide an augmentation of a schema-config object as a parameter instead of schema-config itself, and then know we can do special processing on it (the I was also considering adding new schema for the whitelisting support - you'd do something like |
elastic#64659 In this PR, the action whitelisting utilities have been refactored to allow them to (eventually) be used in plugins other than the actions plugin. Prior to this, actions required deeper integration with the internal of the actions plugin. This also adds some generic typing to the actionType config, secrets, and params properties, since they are now referred to in multiple places within the actionType.
caeca99
to
8136c91
Compare
💚 Build SucceededHistory
To update your PR or re-run it, just comment with: |
Since we decided to leave the case-related actions in the actions plugin, we don't have a burning need for this function right now. Also, the shape of the action type with two validation functions is still a little smelly to me. So, closing this one for now. We'll be back! |
resolves #64659
In this PR, the action whitelisting utilities have been refactored to allow
them to (eventually) be used in plugins other than the actions plugin. Prior
to this, actions required deeper integration with the internal of the
actions plugin.
This also adds some generic typing to the actionType config, secrets, and
params properties, since they are now referred to in multiple places within
the actionType.
For maintainers