## Summary This PR makes `security` a required field for route registration. To incorporate the new required filed, changes has been made: 1. **Test file updates**. A lot of the updates made in this PR were made in tests. 2. **Versioned route security configuration**. For the versioned route `security` config has been lifted up to the top-level definition: Before ```ts router.versioned .get({ path: '/api/path', options: { ... }, ... }, handler) .addVersion({ version: 1, validate: false, security: { authz: { requiredPrivileges: ['privilege'], }, }, }); ``` After ```ts router.versioned .get({ path: '/api/path', options: { ... }, security: { authz: { requiredPrivileges: ['privilege'], }, }, ... }, handler) .addVersion({ version: 1, validate: false, }); ``` 3. **Type adjustments for route wrappers**. Type changes has been made in: - `x-pack/solutions/observability/plugins/infra/server/lib/adapters/framework/adapter_types.ts` - `x-pack/solutions/observability/plugins/metrics_data_access/server/lib/adapters/framework/adapter_types.ts` - `x-pack/solutions/observability/plugins/synthetics/server/routes/types.ts` - `x-pack/solutions/observability/plugins/uptime/server/legacy_uptime/routes/types.ts` Security was made an optional field for the wrappers defined in those files, since the default security is provided in the wrapper itself and then passed down to the core router. ### Checklist - [x] [Unit or functional tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html) were updated or added to match the most common scenarios - [x] The PR description includes the appropriate Release Notes section, and the correct `release_note:*` label is applied per the [guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process) __Closes: https://github.com/elastic/kibana/issues/215331__ --------- Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com> Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com> |
||
---|---|---|
.. | ||
common | ||
public | ||
server | ||
kibana.jsonc | ||
README.md | ||
tsconfig.json |
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
.