-
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
[Security Assistant] Fix Knowledge Base API #211367
[Security Assistant] Fix Knowledge Base API #211367
Conversation
@@ -56,7 +56,26 @@ export class RequestContextFactory implements IRequestContextFactory { | |||
const getSpaceId = (): string => | |||
startPlugins.spaces?.spacesService?.getSpaceId(request) || DEFAULT_NAMESPACE_STRING; | |||
|
|||
const getCurrentUser = () => coreContext.security.authc.getCurrentUser(); | |||
const getCurrentUser = async () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚀
Changes related to user profile ID looks great and should work now! I tested some other routes and noticed next issues: 1. KB entry by ID APIs:I see that we report a few routes in our openapi files a few routes that are not available ![]()
2. Bulk actions - CREATEI bumped into this error which happens once user created private entry and then tries to create a new one via bulk actions: ![]() After some investigation, I've noticed that we have an issue within our code:
Here we check whether user has document entries and if there are some existing entries we throw an 409 error in this case and do no allow user to create new entries via bulk CREATE action. 3. Bulk actions - UPDATEI still see the issue where the document entry disappears after the bulk update. It happens when during the update I set Screen.Recording.2025-02-17.at.14.25.05.-.1080.mov |
...ed/kbn-elastic-assistant-common/impl/schemas/knowledge_base/entries/common_attributes.gen.ts
Outdated
Show resolved
Hide resolved
@patrykkopycinski I checked APIs again and most routes work as expected! Just two notes related to the "update entry by id" route:
![]()
|
Sorry all for the ping, Github resolve conflicts 🤦 |
Starting backport for target branches: 8.18, 9.0 https://github.com/elastic/kibana/actions/runs/13532636265 |
💚 Build Succeeded
Metrics [docs]Public APIs missing comments
Async chunks
Unknown metric groupsAPI count
ESLint disabled line counts
Total ESLint disabled count
History
|
## Summary Fixes bugs related to Security Assistant Knowledge Base API --------- Co-authored-by: kibanamachine <[email protected]> Co-authored-by: Hannah Mudge <[email protected]> Co-authored-by: Marta Bondyra <[email protected]> Co-authored-by: Davis Plumlee <[email protected]> Co-authored-by: Jatin Kathuria <[email protected]> Co-authored-by: Chris Cowan <[email protected]> Co-authored-by: Elastic Machine <[email protected]> Co-authored-by: Arturo Lidueña <[email protected]> Co-authored-by: Jon <[email protected]> Co-authored-by: Rodney Norris <[email protected]> Co-authored-by: Elena Shostak <[email protected]> Co-authored-by: Stratoula Kalafateli <[email protected]> Co-authored-by: Irene Blanco <[email protected]> Co-authored-by: Cauê Marcondes <[email protected]> Co-authored-by: Carlos Crespo <[email protected]> (cherry picked from commit c822109)
## Summary Fixes bugs related to Security Assistant Knowledge Base API --------- Co-authored-by: kibanamachine <[email protected]> Co-authored-by: Hannah Mudge <[email protected]> Co-authored-by: Marta Bondyra <[email protected]> Co-authored-by: Davis Plumlee <[email protected]> Co-authored-by: Jatin Kathuria <[email protected]> Co-authored-by: Chris Cowan <[email protected]> Co-authored-by: Elastic Machine <[email protected]> Co-authored-by: Arturo Lidueña <[email protected]> Co-authored-by: Jon <[email protected]> Co-authored-by: Rodney Norris <[email protected]> Co-authored-by: Elena Shostak <[email protected]> Co-authored-by: Stratoula Kalafateli <[email protected]> Co-authored-by: Irene Blanco <[email protected]> Co-authored-by: Cauê Marcondes <[email protected]> Co-authored-by: Carlos Crespo <[email protected]> (cherry picked from commit c822109)
💚 All backports created successfully
Note: Successful backport PRs will be merged automatically after passing CI. Questions ?Please refer to the Backport tool documentation |
# Backport This will backport the following commits from `main` to `9.0`: - [[Security Assistant] Fix Knowledge Base API (#211367)](#211367) <!--- Backport version: 9.6.6 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sorenlouv/backport) <!--BACKPORT [{"author":{"name":"Patryk Kopyciński","email":"[email protected]"},"sourceCommit":{"committedDate":"2025-02-25T23:00:00Z","message":"[Security Assistant] Fix Knowledge Base API (#211367)\n\n## Summary\n\nFixes bugs related to Security Assistant Knowledge Base API\n\n---------\n\nCo-authored-by: kibanamachine <[email protected]>\nCo-authored-by: Hannah Mudge <[email protected]>\nCo-authored-by: Marta Bondyra <[email protected]>\nCo-authored-by: Davis Plumlee <[email protected]>\nCo-authored-by: Jatin Kathuria <[email protected]>\nCo-authored-by: Chris Cowan <[email protected]>\nCo-authored-by: Elastic Machine <[email protected]>\nCo-authored-by: Arturo Lidueña <[email protected]>\nCo-authored-by: Jon <[email protected]>\nCo-authored-by: Rodney Norris <[email protected]>\nCo-authored-by: Elena Shostak <[email protected]>\nCo-authored-by: Stratoula Kalafateli <[email protected]>\nCo-authored-by: Irene Blanco <[email protected]>\nCo-authored-by: Cauê Marcondes <[email protected]>\nCo-authored-by: Carlos Crespo <[email protected]>","sha":"c822109a492fe4dcf38ca5aa6d87b2a95bf075c4","branchLabelMapping":{"^v9.1.0$":"main","^v8.19.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["bug","release_note:skip","v9.0.0","Feature:Security Assistant","Team:Security Generative AI","backport:version","v8.18.0","v9.1.0"],"title":"[Security Assistant] Fix Knowledge Base API","number":211367,"url":"https://github.com/elastic/kibana/pull/211367","mergeCommit":{"message":"[Security Assistant] Fix Knowledge Base API (#211367)\n\n## Summary\n\nFixes bugs related to Security Assistant Knowledge Base API\n\n---------\n\nCo-authored-by: kibanamachine <[email protected]>\nCo-authored-by: Hannah Mudge <[email protected]>\nCo-authored-by: Marta Bondyra <[email protected]>\nCo-authored-by: Davis Plumlee <[email protected]>\nCo-authored-by: Jatin Kathuria <[email protected]>\nCo-authored-by: Chris Cowan <[email protected]>\nCo-authored-by: Elastic Machine <[email protected]>\nCo-authored-by: Arturo Lidueña <[email protected]>\nCo-authored-by: Jon <[email protected]>\nCo-authored-by: Rodney Norris <[email protected]>\nCo-authored-by: Elena Shostak <[email protected]>\nCo-authored-by: Stratoula Kalafateli <[email protected]>\nCo-authored-by: Irene Blanco <[email protected]>\nCo-authored-by: Cauê Marcondes <[email protected]>\nCo-authored-by: Carlos Crespo <[email protected]>","sha":"c822109a492fe4dcf38ca5aa6d87b2a95bf075c4"}},"sourceBranch":"main","suggestedTargetBranches":["9.0","8.18"],"targetPullRequestStates":[{"branch":"9.0","label":"v9.0.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"8.18","label":"v8.18.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"main","label":"v9.1.0","branchLabelMappingKey":"^v9.1.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/211367","number":211367,"mergeCommit":{"message":"[Security Assistant] Fix Knowledge Base API (#211367)\n\n## Summary\n\nFixes bugs related to Security Assistant Knowledge Base API\n\n---------\n\nCo-authored-by: kibanamachine <[email protected]>\nCo-authored-by: Hannah Mudge <[email protected]>\nCo-authored-by: Marta Bondyra <[email protected]>\nCo-authored-by: Davis Plumlee <[email protected]>\nCo-authored-by: Jatin Kathuria <[email protected]>\nCo-authored-by: Chris Cowan <[email protected]>\nCo-authored-by: Elastic Machine <[email protected]>\nCo-authored-by: Arturo Lidueña <[email protected]>\nCo-authored-by: Jon <[email protected]>\nCo-authored-by: Rodney Norris <[email protected]>\nCo-authored-by: Elena Shostak <[email protected]>\nCo-authored-by: Stratoula Kalafateli <[email protected]>\nCo-authored-by: Irene Blanco <[email protected]>\nCo-authored-by: Cauê Marcondes <[email protected]>\nCo-authored-by: Carlos Crespo <[email protected]>","sha":"c822109a492fe4dcf38ca5aa6d87b2a95bf075c4"}}]}] BACKPORT--> Co-authored-by: Patryk Kopyciński <[email protected]>
# Backport This will backport the following commits from `main` to `8.18`: - [[Security Assistant] Fix Knowledge Base API (#211367)](#211367) <!--- Backport version: 9.6.6 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sorenlouv/backport) <!--BACKPORT [{"author":{"name":"Patryk Kopyciński","email":"[email protected]"},"sourceCommit":{"committedDate":"2025-02-25T23:00:00Z","message":"[Security Assistant] Fix Knowledge Base API (#211367)\n\n## Summary\n\nFixes bugs related to Security Assistant Knowledge Base API\n\n---------\n\nCo-authored-by: kibanamachine <[email protected]>\nCo-authored-by: Hannah Mudge <[email protected]>\nCo-authored-by: Marta Bondyra <[email protected]>\nCo-authored-by: Davis Plumlee <[email protected]>\nCo-authored-by: Jatin Kathuria <[email protected]>\nCo-authored-by: Chris Cowan <[email protected]>\nCo-authored-by: Elastic Machine <[email protected]>\nCo-authored-by: Arturo Lidueña <[email protected]>\nCo-authored-by: Jon <[email protected]>\nCo-authored-by: Rodney Norris <[email protected]>\nCo-authored-by: Elena Shostak <[email protected]>\nCo-authored-by: Stratoula Kalafateli <[email protected]>\nCo-authored-by: Irene Blanco <[email protected]>\nCo-authored-by: Cauê Marcondes <[email protected]>\nCo-authored-by: Carlos Crespo <[email protected]>","sha":"c822109a492fe4dcf38ca5aa6d87b2a95bf075c4","branchLabelMapping":{"^v9.1.0$":"main","^v8.19.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["bug","release_note:skip","v9.0.0","Feature:Security Assistant","Team:Security Generative AI","backport:version","v8.18.0","v9.1.0"],"title":"[Security Assistant] Fix Knowledge Base API","number":211367,"url":"https://github.com/elastic/kibana/pull/211367","mergeCommit":{"message":"[Security Assistant] Fix Knowledge Base API (#211367)\n\n## Summary\n\nFixes bugs related to Security Assistant Knowledge Base API\n\n---------\n\nCo-authored-by: kibanamachine <[email protected]>\nCo-authored-by: Hannah Mudge <[email protected]>\nCo-authored-by: Marta Bondyra <[email protected]>\nCo-authored-by: Davis Plumlee <[email protected]>\nCo-authored-by: Jatin Kathuria <[email protected]>\nCo-authored-by: Chris Cowan <[email protected]>\nCo-authored-by: Elastic Machine <[email protected]>\nCo-authored-by: Arturo Lidueña <[email protected]>\nCo-authored-by: Jon <[email protected]>\nCo-authored-by: Rodney Norris <[email protected]>\nCo-authored-by: Elena Shostak <[email protected]>\nCo-authored-by: Stratoula Kalafateli <[email protected]>\nCo-authored-by: Irene Blanco <[email protected]>\nCo-authored-by: Cauê Marcondes <[email protected]>\nCo-authored-by: Carlos Crespo <[email protected]>","sha":"c822109a492fe4dcf38ca5aa6d87b2a95bf075c4"}},"sourceBranch":"main","suggestedTargetBranches":["9.0","8.18"],"targetPullRequestStates":[{"branch":"9.0","label":"v9.0.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"8.18","label":"v8.18.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"main","label":"v9.1.0","branchLabelMappingKey":"^v9.1.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/211367","number":211367,"mergeCommit":{"message":"[Security Assistant] Fix Knowledge Base API (#211367)\n\n## Summary\n\nFixes bugs related to Security Assistant Knowledge Base API\n\n---------\n\nCo-authored-by: kibanamachine <[email protected]>\nCo-authored-by: Hannah Mudge <[email protected]>\nCo-authored-by: Marta Bondyra <[email protected]>\nCo-authored-by: Davis Plumlee <[email protected]>\nCo-authored-by: Jatin Kathuria <[email protected]>\nCo-authored-by: Chris Cowan <[email protected]>\nCo-authored-by: Elastic Machine <[email protected]>\nCo-authored-by: Arturo Lidueña <[email protected]>\nCo-authored-by: Jon <[email protected]>\nCo-authored-by: Rodney Norris <[email protected]>\nCo-authored-by: Elena Shostak <[email protected]>\nCo-authored-by: Stratoula Kalafateli <[email protected]>\nCo-authored-by: Irene Blanco <[email protected]>\nCo-authored-by: Cauê Marcondes <[email protected]>\nCo-authored-by: Carlos Crespo <[email protected]>","sha":"c822109a492fe4dcf38ca5aa6d87b2a95bf075c4"}}]}] BACKPORT--> --------- Co-authored-by: Patryk Kopyciński <[email protected]>
Summary
Fixes bugs related to Security Assistant Knowledge Base API