-
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
[Spaces] - prepend space id to document id #21372
Merged
Merged
Changes from all commits
Commits
Show all changes
57 commits
Select commit
Hold shift + click to select a range
f208d3c
Crude and incomplete impl of Space-Aware Saved Objects Client
legrego 7538bf3
Code review updates
legrego bb3e511
Missed one - move extraBodyProperties to the top
legrego 0e2e4e8
Remove documentFilter from bulkGet
legrego a6287cc
Merge branch 'spaces-phase-1' into space-aware-saved-objects
legrego 7db0a4a
Make config document id independent of Kibana version
legrego 192d9c2
Merge branch 'spaces-phase-1' into space-aware-saved-objects
legrego 1c4afd8
Merge branch 'spaces-phase-1' into space-aware-saved-objects
legrego d573457
cleanup and fixes following initial rbac phase 1 merge
legrego d99cec7
remove unused/migrated files
legrego 7e2d1e3
remove unused code
legrego 862752b
Merge branch 'spaces-phase-1' into space-aware-saved-objects
legrego a63128c
partial updates for space aware saved objects and tests
legrego 858eff0
working get & find functional tests
legrego 1b95aa0
added bulk_get tests
legrego fc663d9
refactor query params into dedicated module
legrego fc61594
additional tests and bugfixes for space aware saved objects
legrego 776da8a
revert changes to ui settings service
legrego d2545d4
additional tests for space-aware saved objects
legrego 1fd7699
Fix navigating to the default space
legrego 9469742
additional unit tests
legrego e24578f
Create default space on startup, *after* ES has gone green
legrego 5fe4bfd
support & testing for bulk_create for space-enabled installations
legrego c6e8925
cleanup and docs
legrego f4a19ab
undo formatting changes
legrego 7827e02
append space id to document id within spaces saved objects client
legrego dee335b
only allow filters to be passed to getQueryParams
legrego 452de10
don't add space id when updating within the default space
legrego 6bf3515
renaming files
legrego 8cb871a
additional SOC and repository tests
legrego 53bb020
remove default context from utility functions
legrego 90892ca
rename spacesSavedObjectsClientWrapper => spacesSavedObjectsClientWra…
legrego 4181c9e
don't mutate passed options for SOC create method
legrego a35d15f
allow options to be passed for get and bulkGet
legrego 093dd47
additional review updates
legrego 2dd7464
Merge branch 'space-aware-saved-objects' into prepend-space-id
legrego 3bb2aa7
manually re-add tests from space-aware-saved-objects
legrego 6e1c4c4
Merge branch 'spaces-phase-1' into space-aware-saved-objects
legrego 2195ee0
consolidate init logic
legrego 5fced69
Merge branch 'space-aware-saved-objects' into prepend-space-id
legrego 48c5f23
Add error handling when switching spaces
legrego 3a832e9
rename single character variables
legrego 71f0634
Merge branch 'spaces-phase-1' into space-aware-saved-objects
legrego 00bd94c
fix merge
legrego 415fa09
Merge branch 'spaces-phase-1' into space-aware-saved-objects
legrego 8d48c80
Merge branch 'spaces-phase-1' into space-aware-saved-objects
legrego 7ee1cb0
Merge branch 'space-aware-saved-objects' into prepend-space-id
legrego bc8aaef
Merge branch 'spaces-phase-1' into space-aware-saved-objects
legrego 839a0cf
Merge branch 'spaces-phase-1' into space-aware-saved-objects
legrego 0ebe3e3
Merge branch 'space-aware-saved-objects' into prepend-space-id
legrego 8b1ff6b
address PR feedback
legrego e7815e6
Merge branch 'space-aware-saved-objects' into prepend-space-id
legrego 70284a5
Merge branch 'spaces-phase-1' into prepend-space-id
legrego 7e851d0
append space id to document id
legrego 7042889
update functional tests
legrego 560acfa
additional get/bulkget tests
legrego a5161bf
address PR feedback
legrego File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
36 changes: 30 additions & 6 deletions
36
...es/server/lib/saved_objects_client/__snapshots__/spaces_saved_objects_client.test.js.snap
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,37 @@ | ||
// Jest Snapshot v1, https://goo.gl/fbAQLP | ||
|
||
exports[`current space (space_1) #create #delete does not allow an object to be deleted via a different space 1`] = `"not found"`; | ||
exports[`current space (space_1) #bulk_create throws when the base client returns a malformed document id 1`] = `"Saved object [foo/mock-id] is missing its expected space identifier."`; | ||
|
||
exports[`current space (space_1) #create #update does not allow an object to be updated via a different space 1`] = `"not found"`; | ||
exports[`current space (space_1) #bulk_get throws when base client returns documents with malformed ids 1`] = `"Saved object [foo/object_1] is missing its expected space identifier."`; | ||
|
||
exports[`current space (space_1) #get returns error when the object belongs to a different space 1`] = `"not found"`; | ||
exports[`current space (space_1) #create throws when the base client returns a malformed document id 1`] = `"Saved object [foo/mock-id] is missing its expected space identifier."`; | ||
|
||
exports[`default space #delete does not allow an object to be deleted via a different space 1`] = `"not found"`; | ||
exports[`current space (space_1) #delete does not allow an object to be deleted via a different space 1`] = `"not found: foo space_1:object_2"`; | ||
|
||
exports[`default space #get returns error when the object belongs to a different space 1`] = `"not found"`; | ||
exports[`current space (space_1) #find throws when base client returns documents with malformed ids 1`] = `"Saved object [foo/object_1] is missing its expected space identifier."`; | ||
|
||
exports[`default space #update does not allow an object to be updated via a different space 1`] = `"not found"`; | ||
exports[`current space (space_1) #get returns error when the object belongs to a different space 1`] = `"not found: foo space_1:object_2"`; | ||
|
||
exports[`current space (space_1) #get returns error when the object has a malformed identifier 1`] = `"Saved object [foo/object_1] is missing its expected space identifier."`; | ||
|
||
exports[`current space (space_1) #update does not allow an object to be updated via a different space 1`] = `"not found: foo space_1:object_2"`; | ||
|
||
exports[`current space (space_1) #update throws when the base client returns a malformed document id 1`] = `"Saved object [foo/object_1] is missing its expected space identifier."`; | ||
|
||
exports[`default space #bulk_create throws when the base client returns a malformed document id 1`] = `"Saved object [foo/default:default] has an unexpected space identifier [default]."`; | ||
|
||
exports[`default space #bulk_get throws when the base client returns a malformed document id 1`] = `"Saved object [foo/default:default] has an unexpected space identifier [default]."`; | ||
|
||
exports[`default space #create throws when the base client returns a malformed document id 1`] = `"Saved object [foo/default:default] has an unexpected space identifier [default]."`; | ||
|
||
exports[`default space #delete does not allow an object to be deleted via a different space 1`] = `"not found: foo object_2"`; | ||
|
||
exports[`default space #find throws when the base client returns a malformed document id 1`] = `"Saved object [foo/default:default] has an unexpected space identifier [default]."`; | ||
|
||
exports[`default space #get returns error when the object belongs to a different space 1`] = `"not found: foo object_2"`; | ||
|
||
exports[`default space #get throws when the base client returns a malformed document id 1`] = `"Saved object [foo/default:default] has an unexpected space identifier [default]."`; | ||
|
||
exports[`default space #update does not allow an object to be updated via a different space 1`] = `"not found: foo object_2"`; | ||
|
||
exports[`default space #update throws when the base client returns a malformed document id 1`] = `"Saved object [space/default:default] has an unexpected space identifier [default]."`; |
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
Oops, something went wrong.
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.
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.
The way that we're trimming the spaceId is very similar to here, it seems like a rather naive implementation that could have unwanted behaviors if we're missing a spaceId prefix and we should have one for the type. I wonder why they weren't throwing errors in the base
trimIdPrefix
when they weren't found...