kibana/examples/eso_model_version_example
Dario Gieselaar 98ce312ba3
More strict plugin type definitions (#205232)
Stricter defaults for plugin types: `Plugin` and `CoreSetup` now have
empty objects as defaults instead of `object` which is assignable to
anything basically. This catches some type errors, but my motivation for
this is to allow something like:

```ts
function createPlugin ():Plugin<MySetupContract, MyStartContract, MySetupDependencies, MyStartDependencies> {
	return {
		// look ma, no additional typing necessary
		setup ( coreSetup, pluginsSetup ) {
		},
		start ( coreStart, pluginsStart ) {
		}
	}
}
```
2025-01-07 16:41:15 +01:00
..
common Adds AGPL 3.0 license (#192025) 2024-09-06 19:02:41 -06:00
public Adds AGPL 3.0 license (#192025) 2024-09-06 19:02:41 -06:00
server More strict plugin type definitions (#205232) 2025-01-07 16:41:15 +01:00
kibana.jsonc Implements Encrypted Saved Objects Model Version API (#166302) 2023-12-07 16:01:29 -05:00
README.md Implements Encrypted Saved Objects Model Version API (#166302) 2023-12-07 16:01:29 -05:00
tsconfig.json Implements Encrypted Saved Objects Model Version API (#166302) 2023-12-07 16:01:29 -05:00

Encrypted Saved Object Model Version Example

This plugin provides a simple use case demonstration of:

  • How to organize versioned saved object and encryption registration definitions
  • How to use the createModelVersion wrapper function of the Encrypted Saved Objects plugin
  • How/when encrypted model versions are migrated and what to expect when they are queried

This is an example plugin to demonstrate implementation of an encrypted saved object with model versions using the new encryptedSavedObjectsPlugin.createModelVersion API.

A good place to start is by reviewing the definitions in examples/eso_model_version_example/server/types. This is where the interfaces and constants that for the example saved object are defined.

In examples/eso_model_version_example/server/plugin.ts the model versions are defined, which include typical changes you might see in a saved object over time only in this case the model version definitions are wrapped by the new createModelVersion API.

Lastly, use the plugin UI to get a sense for how the objects are migrated - you can query the raw documents and then decrypted the migrated objects.

To run this example, use the command yarn start --run-examples.