-
Notifications
You must be signed in to change notification settings - Fork 8.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Response Ops][Actions] Adding
getAll
to UnsecuredActionsClient (#1…
…79090) ## Summary Adds unsecured version of the `getAll` function that is exposed via the `unsecuredActionsClient` on the actions plugin start contract. This version doesn't expect any user request and doesn't check RBAC. Actions saved objects are accessed via the internal saved objects repository (instead of a saved objects client scoped to the request) and an ES client that uses the internal user (instead of scoped to the request). This function returns all connectors for the give space ID and preconfigured connectors but does not return system actions. ## To Verify 1. Run this PR and create a connector via the UI or API in multiple different spaces. 2. In `x-pack/plugins/alerting/server/plugin.ts` in the start function, add the following: ``` const unsecuredActionsClient = plugins.actions.getUnsecuredActionsClient(); unsecuredActionsClient.getAll('default').then((results) => { console.log('default connectors'); console.log(JSON.stringify(results)); }); unsecuredActionsClient.getAll(<differentSpaceId>).then((results) => { console.log(JSON.stringify(results)); }); ``` 3. Restart Kibana and verify that the appropriate connectors were returned and logged. --------- Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
- Loading branch information
1 parent
3be6e23
commit c81301b
Showing
15 changed files
with
927 additions
and
53 deletions.
There are no files selected for viewing
451 changes: 450 additions & 1 deletion
451
x-pack/plugins/actions/server/application/connector/methods/get_all/get_all.test.ts
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,4 +5,4 @@ | |
* 2.0. | ||
*/ | ||
|
||
export { getAll } from './get_all'; | ||
export { getAll, getAllUnsecured } from './get_all'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.