-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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
[8.15] [Security Assistant] Aligning API Schemas (#188704) #189077
Merged
kibanamachine
merged 1 commit into
elastic:8.15
from
kibanamachine:backport/8.15/pr-188704
Jul 24, 2024
Merged
[8.15] [Security Assistant] Aligning API Schemas (#188704) #189077
kibanamachine
merged 1 commit into
elastic:8.15
from
kibanamachine:backport/8.15/pr-188704
Jul 24, 2024
Conversation
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
## Summary This PR aims to address elastic#183825 to ensure all our public API's have a corresponding OpenAPI spec and to ensure that they are documented as intended. I've updated the kbn-elastic-assistant-common `yarn openapi:bundle` script to generate both `ess` and `serverless` artifacts (as per [this issue](elastic/security-team#9516), which are now created within the package (instead of `target`), and so are checked in to `x-pack/packages/kbn-elastic-assistant-common/docs/openapi/`. This also includes: - [X] Create OpenAPI specs for the endpoints listed above (see [issue](elastic#183825)). - They had already existed - [X] Check if there are any other public endpoints that you own that don't have OpenAPI specs and add them to the list above. - All endpoints (public/internal) had specs, but did need to update the `path`'s to make sure they were consistent with what was registered. - [X] Make sure the specs you add are valid OpenAPI documents. - [X] Make sure the specs you add match the actual API contract defined in the code. - [X] Mark the endpoints as available in ESS, or Serverless, or in both offerings. --- Initial evaluation of routes listed as missing specs in elastic#183825: - [X] `POST /api/elastic_assistant/current_user/conversations/{id}/messages` Latest/Actual Route: `/internal/elastic_assistant/current_user/conversations/{id}/messages` Route Handler: https://github.com/elastic/kibana/blob/bae84d4569870dcecfd0cef346d2e0d38ac92160/x-pack/plugins/elastic_assistant/server/routes/user_conversations/append_conversation_messages_route.ts#L22 Schema: https://github.com/elastic/kibana/blob/bae84d4569870dcecfd0cef346d2e0d38ac92160/x-pack/packages/kbn-elastic-assistant-common/impl/schemas/conversations/crud_conversation_route.schema.yaml#L151-L191 - [X] `POST /api/elastic_assistant/current_user/conversations` Updated Route: `/api/security_ai_assistant/current_user/conversations` Route Handler: https://github.com/elastic/kibana/blob/1d4e9b9b53b5b6dcdc88c08ae5d9858daa483fe0/x-pack/plugins/elastic_assistant/server/routes/user_conversations/create_route.ts#L21 Schema: https://github.com/elastic/kibana/blob/bae84d4569870dcecfd0cef346d2e0d38ac92160/x-pack/packages/kbn-elastic-assistant-common/impl/schemas/conversations/crud_conversation_route.schema.yaml#L6-L39 - [X] GET /api/elastic_assistant/current_user/conversations/_find Updated Route: `/api/security_ai_assistant/current_user/conversations/_find` Route Handler: https://github.com/elastic/kibana/blob/1d4e9b9b53b5b6dcdc88c08ae5d9858daa483fe0/x-pack/plugins/elastic_assistant/server/routes/user_conversations/find_route.ts#L26 Schema: https://github.com/elastic/kibana/blob/1b872fbf9dc90d3c82a569a9faef9e360fc41171/x-pack/packages/kbn-elastic-assistant-common/impl/schemas/conversations/find_conversations_route.schema.yaml#L94-L180 - [X] DELETE /api/elastic_assistant/current_user/conversations/{id} Updated Route: `/api/security_ai_assistant/current_user/conversations/{id}` Route Handler: https://github.com/elastic/kibana/blob/1d5cf48a9700ee769f64256c23278fcfd8cecc5d/x-pack/plugins/elastic_assistant/server/routes/user_conversations/delete_route.ts#L19 Schema: https://github.com/elastic/kibana/blob/bae84d4569870dcecfd0cef346d2e0d38ac92160/x-pack/packages/kbn-elastic-assistant-common/impl/schemas/conversations/crud_conversation_route.schema.yaml#L116-L149 - [X] GET /api/elastic_assistant/current_user/conversations/{id} Updated Route: `/api/security_ai_assistant/current_user/conversations/{id}` Route Handler: https://github.com/elastic/kibana/blob/1d5cf48a9700ee769f64256c23278fcfd8cecc5d/x-pack/plugins/elastic_assistant/server/routes/user_conversations/read_route.ts#L21 Schema: https://github.com/elastic/kibana/blob/bae84d4569870dcecfd0cef346d2e0d38ac92160/x-pack/packages/kbn-elastic-assistant-common/impl/schemas/conversations/crud_conversation_route.schema.yaml#L42-L75 - [X] PUT /api/elastic_assistant/current_user/conversations/{id} Updated Route: `/api/security_ai_assistant/current_user/conversations/{id}` Route Handler: https://github.com/elastic/kibana/blob/1d5cf48a9700ee769f64256c23278fcfd8cecc5d/x-pack/plugins/elastic_assistant/server/routes/user_conversations/update_route.ts#L24 Schema: https://github.com/elastic/kibana/blob/bae84d4569870dcecfd0cef346d2e0d38ac92160/x-pack/packages/kbn-elastic-assistant-common/impl/schemas/conversations/crud_conversation_route.schema.yaml#L76-L115 To continue with remaining public routes.... --------- Co-authored-by: kibanamachine <[email protected]> (cherry picked from commit a51b775)
11 tasks
💚 Build Succeeded
Metrics [docs]Public APIs missing comments
To update your PR or re-run it, just comment with: cc @spong |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Backport
This will backport the following commits from
main
to8.15
:Questions ?
Please refer to the Backport tool documentation