From 4bf22f42121f6296c9785140513a5db83a9a468e Mon Sep 17 00:00:00 2001 From: Joe Portner <5295965+jportner@users.noreply.github.com> Date: Wed, 17 Mar 2021 13:30:30 -0400 Subject: [PATCH 1/5] Harden SavedObjectsSerializer.rawToSavedObject() method This method will now throw an error if the input is not a valid raw saved object, based on the output of the isRawSavedObject() method. --- .../serialization/serializer.test.ts | 119 +++++++++++------- .../saved_objects/serialization/serializer.ts | 3 + 2 files changed, 74 insertions(+), 48 deletions(-) diff --git a/src/core/server/saved_objects/serialization/serializer.test.ts b/src/core/server/saved_objects/serialization/serializer.test.ts index 6c7fcc88cc902..a2a7c13f2b5f2 100644 --- a/src/core/server/saved_objects/serialization/serializer.test.ts +++ b/src/core/server/saved_objects/serialization/serializer.test.ts @@ -35,6 +35,7 @@ const sampleTemplate = { _id: 'foo:bar', _source: { type: 'foo', + foo: {}, }, }; const createSampleDoc = (raw: any, template = sampleTemplate): SavedObjectsRawDoc => @@ -46,6 +47,7 @@ describe('#rawToSavedObject', () => { _id: 'foo:bar', _source: { type: 'foo', + foo: {}, }, }); expect(actual).toHaveProperty('type', 'foo'); @@ -56,6 +58,7 @@ describe('#rawToSavedObject', () => { _id: 'foo:bar', _source: { type: 'foo', + foo: {}, references: [{ name: 'ref_0', type: 'index-pattern', id: 'pattern*' }], }, }); @@ -73,6 +76,7 @@ describe('#rawToSavedObject', () => { _id: 'foo:bar', _source: { type: 'foo', + foo: {}, migrationVersion: { hello: '1.2.3', acl: '33.3.5', @@ -90,6 +94,7 @@ describe('#rawToSavedObject', () => { _id: 'foo:bar', _source: { type: 'foo', + foo: {}, }, }); expect(actual).not.toHaveProperty('migrationVersion'); @@ -137,6 +142,7 @@ describe('#rawToSavedObject', () => { _id: 'foo:bar', _source: { type: 'foo', + foo: {}, coreMigrationVersion: '1.2.3', }, }); @@ -148,6 +154,7 @@ describe('#rawToSavedObject', () => { _id: 'foo:bar', _source: { type: 'foo', + foo: {}, }, }); expect(actual).not.toHaveProperty('coreMigrationVersion'); @@ -158,7 +165,7 @@ describe('#rawToSavedObject', () => { _id: 'foo:bar', _source: { type: 'foo', - hello: {}, + foo: {}, }, }); expect(actual).not.toHaveProperty('version'); @@ -171,7 +178,7 @@ describe('#rawToSavedObject', () => { _primary_term: 1, _source: { type: 'foo', - hello: {}, + foo: {}, }, }); expect(actual).toHaveProperty('version', encodeVersion(4, 1)); @@ -184,7 +191,7 @@ describe('#rawToSavedObject', () => { _seq_no: 4, _source: { type: 'foo', - hello: {}, + foo: {}, }, }) ).toThrowErrorMatchingInlineSnapshot(`"_primary_term from elasticsearch must be an integer"`); @@ -197,7 +204,7 @@ describe('#rawToSavedObject', () => { _primary_term: 1, _source: { type: 'foo', - hello: {}, + foo: {}, }, }) ).toThrowErrorMatchingInlineSnapshot(`"_seq_no from elasticsearch must be an integer"`); @@ -209,6 +216,7 @@ describe('#rawToSavedObject', () => { _id: 'foo:bar', _source: { type: 'foo', + foo: {}, updated_at: now, }, }); @@ -220,6 +228,7 @@ describe('#rawToSavedObject', () => { _id: 'foo:bar', _source: { type: 'foo', + foo: {}, }, }); expect(actual).not.toHaveProperty('updated_at'); @@ -231,6 +240,7 @@ describe('#rawToSavedObject', () => { _id: 'foo:bar', _source: { type: 'foo', + foo: {}, originId, }, }); @@ -242,6 +252,7 @@ describe('#rawToSavedObject', () => { _id: 'foo:bar', _source: { type: 'foo', + foo: {}, }, }); expect(actual).not.toHaveProperty('originId'); @@ -249,7 +260,7 @@ describe('#rawToSavedObject', () => { test('it does not pass unknown properties through', () => { const actual = singleNamespaceSerializer.rawToSavedObject({ - _id: 'universe', + _id: 'hello:universe', _source: { type: 'hello', hello: { @@ -268,31 +279,28 @@ describe('#rawToSavedObject', () => { }); }); - test('it does not create attributes if [type] is missing', () => { - const actual = singleNamespaceSerializer.rawToSavedObject({ - _id: 'universe', - _source: { - type: 'hello', - }, - }); - expect(actual).toEqual({ - id: 'universe', - type: 'hello', - references: [], - }); + test('it fails for documents which do not specify a [type] (attributes)', () => { + expect(() => + singleNamespaceSerializer.rawToSavedObject({ + _id: 'hello:universe', + _source: { + type: 'hello', + }, + }) + ).toThrow(`Raw document 'hello:universe' is not a valid saved object`); }); test('it fails for documents which do not specify a type', () => { expect(() => singleNamespaceSerializer.rawToSavedObject({ - _id: 'universe', + _id: 'hello:universe', _source: { hello: { world: 'earth', }, } as any, }) - ).toThrow(/Expected "undefined" to be a saved object type/); + ).toThrow(`Raw document 'hello:universe' is not a valid saved object`); }); test('it is complimentary with savedObjectToRaw', () => { @@ -325,29 +333,30 @@ describe('#rawToSavedObject', () => { ).toEqual(raw); }); - test('it handles unprefixed ids', () => { - const actual = singleNamespaceSerializer.rawToSavedObject({ - _id: 'universe', - _source: { - type: 'hello', - }, - }); - - expect(actual).toHaveProperty('id', 'universe'); + test('fails for documents which do not have a type prefix in their _id', () => { + expect(() => + singleNamespaceSerializer.rawToSavedObject({ + _id: 'universe', + _source: { + type: 'hello', + }, + }) + ).toThrow(`Raw document 'universe' is not a valid saved object`); }); describe('namespace-agnostic type with a namespace', () => { - const raw = createSampleDoc({ _source: { namespace: 'baz' } }); + const raw = createSampleDoc({ _source: { namespace: 'baz' } }); // namespace field should be ignored const actual = namespaceAgnosticSerializer.rawToSavedObject(raw); test(`removes type prefix from _id`, () => { expect(actual).toHaveProperty('id', 'bar'); }); - test(`copies _id to id if prefixed by namespace and type`, () => { + test(`fails for documents which have a namespace prefix in their _id`, () => { const _id = `${raw._source.namespace}:${raw._id}`; - const _actual = namespaceAgnosticSerializer.rawToSavedObject({ ...raw, _id }); - expect(_actual).toHaveProperty('id', _id); + expect(() => namespaceAgnosticSerializer.rawToSavedObject({ ...raw, _id })).toThrow( + `Raw document 'baz:foo:bar' is not a valid saved object` + ); }); test(`doesn't copy _source.namespace to namespace`, () => { @@ -372,10 +381,11 @@ describe('#rawToSavedObject', () => { expect(actual).toHaveProperty('id', 'bar'); }); - test(`copies _id to id if prefixed by random prefix and type`, () => { + test(`fails for documents which have any extra prefix in their _id`, () => { const _id = `random:${raw._id}`; - const _actual = singleNamespaceSerializer.rawToSavedObject({ ...raw, _id }); - expect(_actual).toHaveProperty('id', _id); + expect(() => singleNamespaceSerializer.rawToSavedObject({ ...raw, _id })).toThrow( + `Raw document 'random:foo:bar' is not a valid saved object` + ); }); test(`doesn't specify namespace`, () => { @@ -385,23 +395,28 @@ describe('#rawToSavedObject', () => { describe('single-namespace type with a namespace', () => { const namespace = 'baz'; - const raw = createSampleDoc({ _source: { namespace } }); + const raw = createSampleDoc({ + _id: `${namespace}:${sampleTemplate._id}`, + _source: { namespace }, + }); const actual = singleNamespaceSerializer.rawToSavedObject(raw); test(`removes type and namespace prefix from _id`, () => { - const _id = `${namespace}:${raw._id}`; - const _actual = singleNamespaceSerializer.rawToSavedObject({ ...raw, _id }); - expect(_actual).toHaveProperty('id', 'bar'); + expect(actual).toHaveProperty('id', 'bar'); }); - test(`copies _id to id if prefixed only by type`, () => { - expect(actual).toHaveProperty('id', raw._id); + test(`fails for documents which do not have a namespace prefix in their _id`, () => { + const _id = sampleTemplate._id; + expect(() => singleNamespaceSerializer.rawToSavedObject({ ...raw, _id })).toThrow( + `Raw document 'foo:bar' is not a valid saved object` + ); }); - test(`copies _id to id if prefixed by random prefix and type`, () => { + test(`fails for documents which have any extra prefix in their _id`, () => { const _id = `random:${raw._id}`; - const _actual = singleNamespaceSerializer.rawToSavedObject({ ...raw, _id }); - expect(_actual).toHaveProperty('id', _id); + expect(() => singleNamespaceSerializer.rawToSavedObject({ ...raw, _id })).toThrow( + `Raw document 'random:baz:foo:bar' is not a valid saved object` + ); }); test(`copies _source.namespace to namespace`, () => { @@ -419,17 +434,25 @@ describe('#rawToSavedObject', () => { }); describe('multi-namespace type with a namespace', () => { - const raw = createSampleDoc({ _source: { namespace: 'baz' } }); + const raw = createSampleDoc({ _source: { namespace: 'baz' } }); // namespace should be ignored const actual = multiNamespaceSerializer.rawToSavedObject(raw); test(`removes type prefix from _id`, () => { expect(actual).toHaveProperty('id', 'bar'); }); - test(`copies _id to id if prefixed by namespace and type`, () => { + test(`fails for documents which have a namespace prefix in their _id`, () => { const _id = `${raw._source.namespace}:${raw._id}`; - const _actual = multiNamespaceSerializer.rawToSavedObject({ ...raw, _id }); - expect(_actual).toHaveProperty('id', _id); + expect(() => multiNamespaceSerializer.rawToSavedObject({ ...raw, _id })).toThrow( + `Raw document 'baz:foo:bar' is not a valid saved object` + ); + }); + + test(`fails for documents which have any extra prefix in their _id`, () => { + const _id = `random:${raw._id}`; + expect(() => multiNamespaceSerializer.rawToSavedObject({ ...raw, _id })).toThrow( + `Raw document 'random:foo:bar' is not a valid saved object` + ); }); test(`doesn't copy _source.namespace to namespace`, () => { diff --git a/src/core/server/saved_objects/serialization/serializer.ts b/src/core/server/saved_objects/serialization/serializer.ts index cd6c68a6de076..6e8e63447450d 100644 --- a/src/core/server/saved_objects/serialization/serializer.ts +++ b/src/core/server/saved_objects/serialization/serializer.ts @@ -59,6 +59,9 @@ export class SavedObjectsSerializer { doc: SavedObjectsRawDoc, options: SavedObjectsRawDocParseOptions = {} ): SavedObjectSanitizedDoc { + if (!this.isRawSavedObject(doc, options)) { + throw new Error(`Raw document '${doc._id}' is not a valid saved object`); + } const { namespaceTreatment = 'strict' } = options; const { _id, _source, _seq_no, _primary_term } = doc; const { From 4421a0680d9013b5c7b73098fc015ee21700badc Mon Sep 17 00:00:00 2001 From: Joe Portner <5295965+jportner@users.noreply.github.com> Date: Wed, 17 Mar 2021 17:43:25 -0400 Subject: [PATCH 2/5] Relax conditions for isRawSavedObject This previously required a [type] field to be present, but that breaks object parsing for "find" operations that do not include any type- specific fields. --- .../serialization/serializer.test.ts | 48 +++++++------------ .../saved_objects/serialization/serializer.ts | 2 +- 2 files changed, 19 insertions(+), 31 deletions(-) diff --git a/src/core/server/saved_objects/serialization/serializer.test.ts b/src/core/server/saved_objects/serialization/serializer.test.ts index a2a7c13f2b5f2..c1728be845ea7 100644 --- a/src/core/server/saved_objects/serialization/serializer.test.ts +++ b/src/core/server/saved_objects/serialization/serializer.test.ts @@ -35,7 +35,6 @@ const sampleTemplate = { _id: 'foo:bar', _source: { type: 'foo', - foo: {}, }, }; const createSampleDoc = (raw: any, template = sampleTemplate): SavedObjectsRawDoc => @@ -47,7 +46,6 @@ describe('#rawToSavedObject', () => { _id: 'foo:bar', _source: { type: 'foo', - foo: {}, }, }); expect(actual).toHaveProperty('type', 'foo'); @@ -58,7 +56,6 @@ describe('#rawToSavedObject', () => { _id: 'foo:bar', _source: { type: 'foo', - foo: {}, references: [{ name: 'ref_0', type: 'index-pattern', id: 'pattern*' }], }, }); @@ -76,7 +73,6 @@ describe('#rawToSavedObject', () => { _id: 'foo:bar', _source: { type: 'foo', - foo: {}, migrationVersion: { hello: '1.2.3', acl: '33.3.5', @@ -94,7 +90,6 @@ describe('#rawToSavedObject', () => { _id: 'foo:bar', _source: { type: 'foo', - foo: {}, }, }); expect(actual).not.toHaveProperty('migrationVersion'); @@ -142,7 +137,6 @@ describe('#rawToSavedObject', () => { _id: 'foo:bar', _source: { type: 'foo', - foo: {}, coreMigrationVersion: '1.2.3', }, }); @@ -154,7 +148,6 @@ describe('#rawToSavedObject', () => { _id: 'foo:bar', _source: { type: 'foo', - foo: {}, }, }); expect(actual).not.toHaveProperty('coreMigrationVersion'); @@ -165,7 +158,6 @@ describe('#rawToSavedObject', () => { _id: 'foo:bar', _source: { type: 'foo', - foo: {}, }, }); expect(actual).not.toHaveProperty('version'); @@ -178,7 +170,6 @@ describe('#rawToSavedObject', () => { _primary_term: 1, _source: { type: 'foo', - foo: {}, }, }); expect(actual).toHaveProperty('version', encodeVersion(4, 1)); @@ -191,7 +182,6 @@ describe('#rawToSavedObject', () => { _seq_no: 4, _source: { type: 'foo', - foo: {}, }, }) ).toThrowErrorMatchingInlineSnapshot(`"_primary_term from elasticsearch must be an integer"`); @@ -204,7 +194,6 @@ describe('#rawToSavedObject', () => { _primary_term: 1, _source: { type: 'foo', - foo: {}, }, }) ).toThrowErrorMatchingInlineSnapshot(`"_seq_no from elasticsearch must be an integer"`); @@ -216,7 +205,6 @@ describe('#rawToSavedObject', () => { _id: 'foo:bar', _source: { type: 'foo', - foo: {}, updated_at: now, }, }); @@ -228,7 +216,6 @@ describe('#rawToSavedObject', () => { _id: 'foo:bar', _source: { type: 'foo', - foo: {}, }, }); expect(actual).not.toHaveProperty('updated_at'); @@ -240,7 +227,6 @@ describe('#rawToSavedObject', () => { _id: 'foo:bar', _source: { type: 'foo', - foo: {}, originId, }, }); @@ -252,7 +238,6 @@ describe('#rawToSavedObject', () => { _id: 'foo:bar', _source: { type: 'foo', - foo: {}, }, }); expect(actual).not.toHaveProperty('originId'); @@ -279,15 +264,18 @@ describe('#rawToSavedObject', () => { }); }); - test('it fails for documents which do not specify a [type] (attributes)', () => { - expect(() => - singleNamespaceSerializer.rawToSavedObject({ - _id: 'hello:universe', - _source: { - type: 'hello', - }, - }) - ).toThrow(`Raw document 'hello:universe' is not a valid saved object`); + test('it does not create attributes if [type] is missing', () => { + const actual = singleNamespaceSerializer.rawToSavedObject({ + _id: 'hello:universe', + _source: { + type: 'hello', + }, + }); + expect(actual).toEqual({ + id: 'universe', + type: 'hello', + references: [], + }); }); test('it fails for documents which do not specify a type', () => { @@ -808,7 +796,7 @@ describe('#isRawSavedObject', () => { ).toBeFalsy(); }); - test('is false if there is no [type] attribute', () => { + test('is true if there is no [type] attribute', () => { expect( singleNamespaceSerializer.isRawSavedObject({ _id: 'hello:world', @@ -817,7 +805,7 @@ describe('#isRawSavedObject', () => { jam: {}, }, }) - ).toBeFalsy(); + ).toBeTruthy(); }); }); @@ -1037,7 +1025,7 @@ describe('#isRawSavedObject', () => { ).toBeFalsy(); }); - test('is false if there is no [type] attribute', () => { + test('is true if there is no [type] attribute', () => { expect( multiNamespaceSerializer.isRawSavedObject({ _id: 'hello:world', @@ -1047,7 +1035,7 @@ describe('#isRawSavedObject', () => { namespace: 'foo', }, }) - ).toBeFalsy(); + ).toBeTruthy(); }); }); @@ -1130,7 +1118,7 @@ describe('#isRawSavedObject', () => { ).toBeFalsy(); }); - test('is false if there is no [type] attribute', () => { + test('is true if there is no [type] attribute', () => { expect( namespaceAgnosticSerializer.isRawSavedObject({ _id: 'hello:world', @@ -1140,7 +1128,7 @@ describe('#isRawSavedObject', () => { namespace: 'foo', }, }) - ).toBeFalsy(); + ).toBeTruthy(); }); }); }); diff --git a/src/core/server/saved_objects/serialization/serializer.ts b/src/core/server/saved_objects/serialization/serializer.ts index 6e8e63447450d..0f67128ccbca8 100644 --- a/src/core/server/saved_objects/serialization/serializer.ts +++ b/src/core/server/saved_objects/serialization/serializer.ts @@ -46,7 +46,7 @@ export class SavedObjectsSerializer { return false; } const { idMatchesPrefix } = this.parseIdPrefix(namespace, type, _id, namespaceTreatment); - return idMatchesPrefix && _source.hasOwnProperty(type); + return idMatchesPrefix; } /** From cfa3520e47fb1e13ee1284a1053829a7c1712601 Mon Sep 17 00:00:00 2001 From: Joe Portner <5295965+jportner@users.noreply.github.com> Date: Mon, 29 Mar 2021 11:28:43 -0400 Subject: [PATCH 3/5] PR review feedback --- .../serialization/serializer.test.ts | 16 +++++----- .../saved_objects/serialization/serializer.ts | 30 +++++++++++++++---- 2 files changed, 33 insertions(+), 13 deletions(-) diff --git a/src/core/server/saved_objects/serialization/serializer.test.ts b/src/core/server/saved_objects/serialization/serializer.test.ts index c1728be845ea7..3fdeb4aa088e1 100644 --- a/src/core/server/saved_objects/serialization/serializer.test.ts +++ b/src/core/server/saved_objects/serialization/serializer.test.ts @@ -288,7 +288,7 @@ describe('#rawToSavedObject', () => { }, } as any, }) - ).toThrow(`Raw document 'hello:universe' is not a valid saved object`); + ).toThrow(`Raw document 'hello:universe' is missing _source.type field`); }); test('it is complimentary with savedObjectToRaw', () => { @@ -329,7 +329,7 @@ describe('#rawToSavedObject', () => { type: 'hello', }, }) - ).toThrow(`Raw document 'universe' is not a valid saved object`); + ).toThrow(`Raw document 'universe' does not start with expected prefix 'hello:'`); }); describe('namespace-agnostic type with a namespace', () => { @@ -343,7 +343,7 @@ describe('#rawToSavedObject', () => { test(`fails for documents which have a namespace prefix in their _id`, () => { const _id = `${raw._source.namespace}:${raw._id}`; expect(() => namespaceAgnosticSerializer.rawToSavedObject({ ...raw, _id })).toThrow( - `Raw document 'baz:foo:bar' is not a valid saved object` + `Raw document 'baz:foo:bar' does not start with expected prefix 'foo:'` ); }); @@ -372,7 +372,7 @@ describe('#rawToSavedObject', () => { test(`fails for documents which have any extra prefix in their _id`, () => { const _id = `random:${raw._id}`; expect(() => singleNamespaceSerializer.rawToSavedObject({ ...raw, _id })).toThrow( - `Raw document 'random:foo:bar' is not a valid saved object` + `Raw document 'random:foo:bar' does not start with expected prefix 'foo:'` ); }); @@ -396,14 +396,14 @@ describe('#rawToSavedObject', () => { test(`fails for documents which do not have a namespace prefix in their _id`, () => { const _id = sampleTemplate._id; expect(() => singleNamespaceSerializer.rawToSavedObject({ ...raw, _id })).toThrow( - `Raw document 'foo:bar' is not a valid saved object` + `Raw document 'foo:bar' does not start with expected prefix 'baz:foo:'` ); }); test(`fails for documents which have any extra prefix in their _id`, () => { const _id = `random:${raw._id}`; expect(() => singleNamespaceSerializer.rawToSavedObject({ ...raw, _id })).toThrow( - `Raw document 'random:baz:foo:bar' is not a valid saved object` + `Raw document 'random:baz:foo:bar' does not start with expected prefix 'baz:foo:'` ); }); @@ -432,14 +432,14 @@ describe('#rawToSavedObject', () => { test(`fails for documents which have a namespace prefix in their _id`, () => { const _id = `${raw._source.namespace}:${raw._id}`; expect(() => multiNamespaceSerializer.rawToSavedObject({ ...raw, _id })).toThrow( - `Raw document 'baz:foo:bar' is not a valid saved object` + `Raw document 'baz:foo:bar' does not start with expected prefix 'foo:'` ); }); test(`fails for documents which have any extra prefix in their _id`, () => { const _id = `random:${raw._id}`; expect(() => multiNamespaceSerializer.rawToSavedObject({ ...raw, _id })).toThrow( - `Raw document 'random:foo:bar' is not a valid saved object` + `Raw document 'random:foo:bar' does not start with expected prefix 'foo:'` ); }); diff --git a/src/core/server/saved_objects/serialization/serializer.ts b/src/core/server/saved_objects/serialization/serializer.ts index 0f67128ccbca8..4b955032939b3 100644 --- a/src/core/server/saved_objects/serialization/serializer.ts +++ b/src/core/server/saved_objects/serialization/serializer.ts @@ -39,13 +39,34 @@ export class SavedObjectsSerializer { * @param {SavedObjectsRawDocParseOptions} options - Options for parsing the raw document. */ public isRawSavedObject(doc: SavedObjectsRawDoc, options: SavedObjectsRawDocParseOptions = {}) { + try { + this.checkIsRawSavedObject(doc, options); + return true; + } catch (error) { + // do nothing + } + return false; + } + + private checkIsRawSavedObject( + doc: SavedObjectsRawDoc, + options: SavedObjectsRawDocParseOptions = {} + ) { const { namespaceTreatment = 'strict' } = options; const { _id, _source } = doc; const { type, namespace } = _source; if (!type) { - return false; + throw new Error(`Raw document '${_id}' is missing _source.type field`); + } + const { idMatchesPrefix, prefix } = this.parseIdPrefix( + namespace, + type, + _id, + namespaceTreatment + ); + if (!idMatchesPrefix) { + throw new Error(`Raw document '${_id}' does not start with expected prefix '${prefix}'`); } - const { idMatchesPrefix } = this.parseIdPrefix(namespace, type, _id, namespaceTreatment); return idMatchesPrefix; } @@ -59,9 +80,8 @@ export class SavedObjectsSerializer { doc: SavedObjectsRawDoc, options: SavedObjectsRawDocParseOptions = {} ): SavedObjectSanitizedDoc { - if (!this.isRawSavedObject(doc, options)) { - throw new Error(`Raw document '${doc._id}' is not a valid saved object`); - } + this.checkIsRawSavedObject(doc, options); // throws a descriptive error if the document is not a saved object + const { namespaceTreatment = 'strict' } = options; const { _id, _source, _seq_no, _primary_term } = doc; const { From e35a760447ce568d19e602d3b6ecf9861fb1d270 Mon Sep 17 00:00:00 2001 From: Joe Portner <5295965+jportner@users.noreply.github.com> Date: Wed, 14 Apr 2021 22:47:23 -0400 Subject: [PATCH 4/5] Fix API integration test data --- .../fixtures/es_archiver/saved_objects/ui_counters/data.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/api_integration/fixtures/es_archiver/saved_objects/ui_counters/data.json b/test/api_integration/fixtures/es_archiver/saved_objects/ui_counters/data.json index 80071fe422780..8192c3c161f93 100644 --- a/test/api_integration/fixtures/es_archiver/saved_objects/ui_counters/data.json +++ b/test/api_integration/fixtures/es_archiver/saved_objects/ui_counters/data.json @@ -77,7 +77,7 @@ "type": "doc", "value": { "index": ".kibana", - "id": "uiCounter:09042021:count:myApp:some_app_event", + "id": "usage-counters:uiCounter:09042021:count:myApp:some_app_event", "source": { "usage-counters": { "count": 2, @@ -95,7 +95,7 @@ "type": "doc", "value": { "index": ".kibana", - "id": "anotherDomainId:09042021:count:some_event_name", + "id": "usage-counters:anotherDomainId:09042021:count:some_event_name", "source": { "usage-counters": { "count": 2, From 6b7ca5a66c68d616829a6553431285b7648db95f Mon Sep 17 00:00:00 2001 From: Joe Portner <5295965+jportner@users.noreply.github.com> Date: Wed, 14 Apr 2021 23:49:27 -0400 Subject: [PATCH 5/5] Fix more integration test data --- .../es_archiver/saved_objects/usage_counters/data.json | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/test/api_integration/fixtures/es_archiver/saved_objects/usage_counters/data.json b/test/api_integration/fixtures/es_archiver/saved_objects/usage_counters/data.json index 16e0364b24fda..cd8d63dffa04e 100644 --- a/test/api_integration/fixtures/es_archiver/saved_objects/usage_counters/data.json +++ b/test/api_integration/fixtures/es_archiver/saved_objects/usage_counters/data.json @@ -2,7 +2,7 @@ "type": "doc", "value": { "index": ".kibana", - "id": "uiCounter:20112020:count:myApp:some_app_event", + "id": "usage-counters:uiCounter:20112020:count:myApp:some_app_event", "source": { "usage-counters": { "count": 2, @@ -20,7 +20,7 @@ "type": "doc", "value": { "index": ".kibana", - "id": "anotherDomainId:20112020:count:some_event_name", + "id": "usage-counters:anotherDomainId:20112020:count:some_event_name", "source": { "usage-counters": { "count": 3, @@ -38,7 +38,7 @@ "type": "doc", "value": { "index": ".kibana", - "id": "anotherDomainId:09042021:count:some_event_name", + "id": "usage-counters:anotherDomainId:09042021:count:some_event_name", "source": { "usage-counters": { "count": 2, @@ -56,7 +56,7 @@ "type": "doc", "value": { "index": ".kibana", - "id": "anotherDomainId2:09042021:count:some_event_name", + "id": "usage-counters:anotherDomainId2:09042021:count:some_event_name", "source": { "usage-counters": { "count": 1, @@ -74,7 +74,7 @@ "type": "doc", "value": { "index": ".kibana", - "id": "anotherDomainId3:09042021:custom_type:zero_count", + "id": "usage-counters:anotherDomainId3:09042021:custom_type:zero_count", "source": { "usage-counters": { "count": 0,