Skip to content
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

[Security Solution] Add missing Lists API OpenAPI specifications #185865

Merged
merged 27 commits into from
Jun 18, 2024

Conversation

maximpn
Copy link
Contributor

@maximpn maximpn commented Jun 10, 2024

Resolves: #183821

Summary

This PR adds missing OpenAPI specifications for Lists API which are the following

  • POST /api/lists
  • GET /api/lists
  • PUT /api/lists
  • DELETE /api/lists
  • PATCH /api/lists
  • GET /api/lists/_find
  • GET /api/lists/privileges
  • POST /api/lists/items
  • GET /api/lists/items
  • PUT /api/lists/items
  • DELETE /api/lists/items
  • PATCH /api/lists/items
  • POST /api/lists/items/_export
  • POST /api/lists/items/_import
  • GET /api/lists/items/_find
  • POST /api/lists/index
  • GET /api/lists/index
  • DELETE /api/lists/index

@maximpn maximpn added docs Team:Detections and Resp Security Detection Response Team Team: SecuritySolution Security Solutions Team working on SIEM, Endpoint, Timeline, Resolver, etc. Team:Detection Rule Management Security Detection Rule Management Team Team:Detection Engine Security Solution Detection Engine Area v8.15.0 labels Jun 10, 2024
@maximpn maximpn self-assigned this Jun 10, 2024
@maximpn maximpn force-pushed the add-missing-lists-api-oas branch 9 times, most recently from 2c9293c to 51399c7 Compare June 14, 2024 18:38
@maximpn maximpn marked this pull request as ready for review June 15, 2024 05:18
@maximpn maximpn requested review from a team as code owners June 15, 2024 05:18
@elasticmachine
Copy link
Contributor

Pinging @elastic/security-detections-response (Team:Detections and Resp)

@maximpn maximpn requested a review from nikitaindik June 15, 2024 05:18
@elasticmachine
Copy link
Contributor

Pinging @elastic/security-solution (Team: SecuritySolution)

@elasticmachine
Copy link
Contributor

Pinging @elastic/security-detection-rule-management (Team:Detection Rule Management)

@maximpn maximpn force-pushed the add-missing-lists-api-oas branch 2 times, most recently from ed311a7 to b13882e Compare June 18, 2024 17:16
Copy link
Contributor

@banderror banderror left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A few other minor comments, otherwise it looks awesome! Thank you @maximpn, huge effort.

@maximpn maximpn enabled auto-merge (squash) June 18, 2024 18:54
@kibana-ci
Copy link
Collaborator

💛 Build succeeded, but was flaky

Failed CI Steps

Test Failures

  • [job] [logs] Jest Tests #6 / usePostPushToService refresh the case after pushing

Metrics [docs]

Module Count

Fewer modules leads to a faster build time

id before after diff
securitySolution 5513 5514 +1

Public APIs missing comments

Total count of every public API that lacks a comment. Target amount is 0. Run node scripts/build_api_docs --plugin [yourplugin] --stats comments for more detailed information.

id before after diff
@kbn/zod-helpers 9 10 +1
Unknown metric groups

API count

id before after diff
@kbn/zod-helpers 18 20 +2

History

To update your PR or re-run it, just comment with:
@elasticmachine merge upstream

cc @maximpn

@maximpn maximpn merged commit 7a0065d into elastic:main Jun 18, 2024
39 checks passed
@kibanamachine kibanamachine added the backport:skip This commit does not require backporting label Jun 18, 2024
@maximpn maximpn deleted the add-missing-lists-api-oas branch June 18, 2024 21:06
seanrathier pushed a commit to seanrathier/kibana that referenced this pull request Jun 21, 2024
…stic#185865)

**Resolves:** elastic#183821

## Summary

This PR adds missing OpenAPI specifications for Lists API which are the following

- `POST /api/lists`
- `GET /api/lists`
- `PUT /api/lists`
- `DELETE /api/lists`
- `PATCH /api/lists`
- `GET /api/lists/_find`
- `GET /api/lists/privileges`
- `POST /api/lists/items`
- `GET /api/lists/items`
- `PUT /api/lists/items`
- `DELETE /api/lists/items`
- `PATCH /api/lists/items`
- `POST /api/lists/items/_export`
- `POST /api/lists/items/_import`
- `GET /api/lists/items/_find`
- `POST /api/lists/index`
- `GET /api/lists/index`
- `DELETE /api/lists/index`

**Note:** Code generation is enabled for the added specs to verify that it works and produces expected results. Generated Zod schemas and types aren't integrated in the route's code.
e40pud added a commit that referenced this pull request Jun 27, 2024
## Summary

While investigation one of the SDHs, I noticed that our value lists
modal does not show list items anymore and shows `Failed to load list
items. You can change the search query or contact your administrator`
error instead.

The root cause is update API which were migrated in [this
PR](#185865) to OpenAPI
specifications. One of the query parameters was updated to be non-empty
strings when that was not required before.

Since those list APIs are public, we should keep them as they were
specified before, otherwise it makes breaking changes.

Previously `filter` parameter was specified as a string without
limitation of being non-empty:
- [Find list
schema](https://github.com/elastic/kibana/blob/main/packages/kbn-securitysolution-io-ts-list-types/src/request/find_list_schema/index.ts)
- [Find list item
schema](https://github.com/elastic/kibana/blob/main/packages/kbn-securitysolution-io-ts-list-types/src/request/find_list_item_schema/index.ts)

**Current broken behaviour**:


https://github.com/elastic/kibana/assets/2700761/383dfd0f-5358-4325-88fe-b4820b4e2726

**Fixed state**:


https://github.com/elastic/kibana/assets/2700761/2d9adcc2-a55e-4aac-a8ff-5921222067c4

cc @maximpn
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport:skip This commit does not require backporting docs release_note:skip Skip the PR/issue when compiling release notes Team:Detection Engine Security Solution Detection Engine Area Team:Detection Rule Management Security Detection Rule Management Team Team:Detections and Resp Security Detection Response Team Team: SecuritySolution Security Solutions Team working on SIEM, Endpoint, Timeline, Resolver, etc. v8.15.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Security Solution] Create missing OpenAPI specs for Lists API
9 participants