-
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.
[Threat Hunting Investigations] Migrate all timeline routes to OpenAP…
…I types (#190238) fixes: elastic/security-team#10235 fixes: elastic/security-team#10237 This is the final PR for migrating over all timeline-related schemas and types to the new generated zod schemas from our OpenAPI specs. (see elastic/security-team#10110) On top of moving to the new schemas/types, this PR also cleans up usage of now outdated types. I'm aware of the size of this PR but rest assured, the changes are easy to review and for most teams, only a handful of files need to be reviewed: ```markdown * x-pack/test/security_solution_endpoint/apps/endpoint/endpoint_solution_integrations.ts * x-pack/plugins/security_solution/server/lib/detection_engine/prebuilt_rules/api/get_prebuilt_rules_and_timelines_status/get_prebuilt_rules_and_timelines_status_route.ts * x-pack/plugins/security_solution/server/lib/detection_engine/prebuilt_rules/logic/perform_timelines_installation.ts * x-pack/test/security_solution_cypress/cypress/objects/timeline.ts * x-pack/test/security_solution_cypress/cypress/objects/timeline.ts * x-pack/test/security_solution_cypress/cypress/tasks/api_calls/timelines.ts ``` - [x] [Unit or functional tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html) were updated or added to match the most common scenarios --------- Co-authored-by: kibanamachine <[email protected]> Co-authored-by: Elastic Machine <[email protected]> (cherry picked from commit 0078960)
- Loading branch information
1 parent
45b67b9
commit 7f87643
Showing
106 changed files
with
2,013 additions
and
2,661 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
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
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
29 changes: 29 additions & 0 deletions
29
...ck/plugins/security_solution/common/api/timeline/copy_timeline/copy_timeline_route.gen.ts
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 |
---|---|---|
@@ -0,0 +1,29 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License | ||
* 2.0; you may not use this file except in compliance with the Elastic License | ||
* 2.0. | ||
*/ | ||
|
||
/* | ||
* NOTICE: Do not edit this file manually. | ||
* This file is automatically generated by the OpenAPI Generator, @kbn/openapi-generator. | ||
* | ||
* info: | ||
* title: Elastic Security - Timeline - Copy Timeline API | ||
* version: 2023-10-31 | ||
*/ | ||
|
||
import { z } from '@kbn/zod'; | ||
|
||
import { SavedTimeline, PersistTimelineResponse } from '../model/components.gen'; | ||
|
||
export type CopyTimelineRequestBody = z.infer<typeof CopyTimelineRequestBody>; | ||
export const CopyTimelineRequestBody = z.object({ | ||
timeline: SavedTimeline, | ||
timelineIdToCopy: z.string(), | ||
}); | ||
export type CopyTimelineRequestBodyInput = z.input<typeof CopyTimelineRequestBody>; | ||
|
||
export type CopyTimelineResponse = z.infer<typeof CopyTimelineResponse>; | ||
export const CopyTimelineResponse = PersistTimelineResponse; |
34 changes: 34 additions & 0 deletions
34
...ugins/security_solution/common/api/timeline/copy_timeline/copy_timeline_route.schema.yaml
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 |
---|---|---|
@@ -0,0 +1,34 @@ | ||
openapi: 3.0.0 | ||
info: | ||
title: Elastic Security - Timeline - Copy Timeline API | ||
version: '2023-10-31' | ||
paths: | ||
/api/timeline/_copy: | ||
get: | ||
x-labels: [serverless, ess] | ||
x-codegen-enabled: true | ||
operationId: CopyTimeline | ||
summary: Copies timeline or timeline template | ||
description: | | ||
Copies and returns a timeline or timeline template. | ||
tags: | ||
- access:securitySolution | ||
requestBody: | ||
required: true | ||
content: | ||
application/json: | ||
schema: | ||
type: object | ||
required: [timeline, timelineIdToCopy] | ||
properties: | ||
timeline: | ||
$ref: '../model/components.schema.yaml#/components/schemas/SavedTimeline' | ||
timelineIdToCopy: | ||
type: string | ||
responses: | ||
'200': | ||
description: Indicates that the timeline has been successfully copied. | ||
content: | ||
application/json: | ||
schema: | ||
$ref: '../model/components.schema.yaml#/components/schemas/PersistTimelineResponse' |
15 changes: 0 additions & 15 deletions
15
x-pack/plugins/security_solution/common/api/timeline/copy_timeline/copy_timeline_route.ts
This file was deleted.
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
36 changes: 0 additions & 36 deletions
36
.../plugins/security_solution/common/api/timeline/create_timelines/create_timelines_route.ts
This file was deleted.
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
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.