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

[Obs AI Assistant] Knowledge base should create user scoped IDs #183897

Closed
1 task
miltonhultgren opened this issue May 21, 2024 · 2 comments
Closed
1 task

[Obs AI Assistant] Knowledge base should create user scoped IDs #183897

miltonhultgren opened this issue May 21, 2024 · 2 comments

Comments

@miltonhultgren
Copy link
Contributor

miltonhultgren commented May 21, 2024

Summary

An entry in the knowledge base should be a piece of content that is bound to a user and a namespace meaning that two users (A and B) should be able to create an entry into the knowledge base in the same space and use the same ID without creating a conflict because the "primary key" for the entry should be username-space-id (to allow for easier wildcard queries).

Today we only use the id, meaning that if User A has created the entry "my-entry", when user B tries to create "my-entry" the system reports a conflict which has two issues:

  1. We leak across the access control boundary that some entry with this ID already exists
  2. User B has to modify their ID to avoid a conflict that shouldn't be visible to the user at all

If User B follows up their create request with a "get all entries" request to check what they have, they will get back a list that doesn't include "my-entry" since it doesn't belong to them.

Possible solutions

One approach that could work is to append the user name and space name to each ID behind the scenes, so that what is stored has the "full" ID schema, but what we return from the API to the user only has the base ID part.
This means that all APIs and the Knowledge base service have to consistently do this packing/unpacking.

Related

  1. 8.15 candidate Team:Obs AI Assistant bug
    sorenlouv
@miltonhultgren miltonhultgren added the Team:obs-knowledge Observability Experience Knowledge team label May 21, 2024
@elasticmachine
Copy link
Contributor

Pinging @elastic/obs-knowledge-team (Team:obs-knowledge)

@miltonhultgren
Copy link
Contributor Author

Duplicate of #184069

@miltonhultgren miltonhultgren marked this as a duplicate of #184069 May 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants