Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sharing saved objects phase 3 #94383

Merged
merged 35 commits into from
May 14, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
8b853a5
Simplify saved objects service `includedFields` method
jportner Mar 4, 2021
ba57c2b
WIP: Add `collectMultiNamespaceReferences` SOR/SOC method
jportner Mar 10, 2021
0ddde66
WIP: Add `updateObjectsSpaces` SOR/SOC method
jportner Mar 16, 2021
70fb0b6
WIP: Add AuthZ for new SOC methods, add tagging SOC wrapper
jportner Mar 23, 2021
f2b05ec
Update AuthZ
jportner Apr 2, 2021
a76ccec
Add support for checking for potential destination conflicts before s…
jportner Apr 8, 2021
530ff43
client side changes WIP
jportner Apr 8, 2021
412ed3a
Address more PR review feedback
jportner Apr 15, 2021
e56169d
Change collectMultiNamespaceReferences to use SOR.find()
jportner Apr 16, 2021
15e00f5
PR review feedback
jportner Apr 23, 2021
090e174
Abstract out 'ensureAuthorized' from secure SOC wrapper
jportner Apr 25, 2021
94b6349
Update 'ensureAuthorized' to handle fail-secure scenarios
jportner May 1, 2021
7949b94
Secure SOC wrapper unit tests
jportner May 3, 2021
2050381
Even more PR review feedback!
jportner May 3, 2021
c05f660
Change ML plugin to use updateObjectsSpaces API
jportner May 3, 2021
5e388f7
Revert changes to the tagging plugin
jportner May 4, 2021
79fd42c
Remove addToNamespaces and deleteFromNamespaces SOC APIs
jportner May 4, 2021
21d9e00
Update docs
jportner May 4, 2021
9ef6622
Fix tests
jportner May 4, 2021
69d2fbf
Updated the _get_shareable_references route
jportner May 4, 2021
b4db885
Refactor share_to_space route (now named update_objects_spaces)
jportner May 4, 2021
3adcc47
Add updateObjectsSpaces integration tests
jportner May 5, 2021
b5b3e0d
Merge branch 'master' into pr/jportner/94383
jportner May 5, 2021
7a5f213
Simplify _update_objects_spaces integration tests
jportner May 5, 2021
4296e5e
Merge branch 'master' into pr/jportner/94383
jportner May 6, 2021
c99e438
Add integration test for _get_shareable_references
jportner May 6, 2021
9360d41
Exclude objects that already exist in the destination when copying
jportner May 6, 2021
83d78b6
Fix type definitions for getShareableReferences public API
jportner May 6, 2021
d03e96c
Merge branch 'master' into pr/jportner/94383
jportner May 11, 2021
f71f027
PLatest round of PR review feedback
jportner May 12, 2021
742f79f
Revert change to rawDocExistsInNamespace function
jportner May 12, 2021
1e1e3dc
Update collectMultiNamespaceReferences to ignore disabled aliases
jportner May 12, 2021
71622e1
More feedback
jportner May 12, 2021
812f3a1
Merge branch 'master' into pr/jportner/94383
jportner May 12, 2021
230409a
Throw error in collectMultiNamespaceReferences for invalid inbound re…
jportner May 12, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion api_docs/spaces.json
Original file line number Diff line number Diff line change
Expand Up @@ -1867,7 +1867,7 @@
"section": "def-server.SavedObjectsRepository",
"text": "SavedObjectsRepository"
},
", \"get\" | \"delete\" | \"create\" | \"bulkCreate\" | \"checkConflicts\" | \"deleteByNamespace\" | \"find\" | \"bulkGet\" | \"resolve\" | \"update\" | \"addToNamespaces\" | \"deleteFromNamespaces\" | \"bulkUpdate\" | \"removeReferencesTo\" | \"incrementCounter\" | \"openPointInTimeForType\" | \"closePointInTime\" | \"createPointInTimeFinder\">"
", \"get\" | \"delete\" | \"create\" | \"bulkCreate\" | \"checkConflicts\" | \"deleteByNamespace\" | \"find\" | \"bulkGet\" | \"resolve\" | \"update\" | \"collectMultiNamespaceReferences\" | \"updateObjectsSpaces\" | \"bulkUpdate\" | \"removeReferencesTo\" | \"incrementCounter\" | \"openPointInTimeForType\" | \"closePointInTime\" | \"createPointInTimeFinder\">"
],
"source": {
"path": "x-pack/plugins/spaces/server/spaces_client/spaces_client_service.ts",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,5 @@ export interface DocLinksStart
| --- | --- | --- |
| [DOC\_LINK\_VERSION](./kibana-plugin-core-public.doclinksstart.doc_link_version.md) | <code>string</code> | |
| [ELASTIC\_WEBSITE\_URL](./kibana-plugin-core-public.doclinksstart.elastic_website_url.md) | <code>string</code> | |

| [links](./kibana-plugin-core-public.doclinksstart.links.md) | <code>{</code><br/><code> readonly canvas: {</code><br/><code> readonly guide: string;</code><br/><code> };</code><br/><code> readonly dashboard: {</code><br/><code> readonly guide: string;</code><br/><code> readonly drilldowns: string;</code><br/><code> readonly drilldownsTriggerPicker: string;</code><br/><code> readonly urlDrilldownTemplateSyntax: string;</code><br/><code> readonly urlDrilldownVariables: string;</code><br/><code> };</code><br/><code> readonly discover: Record&lt;string, string&gt;;</code><br/><code> readonly filebeat: {</code><br/><code> readonly base: string;</code><br/><code> readonly installation: string;</code><br/><code> readonly configuration: string;</code><br/><code> readonly elasticsearchOutput: string;</code><br/><code> readonly elasticsearchModule: string;</code><br/><code> readonly startup: string;</code><br/><code> readonly exportedFields: string;</code><br/><code> };</code><br/><code> readonly auditbeat: {</code><br/><code> readonly base: string;</code><br/><code> };</code><br/><code> readonly metricbeat: {</code><br/><code> readonly base: string;</code><br/><code> readonly configure: string;</code><br/><code> readonly httpEndpoint: string;</code><br/><code> readonly install: string;</code><br/><code> readonly start: string;</code><br/><code> };</code><br/><code> readonly enterpriseSearch: {</code><br/><code> readonly base: string;</code><br/><code> readonly appSearchBase: string;</code><br/><code> readonly workplaceSearchBase: string;</code><br/><code> };</code><br/><code> readonly heartbeat: {</code><br/><code> readonly base: string;</code><br/><code> };</code><br/><code> readonly logstash: {</code><br/><code> readonly base: string;</code><br/><code> };</code><br/><code> readonly functionbeat: {</code><br/><code> readonly base: string;</code><br/><code> };</code><br/><code> readonly winlogbeat: {</code><br/><code> readonly base: string;</code><br/><code> };</code><br/><code> readonly aggs: {</code><br/><code> readonly composite: string;</code><br/><code> readonly composite_missing_bucket: string;</code><br/><code> readonly date_histogram: string;</code><br/><code> readonly date_range: string;</code><br/><code> readonly date_format_pattern: string;</code><br/><code> readonly filter: string;</code><br/><code> readonly filters: string;</code><br/><code> readonly geohash_grid: string;</code><br/><code> readonly histogram: string;</code><br/><code> readonly ip_range: string;</code><br/><code> readonly range: string;</code><br/><code> readonly significant_terms: string;</code><br/><code> readonly terms: string;</code><br/><code> readonly avg: string;</code><br/><code> readonly avg_bucket: string;</code><br/><code> readonly max_bucket: string;</code><br/><code> readonly min_bucket: string;</code><br/><code> readonly sum_bucket: string;</code><br/><code> readonly cardinality: string;</code><br/><code> readonly count: string;</code><br/><code> readonly cumulative_sum: string;</code><br/><code> readonly derivative: string;</code><br/><code> readonly geo_bounds: string;</code><br/><code> readonly geo_centroid: string;</code><br/><code> readonly max: string;</code><br/><code> readonly median: string;</code><br/><code> readonly min: string;</code><br/><code> readonly moving_avg: string;</code><br/><code> readonly percentile_ranks: string;</code><br/><code> readonly serial_diff: string;</code><br/><code> readonly std_dev: string;</code><br/><code> readonly sum: string;</code><br/><code> readonly top_hits: string;</code><br/><code> };</code><br/><code> readonly runtimeFields: {</code><br/><code> readonly overview: string;</code><br/><code> readonly mapping: string;</code><br/><code> };</code><br/><code> readonly scriptedFields: {</code><br/><code> readonly scriptFields: string;</code><br/><code> readonly scriptAggs: string;</code><br/><code> readonly painless: string;</code><br/><code> readonly painlessApi: string;</code><br/><code> readonly painlessLangSpec: string;</code><br/><code> readonly painlessSyntax: string;</code><br/><code> readonly painlessWalkthrough: string;</code><br/><code> readonly luceneExpressions: string;</code><br/><code> };</code><br/><code> readonly search: {</code><br/><code> readonly sessions: string;</code><br/><code> };</code><br/><code> readonly indexPatterns: {</code><br/><code> readonly introduction: string;</code><br/><code> readonly fieldFormattersNumber: string;</code><br/><code> readonly fieldFormattersString: string;</code><br/><code> };</code><br/><code> readonly addData: string;</code><br/><code> readonly kibana: string;</code><br/><code> readonly upgradeAssistant: string;</code><br/><code> readonly elasticsearch: Record&lt;string, string&gt;;</code><br/><code> readonly siem: {</code><br/><code> readonly guide: string;</code><br/><code> readonly gettingStarted: string;</code><br/><code> };</code><br/><code> readonly query: {</code><br/><code> readonly eql: string;</code><br/><code> readonly kueryQuerySyntax: string;</code><br/><code> readonly luceneQuerySyntax: string;</code><br/><code> readonly percolate: string;</code><br/><code> readonly queryDsl: string;</code><br/><code> };</code><br/><code> readonly date: {</code><br/><code> readonly dateMath: string;</code><br/><code> readonly dateMathIndexNames: string;</code><br/><code> };</code><br/><code> readonly management: Record&lt;string, string&gt;;</code><br/><code> readonly ml: Record&lt;string, string&gt;;</code><br/><code> readonly transforms: Record&lt;string, string&gt;;</code><br/><code> readonly visualize: Record&lt;string, string&gt;;</code><br/><code> readonly apis: Readonly&lt;{</code><br/><code> bulkIndexAlias: string;</code><br/><code> byteSizeUnits: string;</code><br/><code> createAutoFollowPattern: string;</code><br/><code> createFollower: string;</code><br/><code> createIndex: string;</code><br/><code> createSnapshotLifecyclePolicy: string;</code><br/><code> createRoleMapping: string;</code><br/><code> createRoleMappingTemplates: string;</code><br/><code> createRollupJobsRequest: string;</code><br/><code> createApiKey: string;</code><br/><code> createPipeline: string;</code><br/><code> createTransformRequest: string;</code><br/><code> cronExpressions: string;</code><br/><code> executeWatchActionModes: string;</code><br/><code> indexExists: string;</code><br/><code> openIndex: string;</code><br/><code> putComponentTemplate: string;</code><br/><code> painlessExecute: string;</code><br/><code> painlessExecuteAPIContexts: string;</code><br/><code> putComponentTemplateMetadata: string;</code><br/><code> putSnapshotLifecyclePolicy: string;</code><br/><code> putIndexTemplateV1: string;</code><br/><code> putWatch: string;</code><br/><code> simulatePipeline: string;</code><br/><code> timeUnits: string;</code><br/><code> updateTransform: string;</code><br/><code> }&gt;;</code><br/><code> readonly observability: Record&lt;string, string&gt;;</code><br/><code> readonly alerting: Record&lt;string, string&gt;;</code><br/><code> readonly maps: Record&lt;string, string&gt;;</code><br/><code> readonly monitoring: Record&lt;string, string&gt;;</code><br/><code> readonly security: Readonly&lt;{</code><br/><code> apiKeyServiceSettings: string;</code><br/><code> clusterPrivileges: string;</code><br/><code> elasticsearchSettings: string;</code><br/><code> elasticsearchEnableSecurity: string;</code><br/><code> indicesPrivileges: string;</code><br/><code> kibanaTLS: string;</code><br/><code> kibanaPrivileges: string;</code><br/><code> mappingRoles: string;</code><br/><code> mappingRolesFieldRules: string;</code><br/><code> runAsPrivilege: string;</code><br/><code> }&gt;;</code><br/><code> readonly watcher: Record&lt;string, string&gt;;</code><br/><code> readonly ccs: Record&lt;string, string&gt;;</code><br/><code> readonly plugins: Record&lt;string, string&gt;;</code><br/><code> readonly snapshotRestore: Record&lt;string, string&gt;;</code><br/><code> readonly ingest: Record&lt;string, string&gt;;</code><br/><code> }</code> | |


2 changes: 2 additions & 0 deletions docs/development/core/public/kibana-plugin-core-public.md
Original file line number Diff line number Diff line change
Expand Up @@ -103,12 +103,14 @@ The plugin integrates with the core system via lifecycle events: `setup`<!-- -->
| [SavedObjectAttributes](./kibana-plugin-core-public.savedobjectattributes.md) | The data for a Saved Object is stored as an object in the <code>attributes</code> property. |
| [SavedObjectError](./kibana-plugin-core-public.savedobjecterror.md) | |
| [SavedObjectReference](./kibana-plugin-core-public.savedobjectreference.md) | A reference to another saved object. |
| [SavedObjectReferenceWithContext](./kibana-plugin-core-public.savedobjectreferencewithcontext.md) | A returned input object or one of its references, with additional context. |
| [SavedObjectsBaseOptions](./kibana-plugin-core-public.savedobjectsbaseoptions.md) | |
| [SavedObjectsBatchResponse](./kibana-plugin-core-public.savedobjectsbatchresponse.md) | |
| [SavedObjectsBulkCreateObject](./kibana-plugin-core-public.savedobjectsbulkcreateobject.md) | |
| [SavedObjectsBulkCreateOptions](./kibana-plugin-core-public.savedobjectsbulkcreateoptions.md) | |
| [SavedObjectsBulkUpdateObject](./kibana-plugin-core-public.savedobjectsbulkupdateobject.md) | |
| [SavedObjectsBulkUpdateOptions](./kibana-plugin-core-public.savedobjectsbulkupdateoptions.md) | |
| [SavedObjectsCollectMultiNamespaceReferencesResponse](./kibana-plugin-core-public.savedobjectscollectmultinamespacereferencesresponse.md) | The response when object references are collected. |
| [SavedObjectsCreateOptions](./kibana-plugin-core-public.savedobjectscreateoptions.md) | |
| [SavedObjectsFindOptions](./kibana-plugin-core-public.savedobjectsfindoptions.md) | |
| [SavedObjectsFindOptionsReference](./kibana-plugin-core-public.savedobjectsfindoptionsreference.md) | |
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [kibana-plugin-core-public](./kibana-plugin-core-public.md) &gt; [SavedObjectReferenceWithContext](./kibana-plugin-core-public.savedobjectreferencewithcontext.md) &gt; [id](./kibana-plugin-core-public.savedobjectreferencewithcontext.id.md)

## SavedObjectReferenceWithContext.id property

The ID of the referenced object

<b>Signature:</b>

```typescript
id: string;
```
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [kibana-plugin-core-public](./kibana-plugin-core-public.md) &gt; [SavedObjectReferenceWithContext](./kibana-plugin-core-public.savedobjectreferencewithcontext.md) &gt; [inboundReferences](./kibana-plugin-core-public.savedobjectreferencewithcontext.inboundreferences.md)

## SavedObjectReferenceWithContext.inboundReferences property

References to this object; note that this does not contain \_all inbound references everywhere for this object\_, it only contains inbound references for the scope of this operation

<b>Signature:</b>

```typescript
inboundReferences: Array<{
type: string;
id: string;
name: string;
}>;
```
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [kibana-plugin-core-public](./kibana-plugin-core-public.md) &gt; [SavedObjectReferenceWithContext](./kibana-plugin-core-public.savedobjectreferencewithcontext.md) &gt; [isMissing](./kibana-plugin-core-public.savedobjectreferencewithcontext.ismissing.md)

## SavedObjectReferenceWithContext.isMissing property

Whether or not this object or reference is missing

<b>Signature:</b>

```typescript
isMissing?: boolean;
```
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [kibana-plugin-core-public](./kibana-plugin-core-public.md) &gt; [SavedObjectReferenceWithContext](./kibana-plugin-core-public.savedobjectreferencewithcontext.md)

## SavedObjectReferenceWithContext interface

A returned input object or one of its references, with additional context.

<b>Signature:</b>

```typescript
export interface SavedObjectReferenceWithContext
```

## Properties

| Property | Type | Description |
| --- | --- | --- |
| [id](./kibana-plugin-core-public.savedobjectreferencewithcontext.id.md) | <code>string</code> | The ID of the referenced object |
| [inboundReferences](./kibana-plugin-core-public.savedobjectreferencewithcontext.inboundreferences.md) | <code>Array&lt;{</code><br/><code> type: string;</code><br/><code> id: string;</code><br/><code> name: string;</code><br/><code> }&gt;</code> | References to this object; note that this does not contain \_all inbound references everywhere for this object\_, it only contains inbound references for the scope of this operation |
| [isMissing](./kibana-plugin-core-public.savedobjectreferencewithcontext.ismissing.md) | <code>boolean</code> | Whether or not this object or reference is missing |
| [spaces](./kibana-plugin-core-public.savedobjectreferencewithcontext.spaces.md) | <code>string[]</code> | The space(s) that the referenced object exists in |
| [spacesWithMatchingAliases](./kibana-plugin-core-public.savedobjectreferencewithcontext.spaceswithmatchingaliases.md) | <code>string[]</code> | The space(s) that legacy URL aliases matching this type/id exist in |
| [type](./kibana-plugin-core-public.savedobjectreferencewithcontext.type.md) | <code>string</code> | The type of the referenced object |

Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [kibana-plugin-core-public](./kibana-plugin-core-public.md) &gt; [SavedObjectReferenceWithContext](./kibana-plugin-core-public.savedobjectreferencewithcontext.md) &gt; [spaces](./kibana-plugin-core-public.savedobjectreferencewithcontext.spaces.md)

## SavedObjectReferenceWithContext.spaces property

The space(s) that the referenced object exists in

<b>Signature:</b>

```typescript
spaces: string[];
```
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [kibana-plugin-core-public](./kibana-plugin-core-public.md) &gt; [SavedObjectReferenceWithContext](./kibana-plugin-core-public.savedobjectreferencewithcontext.md) &gt; [spacesWithMatchingAliases](./kibana-plugin-core-public.savedobjectreferencewithcontext.spaceswithmatchingaliases.md)

## SavedObjectReferenceWithContext.spacesWithMatchingAliases property

The space(s) that legacy URL aliases matching this type/id exist in

<b>Signature:</b>

```typescript
spacesWithMatchingAliases?: string[];
```
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [kibana-plugin-core-public](./kibana-plugin-core-public.md) &gt; [SavedObjectReferenceWithContext](./kibana-plugin-core-public.savedobjectreferencewithcontext.md) &gt; [type](./kibana-plugin-core-public.savedobjectreferencewithcontext.type.md)

## SavedObjectReferenceWithContext.type property

The type of the referenced object

<b>Signature:</b>

```typescript
type: string;
```
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [kibana-plugin-core-public](./kibana-plugin-core-public.md) &gt; [SavedObjectsCollectMultiNamespaceReferencesResponse](./kibana-plugin-core-public.savedobjectscollectmultinamespacereferencesresponse.md)

## SavedObjectsCollectMultiNamespaceReferencesResponse interface

The response when object references are collected.

<b>Signature:</b>

```typescript
export interface SavedObjectsCollectMultiNamespaceReferencesResponse
```

## Properties

| Property | Type | Description |
| --- | --- | --- |
| [objects](./kibana-plugin-core-public.savedobjectscollectmultinamespacereferencesresponse.objects.md) | <code>SavedObjectReferenceWithContext[]</code> | |

Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [kibana-plugin-core-public](./kibana-plugin-core-public.md) &gt; [SavedObjectsCollectMultiNamespaceReferencesResponse](./kibana-plugin-core-public.savedobjectscollectmultinamespacereferencesresponse.md) &gt; [objects](./kibana-plugin-core-public.savedobjectscollectmultinamespacereferencesresponse.objects.md)

## SavedObjectsCollectMultiNamespaceReferencesResponse.objects property

<b>Signature:</b>

```typescript
objects: SavedObjectReferenceWithContext[];
```
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,5 @@ An async generator which wraps calls to `savedObjectsClient.find` and iterates o
<b>Signature:</b>

```typescript
find: () => AsyncGenerator<SavedObjectsFindResponse>;
find: () => AsyncGenerator<SavedObjectsFindResponse<T, A>>;
```
Loading