mirror of
https://github.com/elastic/kibana.git
synced 2025-04-21 16:29:04 -04:00
# Backport This will backport the following commits from `main` to `8.8`: - [Handles non-existing objects in _copy_saved_objects API call (#158036)](https://github.com/elastic/kibana/pull/158036) <!--- Backport version: 8.9.7 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sqren/backport) <!--BACKPORT [{"author":{"name":"Jeramy Soucy","email":"jeramy.soucy@elastic.co"},"sourceCommit":{"committedDate":"2023-05-24T16:20:46Z","message":"Handles non-existing objects in _copy_saved_objects API call (#158036)\n\nCloses #156791\r\n\r\n## Summary\r\n\r\nThis PR implements catching the error thrown by the\r\nsaved_objects_exporter when an object is not found, and responding with\r\na detailed 404 (\"Not Found\") rather than a generic 500 (\"Internal Server\r\nError\") response message.\r\n\r\n### Example Response:\r\n```\r\n{\r\n \"statusCode\": 404,\r\n \"error\": \"Not Found\",\r\n \"message\": \"Saved objects not found\",\r\n \"attributes\": {\r\n \"objects\": [\r\n {\r\n \"id\": \"7adfa750-4c81-11e8-b3d7-01146121b73d\",\r\n \"type\": \"dashboard\"\r\n },\r\n {\r\n \"id\": \"571aaf70-4c88-11e8-b3d7-01146121b73d\",\r\n \"type\": \"search\"\r\n },\r\n {\r\n \"id\": \"d3d7af60-4c81-11e8-b3d7-01146121b73d\",\r\n \"type\": \"index-pattern\"\r\n }\r\n ]\r\n }\r\n}\r\n```\r\n\r\n### Testing\r\n\r\n1. Install sample flight data, find the id of the flights dashboard SO\r\n2. Create an additional space 'b'\r\n3. Issue a request to copy saved objects to space b\r\n```\r\nPOST kbn:/api/spaces/_copy_saved_objects\r\n{\r\n \"spaces\": [\r\n \"b\"\r\n ],\r\n \"objects\": [\r\n {\r\n \"type\": \"dashboard\",\r\n \"id\": \"7adfa750-4c81-11e8-b3d7-01146121b73e\"\r\n },\r\n {\r\n \"type\": \"dashboard\",\r\n \"id\": \"7adfa750-4c81-11e8-b3d7-01146121b73f\"\r\n },\r\n {\r\n \"type\": \"dashboard\",\r\n \"id\": \"7adfa750-4c81-11e8-b3d7-01146121b73g\"\r\n }\r\n ]\r\n}\r\n```\r\n4. Verify response\r\n```\r\n{\r\n \"statusCode\": 404,\r\n \"error\": \"Not Found\",\r\n \"message\": \"Saved objects not found\",\r\n \"attributes\": {\r\n \"objects\": [\r\n {\r\n \"type\": \"dashboard\",\r\n \"id\": \"7adfa750-4c81-11e8-b3d7-01146121b73e\"\r\n },\r\n {\r\n \"type\": \"dashboard\",\r\n \"id\": \"7adfa750-4c81-11e8-b3d7-01146121b73f\"\r\n },\r\n {\r\n \"type\": \"dashboard\",\r\n \"id\": \"7adfa750-4c81-11e8-b3d7-01146121b73g\"\r\n }\r\n ]\r\n }\r\n}\r\n```\r\n5. Issue a request to copy the flights dashboard SO\r\n6. Verify the usual response (200, missing references)\r\n7. Issue a malformed request to copy an SO\r\n8. Verify status 400 response with details","sha":"1589547b6f143c45c782ed857902026af2e7e38a","branchLabelMapping":{"^v8.9.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:fix","Team:Security","Feature:Saved Objects","Feature:Security/Spaces","backport:all-open","v8.9.0"],"number":158036,"url":"https://github.com/elastic/kibana/pull/158036","mergeCommit":{"message":"Handles non-existing objects in _copy_saved_objects API call (#158036)\n\nCloses #156791\r\n\r\n## Summary\r\n\r\nThis PR implements catching the error thrown by the\r\nsaved_objects_exporter when an object is not found, and responding with\r\na detailed 404 (\"Not Found\") rather than a generic 500 (\"Internal Server\r\nError\") response message.\r\n\r\n### Example Response:\r\n```\r\n{\r\n \"statusCode\": 404,\r\n \"error\": \"Not Found\",\r\n \"message\": \"Saved objects not found\",\r\n \"attributes\": {\r\n \"objects\": [\r\n {\r\n \"id\": \"7adfa750-4c81-11e8-b3d7-01146121b73d\",\r\n \"type\": \"dashboard\"\r\n },\r\n {\r\n \"id\": \"571aaf70-4c88-11e8-b3d7-01146121b73d\",\r\n \"type\": \"search\"\r\n },\r\n {\r\n \"id\": \"d3d7af60-4c81-11e8-b3d7-01146121b73d\",\r\n \"type\": \"index-pattern\"\r\n }\r\n ]\r\n }\r\n}\r\n```\r\n\r\n### Testing\r\n\r\n1. Install sample flight data, find the id of the flights dashboard SO\r\n2. Create an additional space 'b'\r\n3. Issue a request to copy saved objects to space b\r\n```\r\nPOST kbn:/api/spaces/_copy_saved_objects\r\n{\r\n \"spaces\": [\r\n \"b\"\r\n ],\r\n \"objects\": [\r\n {\r\n \"type\": \"dashboard\",\r\n \"id\": \"7adfa750-4c81-11e8-b3d7-01146121b73e\"\r\n },\r\n {\r\n \"type\": \"dashboard\",\r\n \"id\": \"7adfa750-4c81-11e8-b3d7-01146121b73f\"\r\n },\r\n {\r\n \"type\": \"dashboard\",\r\n \"id\": \"7adfa750-4c81-11e8-b3d7-01146121b73g\"\r\n }\r\n ]\r\n}\r\n```\r\n4. Verify response\r\n```\r\n{\r\n \"statusCode\": 404,\r\n \"error\": \"Not Found\",\r\n \"message\": \"Saved objects not found\",\r\n \"attributes\": {\r\n \"objects\": [\r\n {\r\n \"type\": \"dashboard\",\r\n \"id\": \"7adfa750-4c81-11e8-b3d7-01146121b73e\"\r\n },\r\n {\r\n \"type\": \"dashboard\",\r\n \"id\": \"7adfa750-4c81-11e8-b3d7-01146121b73f\"\r\n },\r\n {\r\n \"type\": \"dashboard\",\r\n \"id\": \"7adfa750-4c81-11e8-b3d7-01146121b73g\"\r\n }\r\n ]\r\n }\r\n}\r\n```\r\n5. Issue a request to copy the flights dashboard SO\r\n6. Verify the usual response (200, missing references)\r\n7. Issue a malformed request to copy an SO\r\n8. Verify status 400 response with details","sha":"1589547b6f143c45c782ed857902026af2e7e38a"}},"sourceBranch":"main","suggestedTargetBranches":[],"targetPullRequestStates":[{"branch":"main","label":"v8.9.0","labelRegex":"^v8.9.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/158036","number":158036,"mergeCommit":{"message":"Handles non-existing objects in _copy_saved_objects API call (#158036)\n\nCloses #156791\r\n\r\n## Summary\r\n\r\nThis PR implements catching the error thrown by the\r\nsaved_objects_exporter when an object is not found, and responding with\r\na detailed 404 (\"Not Found\") rather than a generic 500 (\"Internal Server\r\nError\") response message.\r\n\r\n### Example Response:\r\n```\r\n{\r\n \"statusCode\": 404,\r\n \"error\": \"Not Found\",\r\n \"message\": \"Saved objects not found\",\r\n \"attributes\": {\r\n \"objects\": [\r\n {\r\n \"id\": \"7adfa750-4c81-11e8-b3d7-01146121b73d\",\r\n \"type\": \"dashboard\"\r\n },\r\n {\r\n \"id\": \"571aaf70-4c88-11e8-b3d7-01146121b73d\",\r\n \"type\": \"search\"\r\n },\r\n {\r\n \"id\": \"d3d7af60-4c81-11e8-b3d7-01146121b73d\",\r\n \"type\": \"index-pattern\"\r\n }\r\n ]\r\n }\r\n}\r\n```\r\n\r\n### Testing\r\n\r\n1. Install sample flight data, find the id of the flights dashboard SO\r\n2. Create an additional space 'b'\r\n3. Issue a request to copy saved objects to space b\r\n```\r\nPOST kbn:/api/spaces/_copy_saved_objects\r\n{\r\n \"spaces\": [\r\n \"b\"\r\n ],\r\n \"objects\": [\r\n {\r\n \"type\": \"dashboard\",\r\n \"id\": \"7adfa750-4c81-11e8-b3d7-01146121b73e\"\r\n },\r\n {\r\n \"type\": \"dashboard\",\r\n \"id\": \"7adfa750-4c81-11e8-b3d7-01146121b73f\"\r\n },\r\n {\r\n \"type\": \"dashboard\",\r\n \"id\": \"7adfa750-4c81-11e8-b3d7-01146121b73g\"\r\n }\r\n ]\r\n}\r\n```\r\n4. Verify response\r\n```\r\n{\r\n \"statusCode\": 404,\r\n \"error\": \"Not Found\",\r\n \"message\": \"Saved objects not found\",\r\n \"attributes\": {\r\n \"objects\": [\r\n {\r\n \"type\": \"dashboard\",\r\n \"id\": \"7adfa750-4c81-11e8-b3d7-01146121b73e\"\r\n },\r\n {\r\n \"type\": \"dashboard\",\r\n \"id\": \"7adfa750-4c81-11e8-b3d7-01146121b73f\"\r\n },\r\n {\r\n \"type\": \"dashboard\",\r\n \"id\": \"7adfa750-4c81-11e8-b3d7-01146121b73g\"\r\n }\r\n ]\r\n }\r\n}\r\n```\r\n5. Issue a request to copy the flights dashboard SO\r\n6. Verify the usual response (200, missing references)\r\n7. Issue a malformed request to copy an SO\r\n8. Verify status 400 response with details","sha":"1589547b6f143c45c782ed857902026af2e7e38a"}}]}] BACKPORT--> Co-authored-by: Jeramy Soucy <jeramy.soucy@elastic.co> |
||
---|---|---|
.. | ||
common | ||
public | ||
server | ||
jest.config.js | ||
kibana.jsonc | ||
README.md | ||
tsconfig.json |
Kibana Spaces Plugin
See Configuring Kibana Spaces.
The spaces plugin enables Kibana Spaces, which provide isolation and organization for saved objects.
Spaces also allow for a creating a curated Kibana experience, by hiding features that aren't relevant to your users.
Spaces can be combined with Security to further enhance the authorization model.