/* * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one * or more contributor license agreements. Licensed under the "Elastic License * 2.0", the "GNU Affero General Public License v3.0 only", and the "Server Side * Public License v 1"; you may not use this file except in compliance with, at * your election, the "Elastic License 2.0", the "GNU Affero General Public * License v3.0 only", or the "Server Side Public License, v 1". */ import { EuiAccordion, EuiButton, EuiCodeBlock, EuiPageTemplate, EuiSpacer, EuiText, EuiTextColor, EuiTitle, } from '@elastic/eui'; import React, { useState } from 'react'; export const MyPluginComponent: React.FC = () => { const [generated, setGenerated] = useState(''); const [rawDocs, setRawDocs] = useState(''); const [objects, setObjects] = useState(''); const [decrypted, setDecrypted] = useState(''); const handler = async ( endpoint: string, setter: (value: React.SetStateAction) => void ) => { const response = await fetch(endpoint); const data = await response.json(); setter(JSON.stringify(data, null, 2)); }; return (

Encrypted Saved Object Model Version Example

This is a demonstration to show the results of the implementation found in  examples/eso_model_version_example
1. This will create three objects - one for each model version definition (see  examples/eso_model_version_example/server/types ). { handler('/internal/eso_mv_example/generate', setGenerated); }} > Create Objects {generated} 2. This will read the raw documents of the objects with an Elasticsearch client. Note that the  typeMigrationVersion  (10.n.0) will correspond to the model version (n). { handler('/internal/eso_mv_example/read_raw', setRawDocs); }} > Read Raw Documents {rawDocs} 3. This will read the saved objects with a Kibana saved object client. Note that the objects have been migrated on read to the latest model version, and the encrypted fields have been stripped. { handler('/internal/eso_mv_example/get_objects', setObjects); }} > Read Saved Objects {objects} 4. This will decrypt the saved objects. { handler('/internal/eso_mv_example/get_decrypted', setDecrypted); }} > Decrypt Secrets {decrypted}
); };