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

Allow "unresolvable conflict" errors to be circumvented using initialNamespaces #102950

Open
jportner opened this issue Jun 22, 2021 · 0 comments
Labels
enhancement New value added to drive a business result Feature:Saved Objects Feature:Security/Sharing Saved Objects Platform Security - Sharing Saved Objects feature Team:Core Core services & architecture: plugins, logging, config, saved objects, http, ES client, i18n, etc Team:Security Team focused on: Auth, Users, Roles, Spaces, Audit Logging, and more!

Comments

@jportner
Copy link
Contributor

jportner commented Jun 22, 2021

Blocked by: #102957

In #101904 (PR: #102585), we added support for initialNamespaces to be used when creating isolated object types. This allows consumers to create any non-space-agnostic object and define the initial space(s) it should be created in. It breaks down the barriers between spaces in the SavedObjectsRepository (SOR) and SavedObjectsClient (SOC), where operations are otherwise generally isolated to a single space.

However, multi-namespace objects currently have a limitation because they have globally unique IDs: if you try to create an object in space A, but an object with the same ID already exists in space B, that operation will fail with an "unresolvable conflict" error. This makes sense for a normal create operation, but the assumption breaks down when using the initialNamespaces option.

When creating an object and using the initialNamespaces option in conjunction with overwrite: true, the consumer is being deliberate about what they want to accomplish, and we should allow them to overwrite the existing object without throwing an unresolvable conflict error. However, we should only allow this if the user has privileges to do all of the following:

  • Create in the current space
  • Create in the target spaces (defined by initialNamespaces)
  • Create in at least one space where the object currently exists

To enable this behavior, we have to do two things:

  1. Conduct preflight checks in the Repository for create and bulkCreate to see if the object currently exists, and if so, what space(s) it exists in
  2. Avoid throwing the unresolvable conflict error in the SOR iff initialNamespaces and overwrite: true are both specified
@jportner jportner added Team:Core Core services & architecture: plugins, logging, config, saved objects, http, ES client, i18n, etc Team:Security Team focused on: Auth, Users, Roles, Spaces, Audit Logging, and more! enhancement New value added to drive a business result labels Jun 22, 2021
@jportner jportner self-assigned this Jun 22, 2021
@exalate-issue-sync exalate-issue-sync bot added impact:low Addressing this issue will have a low level of impact on the quality/strength of our product. loe:small Small Level of Effort labels Aug 4, 2021
@legrego legrego removed EnableJiraSync loe:small Small Level of Effort impact:low Addressing this issue will have a low level of impact on the quality/strength of our product. labels Aug 18, 2022
@legrego legrego added Feature:Saved Objects Feature:Security/Sharing Saved Objects Platform Security - Sharing Saved Objects feature labels Oct 31, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New value added to drive a business result Feature:Saved Objects Feature:Security/Sharing Saved Objects Platform Security - Sharing Saved Objects feature Team:Core Core services & architecture: plugins, logging, config, saved objects, http, ES client, i18n, etc Team:Security Team focused on: Auth, Users, Roles, Spaces, Audit Logging, and more!
Projects
None yet
Development

No branches or pull requests

2 participants