-
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.
[Security Solution] Enable OpenAPI schemas linting in Security Soluti…
…on plugin (#188529) **Relates to:** elastic/security-team#9401 ## Summary Disabling OpenAPI spec linting in #179074 lead to accumulating invalid OpenAPi specs. This PR enables OpenAPI linting for Security Solution plugin and make appropriate fixes to make the linting pass. ## Details OpenAPI linting is a part of code generation. It runs automatically but can be disabled via `skipLinting: true`. Code generation with disabled linting isn't able to catch all possible problems in processing specs. The majority of problems came from Entity Analytics and Osquery OpenAPI specs. These specs were fixed and refactored to enable code generation and integrate generated artefacts into routes to make sure OpenAPI spec match API endpoints they describe. It helped to catch some subtle inconsistencies.
- Loading branch information
Showing
88 changed files
with
1,077 additions
and
718 deletions.
There are no files selected for viewing
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 |
---|---|---|
@@ -0,0 +1,37 @@ | ||
/* | ||
* 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: Assets Schema | ||
* version: 1 | ||
*/ | ||
|
||
import { z } from 'zod'; | ||
|
||
import { AssetsRequestQuery } from './assets_status.gen'; | ||
|
||
export type ReadAssetsStatusRequestParams = z.infer<typeof ReadAssetsStatusRequestParams>; | ||
export const ReadAssetsStatusRequestParams = z.object({ | ||
query: AssetsRequestQuery, | ||
}); | ||
export type ReadAssetsStatusRequestParamsInput = z.input<typeof ReadAssetsStatusRequestParams>; | ||
|
||
export type ReadAssetsStatusResponse = z.infer<typeof ReadAssetsStatusResponse>; | ||
export const ReadAssetsStatusResponse = z.object({}); | ||
|
||
export type UpdateAssetsStatusRequestParams = z.infer<typeof UpdateAssetsStatusRequestParams>; | ||
export const UpdateAssetsStatusRequestParams = z.object({ | ||
query: AssetsRequestQuery, | ||
}); | ||
export type UpdateAssetsStatusRequestParamsInput = z.input<typeof UpdateAssetsStatusRequestParams>; | ||
|
||
export type UpdateAssetsStatusResponse = z.infer<typeof UpdateAssetsStatusResponse>; | ||
export const UpdateAssetsStatusResponse = z.object({}); |
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
51 changes: 51 additions & 0 deletions
51
x-pack/plugins/osquery/common/api/fleet_wrapper/fleet_wrapper.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,51 @@ | ||
/* | ||
* 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: Fleet wrapper schema | ||
* version: 1 | ||
*/ | ||
|
||
import { z } from 'zod'; | ||
|
||
import { Id } from '../model/schema/common_attributes.gen'; | ||
|
||
export type GetAgentDetailsRequestParams = z.infer<typeof GetAgentDetailsRequestParams>; | ||
export const GetAgentDetailsRequestParams = z.object({ | ||
id: Id, | ||
}); | ||
export type GetAgentDetailsRequestParamsInput = z.input<typeof GetAgentDetailsRequestParams>; | ||
|
||
export type GetAgentDetailsResponse = z.infer<typeof GetAgentDetailsResponse>; | ||
export const GetAgentDetailsResponse = z.object({}); | ||
|
||
export type GetAgentPackagePoliciesResponse = z.infer<typeof GetAgentPackagePoliciesResponse>; | ||
export const GetAgentPackagePoliciesResponse = z.object({}); | ||
|
||
export type GetAgentPoliciesResponse = z.infer<typeof GetAgentPoliciesResponse>; | ||
export const GetAgentPoliciesResponse = z.object({}); | ||
|
||
export type GetAgentPolicyRequestParams = z.infer<typeof GetAgentPolicyRequestParams>; | ||
export const GetAgentPolicyRequestParams = z.object({ | ||
id: Id, | ||
}); | ||
export type GetAgentPolicyRequestParamsInput = z.input<typeof GetAgentPolicyRequestParams>; | ||
|
||
export type GetAgentPolicyResponse = z.infer<typeof GetAgentPolicyResponse>; | ||
export const GetAgentPolicyResponse = z.object({}); | ||
export type GetAgentsRequestQuery = z.infer<typeof GetAgentsRequestQuery>; | ||
export const GetAgentsRequestQuery = z.object({ | ||
query: z.object({}), | ||
}); | ||
export type GetAgentsRequestQueryInput = z.input<typeof GetAgentsRequestQuery>; | ||
|
||
export type GetAgentsResponse = z.infer<typeof GetAgentsResponse>; | ||
export const GetAgentsResponse = z.object({}); |
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
23 changes: 0 additions & 23 deletions
23
x-pack/plugins/osquery/common/api/fleet_wrapper/get_agent_details.gen.ts
This file was deleted.
Oops, something went wrong.
20 changes: 0 additions & 20 deletions
20
x-pack/plugins/osquery/common/api/fleet_wrapper/get_agent_details.schema.yaml
This file was deleted.
Oops, something went wrong.
14 changes: 0 additions & 14 deletions
14
x-pack/plugins/osquery/common/api/fleet_wrapper/get_agent_details_route.ts
This file was deleted.
Oops, something went wrong.
23 changes: 0 additions & 23 deletions
23
x-pack/plugins/osquery/common/api/fleet_wrapper/get_agent_policies.gen.ts
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.