Skip to content

Commit

Permalink
[CI] Auto-commit changed files from 'yarn openapi:generate'
Browse files Browse the repository at this point in the history
  • Loading branch information
kibanamachine committed Sep 25, 2024
1 parent 8f41920 commit 40661e3
Show file tree
Hide file tree
Showing 3 changed files with 97 additions and 80 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ import { DeleteEndpointListItemRequestQueryInput } from '@kbn/securitysolution-e
import { FindEndpointListItemsRequestQueryInput } from '@kbn/securitysolution-endpoint-exceptions-common/api/find_endpoint_list_item/find_endpoint_list_item.gen';
import { ReadEndpointListItemRequestQueryInput } from '@kbn/securitysolution-endpoint-exceptions-common/api/read_endpoint_list_item/read_endpoint_list_item.gen';
import { UpdateEndpointListItemRequestBodyInput } from '@kbn/securitysolution-endpoint-exceptions-common/api/update_endpoint_list_item/update_endpoint_list_item.gen';
import { routeWithNamespace } from '../../common/utils/security_solution';
import { FtrProviderContext } from '../ftr_provider_context';

export function SecuritySolutionApiProvider({ getService }: FtrProviderContext) {
Expand All @@ -33,19 +34,19 @@ export function SecuritySolutionApiProvider({ getService }: FtrProviderContext)
/**
* Create an endpoint exception list, which groups endpoint exception list items. If an endpoint exception list already exists, an empty response is returned.
*/
createEndpointList() {
createEndpointList(kibanaSpace: string = 'default') {
return supertest
.post('/api/endpoint_list')
.post(routeWithNamespace('/api/endpoint_list', kibanaSpace))
.set('kbn-xsrf', 'true')
.set(ELASTIC_HTTP_VERSION_HEADER, '2023-10-31')
.set(X_ELASTIC_INTERNAL_ORIGIN_REQUEST, 'kibana');
},
/**
* Create an endpoint exception list item, and associate it with the endpoint exception list.
*/
createEndpointListItem(props: CreateEndpointListItemProps) {
createEndpointListItem(props: CreateEndpointListItemProps, kibanaSpace: string = 'default') {
return supertest
.post('/api/endpoint_list/items')
.post(routeWithNamespace('/api/endpoint_list/items', kibanaSpace))
.set('kbn-xsrf', 'true')
.set(ELASTIC_HTTP_VERSION_HEADER, '2023-10-31')
.set(X_ELASTIC_INTERNAL_ORIGIN_REQUEST, 'kibana')
Expand All @@ -54,9 +55,9 @@ export function SecuritySolutionApiProvider({ getService }: FtrProviderContext)
/**
* Delete an endpoint exception list item using the `id` or `item_id` field.
*/
deleteEndpointListItem(props: DeleteEndpointListItemProps) {
deleteEndpointListItem(props: DeleteEndpointListItemProps, kibanaSpace: string = 'default') {
return supertest
.delete('/api/endpoint_list/items')
.delete(routeWithNamespace('/api/endpoint_list/items', kibanaSpace))
.set('kbn-xsrf', 'true')
.set(ELASTIC_HTTP_VERSION_HEADER, '2023-10-31')
.set(X_ELASTIC_INTERNAL_ORIGIN_REQUEST, 'kibana')
Expand All @@ -65,9 +66,9 @@ export function SecuritySolutionApiProvider({ getService }: FtrProviderContext)
/**
* Get a list of all endpoint exception list items.
*/
findEndpointListItems(props: FindEndpointListItemsProps) {
findEndpointListItems(props: FindEndpointListItemsProps, kibanaSpace: string = 'default') {
return supertest
.get('/api/endpoint_list/items/_find')
.get(routeWithNamespace('/api/endpoint_list/items/_find', kibanaSpace))
.set('kbn-xsrf', 'true')
.set(ELASTIC_HTTP_VERSION_HEADER, '2023-10-31')
.set(X_ELASTIC_INTERNAL_ORIGIN_REQUEST, 'kibana')
Expand All @@ -76,9 +77,9 @@ export function SecuritySolutionApiProvider({ getService }: FtrProviderContext)
/**
* Get the details of an endpoint exception list item using the `id` or `item_id` field.
*/
readEndpointListItem(props: ReadEndpointListItemProps) {
readEndpointListItem(props: ReadEndpointListItemProps, kibanaSpace: string = 'default') {
return supertest
.get('/api/endpoint_list/items')
.get(routeWithNamespace('/api/endpoint_list/items', kibanaSpace))
.set('kbn-xsrf', 'true')
.set(ELASTIC_HTTP_VERSION_HEADER, '2023-10-31')
.set(X_ELASTIC_INTERNAL_ORIGIN_REQUEST, 'kibana')
Expand All @@ -87,9 +88,9 @@ export function SecuritySolutionApiProvider({ getService }: FtrProviderContext)
/**
* Update an endpoint exception list item using the `id` or `item_id` field.
*/
updateEndpointListItem(props: UpdateEndpointListItemProps) {
updateEndpointListItem(props: UpdateEndpointListItemProps, kibanaSpace: string = 'default') {
return supertest
.put('/api/endpoint_list/items')
.put(routeWithNamespace('/api/endpoint_list/items', kibanaSpace))
.set('kbn-xsrf', 'true')
.set(ELASTIC_HTTP_VERSION_HEADER, '2023-10-31')
.set(X_ELASTIC_INTERNAL_ORIGIN_REQUEST, 'kibana')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ import { ReadExceptionListItemRequestQueryInput } from '@kbn/securitysolution-ex
import { ReadExceptionListSummaryRequestQueryInput } from '@kbn/securitysolution-exceptions-common/api/read_exception_list_summary/read_exception_list_summary.gen';
import { UpdateExceptionListRequestBodyInput } from '@kbn/securitysolution-exceptions-common/api/update_exception_list/update_exception_list.gen';
import { UpdateExceptionListItemRequestBodyInput } from '@kbn/securitysolution-exceptions-common/api/update_exception_list_item/update_exception_list_item.gen';
import { routeWithNamespace } from '../../common/utils/security_solution';
import { FtrProviderContext } from '../ftr_provider_context';

export function SecuritySolutionApiProvider({ getService }: FtrProviderContext) {
Expand All @@ -51,9 +52,9 @@ export function SecuritySolutionApiProvider({ getService }: FtrProviderContext)
> All exception items added to the same list are evaluated using `OR` logic. That is, if any of the items in a list evaluate to `true`, the exception prevents the rule from generating an alert. Likewise, `OR` logic is used for evaluating exceptions when more than one exception list is assigned to a rule. To use the `AND` operator, you can define multiple clauses (`entries`) in a single exception item.
*/
createExceptionList(props: CreateExceptionListProps) {
createExceptionList(props: CreateExceptionListProps, kibanaSpace: string = 'default') {
return supertest
.post('/api/exception_lists')
.post(routeWithNamespace('/api/exception_lists', kibanaSpace))
.set('kbn-xsrf', 'true')
.set(ELASTIC_HTTP_VERSION_HEADER, '2023-10-31')
.set(X_ELASTIC_INTERNAL_ORIGIN_REQUEST, 'kibana')
Expand All @@ -65,9 +66,9 @@ export function SecuritySolutionApiProvider({ getService }: FtrProviderContext)
> Before creating exception items, you must create an exception list.
*/
createExceptionListItem(props: CreateExceptionListItemProps) {
createExceptionListItem(props: CreateExceptionListItemProps, kibanaSpace: string = 'default') {
return supertest
.post('/api/exception_lists/items')
.post(routeWithNamespace('/api/exception_lists/items', kibanaSpace))
.set('kbn-xsrf', 'true')
.set(ELASTIC_HTTP_VERSION_HEADER, '2023-10-31')
.set(X_ELASTIC_INTERNAL_ORIGIN_REQUEST, 'kibana')
Expand All @@ -76,9 +77,17 @@ export function SecuritySolutionApiProvider({ getService }: FtrProviderContext)
/**
* Create exception items that apply to a single detection rule.
*/
createRuleExceptionListItems(props: CreateRuleExceptionListItemsProps) {
createRuleExceptionListItems(
props: CreateRuleExceptionListItemsProps,
kibanaSpace: string = 'default'
) {
return supertest
.post(replaceParams('/api/detection_engine/rules/{id}/exceptions', props.params))
.post(
routeWithNamespace(
replaceParams('/api/detection_engine/rules/{id}/exceptions', props.params),
kibanaSpace
)
)
.set('kbn-xsrf', 'true')
.set(ELASTIC_HTTP_VERSION_HEADER, '2023-10-31')
.set(X_ELASTIC_INTERNAL_ORIGIN_REQUEST, 'kibana')
Expand All @@ -90,9 +99,12 @@ export function SecuritySolutionApiProvider({ getService }: FtrProviderContext)
> All exception items added to the same list are evaluated using `OR` logic. That is, if any of the items in a list evaluate to `true`, the exception prevents the rule from generating an alert. Likewise, `OR` logic is used for evaluating exceptions when more than one exception list is assigned to a rule. To use the `AND` operator, you can define multiple clauses (`entries`) in a single exception item.
*/
createSharedExceptionList(props: CreateSharedExceptionListProps) {
createSharedExceptionList(
props: CreateSharedExceptionListProps,
kibanaSpace: string = 'default'
) {
return supertest
.post('/api/exceptions/shared')
.post(routeWithNamespace('/api/exceptions/shared', kibanaSpace))
.set('kbn-xsrf', 'true')
.set(ELASTIC_HTTP_VERSION_HEADER, '2023-10-31')
.set(X_ELASTIC_INTERNAL_ORIGIN_REQUEST, 'kibana')
Expand All @@ -101,9 +113,9 @@ export function SecuritySolutionApiProvider({ getService }: FtrProviderContext)
/**
* Delete an exception list using the `id` or `list_id` field.
*/
deleteExceptionList(props: DeleteExceptionListProps) {
deleteExceptionList(props: DeleteExceptionListProps, kibanaSpace: string = 'default') {
return supertest
.delete('/api/exception_lists')
.delete(routeWithNamespace('/api/exception_lists', kibanaSpace))
.set('kbn-xsrf', 'true')
.set(ELASTIC_HTTP_VERSION_HEADER, '2023-10-31')
.set(X_ELASTIC_INTERNAL_ORIGIN_REQUEST, 'kibana')
Expand All @@ -112,9 +124,9 @@ export function SecuritySolutionApiProvider({ getService }: FtrProviderContext)
/**
* Delete an exception list item using the `id` or `item_id` field.
*/
deleteExceptionListItem(props: DeleteExceptionListItemProps) {
deleteExceptionListItem(props: DeleteExceptionListItemProps, kibanaSpace: string = 'default') {
return supertest
.delete('/api/exception_lists/items')
.delete(routeWithNamespace('/api/exception_lists/items', kibanaSpace))
.set('kbn-xsrf', 'true')
.set(ELASTIC_HTTP_VERSION_HEADER, '2023-10-31')
.set(X_ELASTIC_INTERNAL_ORIGIN_REQUEST, 'kibana')
Expand All @@ -123,9 +135,9 @@ export function SecuritySolutionApiProvider({ getService }: FtrProviderContext)
/**
* Duplicate an existing exception list.
*/
duplicateExceptionList(props: DuplicateExceptionListProps) {
duplicateExceptionList(props: DuplicateExceptionListProps, kibanaSpace: string = 'default') {
return supertest
.post('/api/exception_lists/_duplicate')
.post(routeWithNamespace('/api/exception_lists/_duplicate', kibanaSpace))
.set('kbn-xsrf', 'true')
.set(ELASTIC_HTTP_VERSION_HEADER, '2023-10-31')
.set(X_ELASTIC_INTERNAL_ORIGIN_REQUEST, 'kibana')
Expand All @@ -134,9 +146,9 @@ export function SecuritySolutionApiProvider({ getService }: FtrProviderContext)
/**
* Export an exception list and its associated items to an NDJSON file.
*/
exportExceptionList(props: ExportExceptionListProps) {
exportExceptionList(props: ExportExceptionListProps, kibanaSpace: string = 'default') {
return supertest
.post('/api/exception_lists/_export')
.post(routeWithNamespace('/api/exception_lists/_export', kibanaSpace))
.set('kbn-xsrf', 'true')
.set(ELASTIC_HTTP_VERSION_HEADER, '2023-10-31')
.set(X_ELASTIC_INTERNAL_ORIGIN_REQUEST, 'kibana')
Expand All @@ -145,9 +157,9 @@ export function SecuritySolutionApiProvider({ getService }: FtrProviderContext)
/**
* Get a list of all exception list items in the specified list.
*/
findExceptionListItems(props: FindExceptionListItemsProps) {
findExceptionListItems(props: FindExceptionListItemsProps, kibanaSpace: string = 'default') {
return supertest
.get('/api/exception_lists/items/_find')
.get(routeWithNamespace('/api/exception_lists/items/_find', kibanaSpace))
.set('kbn-xsrf', 'true')
.set(ELASTIC_HTTP_VERSION_HEADER, '2023-10-31')
.set(X_ELASTIC_INTERNAL_ORIGIN_REQUEST, 'kibana')
Expand All @@ -156,9 +168,9 @@ export function SecuritySolutionApiProvider({ getService }: FtrProviderContext)
/**
* Get a list of all exception lists.
*/
findExceptionLists(props: FindExceptionListsProps) {
findExceptionLists(props: FindExceptionListsProps, kibanaSpace: string = 'default') {
return supertest
.get('/api/exception_lists/_find')
.get(routeWithNamespace('/api/exception_lists/_find', kibanaSpace))
.set('kbn-xsrf', 'true')
.set(ELASTIC_HTTP_VERSION_HEADER, '2023-10-31')
.set(X_ELASTIC_INTERNAL_ORIGIN_REQUEST, 'kibana')
Expand All @@ -167,9 +179,9 @@ export function SecuritySolutionApiProvider({ getService }: FtrProviderContext)
/**
* Import an exception list and its associated items from an NDJSON file.
*/
importExceptionList(props: ImportExceptionListProps) {
importExceptionList(props: ImportExceptionListProps, kibanaSpace: string = 'default') {
return supertest
.post('/api/exception_lists/_import')
.post(routeWithNamespace('/api/exception_lists/_import', kibanaSpace))
.set('kbn-xsrf', 'true')
.set(ELASTIC_HTTP_VERSION_HEADER, '2023-10-31')
.set(X_ELASTIC_INTERNAL_ORIGIN_REQUEST, 'kibana')
Expand All @@ -178,9 +190,9 @@ export function SecuritySolutionApiProvider({ getService }: FtrProviderContext)
/**
* Get the details of an exception list using the `id` or `list_id` field.
*/
readExceptionList(props: ReadExceptionListProps) {
readExceptionList(props: ReadExceptionListProps, kibanaSpace: string = 'default') {
return supertest
.get('/api/exception_lists')
.get(routeWithNamespace('/api/exception_lists', kibanaSpace))
.set('kbn-xsrf', 'true')
.set(ELASTIC_HTTP_VERSION_HEADER, '2023-10-31')
.set(X_ELASTIC_INTERNAL_ORIGIN_REQUEST, 'kibana')
Expand All @@ -189,9 +201,9 @@ export function SecuritySolutionApiProvider({ getService }: FtrProviderContext)
/**
* Get the details of an exception list item using the `id` or `item_id` field.
*/
readExceptionListItem(props: ReadExceptionListItemProps) {
readExceptionListItem(props: ReadExceptionListItemProps, kibanaSpace: string = 'default') {
return supertest
.get('/api/exception_lists/items')
.get(routeWithNamespace('/api/exception_lists/items', kibanaSpace))
.set('kbn-xsrf', 'true')
.set(ELASTIC_HTTP_VERSION_HEADER, '2023-10-31')
.set(X_ELASTIC_INTERNAL_ORIGIN_REQUEST, 'kibana')
Expand All @@ -200,9 +212,12 @@ export function SecuritySolutionApiProvider({ getService }: FtrProviderContext)
/**
* Get a summary of the specified exception list.
*/
readExceptionListSummary(props: ReadExceptionListSummaryProps) {
readExceptionListSummary(
props: ReadExceptionListSummaryProps,
kibanaSpace: string = 'default'
) {
return supertest
.get('/api/exception_lists/summary')
.get(routeWithNamespace('/api/exception_lists/summary', kibanaSpace))
.set('kbn-xsrf', 'true')
.set(ELASTIC_HTTP_VERSION_HEADER, '2023-10-31')
.set(X_ELASTIC_INTERNAL_ORIGIN_REQUEST, 'kibana')
Expand All @@ -211,9 +226,9 @@ export function SecuritySolutionApiProvider({ getService }: FtrProviderContext)
/**
* Update an exception list using the `id` or `list_id` field.
*/
updateExceptionList(props: UpdateExceptionListProps) {
updateExceptionList(props: UpdateExceptionListProps, kibanaSpace: string = 'default') {
return supertest
.put('/api/exception_lists')
.put(routeWithNamespace('/api/exception_lists', kibanaSpace))
.set('kbn-xsrf', 'true')
.set(ELASTIC_HTTP_VERSION_HEADER, '2023-10-31')
.set(X_ELASTIC_INTERNAL_ORIGIN_REQUEST, 'kibana')
Expand All @@ -222,9 +237,9 @@ export function SecuritySolutionApiProvider({ getService }: FtrProviderContext)
/**
* Update an exception list item using the `id` or `item_id` field.
*/
updateExceptionListItem(props: UpdateExceptionListItemProps) {
updateExceptionListItem(props: UpdateExceptionListItemProps, kibanaSpace: string = 'default') {
return supertest
.put('/api/exception_lists/items')
.put(routeWithNamespace('/api/exception_lists/items', kibanaSpace))
.set('kbn-xsrf', 'true')
.set(ELASTIC_HTTP_VERSION_HEADER, '2023-10-31')
.set(X_ELASTIC_INTERNAL_ORIGIN_REQUEST, 'kibana')
Expand Down
Loading

0 comments on commit 40661e3

Please sign in to comment.