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

Change saved object bulkUpdate to work across multiple namespaces #75478

Merged
Merged
Show file tree
Hide file tree
Changes from 20 commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
fa6ae1c
Add `namespaceStringToId` and `namespaceIdToString` methods to core
jportner Aug 19, 2020
341052a
Change `bulkUpdate` method to allow per-object namespaces
jportner Aug 20, 2020
6c78cd4
Merge branch 'master' into issue-75449-bulk-update-across-spaces
elasticmachine Aug 26, 2020
9d849b6
Merge branch 'master' into issue-75449-bulk-update-across-spaces
jportner Aug 31, 2020
2096fc3
Add comment per review feedback
jportner Aug 31, 2020
440d987
Tweak secure saved objects client wrapper authZ checks
jportner Aug 31, 2020
0b2f62c
Don't expose core namespace conversion methods in the public contract
jportner Aug 31, 2020
1228d61
Remove @public tag from jsdocs that are no longer exported from core
jportner Sep 1, 2020
46bc77d
Normalize namespace strings for saved object CRUD operations
jportner Sep 1, 2020
9dd4d5b
Merge branch 'master' into issue-75449-bulk-update-across-spaces
jportner Sep 2, 2020
ea2235f
Change `bulkUpdate` in ESO plugin to use object namespace
jportner Sep 2, 2020
17985c3
Updated non-dev usages of node-forge
jportner Sep 3, 2020
def73c7
Merge branch 'master' of github.com:elastic/kibana
jportner Sep 4, 2020
978ccf1
Merge branch 'master' into issue-75449-bulk-update-across-spaces
jportner Sep 4, 2020
ba8c72d
Revert "Don't expose core namespace conversion methods in the public …
jportner Sep 4, 2020
2c36a31
Wrap namespace utility methods in `SavedObjectsUtils` class
jportner Sep 4, 2020
714a14e
Change ESO plugin to use SavedObjectsUtils for namespaces
jportner Sep 4, 2020
c2a207a
Remove unnecessary comment
jportner Sep 4, 2020
0a36aa5
Merge branch 'master' into issue-75449-bulk-update-across-spaces
elasticmachine Sep 7, 2020
0c97bf3
Merge branch 'master' into issue-75449-bulk-update-across-spaces
elasticmachine Sep 9, 2020
65acf6d
Merge branch 'master' into issue-75449-bulk-update-across-spaces
jportner Sep 9, 2020
cf0a0a0
Address PR review feedback
jportner Sep 9, 2020
71bf105
Merge branch 'master' into issue-75449-bulk-update-across-spaces
jportner Sep 10, 2020
70793b0
Address more PR review feedback
jportner Sep 10, 2020
f345891
Update JSdocs
jportner Sep 10, 2020
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
1 change: 1 addition & 0 deletions docs/development/core/server/kibana-plugin-core-server.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ The plugin integrates with the core system via lifecycle events: `setup`<!-- -->
| [SavedObjectsErrorHelpers](./kibana-plugin-core-server.savedobjectserrorhelpers.md) | |
| [SavedObjectsRepository](./kibana-plugin-core-server.savedobjectsrepository.md) | |
| [SavedObjectsSerializer](./kibana-plugin-core-server.savedobjectsserializer.md) | A serializer that can be used to manually convert [raw](./kibana-plugin-core-server.savedobjectsrawdoc.md) or [sanitized](./kibana-plugin-core-server.savedobjectsanitizeddoc.md) documents to the other kind. |
| [SavedObjectsUtils](./kibana-plugin-core-server.savedobjectsutils.md) | |
| [SavedObjectTypeRegistry](./kibana-plugin-core-server.savedobjecttyperegistry.md) | Registry holding information about all the registered [saved object types](./kibana-plugin-core-server.savedobjectstype.md)<!-- -->. |

## Enumerations
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,6 @@ export interface SavedObjectsBulkUpdateObject<T = unknown> extends Pick<SavedObj
| --- | --- | --- |
| [attributes](./kibana-plugin-core-server.savedobjectsbulkupdateobject.attributes.md) | <code>Partial&lt;T&gt;</code> | The data for a Saved Object is stored as an object in the <code>attributes</code> property. |
| [id](./kibana-plugin-core-server.savedobjectsbulkupdateobject.id.md) | <code>string</code> | The ID of this Saved Object, guaranteed to be unique for all objects of the same <code>type</code> |
| [namespace](./kibana-plugin-core-server.savedobjectsbulkupdateobject.namespace.md) | <code>string</code> | Optional namespace string to use for this document. If this is defined, it will supersede the namespace ID that is in [SavedObjectsUpdateOptions](./kibana-plugin-core-server.savedobjectsupdateoptions.md)<!-- -->.<!-- -->Note: the default namespace's string representation is <code>'default'</code>, and its ID representation is <code>undefined</code>. |
| [type](./kibana-plugin-core-server.savedobjectsbulkupdateobject.type.md) | <code>string</code> | The type of this Saved Object. Each plugin can define it's own custom Saved Object types. |

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

