kibana/examples
Jeramy Soucy 835d4aff4c
Implements Encrypted Saved Objects Model Version API (#166302)
Closes #161002
Closes #170073

## Summary

This PR implements a createModelVersion API in the Encrypted Saved
Objects plugin to support upward migrations for model version encrypted
saved objects.

Much like how the `createMigration` API provided a way to wrap migration
functions to support migration of encrypted saved objects prior to the
model version paradigm, the new `createModelVersion` API provides a way
to wrap a model version definition for the same purpose.

`createModelVersion` manipulates the changes defined for a model version
('unsafe_transform', 'data_backfill', 'data_removal'), merging them into
a single transform function in which the saved object document is
decrypted, transformed, and then encrypted again. The document is
decrypted with the `encrypted saved object type registration` provided
by the required `inputType` parameter. Similarly, the document is by
encrypted with the `encrypted saved object type registration` provided
by the required `outputType` parameter.

An example plugin (`examples/eso_model_version_example`) provides a
demonstration of how the createModelVersion API should be used. The UI
of the example plugin gives an idea of what the encrypted saved objects
look like before and after the model version changes are applied.

## Testing

### Manual Testing
- Modify the example plugin implementation in
`examples/eso_model_version_example` to include different changes or
additional model versions.

### Unit Tests
-
`x-pack/plugins/encrypted_saved_objects/server/create_model_version.test.ts`

### Functional Tests
-
`x-pack/test/encrypted_saved_objects_api_integration/tests/encrypted_saved_objects_api.ts`
-
`x-pack/test/encrypted_saved_objects_api_integration/tests/encrypted_saved_objects_decryption.ts`

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2023-12-07 16:01:29 -05:00
..
bfetch_explorer async-import plugins in the server side (#170856) 2023-11-15 00:55:56 -07:00
content_management_examples [shared-ux] no-data analytics page package code cleanup (#172416) 2023-12-04 13:07:59 -07:00
controls_example [Tech Debt] Remove deprecated EuiLoadingContent (#156316) 2023-05-03 08:01:37 -06:00
data_view_field_editor_example Assign functional tests and example plugins code ownership to Data Discovery (#162740) 2023-08-04 17:21:13 -03:00
developer_examples Update EUI layout components in dev examples (#163494) 2023-08-10 11:19:06 +02:00
discover_customization_examples [Discover] Show "unsaved changes" label when in unsaved state of saved search (#169548) 2023-11-13 13:36:25 +01:00
embeddable_examples async-import plugins in the server side (#170856) 2023-11-15 00:55:56 -07:00
embeddable_explorer Clean up saved object based embeddable examples (#162987) 2023-08-03 03:14:36 -07:00
error_boundary Functional tests for KibanaErrorBoundary (#170569) 2023-11-08 11:23:19 -07:00
eso_model_version_example Implements Encrypted Saved Objects Model Version API (#166302) 2023-12-07 16:01:29 -05:00
expressions_explorer Set correct ownership of older app-services code (#168209) 2023-10-09 18:57:26 +02:00
feature_control_examples async-import plugins in the server side (#170856) 2023-11-15 00:55:56 -07:00
field_formats_example async-import plugins in the server side (#170856) 2023-11-15 00:55:56 -07:00
files_example async-import plugins in the server side (#170856) 2023-11-15 00:55:56 -07:00
guided_onboarding_example async-import plugins in the server side (#170856) 2023-11-15 00:55:56 -07:00
hello_world [packages] migrate all plugins to packages (#148130) 2023-02-08 21:06:50 -06:00
locator_examples Set correct ownership of older app-services code (#168209) 2023-10-09 18:57:26 +02:00
locator_explorer Set correct ownership of older app-services code (#168209) 2023-10-09 18:57:26 +02:00
partial_results_example [Discover] Replace deprecated page components (#162836) 2023-08-02 20:08:17 +02:00
portable_dashboards_example [shared-ux-router] Add Router and Routes components (#159834) 2023-06-23 10:02:06 -05:00
preboot_example async-import plugins in the server side (#170856) 2023-11-15 00:55:56 -07:00
resizable_layout_examples [Discover] Add resize support to the Discover field list sidebar (#167066) 2023-09-27 21:52:25 -03:00
response_stream async-import plugins in the server side (#170856) 2023-11-15 00:55:56 -07:00
routing_example async-import plugins in the server side (#170856) 2023-11-15 00:55:56 -07:00
screenshot_mode_example async-import plugins in the server side (#170856) 2023-11-15 00:55:56 -07:00
search_examples async-import plugins in the server side (#170856) 2023-11-15 00:55:56 -07:00
share_examples Set correct ownership of older app-services code (#168209) 2023-10-09 18:57:26 +02:00
state_containers_examples [Kibana] New "Saved Query Management" privilege to allow saving queries across Kibana (#166937) 2023-09-29 11:52:39 +02:00
ui_action_examples [packages] migrate all plugins to packages (#148130) 2023-02-08 21:06:50 -06:00
ui_actions_explorer Update usage of deprecated EUI components in SharedUx plugins (#163560) 2023-08-14 06:36:38 -07:00
unified_doc_viewer [UnifiedDocViewer] Move Discover doc viewer into plugin/package (#162847) 2023-08-31 11:46:59 -07:00
unified_field_list_examples [Discover] Redesign for the grid, panels and sidebar v1 (#165866) 2023-09-12 08:51:34 +02:00
user_profile_examples async-import plugins in the server side (#170856) 2023-11-15 00:55:56 -07:00
v8_profiler_examples async-import plugins in the server side (#170856) 2023-11-15 00:55:56 -07:00
README.asciidoc Add a few asciidoc readmes (#72082) 2020-07-17 11:08:57 -04:00

[[example-plugins]]
== Example plugins

This folder contains example plugins.  To run the plugins in this folder, use the `--run-examples` flag, via

[source,bash]
----
yarn start --run-examples
----