-
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
Saved Object Namespaces #22968
Saved Object Namespaces #22968
Conversation
This comment has been minimized.
This comment has been minimized.
💚 Build Succeeded |
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.
LGTM: Tested and re-reviewed. Previously reviewed when these changes were part of #22357
It looks like this PR has conflicts, I assume with the saved object migrations PR that just got merged. |
That is correct, I'll be taking a look at resolving the conflicts a little later today and will update this and the spaces PR accordingly. |
Closing this out, I'll be opening up another one shortly that does the same thing but works with migrations |
Replaced by #23378 |
This introduces the concept of Saved Object Namespaces, which Spaces will be taking advantage of. This solves two primary pain-points, it allows us to prefix the very beginning of the Elasticsearch document IDs to prevent collisions, and it also makes the user experience when the Spaces plugin is disabled or removed more user friendly.
When Spaces isn't enabled, Saved Objects will continue to behave as they do today and their IDs will simply be type:id. However, when Saved Objects are in a namespace, as specified by the Spaces plugin, the ID will become namespace:type:id, which will prevent collisions and allow users to import/export objects between Spaces. Additionally, when a Saved Object is in a namespace, there will be an additional root level property of namespace, which allows us to efficiently query for objects within a namespace.
These changes are made in a backwards compatible manner for SavedObjectsClient consumers, and the namespace is simply an optional parameter on the interface to the SavedObjectsClient.