[Home](./index.md) &gt; [kibana-plugin-core-server](./kibana-plugin-core-server.md) &gt; [SavedObjectsBulkUpdateObject](./kibana-plugin-core-server.savedobjectsbulkupdateobject.md) &gt; [namespace](./kibana-plugin-core-server.savedobjectsbulkupdateobject.namespace.md)

## SavedObjectsBulkUpdateObject.namespace property

Optional namespace string to use for this document. If this is defined, it will supersede the namespace ID that is in [SavedObjectsUpdateOptions](./kibana-plugin-core-server.savedobjectsupdateoptions.md)<!-- -->.

Note: the default namespace's string representation is `'default'`<!-- -->, and its ID representation is `undefined`<!-- -->.

<b>Signature:</b>

```typescript
namespace?: 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-server](./kibana-plugin-core-server.md) &gt; [SavedObjectsUtils](./kibana-plugin-core-server.savedobjectsutils.md)

## SavedObjectsUtils class


<b>Signature:</b>

```typescript
export declare class SavedObjectsUtils
```

## Properties

| Property | Modifiers | Type | Description |
| --- | --- | --- | --- |
| [namespaceIdToString](./kibana-plugin-core-server.savedobjectsutils.namespaceidtostring.md) | <code>static</code> | <code>(namespace?: string &#124; undefined) =&gt; string</code> | Converts a given saved object namespace ID to its string representation. All namespace IDs have an identical string representation, with the exception of the <code>undefined</code> namespace ID (which has a namespace string of <code>'default'</code>). |
| [namespaceStringToId](./kibana-plugin-core-server.savedobjectsutils.namespacestringtoid.md) | <code>static</code> | <code>(namespace: string) =&gt; string &#124; undefined</code> | Converts a given saved object namespace string to its ID representation. All namespace strings have an identical ID representation, with the exception of the <code>'default'</code> namespace string (which has a namespace ID of <code>undefined</code>). |

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-server](./kibana-plugin-core-server.md) &gt; [SavedObjectsUtils](./kibana-plugin-core-server.savedobjectsutils.md) &gt; [namespaceIdToString](./kibana-plugin-core-server.savedobjectsutils.namespaceidtostring.md)

## SavedObjectsUtils.namespaceIdToString property

Converts a given saved object namespace ID to its string representation. All namespace IDs have an identical string representation, with the exception of the `undefined` namespace ID (which has a namespace string of `'default'`<!-- -->).

<b>Signature:</b>

```typescript
static namespaceIdToString: (namespace?: string | undefined) => 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-server](./kibana-plugin-core-server.md) &gt; [SavedObjectsUtils](./kibana-plugin-core-server.savedobjectsutils.md) &gt; [namespaceStringToId](./kibana-plugin-core-server.savedobjectsutils.namespacestringtoid.md)

## SavedObjectsUtils.namespaceStringToId property

Converts a given saved object namespace string to its ID representation. All namespace strings have an identical ID representation, with the exception of the `'default'` namespace string (which has a namespace ID of `undefined`<!-- -->).

<b>Signature:</b>

```typescript
static namespaceStringToId: (namespace: string) => string | undefined;
```
1 change: 1 addition & 0 deletions src/core/server/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -293,6 +293,7 @@ export {
SavedObjectsTypeManagementDefinition,
SavedObjectMigrationMap,
SavedObjectMigrationFn,
SavedObjectsUtils,
exportSavedObjectsToStream,
importSavedObjectsFromStream,
resolveSavedObjectsImportErrors,
Expand Down
1 change: 1 addition & 0 deletions src/core/server/saved_objects/routes/bulk_update.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ export const registerBulkUpdateRoute = (router: IRouter) => {
})
)
),
namespace: schema.maybe(schema.string({ minLength: 1 })),
})
),
},
Expand Down
1 change: 1 addition & 0 deletions src/core/server/saved_objects/service/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ export {
SavedObjectsErrorHelpers,
SavedObjectsClientFactory,
SavedObjectsClientFactoryProvider,
SavedObjectsUtils,
} from './lib';

export * from './saved_objects_client';
2 changes: 2 additions & 0 deletions src/core/server/saved_objects/service/lib/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,3 +30,5 @@ export {
} from './scoped_client_provider';

export { SavedObjectsErrorHelpers } from './errors';

export { SavedObjectsUtils } from './utils';
Loading