From d3b1941db9b7b4bd85da37d3c0ada47b643e4725 Mon Sep 17 00:00:00 2001 From: Nicolas Chaulet Date: Wed, 13 Nov 2019 12:22:57 -0500 Subject: [PATCH] [Fleet] Remove in memory repository (#50431) --- .../default.contract.test.slap_snap | 6 +- .../encrypted_saved_objects/adapter_types.ts | 15 + .../encrypted_saved_objects/default.ts | 3 +- .../memorize_adapter.ts | 4 +- .../memorize_adapter.ts | 10 +- .../agent.contract.test.slap_snap | 1582 +++++++++++++ .../api_keys.contract.test.slap_snap | 358 +++ .../fleet/server/libs/__mocks__/framework.ts | 2 + .../fleet/server/libs/agent.contract.test.ts | 470 ++++ .../plugins/fleet/server/libs/agent.test.ts | 429 ---- .../legacy/plugins/fleet/server/libs/agent.ts | 2 +- .../server/libs/api_keys.contract.test.ts | 187 ++ .../fleet/server/libs/api_keys.test.ts | 142 -- .../plugins/fleet/server/libs/api_keys.ts | 4 +- .../fleet/server/libs/compose/memorized.ts | 69 + .../plugins/fleet/server/libs/policy.test.ts | 27 - .../plugins/fleet/server/libs/policy.ts | 2 +- .../default.contract.test.slap_snap | 296 +-- .../repositories/agent_events/in_memory.ts | 50 - .../default.contract.test.slap_snap | 2074 ++++++++--------- .../server/repositories/agents/in_memory.ts | 98 - .../default.contract.test.slap_snap | 138 +- .../default.contract.test.ts | 2 +- .../enrollment_api_keys/default.ts | 2 +- .../enrollment_api_keys/memory.ts | 99 - .../server/repositories/policies/default.ts | 8 +- .../server/repositories/policies/in_memory.ts | 18 - .../server/repositories/policies/types.ts | 2 +- 28 files changed, 3978 insertions(+), 2121 deletions(-) create mode 100644 x-pack/legacy/plugins/fleet/server/adapters/encrypted_saved_objects/adapter_types.ts create mode 100644 x-pack/legacy/plugins/fleet/server/libs/__memorize_snapshots__/agent.contract.test.slap_snap create mode 100644 x-pack/legacy/plugins/fleet/server/libs/__memorize_snapshots__/api_keys.contract.test.slap_snap create mode 100644 x-pack/legacy/plugins/fleet/server/libs/agent.contract.test.ts delete mode 100644 x-pack/legacy/plugins/fleet/server/libs/agent.test.ts create mode 100644 x-pack/legacy/plugins/fleet/server/libs/api_keys.contract.test.ts delete mode 100644 x-pack/legacy/plugins/fleet/server/libs/api_keys.test.ts create mode 100644 x-pack/legacy/plugins/fleet/server/libs/compose/memorized.ts delete mode 100644 x-pack/legacy/plugins/fleet/server/libs/policy.test.ts delete mode 100644 x-pack/legacy/plugins/fleet/server/repositories/agent_events/in_memory.ts delete mode 100644 x-pack/legacy/plugins/fleet/server/repositories/agents/in_memory.ts delete mode 100644 x-pack/legacy/plugins/fleet/server/repositories/enrollment_api_keys/memory.ts delete mode 100644 x-pack/legacy/plugins/fleet/server/repositories/policies/in_memory.ts diff --git a/x-pack/legacy/plugins/fleet/server/adapters/elasticsearch/__memorize_snapshots__/default.contract.test.slap_snap b/x-pack/legacy/plugins/fleet/server/adapters/elasticsearch/__memorize_snapshots__/default.contract.test.slap_snap index 80c9da08df23d..9fdd79bae58bd 100644 --- a/x-pack/legacy/plugins/fleet/server/adapters/elasticsearch/__memorize_snapshots__/default.contract.test.slap_snap +++ b/x-pack/legacy/plugins/fleet/server/adapters/elasticsearch/__memorize_snapshots__/default.contract.test.slap_snap @@ -1,16 +1,16 @@ exports['AgentsEventsRepository Api Keys allow to create and delete an api key - createApiKey (1)'] = { "results": { - "id": "xnomHW4BOCe18YaxW5t6", + "id": "tLNEZW4B4KwD6w8oPuUl", "name": "test api key", - "api_key": "HSIY-8YbQCuVOy1lTUSJsg" + "api_key": "RXqjPJhUQ8O7LWLMH4Wuvw" } } exports['AgentsEventsRepository Api Keys allow to create and delete an api key - deleteApiKey (2)'] = { "results": { "invalidated_api_keys": [ - "xnomHW4BOCe18YaxW5t6" + "tLNEZW4B4KwD6w8oPuUl" ], "previously_invalidated_api_keys": [], "error_count": 0 diff --git a/x-pack/legacy/plugins/fleet/server/adapters/encrypted_saved_objects/adapter_types.ts b/x-pack/legacy/plugins/fleet/server/adapters/encrypted_saved_objects/adapter_types.ts new file mode 100644 index 0000000000000..0a3374324f38b --- /dev/null +++ b/x-pack/legacy/plugins/fleet/server/adapters/encrypted_saved_objects/adapter_types.ts @@ -0,0 +1,15 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License; + * you may not use this file except in compliance with the Elastic License. + */ + +import { SavedObjectsBaseOptions, SavedObjectAttributes, SavedObject } from 'src/core/server'; + +export interface EncryptedSavedObjects { + getDecryptedAsInternalUser( + type: string, + id: string, + options?: SavedObjectsBaseOptions + ): Promise>; +} diff --git a/x-pack/legacy/plugins/fleet/server/adapters/encrypted_saved_objects/default.ts b/x-pack/legacy/plugins/fleet/server/adapters/encrypted_saved_objects/default.ts index 56791cdf7a56e..41bb8025fe5e3 100644 --- a/x-pack/legacy/plugins/fleet/server/adapters/encrypted_saved_objects/default.ts +++ b/x-pack/legacy/plugins/fleet/server/adapters/encrypted_saved_objects/default.ts @@ -6,8 +6,9 @@ import { SavedObjectsBaseOptions, SavedObjectAttributes, SavedObject } from 'src/core/server'; import { PluginStartContract } from '../../../../../../plugins/encrypted_saved_objects/server'; +import { EncryptedSavedObjects as EncryptedSavedObjectsType } from './adapter_types'; -export class EncryptedSavedObjects { +export class EncryptedSavedObjects implements EncryptedSavedObjectsType { constructor(private readonly plugin: PluginStartContract) {} public async getDecryptedAsInternalUser( diff --git a/x-pack/legacy/plugins/fleet/server/adapters/encrypted_saved_objects/memorize_adapter.ts b/x-pack/legacy/plugins/fleet/server/adapters/encrypted_saved_objects/memorize_adapter.ts index aa408141257eb..bb933a5a2919b 100644 --- a/x-pack/legacy/plugins/fleet/server/adapters/encrypted_saved_objects/memorize_adapter.ts +++ b/x-pack/legacy/plugins/fleet/server/adapters/encrypted_saved_objects/memorize_adapter.ts @@ -6,12 +6,12 @@ import { memorize } from '@mattapperson/slapshot/lib/memorize'; import { SavedObjectsBaseOptions, SavedObjectAttributes, SavedObject } from 'src/core/server'; -import { EncryptedSavedObjects } from './default'; +import { EncryptedSavedObjects } from './adapter_types'; /** * Memorize adpater for test purpose only */ -export class MemorizeEncryptedSavedObjects { +export class MemorizeEncryptedSavedObjects implements EncryptedSavedObjects { constructor(private readonly adapter?: EncryptedSavedObjects) {} public async getDecryptedAsInternalUser( diff --git a/x-pack/legacy/plugins/fleet/server/adapters/saved_objects_database/memorize_adapter.ts b/x-pack/legacy/plugins/fleet/server/adapters/saved_objects_database/memorize_adapter.ts index b006221b75e1a..ecd6f79dc28d1 100644 --- a/x-pack/legacy/plugins/fleet/server/adapters/saved_objects_database/memorize_adapter.ts +++ b/x-pack/legacy/plugins/fleet/server/adapters/saved_objects_database/memorize_adapter.ts @@ -49,7 +49,7 @@ export class MemorizeSODatabaseAdapter implements SODatabaseAdapterType { options?: SavedObjectsCreateOptions ) { return Slapshot.memorize( - `bulkCreate:${JSON.stringify(objects)}:${JSON.stringify(options || {})}`, + `bulkCreate`, () => { if (!this.soAdadpter) { throw new Error('An adapter must be provided when running tests online'); @@ -67,7 +67,7 @@ export class MemorizeSODatabaseAdapter implements SODatabaseAdapterType { options: SavedObjectsBaseOptions = {} ) { return Slapshot.memorize( - `delete:${type}:${id}:${JSON.stringify(options)}`, + `delete`, () => { if (!this.soAdadpter) { throw new Error('An adapter must be provided when running tests online'); @@ -100,7 +100,7 @@ export class MemorizeSODatabaseAdapter implements SODatabaseAdapterType { options: SavedObjectsBaseOptions = {} ): Promise> { return Slapshot.memorize( - `bulkCreate:${JSON.stringify(objects)}:${JSON.stringify(options || {})}`, + `bulkGet`, () => { if (!this.soAdadpter) { throw new Error('An adapter must be provided when running tests online'); @@ -118,7 +118,7 @@ export class MemorizeSODatabaseAdapter implements SODatabaseAdapterType { options: SavedObjectsBaseOptions = {} ): Promise | null> { return Slapshot.memorize( - `get:${type}:${id}:${JSON.stringify(options)}`, + `get:${type}`, () => { if (!this.soAdadpter) { throw new Error('An adapter must be provided when running tests online'); @@ -137,7 +137,7 @@ export class MemorizeSODatabaseAdapter implements SODatabaseAdapterType { options: SavedObjectsUpdateOptions = {} ): Promise> { return Slapshot.memorize( - `get:${type}:${id}:${JSON.stringify(attributes)}:${JSON.stringify(options)}`, + `update:${type}`, () => { if (!this.soAdadpter) { throw new Error('An adapter must be provided when running tests online'); diff --git a/x-pack/legacy/plugins/fleet/server/libs/__memorize_snapshots__/agent.contract.test.slap_snap b/x-pack/legacy/plugins/fleet/server/libs/__memorize_snapshots__/agent.contract.test.slap_snap new file mode 100644 index 0000000000000..ba58de97ecc5d --- /dev/null +++ b/x-pack/legacy/plugins/fleet/server/libs/__memorize_snapshots__/agent.contract.test.slap_snap @@ -0,0 +1,1582 @@ + +exports['Agent lib Enroll Should throw if the enrollment api key is not valid - find:"agents" (1)'] = { + "results": { + "page": 1, + "per_page": 1000, + "total": 0, + "saved_objects": [] + } +} + +exports['Agent lib Enroll Should enroll a new PERMANENT agent - find:"agents" (1)'] = { + "results": { + "page": 1, + "per_page": 1000, + "total": 0, + "saved_objects": [] + } +} + +exports['Agent lib Enroll Should enroll a new PERMANENT agent - find:"agents" (2)'] = { + "results": { + "page": 1, + "per_page": 20, + "total": 0, + "saved_objects": [] + } +} + +exports['Agent lib Enroll Should enroll a new PERMANENT agent - create:agents (3)'] = { + "results": { + "type": "agents", + "id": "86bd7020-0625-11ea-9674-75a3ee7c8618", + "attributes": { + "shared_id": "agent-1", + "active": true, + "policy_id": "policyId", + "type": "PERMANENT", + "enrolled_at": "2019-11-13T14:54:43.233Z", + "user_provided_metadata": "{}", + "local_metadata": "{}", + "actions": [] + }, + "references": [], + "updated_at": "2019-11-13T14:54:43.234Z", + "version": "WzIyNywxXQ==" + } +} + +exports['Agent lib Enroll Should enroll a new PERMANENT agent - update:agents (4)'] = { + "results": { + "id": "86bd7020-0625-11ea-9674-75a3ee7c8618", + "type": "agents", + "updated_at": "2019-11-13T14:54:44.297Z", + "version": "WzIyOCwxXQ==", + "attributes": { + "access_api_key_id": "mock-access-api-key-id-1" + } + } +} + +exports['Agent lib Enroll Should allow to enroll a new PERMANENT agent again if this agent is active - find:"agents" (1)'] = { + "results": { + "page": 1, + "per_page": 1000, + "total": 1, + "saved_objects": [ + { + "type": "agents", + "id": "86bd7020-0625-11ea-9674-75a3ee7c8618", + "attributes": { + "shared_id": "agent-1", + "active": true, + "policy_id": "policyId", + "type": "PERMANENT", + "enrolled_at": "2019-11-13T14:54:43.233Z", + "user_provided_metadata": "{}", + "local_metadata": "{}", + "actions": [], + "access_api_key_id": "mock-access-api-key-id-1" + }, + "references": [], + "updated_at": "2019-11-13T14:54:44.297Z", + "version": "WzIyOCwxXQ==" + } + ] + } +} + +exports['Agent lib Enroll Should allow to enroll a new PERMANENT agent again if this agent is active - delete (2)'] = { + "results": {} +} + +exports['Agent lib Enroll Should allow to enroll a new PERMANENT agent again if this agent is active - find:"agents" (3)'] = { + "results": { + "page": 1, + "per_page": 20, + "total": 0, + "saved_objects": [] + } +} + +exports['Agent lib Enroll Should allow to enroll a new PERMANENT agent again if this agent is active - create:agents (4)'] = { + "results": { + "type": "agents", + "id": "889eb340-0625-11ea-9674-75a3ee7c8618", + "attributes": { + "shared_id": "agent-1", + "active": true, + "type": "PERMANENT", + "enrolled_at": "2019-11-13T14:54:46.387Z", + "user_provided_metadata": "{}", + "local_metadata": "{}", + "actions": [] + }, + "references": [], + "updated_at": "2019-11-13T14:54:46.388Z", + "version": "WzIzMCwxXQ==" + } +} + +exports['Agent lib Enroll Should allow to enroll a new PERMANENT agent again if this agent is active - update:agents (5)'] = { + "results": { + "id": "889eb340-0625-11ea-9674-75a3ee7c8618", + "type": "agents", + "updated_at": "2019-11-13T14:54:47.399Z", + "version": "WzIzMSwxXQ==", + "attributes": { + "access_api_key_id": "mock-access-api-key-id-1" + } + } +} + +exports['Agent lib Enroll Should allow to enroll a new PERMANENT agent again if this agent is active - update:agents (6)'] = { + "results": { + "id": "889eb340-0625-11ea-9674-75a3ee7c8618", + "type": "agents", + "updated_at": "2019-11-13T14:54:48.433Z", + "version": "WzIzMiwxXQ==", + "attributes": { + "active": false + } + } +} + +exports['Agent lib Enroll Should allow to enroll a new PERMANENT agent again if this agent is active - find:"agents" (7)'] = { + "results": { + "page": 1, + "per_page": 20, + "total": 1, + "saved_objects": [ + { + "type": "agents", + "id": "889eb340-0625-11ea-9674-75a3ee7c8618", + "attributes": { + "shared_id": "agent-1", + "active": false, + "type": "PERMANENT", + "enrolled_at": "2019-11-13T14:54:46.387Z", + "user_provided_metadata": "{}", + "local_metadata": "{}", + "actions": [], + "access_api_key_id": "mock-access-api-key-id-1" + }, + "references": [], + "updated_at": "2019-11-13T14:54:48.433Z", + "version": "WzIzMiwxXQ==" + } + ] + } +} + +exports['Agent lib Enroll Should allow to enroll a new PERMANENT agent again if this agent is active - update:agents (8)'] = { + "results": { + "id": "889eb340-0625-11ea-9674-75a3ee7c8618", + "type": "agents", + "updated_at": "2019-11-13T14:54:49.451Z", + "version": "WzIzMywxXQ==", + "attributes": { + "shared_id": "agent-1", + "active": true, + "type": "PERMANENT", + "enrolled_at": "2019-11-13T14:54:49.450Z" + } + } +} + +exports['Agent lib Enroll Should allow to enroll a new PERMANENT agent again if this agent is active - update:agents (9)'] = { + "results": { + "id": "889eb340-0625-11ea-9674-75a3ee7c8618", + "type": "agents", + "updated_at": "2019-11-13T14:54:50.456Z", + "version": "WzIzNCwxXQ==", + "attributes": { + "access_api_key_id": "mock-access-api-key-id-2" + } + } +} + +exports['Agent lib Enroll Should not enroll a new PERMANENT agent if this agent is already active - find:"agents" (1)'] = { + "results": { + "page": 1, + "per_page": 1000, + "total": 1, + "saved_objects": [ + { + "type": "agents", + "id": "889eb340-0625-11ea-9674-75a3ee7c8618", + "attributes": { + "shared_id": "agent-1", + "active": true, + "type": "PERMANENT", + "enrolled_at": "2019-11-13T14:54:49.450Z", + "user_provided_metadata": "{}", + "local_metadata": "{}", + "actions": [], + "access_api_key_id": "mock-access-api-key-id-2" + }, + "references": [], + "updated_at": "2019-11-13T14:54:50.456Z", + "version": "WzIzNCwxXQ==" + } + ] + } +} + +exports['Agent lib Enroll Should not enroll a new PERMANENT agent if this agent is already active - delete (2)'] = { + "results": {} +} + +exports['Agent lib Enroll Should not enroll a new PERMANENT agent if this agent is already active - find:"agents" (3)'] = { + "results": { + "page": 1, + "per_page": 20, + "total": 0, + "saved_objects": [] + } +} + +exports['Agent lib Enroll Should not enroll a new PERMANENT agent if this agent is already active - create:agents (4)'] = { + "results": { + "type": "agents", + "id": "8c415570-0625-11ea-9674-75a3ee7c8618", + "attributes": { + "shared_id": "agent-1", + "active": true, + "type": "PERMANENT", + "enrolled_at": "2019-11-13T14:54:52.486Z", + "user_provided_metadata": "{}", + "local_metadata": "{}", + "actions": [] + }, + "references": [], + "updated_at": "2019-11-13T14:54:52.487Z", + "version": "WzIzNiwxXQ==" + } +} + +exports['Agent lib Enroll Should not enroll a new PERMANENT agent if this agent is already active - update:agents (5)'] = { + "results": { + "id": "8c415570-0625-11ea-9674-75a3ee7c8618", + "type": "agents", + "updated_at": "2019-11-13T14:54:53.498Z", + "version": "WzIzNywxXQ==", + "attributes": { + "access_api_key_id": "mock-access-api-key-id-1" + } + } +} + +exports['Agent lib Enroll Should not enroll a new PERMANENT agent if this agent is already active - find:"agents" (6)'] = { + "results": { + "page": 1, + "per_page": 20, + "total": 1, + "saved_objects": [ + { + "type": "agents", + "id": "8c415570-0625-11ea-9674-75a3ee7c8618", + "attributes": { + "shared_id": "agent-1", + "active": true, + "type": "PERMANENT", + "enrolled_at": "2019-11-13T14:54:52.486Z", + "user_provided_metadata": "{}", + "local_metadata": "{}", + "actions": [], + "access_api_key_id": "mock-access-api-key-id-1" + }, + "references": [], + "updated_at": "2019-11-13T14:54:53.498Z", + "version": "WzIzNywxXQ==" + } + ] + } +} + +exports['Agent lib Enroll Should enroll a new EPHEMERAL agent - find:"agents" (1)'] = { + "results": { + "page": 1, + "per_page": 1000, + "total": 1, + "saved_objects": [ + { + "type": "agents", + "id": "8c415570-0625-11ea-9674-75a3ee7c8618", + "attributes": { + "shared_id": "agent-1", + "active": true, + "type": "PERMANENT", + "enrolled_at": "2019-11-13T14:54:52.486Z", + "user_provided_metadata": "{}", + "local_metadata": "{}", + "actions": [], + "access_api_key_id": "mock-access-api-key-id-1" + }, + "references": [], + "updated_at": "2019-11-13T14:54:53.498Z", + "version": "WzIzNywxXQ==" + } + ] + } +} + +exports['Agent lib Enroll Should enroll a new EPHEMERAL agent - delete (2)'] = { + "results": {} +} + +exports['Agent lib Enroll Should enroll a new EPHEMERAL agent - create:agents (3)'] = { + "results": { + "type": "agents", + "id": "8e132f40-0625-11ea-9674-75a3ee7c8618", + "attributes": { + "active": true, + "policy_id": "policyId", + "type": "EPHEMERAL", + "enrolled_at": "2019-11-13T14:54:55.538Z", + "user_provided_metadata": "{}", + "local_metadata": "{}", + "actions": [] + }, + "references": [], + "updated_at": "2019-11-13T14:54:55.540Z", + "version": "WzIzOSwxXQ==" + } +} + +exports['Agent lib Enroll Should enroll a new EPHEMERAL agent - update:agents (4)'] = { + "results": { + "id": "8e132f40-0625-11ea-9674-75a3ee7c8618", + "type": "agents", + "updated_at": "2019-11-13T14:54:56.551Z", + "version": "WzI0MCwxXQ==", + "attributes": { + "access_api_key_id": "mock-access-api-key-id-1" + } + } +} + +exports['Agent lib Delete should delete ephemeral instances - find:"agents" (1)'] = { + "results": { + "page": 1, + "per_page": 1000, + "total": 1, + "saved_objects": [ + { + "type": "agents", + "id": "8e132f40-0625-11ea-9674-75a3ee7c8618", + "attributes": { + "active": true, + "policy_id": "policyId", + "type": "EPHEMERAL", + "enrolled_at": "2019-11-13T14:54:55.538Z", + "user_provided_metadata": "{}", + "local_metadata": "{}", + "actions": [], + "access_api_key_id": "mock-access-api-key-id-1" + }, + "references": [], + "updated_at": "2019-11-13T14:54:56.551Z", + "version": "WzI0MCwxXQ==" + } + ] + } +} + +exports['Agent lib Delete should delete ephemeral instances - delete (2)'] = { + "results": {} +} + +exports['Agent lib Delete should delete ephemeral instances - create:agents (3)'] = { + "results": { + "type": "agents", + "id": "8fe2bf20-0625-11ea-9674-75a3ee7c8618", + "attributes": { + "type": "EPHEMERAL", + "active": true, + "local_metadata": "{}", + "user_provided_metadata": "{}" + }, + "references": [], + "updated_at": "2019-11-13T14:54:58.578Z", + "version": "WzI0MiwxXQ==" + } +} + +exports['Agent lib Delete should delete ephemeral instances - find:"agent_events" (4)'] = { + "results": { + "page": 1, + "per_page": 1000, + "total": 0, + "saved_objects": [] + } +} + +exports['Agent lib Delete should delete ephemeral instances - delete (5)'] = { + "results": {} +} + +exports['Agent lib Delete should delete ephemeral instances - get:agents (6)'] = { + "results": null +} + +exports['Agent lib Delete should desactivate other agent - find:"agents" (1)'] = { + "results": { + "page": 1, + "per_page": 1000, + "total": 0, + "saved_objects": [] + } +} + +exports['Agent lib Delete should desactivate other agent - create:agents (2)'] = { + "results": { + "type": "agents", + "id": "91180ad0-0625-11ea-9674-75a3ee7c8618", + "attributes": { + "type": "PERMANENT", + "active": true, + "local_metadata": "{}", + "user_provided_metadata": "{}" + }, + "references": [], + "updated_at": "2019-11-13T14:55:00.605Z", + "version": "WzI0NCwxXQ==" + } +} + +exports['Agent lib Delete should desactivate other agent - update:agents (3)'] = { + "results": { + "id": "91180ad0-0625-11ea-9674-75a3ee7c8618", + "type": "agents", + "updated_at": "2019-11-13T14:55:01.614Z", + "version": "WzI0NSwxXQ==", + "attributes": { + "active": false + } + } +} + +exports['Agent lib Delete should desactivate other agent - get:agents (4)'] = { + "results": { + "id": "91180ad0-0625-11ea-9674-75a3ee7c8618", + "type": "agents", + "updated_at": "2019-11-13T14:55:01.614Z", + "version": "WzI0NSwxXQ==", + "attributes": { + "type": "PERMANENT", + "active": false, + "local_metadata": "{}", + "user_provided_metadata": "{}" + }, + "references": [] + } +} + +exports['Agent lib list should return all agents - find:"agents" (1)'] = { + "results": { + "page": 1, + "per_page": 1000, + "total": 1, + "saved_objects": [ + { + "type": "agents", + "id": "91180ad0-0625-11ea-9674-75a3ee7c8618", + "attributes": { + "type": "PERMANENT", + "active": false, + "local_metadata": "{}", + "user_provided_metadata": "{}" + }, + "references": [], + "updated_at": "2019-11-13T14:55:01.614Z", + "version": "WzI0NSwxXQ==" + } + ] + } +} + +exports['Agent lib list should return all agents - delete (2)'] = { + "results": {} +} + +exports['Agent lib list should return all agents - create:agents (3)'] = { + "results": { + "type": "agents", + "id": "92e74c90-0625-11ea-9674-75a3ee7c8618", + "attributes": { + "type": "PERMANENT", + "active": true, + "local_metadata": "{}", + "user_provided_metadata": "{}" + }, + "references": [], + "updated_at": "2019-11-13T14:55:03.641Z", + "version": "WzI0NywxXQ==" + } +} + +exports['Agent lib list should return all agents - create:agents (4)'] = { + "results": { + "type": "agents", + "id": "93844fe0-0625-11ea-9674-75a3ee7c8618", + "attributes": { + "type": "PERMANENT", + "active": true, + "local_metadata": "{}", + "user_provided_metadata": "{}" + }, + "references": [], + "updated_at": "2019-11-13T14:55:04.670Z", + "version": "WzI0OCwxXQ==" + } +} + +exports['Agent lib list should return all agents - find:"agents" (5)'] = { + "results": { + "page": 1, + "per_page": 20, + "total": 2, + "saved_objects": [ + { + "type": "agents", + "id": "92e74c90-0625-11ea-9674-75a3ee7c8618", + "attributes": { + "type": "PERMANENT", + "active": true, + "local_metadata": "{}", + "user_provided_metadata": "{}" + }, + "references": [], + "updated_at": "2019-11-13T14:55:03.641Z", + "version": "WzI0NywxXQ==" + }, + { + "type": "agents", + "id": "93844fe0-0625-11ea-9674-75a3ee7c8618", + "attributes": { + "type": "PERMANENT", + "active": true, + "local_metadata": "{}", + "user_provided_metadata": "{}" + }, + "references": [], + "updated_at": "2019-11-13T14:55:04.670Z", + "version": "WzI0OCwxXQ==" + } + ] + } +} + +exports['Agent lib checkin should throw if the agens do not exists - find:"agents" (1)'] = { + "results": { + "page": 1, + "per_page": 1000, + "total": 2, + "saved_objects": [ + { + "type": "agents", + "id": "92e74c90-0625-11ea-9674-75a3ee7c8618", + "attributes": { + "type": "PERMANENT", + "active": true, + "local_metadata": "{}", + "user_provided_metadata": "{}" + }, + "references": [], + "updated_at": "2019-11-13T14:55:03.641Z", + "version": "WzI0NywxXQ==" + }, + { + "type": "agents", + "id": "93844fe0-0625-11ea-9674-75a3ee7c8618", + "attributes": { + "type": "PERMANENT", + "active": true, + "local_metadata": "{}", + "user_provided_metadata": "{}" + }, + "references": [], + "updated_at": "2019-11-13T14:55:04.670Z", + "version": "WzI0OCwxXQ==" + } + ] + } +} + +exports['Agent lib checkin should throw if the agens do not exists - delete (2)'] = { + "results": {} +} + +exports['Agent lib checkin should throw if the agens do not exists - delete (3)'] = { + "results": {} +} + +exports['Agent lib checkin should throw if the agens do not exists - find:"agents" (4)'] = { + "results": { + "page": 1, + "per_page": 20, + "total": 0, + "saved_objects": [] + } +} + +exports['Agent lib checkin should throw is the agent is not active - find:"agents" (1)'] = { + "results": { + "page": 1, + "per_page": 1000, + "total": 0, + "saved_objects": [] + } +} + +exports['Agent lib checkin should throw is the agent is not active - create:agents (2)'] = { + "results": { + "type": "agents", + "id": "95578940-0625-11ea-9674-75a3ee7c8618", + "attributes": { + "actions": [], + "active": false, + "policy_id": "policy:1", + "access_api_key_id": "key1", + "local_metadata": "{}", + "user_provided_metadata": "{}" + }, + "references": [], + "updated_at": "2019-11-13T14:55:07.732Z", + "version": "WzI1MSwxXQ==" + } +} + +exports['Agent lib checkin should throw is the agent is not active - find:"agents" (3)'] = { + "results": { + "page": 1, + "per_page": 20, + "total": 1, + "saved_objects": [ + { + "type": "agents", + "id": "95578940-0625-11ea-9674-75a3ee7c8618", + "attributes": { + "actions": [], + "active": false, + "policy_id": "policy:1", + "access_api_key_id": "key1", + "local_metadata": "{}", + "user_provided_metadata": "{}" + }, + "references": [], + "updated_at": "2019-11-13T14:55:07.732Z", + "version": "WzI1MSwxXQ==" + } + ] + } +} + +exports['Agent lib checkin should persist new events - find:"agents" (1)'] = { + "results": { + "page": 1, + "per_page": 1000, + "total": 1, + "saved_objects": [ + { + "type": "agents", + "id": "95578940-0625-11ea-9674-75a3ee7c8618", + "attributes": { + "actions": [], + "active": false, + "policy_id": "policy:1", + "access_api_key_id": "key1", + "local_metadata": "{}", + "user_provided_metadata": "{}" + }, + "references": [], + "updated_at": "2019-11-13T14:55:07.732Z", + "version": "WzI1MSwxXQ==" + } + ] + } +} + +exports['Agent lib checkin should persist new events - delete (2)'] = { + "results": {} +} + +exports['Agent lib checkin should persist new events - create:agents (3)'] = { + "results": { + "type": "agents", + "id": "96890460-0625-11ea-9674-75a3ee7c8618", + "attributes": { + "actions": [], + "active": true, + "policy_id": "policy:1", + "access_api_key_id": "key1", + "local_metadata": "{}", + "user_provided_metadata": "{}" + }, + "references": [], + "updated_at": "2019-11-13T14:55:09.734Z", + "version": "WzI1MywxXQ==" + } +} + +exports['Agent lib checkin should persist new events - find:"agents" (4)'] = { + "results": { + "page": 1, + "per_page": 20, + "total": 1, + "saved_objects": [ + { + "type": "agents", + "id": "96890460-0625-11ea-9674-75a3ee7c8618", + "attributes": { + "actions": [], + "active": true, + "policy_id": "policy:1", + "access_api_key_id": "key1", + "local_metadata": "{}", + "user_provided_metadata": "{}" + }, + "references": [], + "updated_at": "2019-11-13T14:55:09.734Z", + "version": "WzI1MywxXQ==" + } + ] + } +} + +exports['Agent lib checkin should persist new events - update:agents (5)'] = { + "results": { + "id": "96890460-0625-11ea-9674-75a3ee7c8618", + "type": "agents", + "updated_at": "2019-11-13T14:55:10.747Z", + "version": "WzI1NCwxXQ==", + "attributes": { + "last_checkin": "2019-11-13T14:55:10.745Z", + "actions": [] + } + } +} + +exports['Agent lib checkin should persist new events - bulkCreate (6)'] = { + "results": { + "saved_objects": [ + { + "id": "agent_events:97bd3ea0-0625-11ea-9674-75a3ee7c8618", + "type": "agent_events", + "updated_at": "2019-11-13T14:55:11.754Z", + "version": "WzI1NSwxXQ==", + "attributes": { + "agent_id": "96890460-0625-11ea-9674-75a3ee7c8618", + "timestamp": "2019-09-05T15:41:26+0000", + "type": "STATE", + "subtype": "STARTING", + "message": "State changed from PAUSE to STARTING" + }, + "references": [] + } + ] + } +} + +exports['Agent lib checkin should persist new events - find:"agent_events" (7)'] = { + "results": { + "page": 1, + "per_page": 20, + "total": 1, + "saved_objects": [ + { + "type": "agent_events", + "id": "97bd3ea0-0625-11ea-9674-75a3ee7c8618", + "attributes": { + "agent_id": "96890460-0625-11ea-9674-75a3ee7c8618", + "timestamp": "2019-09-05T15:41:26+0000", + "type": "STATE", + "subtype": "STARTING", + "message": "State changed from PAUSE to STARTING" + }, + "references": [], + "updated_at": "2019-11-13T14:55:11.754Z", + "version": "WzI1NSwxXQ==" + } + ] + } +} + +exports['Agent lib checkin should not update agent metadata if none are provided - find:"agents" (1)'] = { + "results": { + "page": 1, + "per_page": 1000, + "total": 1, + "saved_objects": [ + { + "type": "agents", + "id": "96890460-0625-11ea-9674-75a3ee7c8618", + "attributes": { + "actions": [], + "active": true, + "policy_id": "policy:1", + "access_api_key_id": "key1", + "local_metadata": "{}", + "user_provided_metadata": "{}", + "last_checkin": "2019-11-13T14:55:10.745Z" + }, + "references": [], + "updated_at": "2019-11-13T14:55:10.747Z", + "version": "WzI1NCwxXQ==" + } + ] + } +} + +exports['Agent lib checkin should not update agent metadata if none are provided - delete (2)'] = { + "results": {} +} + +exports['Agent lib checkin should not update agent metadata if none are provided - create:agents (3)'] = { + "results": { + "type": "agents", + "id": "98f71e30-0625-11ea-9674-75a3ee7c8618", + "attributes": { + "local_metadata": "{\"key\":\"local1\"}", + "user_provided_metadata": "{\"key\":\"user1\"}", + "actions": [], + "active": true, + "policy_id": "policy:1", + "access_api_key_id": "key1" + }, + "references": [], + "updated_at": "2019-11-13T14:55:13.811Z", + "version": "WzI1NywxXQ==" + } +} + +exports['Agent lib checkin should not update agent metadata if none are provided - find:"agents" (4)'] = { + "results": { + "page": 1, + "per_page": 20, + "total": 1, + "saved_objects": [ + { + "type": "agents", + "id": "98f71e30-0625-11ea-9674-75a3ee7c8618", + "attributes": { + "local_metadata": "{\"key\":\"local1\"}", + "user_provided_metadata": "{\"key\":\"user1\"}", + "actions": [], + "active": true, + "policy_id": "policy:1", + "access_api_key_id": "key1" + }, + "references": [], + "updated_at": "2019-11-13T14:55:13.811Z", + "version": "WzI1NywxXQ==" + } + ] + } +} + +exports['Agent lib checkin should not update agent metadata if none are provided - update:agents (5)'] = { + "results": { + "id": "98f71e30-0625-11ea-9674-75a3ee7c8618", + "type": "agents", + "updated_at": "2019-11-13T14:55:14.823Z", + "version": "WzI1OCwxXQ==", + "attributes": { + "last_checkin": "2019-11-13T14:55:14.821Z", + "actions": [] + } + } +} + +exports['Agent lib checkin should not update agent metadata if none are provided - get:agents (6)'] = { + "results": { + "id": "98f71e30-0625-11ea-9674-75a3ee7c8618", + "type": "agents", + "updated_at": "2019-11-13T14:55:14.823Z", + "version": "WzI1OCwxXQ==", + "attributes": { + "local_metadata": "{\"key\":\"local1\"}", + "user_provided_metadata": "{\"key\":\"user1\"}", + "actions": [], + "active": true, + "policy_id": "policy:1", + "access_api_key_id": "key1", + "last_checkin": "2019-11-13T14:55:14.821Z" + }, + "references": [] + } +} + +exports['Agent lib checkin should return the full policy for this agent - find:"agents" (1)'] = { + "results": { + "page": 1, + "per_page": 1000, + "total": 1, + "saved_objects": [ + { + "type": "agents", + "id": "98f71e30-0625-11ea-9674-75a3ee7c8618", + "attributes": { + "local_metadata": "{\"key\":\"local1\"}", + "user_provided_metadata": "{\"key\":\"user1\"}", + "actions": [], + "active": true, + "policy_id": "policy:1", + "access_api_key_id": "key1", + "last_checkin": "2019-11-13T14:55:14.821Z" + }, + "references": [], + "updated_at": "2019-11-13T14:55:14.823Z", + "version": "WzI1OCwxXQ==" + } + ] + } +} + +exports['Agent lib checkin should return the full policy for this agent - delete (2)'] = { + "results": {} +} + +exports['Agent lib checkin should return the full policy for this agent - create:agents (3)'] = { + "results": { + "type": "agents", + "id": "9ac6d520-0625-11ea-9674-75a3ee7c8618", + "attributes": { + "local_metadata": "{\"key\":\"local1\"}", + "user_provided_metadata": "{\"key\":\"user1\"}", + "actions": [], + "active": true, + "policy_id": "policy:1", + "access_api_key_id": "key1" + }, + "references": [], + "updated_at": "2019-11-13T14:55:16.850Z", + "version": "WzI2MCwxXQ==" + } +} + +exports['Agent lib checkin should return the full policy for this agent - find:"agents" (4)'] = { + "results": { + "page": 1, + "per_page": 20, + "total": 1, + "saved_objects": [ + { + "type": "agents", + "id": "9ac6d520-0625-11ea-9674-75a3ee7c8618", + "attributes": { + "local_metadata": "{\"key\":\"local1\"}", + "user_provided_metadata": "{\"key\":\"user1\"}", + "actions": [], + "active": true, + "policy_id": "policy:1", + "access_api_key_id": "key1" + }, + "references": [], + "updated_at": "2019-11-13T14:55:16.850Z", + "version": "WzI2MCwxXQ==" + } + ] + } +} + +exports['Agent lib checkin should return the full policy for this agent - update:agents (5)'] = { + "results": { + "id": "9ac6d520-0625-11ea-9674-75a3ee7c8618", + "type": "agents", + "updated_at": "2019-11-13T14:55:17.873Z", + "version": "WzI2MSwxXQ==", + "attributes": { + "last_checkin": "2019-11-13T14:55:17.868Z", + "actions": [] + } + } +} + +exports['Agent lib checkin should update agent metadata if provided - find:"agents" (1)'] = { + "results": { + "page": 1, + "per_page": 1000, + "total": 1, + "saved_objects": [ + { + "type": "agents", + "id": "9ac6d520-0625-11ea-9674-75a3ee7c8618", + "attributes": { + "local_metadata": "{\"key\":\"local1\"}", + "user_provided_metadata": "{\"key\":\"user1\"}", + "actions": [], + "active": true, + "policy_id": "policy:1", + "access_api_key_id": "key1", + "last_checkin": "2019-11-13T14:55:17.868Z" + }, + "references": [], + "updated_at": "2019-11-13T14:55:17.873Z", + "version": "WzI2MSwxXQ==" + } + ] + } +} + +exports['Agent lib checkin should update agent metadata if provided - delete (2)'] = { + "results": {} +} + +exports['Agent lib checkin should update agent metadata if provided - create:agents (3)'] = { + "results": { + "type": "agents", + "id": "9c979d80-0625-11ea-9674-75a3ee7c8618", + "attributes": { + "local_metadata": "{\"key\":\"local1\"}", + "user_provided_metadata": "{\"key\":\"user1\"}", + "actions": [], + "active": true, + "policy_id": "policy:1", + "access_api_key_id": "key1" + }, + "references": [], + "updated_at": "2019-11-13T14:55:19.895Z", + "version": "WzI2MywxXQ==" + } +} + +exports['Agent lib checkin should update agent metadata if provided - find:"agents" (4)'] = { + "results": { + "page": 1, + "per_page": 20, + "total": 1, + "saved_objects": [ + { + "type": "agents", + "id": "9c979d80-0625-11ea-9674-75a3ee7c8618", + "attributes": { + "local_metadata": "{\"key\":\"local1\"}", + "user_provided_metadata": "{\"key\":\"user1\"}", + "actions": [], + "active": true, + "policy_id": "policy:1", + "access_api_key_id": "key1" + }, + "references": [], + "updated_at": "2019-11-13T14:55:19.895Z", + "version": "WzI2MywxXQ==" + } + ] + } +} + +exports['Agent lib checkin should update agent metadata if provided - update:agents (5)'] = { + "results": { + "id": "9c979d80-0625-11ea-9674-75a3ee7c8618", + "type": "agents", + "updated_at": "2019-11-13T14:55:20.906Z", + "version": "WzI2NCwxXQ==", + "attributes": { + "last_checkin": "2019-11-13T14:55:20.904Z", + "actions": [], + "local_metadata": "{\"key\":\"local2\"}" + } + } +} + +exports['Agent lib checkin should update agent metadata if provided - get:agents (6)'] = { + "results": { + "id": "9c979d80-0625-11ea-9674-75a3ee7c8618", + "type": "agents", + "updated_at": "2019-11-13T14:55:20.906Z", + "version": "WzI2NCwxXQ==", + "attributes": { + "local_metadata": "{\"key\":\"local2\"}", + "user_provided_metadata": "{\"key\":\"user1\"}", + "actions": [], + "active": true, + "policy_id": "policy:1", + "access_api_key_id": "key1", + "last_checkin": "2019-11-13T14:55:20.904Z" + }, + "references": [] + } +} + +exports['Agent lib checkin should return new actions - find:"agents" (1)'] = { + "results": { + "page": 1, + "per_page": 1000, + "total": 1, + "saved_objects": [ + { + "type": "agents", + "id": "9c979d80-0625-11ea-9674-75a3ee7c8618", + "attributes": { + "local_metadata": "{\"key\":\"local2\"}", + "user_provided_metadata": "{\"key\":\"user1\"}", + "actions": [], + "active": true, + "policy_id": "policy:1", + "access_api_key_id": "key1", + "last_checkin": "2019-11-13T14:55:20.904Z" + }, + "references": [], + "updated_at": "2019-11-13T14:55:20.906Z", + "version": "WzI2NCwxXQ==" + } + ] + } +} + +exports['Agent lib checkin should return new actions - delete (2)'] = { + "results": {} +} + +exports['Agent lib checkin should return new actions - create:agents (3)'] = { + "results": { + "type": "agents", + "id": "9e677b80-0625-11ea-9674-75a3ee7c8618", + "attributes": { + "active": true, + "policy_id": "policy:1", + "access_api_key_id": "key1", + "actions": [ + { + "created_at": "2019-09-05T15:43:26+0000", + "type": "PAUSE", + "id": "this-a-unique-id" + }, + { + "created_at": "2019-09-05T15:41:26+0000", + "type": "PAUSE", + "sent_at": "2019-09-05T15:42:26+0000", + "id": "this-a-unique-id-already-sent" + } + ], + "local_metadata": "{}", + "user_provided_metadata": "{}" + }, + "references": [], + "updated_at": "2019-11-13T14:55:22.936Z", + "version": "WzI2NiwxXQ==" + } +} + +exports['Agent lib checkin should return new actions - find:"agents" (4)'] = { + "results": { + "page": 1, + "per_page": 20, + "total": 1, + "saved_objects": [ + { + "type": "agents", + "id": "9e677b80-0625-11ea-9674-75a3ee7c8618", + "attributes": { + "active": true, + "policy_id": "policy:1", + "access_api_key_id": "key1", + "actions": [ + { + "created_at": "2019-09-05T15:43:26+0000", + "type": "PAUSE", + "id": "this-a-unique-id" + }, + { + "created_at": "2019-09-05T15:41:26+0000", + "type": "PAUSE", + "sent_at": "2019-09-05T15:42:26+0000", + "id": "this-a-unique-id-already-sent" + } + ], + "local_metadata": "{}", + "user_provided_metadata": "{}" + }, + "references": [], + "updated_at": "2019-11-13T14:55:22.936Z", + "version": "WzI2NiwxXQ==" + } + ] + } +} + +exports['Agent lib checkin should return new actions - update:agents (5)'] = { + "results": { + "id": "9e677b80-0625-11ea-9674-75a3ee7c8618", + "type": "agents", + "updated_at": "2019-11-13T14:55:23.960Z", + "version": "WzI2NywxXQ==", + "attributes": { + "last_checkin": "2019-11-13T14:55:23.958Z", + "actions": [ + { + "created_at": "2019-09-05T15:43:26+0000", + "type": "PAUSE", + "id": "this-a-unique-id", + "sent_at": "2019-11-13T14:55:23.958Z" + } + ] + } + } +} + +exports['Agent lib unenroll should set the list of agents as inactive - find:"agents" (1)'] = { + "results": { + "page": 1, + "per_page": 1000, + "total": 1, + "saved_objects": [ + { + "type": "agents", + "id": "9e677b80-0625-11ea-9674-75a3ee7c8618", + "attributes": { + "active": true, + "policy_id": "policy:1", + "access_api_key_id": "key1", + "actions": [ + { + "sent_at": "2019-11-13T14:55:23.958Z", + "created_at": "2019-09-05T15:43:26+0000", + "id": "this-a-unique-id", + "type": "PAUSE" + } + ], + "local_metadata": "{}", + "user_provided_metadata": "{}", + "last_checkin": "2019-11-13T14:55:23.958Z" + }, + "references": [], + "updated_at": "2019-11-13T14:55:23.960Z", + "version": "WzI2NywxXQ==" + } + ] + } +} + +exports['Agent lib unenroll should set the list of agents as inactive - delete (2)'] = { + "results": {} +} + +exports['Agent lib unenroll should set the list of agents as inactive - create:agents (3)'] = { + "results": { + "type": "agents", + "id": "a0389200-0625-11ea-9674-75a3ee7c8618", + "attributes": { + "local_metadata": "{\"key\":\"local1\"}", + "user_provided_metadata": "{\"key\":\"user1\"}", + "actions": [], + "active": true, + "policy_id": "policy:1" + }, + "references": [], + "updated_at": "2019-11-13T14:55:25.984Z", + "version": "WzI2OSwxXQ==" + } +} + +exports['Agent lib unenroll should set the list of agents as inactive - create:agents (4)'] = { + "results": { + "type": "agents", + "id": "a0d32450-0625-11ea-9674-75a3ee7c8618", + "attributes": { + "local_metadata": "{\"key\":\"local1\"}", + "user_provided_metadata": "{\"key\":\"user1\"}", + "actions": [], + "active": true, + "policy_id": "policy:1" + }, + "references": [], + "updated_at": "2019-11-13T14:55:26.997Z", + "version": "WzI3MCwxXQ==" + } +} + +exports['Agent lib unenroll should set the list of agents as inactive - update:agents (5)'] = { + "results": { + "id": "a0389200-0625-11ea-9674-75a3ee7c8618", + "type": "agents", + "updated_at": "2019-11-13T14:55:28.012Z", + "version": "WzI3MSwxXQ==", + "attributes": { + "active": false + } + } +} + +exports['Agent lib unenroll should set the list of agents as inactive - update:agents (6)'] = { + "results": { + "id": "a0d32450-0625-11ea-9674-75a3ee7c8618", + "type": "agents", + "updated_at": "2019-11-13T14:55:29.019Z", + "version": "WzI3MiwxXQ==", + "attributes": { + "active": false + } + } +} + +exports['Agent lib unenroll should set the list of agents as inactive - get:agents (7)'] = { + "results": { + "id": "a0389200-0625-11ea-9674-75a3ee7c8618", + "type": "agents", + "updated_at": "2019-11-13T14:55:28.012Z", + "version": "WzI3MSwxXQ==", + "attributes": { + "local_metadata": "{\"key\":\"local1\"}", + "user_provided_metadata": "{\"key\":\"user1\"}", + "actions": [], + "active": false, + "policy_id": "policy:1" + }, + "references": [] + } +} + +exports['Agent lib unenroll should set the list of agents as inactive - get:agents (8)'] = { + "results": { + "id": "a0d32450-0625-11ea-9674-75a3ee7c8618", + "type": "agents", + "updated_at": "2019-11-13T14:55:29.019Z", + "version": "WzI3MiwxXQ==", + "attributes": { + "local_metadata": "{\"key\":\"local1\"}", + "user_provided_metadata": "{\"key\":\"user1\"}", + "actions": [], + "active": false, + "policy_id": "policy:1" + }, + "references": [] + } +} + +exports['Agent lib unenrollForPolicy should set all the of agents for this policy as inactive - find:"agents" (1)'] = { + "results": { + "page": 1, + "per_page": 1000, + "total": 2, + "saved_objects": [ + { + "type": "agents", + "id": "a0389200-0625-11ea-9674-75a3ee7c8618", + "attributes": { + "local_metadata": "{\"key\":\"local1\"}", + "user_provided_metadata": "{\"key\":\"user1\"}", + "actions": [], + "active": false, + "policy_id": "policy:1" + }, + "references": [], + "updated_at": "2019-11-13T14:55:28.012Z", + "version": "WzI3MSwxXQ==" + }, + { + "type": "agents", + "id": "a0d32450-0625-11ea-9674-75a3ee7c8618", + "attributes": { + "local_metadata": "{\"key\":\"local1\"}", + "user_provided_metadata": "{\"key\":\"user1\"}", + "actions": [], + "active": false, + "policy_id": "policy:1" + }, + "references": [], + "updated_at": "2019-11-13T14:55:29.019Z", + "version": "WzI3MiwxXQ==" + } + ] + } +} + +exports['Agent lib unenrollForPolicy should set all the of agents for this policy as inactive - delete (2)'] = { + "results": {} +} + +exports['Agent lib unenrollForPolicy should set all the of agents for this policy as inactive - delete (3)'] = { + "results": {} +} + +exports['Agent lib unenrollForPolicy should set all the of agents for this policy as inactive - create:agents (4)'] = { + "results": { + "type": "agents", + "id": "a3d6ee70-0625-11ea-9674-75a3ee7c8618", + "attributes": { + "local_metadata": "{\"key\":\"local1\"}", + "user_provided_metadata": "{\"key\":\"user1\"}", + "actions": [], + "active": true, + "policy_id": "policy:1" + }, + "references": [], + "updated_at": "2019-11-13T14:55:32.055Z", + "version": "WzI3NSwxXQ==" + } +} + +exports['Agent lib unenrollForPolicy should set all the of agents for this policy as inactive - create:agents (5)'] = { + "results": { + "type": "agents", + "id": "a4743fe0-0625-11ea-9674-75a3ee7c8618", + "attributes": { + "local_metadata": "{\"key\":\"local1\"}", + "user_provided_metadata": "{\"key\":\"user1\"}", + "actions": [], + "active": true, + "policy_id": "policy:1" + }, + "references": [], + "updated_at": "2019-11-13T14:55:33.086Z", + "version": "WzI3NiwxXQ==" + } +} + +exports['Agent lib unenrollForPolicy should set all the of agents for this policy as inactive - find:"agents" (6)'] = { + "results": { + "page": 1, + "per_page": 100, + "total": 2, + "saved_objects": [ + { + "type": "agents", + "id": "a3d6ee70-0625-11ea-9674-75a3ee7c8618", + "attributes": { + "local_metadata": "{\"key\":\"local1\"}", + "user_provided_metadata": "{\"key\":\"user1\"}", + "actions": [], + "active": true, + "policy_id": "policy:1" + }, + "references": [], + "updated_at": "2019-11-13T14:55:32.055Z", + "version": "WzI3NSwxXQ==" + }, + { + "type": "agents", + "id": "a4743fe0-0625-11ea-9674-75a3ee7c8618", + "attributes": { + "local_metadata": "{\"key\":\"local1\"}", + "user_provided_metadata": "{\"key\":\"user1\"}", + "actions": [], + "active": true, + "policy_id": "policy:1" + }, + "references": [], + "updated_at": "2019-11-13T14:55:33.086Z", + "version": "WzI3NiwxXQ==" + } + ] + } +} + +exports['Agent lib unenrollForPolicy should set all the of agents for this policy as inactive - update:agents (7)'] = { + "results": { + "id": "a3d6ee70-0625-11ea-9674-75a3ee7c8618", + "type": "agents", + "updated_at": "2019-11-13T14:55:34.128Z", + "version": "WzI3NywxXQ==", + "attributes": { + "active": false + } + } +} + +exports['Agent lib unenrollForPolicy should set all the of agents for this policy as inactive - update:agents (8)'] = { + "results": { + "id": "a4743fe0-0625-11ea-9674-75a3ee7c8618", + "type": "agents", + "updated_at": "2019-11-13T14:55:35.103Z", + "version": "WzI3OCwxXQ==", + "attributes": { + "active": false + } + } +} + +exports['Agent lib unenrollForPolicy should set all the of agents for this policy as inactive - find:"agents" (9)'] = { + "results": { + "page": 2, + "per_page": 100, + "total": 0, + "saved_objects": [] + } +} + +exports['Agent lib unenrollForPolicy should set all the of agents for this policy as inactive - get:agents (10)'] = { + "results": { + "id": "a3d6ee70-0625-11ea-9674-75a3ee7c8618", + "type": "agents", + "updated_at": "2019-11-13T14:55:34.128Z", + "version": "WzI3NywxXQ==", + "attributes": { + "local_metadata": "{\"key\":\"local1\"}", + "user_provided_metadata": "{\"key\":\"user1\"}", + "actions": [], + "active": false, + "policy_id": "policy:1" + }, + "references": [] + } +} + +exports['Agent lib unenrollForPolicy should set all the of agents for this policy as inactive - get:agents (11)'] = { + "results": { + "id": "a4743fe0-0625-11ea-9674-75a3ee7c8618", + "type": "agents", + "updated_at": "2019-11-13T14:55:35.103Z", + "version": "WzI3OCwxXQ==", + "attributes": { + "local_metadata": "{\"key\":\"local1\"}", + "user_provided_metadata": "{\"key\":\"user1\"}", + "actions": [], + "active": false, + "policy_id": "policy:1" + }, + "references": [] + } +} + +exports['Agent lib addAction should throw if the agent do not exists - find:"agents" (1)'] = { + "results": { + "page": 1, + "per_page": 1000, + "total": 2, + "saved_objects": [ + { + "type": "agents", + "id": "a3d6ee70-0625-11ea-9674-75a3ee7c8618", + "attributes": { + "local_metadata": "{\"key\":\"local1\"}", + "user_provided_metadata": "{\"key\":\"user1\"}", + "actions": [], + "active": false, + "policy_id": "policy:1" + }, + "references": [], + "updated_at": "2019-11-13T14:55:34.128Z", + "version": "WzI3NywxXQ==" + }, + { + "type": "agents", + "id": "a4743fe0-0625-11ea-9674-75a3ee7c8618", + "attributes": { + "local_metadata": "{\"key\":\"local1\"}", + "user_provided_metadata": "{\"key\":\"user1\"}", + "actions": [], + "active": false, + "policy_id": "policy:1" + }, + "references": [], + "updated_at": "2019-11-13T14:55:35.103Z", + "version": "WzI3OCwxXQ==" + } + ] + } +} + +exports['Agent lib addAction should throw if the agent do not exists - delete (2)'] = { + "results": {} +} + +exports['Agent lib addAction should throw if the agent do not exists - delete (3)'] = { + "results": {} +} + +exports['Agent lib addAction should throw if the agent do not exists - get:agents (4)'] = { + "results": null +} diff --git a/x-pack/legacy/plugins/fleet/server/libs/__memorize_snapshots__/api_keys.contract.test.slap_snap b/x-pack/legacy/plugins/fleet/server/libs/__memorize_snapshots__/api_keys.contract.test.slap_snap new file mode 100644 index 0000000000000..e7881ded27232 --- /dev/null +++ b/x-pack/legacy/plugins/fleet/server/libs/__memorize_snapshots__/api_keys.contract.test.slap_snap @@ -0,0 +1,358 @@ + +exports['ApiKeys Lib verifyAccessApiKey should verify a valid api key - find:"enrollment_api_keys" (1)'] = { + "results": { + "page": 1, + "per_page": 1000, + "total": 0, + "saved_objects": [] + } +} + +exports['ApiKeys Lib verifyAccessApiKey should verify a valid api key - createApiKey (2)'] = { + "results": { + "id": "r7NDZW4B4KwD6w8o_-VN", + "name": "TEST API KEY: 4aae3a09-e9d1-4a12-8a57-0206ba925049", + "api_key": "xO4Ms-OZRWWtE61N8MWqLw" + } +} + +exports['ApiKeys Lib verifyAccessApiKey should verify a valid api key - authenticate (3)'] = { + "results": { + "username": "elastic", + "roles": [], + "full_name": null, + "email": null, + "metadata": { + "_reserved": true + }, + "enabled": true, + "authentication_realm": { + "name": "_es_api_key", + "type": "_es_api_key" + }, + "lookup_realm": { + "name": "_es_api_key", + "type": "_es_api_key" + } + } +} + +exports['ApiKeys Lib verifyAccessApiKey should not verify invalid ApiKey - find:"enrollment_api_keys" (1)'] = { + "results": { + "page": 1, + "per_page": 1000, + "total": 0, + "saved_objects": [] + } +} + +exports['ApiKeys Lib verifyAccessApiKey should not verify invalid ApiKey - authenticate (2)'] = { + "thrownError": "{\"msg\":\"[security_exception] missing authentication credentials for REST request [/_security/_authenticate], with { header={ WWW-Authenticate={ 0=\\\"ApiKey\\\" & 1=\\\"Basic realm=\\\\\\\"security\\\\\\\" charset=\\\\\\\"UTF-8\\\\\\\"\\\" } } }\",\"path\":\"/_security/_authenticate\",\"statusCode\":401,\"response\":\"{\\\"error\\\":{\\\"root_cause\\\":[{\\\"type\\\":\\\"security_exception\\\",\\\"reason\\\":\\\"missing authentication credentials for REST request [/_security/_authenticate]\\\",\\\"header\\\":{\\\"WWW-Authenticate\\\":[\\\"ApiKey\\\",\\\"Basic realm=\\\\\\\"security\\\\\\\" charset=\\\\\\\"UTF-8\\\\\\\"\\\"]}}],\\\"type\\\":\\\"security_exception\\\",\\\"reason\\\":\\\"missing authentication credentials for REST request [/_security/_authenticate]\\\",\\\"header\\\":{\\\"WWW-Authenticate\\\":[\\\"ApiKey\\\",\\\"Basic realm=\\\\\\\"security\\\\\\\" charset=\\\\\\\"UTF-8\\\\\\\"\\\"]}},\\\"status\\\":401}\",\"wwwAuthenticateDirective\":\"ApiKey, Basic realm=\\\"security\\\" charset=\\\"UTF-8\\\"\"}", + "results": null +} + +exports['ApiKeys Lib verifyEnrollmentApiKey should verify a valid api key - find:"enrollment_api_keys" (1)'] = { + "results": { + "page": 1, + "per_page": 1000, + "total": 0, + "saved_objects": [] + } +} + +exports['ApiKeys Lib verifyEnrollmentApiKey should verify a valid api key - createApiKey (2)'] = { + "results": { + "id": "sLNEZW4B4KwD6w8oAeXf", + "name": "TEST API KEY: cac73ad9-e757-49e2-9bd9-40fbdce6bf99", + "api_key": "77eOdCJnRWOegQ1iIjGnDg" + } +} + +exports['ApiKeys Lib verifyEnrollmentApiKey should verify a valid api key - create:enrollment_api_keys (3)'] = { + "results": { + "type": "enrollment_api_keys", + "id": "6850373a-bb23-4f02-bb21-c0acbafcd3d8", + "attributes": { + "active": true, + "api_key_id": "sLNEZW4B4KwD6w8oAeXf" + }, + "references": [], + "updated_at": "2019-11-13T14:56:27.037Z", + "version": "WzMxMiwxXQ==" + } +} + +exports['ApiKeys Lib verifyEnrollmentApiKey should verify a valid api key - authenticate (4)'] = { + "results": { + "username": "elastic", + "roles": [], + "full_name": null, + "email": null, + "metadata": { + "_reserved": true + }, + "enabled": true, + "authentication_realm": { + "name": "_es_api_key", + "type": "_es_api_key" + }, + "lookup_realm": { + "name": "_es_api_key", + "type": "_es_api_key" + } + } +} + +exports['ApiKeys Lib verifyEnrollmentApiKey should verify a valid api key - find:"enrollment_api_keys" (5)'] = { + "results": { + "page": 1, + "per_page": 20, + "total": 1, + "saved_objects": [ + { + "type": "enrollment_api_keys", + "id": "6850373a-bb23-4f02-bb21-c0acbafcd3d8", + "attributes": { + "active": true, + "api_key_id": "sLNEZW4B4KwD6w8oAeXf", + "api_key": "y7Zz4tVm3miSfv1W1rd9zAROGpHBVtGKScnQvnDikCWUo1X3DUFTNnOI99B0H4gngrSvq1U8DKofCF7hP0jrGSJqLmuntGss5hES2DvO7/5djsCVf3kva+uTwW18gGsWTP707l7TCMfewDCETNtKBIwxt8w4/j/FfOXxusi1W1PebmiQFspZZTQ30dWKXZ9yzjs6VXqwpIF3Sw==" + }, + "references": [], + "updated_at": "2019-11-13T14:56:27.037Z", + "version": "WzMxMiwxXQ==" + } + ] + } +} + +exports['ApiKeys Lib verifyEnrollmentApiKey should verify a valid api key - getDecryptedAsInternalUser:enrollment_api_keys:6850373a-bb23-4f02-bb21-c0acbafcd3d8 (6)'] = { + "results": { + "id": "6850373a-bb23-4f02-bb21-c0acbafcd3d8", + "type": "enrollment_api_keys", + "updated_at": "2019-11-13T14:56:27.037Z", + "version": "WzMxMiwxXQ==", + "attributes": { + "active": true, + "api_key_id": "sLNEZW4B4KwD6w8oAeXf", + "api_key": "c0xORVpXNEI0S3dENnc4b0FlWGY6NzdlT2RDSm5SV09lZ1ExaUlqR25EZw==" + }, + "references": [] + } +} + +exports['ApiKeys Lib verifyEnrollmentApiKey should not verify a inactive enrollemnt api key - find:"enrollment_api_keys" (1)'] = { + "results": { + "page": 1, + "per_page": 1000, + "total": 1, + "saved_objects": [ + { + "type": "enrollment_api_keys", + "id": "6850373a-bb23-4f02-bb21-c0acbafcd3d8", + "attributes": { + "active": true, + "api_key_id": "sLNEZW4B4KwD6w8oAeXf" + }, + "references": [], + "updated_at": "2019-11-13T14:56:27.037Z", + "version": "WzMxMiwxXQ==" + } + ] + } +} + +exports['ApiKeys Lib verifyEnrollmentApiKey should not verify a inactive enrollemnt api key - delete (2)'] = { + "results": {} +} + +exports['ApiKeys Lib verifyEnrollmentApiKey should not verify a inactive enrollemnt api key - createApiKey (3)'] = { + "results": { + "id": "sbNEZW4B4KwD6w8oDOXF", + "name": "TEST API KEY: c0120d29-ef06-45e8-9649-431939f26e59", + "api_key": "m07xSOsSSk6qroc-hM0gnw" + } +} + +exports['ApiKeys Lib verifyEnrollmentApiKey should not verify a inactive enrollemnt api key - create:enrollment_api_keys (4)'] = { + "results": { + "type": "enrollment_api_keys", + "id": "340f1199-6036-47e0-9b94-a69516fe4629", + "attributes": { + "active": false, + "api_key_id": "sbNEZW4B4KwD6w8oDOXF" + }, + "references": [], + "updated_at": "2019-11-13T14:56:29.059Z", + "version": "WzMxNCwxXQ==" + } +} + +exports['ApiKeys Lib verifyEnrollmentApiKey should not verify a inactive enrollemnt api key - authenticate (5)'] = { + "results": { + "username": "elastic", + "roles": [], + "full_name": null, + "email": null, + "metadata": { + "_reserved": true + }, + "enabled": true, + "authentication_realm": { + "name": "_es_api_key", + "type": "_es_api_key" + }, + "lookup_realm": { + "name": "_es_api_key", + "type": "_es_api_key" + } + } +} + +exports['ApiKeys Lib verifyEnrollmentApiKey should not verify a inactive enrollemnt api key - find:"enrollment_api_keys" (6)'] = { + "results": { + "page": 1, + "per_page": 20, + "total": 1, + "saved_objects": [ + { + "type": "enrollment_api_keys", + "id": "340f1199-6036-47e0-9b94-a69516fe4629", + "attributes": { + "active": false, + "api_key_id": "sbNEZW4B4KwD6w8oDOXF", + "api_key": "5y+RPHiBwUF0Kt8g/uJXlZ8OzR2oQSju6Btm+yv5px5CrhjA1575pQpSW+2kW/MZdmkev9fY+8VMLaGsM4pGoYQfh0PlbkZQ3XQW+mvFvrhMvFX+gZfvS+0AQE27dhRm6qvj091N/gmDGkfm4JZD8kE9CznyZSEmnmNtTeqt/XnuHTRg609J5EPkGtyw8WpA2DohNtzQUiFGiQ==" + }, + "references": [], + "updated_at": "2019-11-13T14:56:29.059Z", + "version": "WzMxNCwxXQ==" + } + ] + } +} + +exports['ApiKeys Lib verifyEnrollmentApiKey should not verify a inactive enrollemnt api key - getDecryptedAsInternalUser:enrollment_api_keys:340f1199-6036-47e0-9b94-a69516fe4629 (7)'] = { + "results": { + "id": "340f1199-6036-47e0-9b94-a69516fe4629", + "type": "enrollment_api_keys", + "updated_at": "2019-11-13T14:56:29.059Z", + "version": "WzMxNCwxXQ==", + "attributes": { + "active": false, + "api_key_id": "sbNEZW4B4KwD6w8oDOXF", + "api_key": "c2JORVpXNEI0S3dENnc4b0RPWEY6bTA3eFNPc1NTazZxcm9jLWhNMGdudw==" + }, + "references": [] + } +} + +exports['ApiKeys Lib verifyEnrollmentApiKey should not verify a inactive an enrollemnt api key not persisted - find:"enrollment_api_keys" (1)'] = { + "results": { + "page": 1, + "per_page": 1000, + "total": 1, + "saved_objects": [ + { + "type": "enrollment_api_keys", + "id": "340f1199-6036-47e0-9b94-a69516fe4629", + "attributes": { + "active": false, + "api_key_id": "sbNEZW4B4KwD6w8oDOXF" + }, + "references": [], + "updated_at": "2019-11-13T14:56:29.059Z", + "version": "WzMxNCwxXQ==" + } + ] + } +} + +exports['ApiKeys Lib verifyEnrollmentApiKey should not verify a inactive an enrollemnt api key not persisted - delete (2)'] = { + "results": {} +} + +exports['ApiKeys Lib verifyEnrollmentApiKey should not verify a inactive an enrollemnt api key not persisted - createApiKey (3)'] = { + "results": { + "id": "srNEZW4B4KwD6w8oFOWo", + "name": "TEST API KEY: d7b015ad-ed9e-4bdc-a4e7-db6449d69f44", + "api_key": "rfo24UgTQ9ecyZZ-erxfkQ" + } +} + +exports['ApiKeys Lib verifyEnrollmentApiKey should not verify a inactive an enrollemnt api key not persisted - authenticate (4)'] = { + "results": { + "username": "elastic", + "roles": [], + "full_name": null, + "email": null, + "metadata": { + "_reserved": true + }, + "enabled": true, + "authentication_realm": { + "name": "_es_api_key", + "type": "_es_api_key" + }, + "lookup_realm": { + "name": "_es_api_key", + "type": "_es_api_key" + } + } +} + +exports['ApiKeys Lib verifyEnrollmentApiKey should not verify a inactive an enrollemnt api key not persisted - find:"enrollment_api_keys" (5)'] = { + "results": { + "page": 1, + "per_page": 20, + "total": 0, + "saved_objects": [] + } +} + +exports['ApiKeys Lib verifyEnrollmentApiKey should not verify invalid ApiKey - find:"enrollment_api_keys" (1)'] = { + "results": { + "page": 1, + "per_page": 1000, + "total": 0, + "saved_objects": [] + } +} + +exports['ApiKeys Lib verifyEnrollmentApiKey should not verify invalid ApiKey - authenticate (2)'] = { + "thrownError": "{\"msg\":\"[security_exception] missing authentication credentials for REST request [/_security/_authenticate], with { header={ WWW-Authenticate={ 0=\\\"ApiKey\\\" & 1=\\\"Basic realm=\\\\\\\"security\\\\\\\" charset=\\\\\\\"UTF-8\\\\\\\"\\\" } } }\",\"path\":\"/_security/_authenticate\",\"statusCode\":401,\"response\":\"{\\\"error\\\":{\\\"root_cause\\\":[{\\\"type\\\":\\\"security_exception\\\",\\\"reason\\\":\\\"missing authentication credentials for REST request [/_security/_authenticate]\\\",\\\"header\\\":{\\\"WWW-Authenticate\\\":[\\\"ApiKey\\\",\\\"Basic realm=\\\\\\\"security\\\\\\\" charset=\\\\\\\"UTF-8\\\\\\\"\\\"]}}],\\\"type\\\":\\\"security_exception\\\",\\\"reason\\\":\\\"missing authentication credentials for REST request [/_security/_authenticate]\\\",\\\"header\\\":{\\\"WWW-Authenticate\\\":[\\\"ApiKey\\\",\\\"Basic realm=\\\\\\\"security\\\\\\\" charset=\\\\\\\"UTF-8\\\\\\\"\\\"]}},\\\"status\\\":401}\",\"wwwAuthenticateDirective\":\"ApiKey, Basic realm=\\\"security\\\" charset=\\\"UTF-8\\\"\"}", + "results": null +} + +exports['ApiKeys Lib generateEnrollmentApiKey should generate a valid ApiKey - find:"enrollment_api_keys" (1)'] = { + "results": { + "page": 1, + "per_page": 1000, + "total": 0, + "saved_objects": [] + } +} + +exports['ApiKeys Lib generateEnrollmentApiKey should generate a valid ApiKey - createApiKey (2)'] = { + "results": { + "id": "s7NEZW4B4KwD6w8oFeVt", + "name": "Fleet:EnrollmentApiKey:294002ed-c668-4970-9fcf-f516341673fa:policy1", + "api_key": "9sWTYpGNTCilNbYkl9lNFg" + } +} + +exports['ApiKeys Lib generateEnrollmentApiKey should generate a valid ApiKey - create:enrollment_api_keys (3)'] = { + "results": { + "type": "enrollment_api_keys", + "id": "dca6bb47-53d6-4317-99e5-30760483bbbe", + "attributes": { + "created_at": "2019-11-13T14:56:32.063Z", + "api_key_id": "s7NEZW4B4KwD6w8oFeVt", + "policy_id": "policy1", + "active": true, + "enrollment_rules": [], + "name": "Fleet:EnrollmentApiKey:294002ed-c668-4970-9fcf-f516341673fa:policy1" + }, + "references": [], + "updated_at": "2019-11-13T14:56:32.078Z", + "version": "WzMxNiwxXQ==" + } +} diff --git a/x-pack/legacy/plugins/fleet/server/libs/__mocks__/framework.ts b/x-pack/legacy/plugins/fleet/server/libs/__mocks__/framework.ts index 74701a1888a3a..584c62dacbae0 100644 --- a/x-pack/legacy/plugins/fleet/server/libs/__mocks__/framework.ts +++ b/x-pack/legacy/plugins/fleet/server/libs/__mocks__/framework.ts @@ -14,4 +14,6 @@ export class FrameworkLib { public getInternalUser(): FrameworkUser { return { kind: 'internal' }; } + + public expose(key: string, method: any) {} } diff --git a/x-pack/legacy/plugins/fleet/server/libs/agent.contract.test.ts b/x-pack/legacy/plugins/fleet/server/libs/agent.contract.test.ts new file mode 100644 index 0000000000000..b2f0cece5be18 --- /dev/null +++ b/x-pack/legacy/plugins/fleet/server/libs/agent.contract.test.ts @@ -0,0 +1,470 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License; + * you may not use this file except in compliance with the Elastic License. + */ + +import Slapshot from '@mattapperson/slapshot'; +import { Agent } from '../repositories/agents/types'; +import { FrameworkUser, internalAuthData } from '../adapters/framework/adapter_types'; +import { compose } from './compose/memorized'; +import { FleetServerLib } from './types'; +import { SODatabaseAdapter } from '../adapters/saved_objects_database/default'; +import { MemorizeSODatabaseAdapter } from '../adapters/saved_objects_database/memorize_adapter'; +import { SavedObject } from 'kibana/server'; + +jest.mock('./api_keys'); +jest.mock('./policy'); + +function getUser(apiKey?: string, apiKeyId?: string) { + if (!apiKey) { + return { kind: 'internal' } as FrameworkUser; + } + return ({ + kind: 'authenticated', + [internalAuthData]: { + authorization: `ApiKey ${Buffer.from(`${apiKeyId || 'key_id'}:${apiKey}`).toString( + 'base64' + )}`, + }, + } as unknown) as FrameworkUser; +} + +describe('Agent lib', () => { + let servers: any; + let libs: FleetServerLib; + let soAdapter: MemorizeSODatabaseAdapter; + + async function clearFixtures() { + const { saved_objects: savedObjects } = await soAdapter.find(getUser(), { + type: 'agents', + perPage: 1000, + }); + for (const so of savedObjects) { + await soAdapter.delete(getUser(), 'agents', so.id); + } + } + + async function loadFixtures(agents: Array>) { + const agentIds: string[] = []; + for (const agent of agents) { + agentIds.push( + (await soAdapter.create(getUser(), 'agents', { + ...agent, + local_metadata: JSON.stringify(agent.local_metadata || {}), + user_provided_metadata: JSON.stringify(agent.user_provided_metadata || {}), + })).id + ); + } + return agentIds; + } + + async function getAgentById(agentId: string) { + return await soAdapter.get(getUser(), 'agents', agentId); + } + beforeAll(async () => { + await Slapshot.callWhenOnline(async () => { + const { createKibanaServer } = await import( + '../../../../../test_utils/jest/contract_tests/servers' + ); + servers = await createKibanaServer({ + security: { enabled: false }, + }); + + soAdapter = new MemorizeSODatabaseAdapter( + new SODatabaseAdapter( + servers.kbnServer.savedObjects, + servers.kbnServer.plugins.elasticsearch + ) + ); + }); + + if (!soAdapter) { + soAdapter = new MemorizeSODatabaseAdapter(); + } + }); + + afterAll(async () => { + if (servers) { + await servers.shutdown; + } + }); + + beforeEach(async () => { + await clearFixtures(); + libs = compose(servers ? servers.kbnServer : undefined); + }); + + describe('Enroll', () => { + it('Should throw if the enrollment api key is not valid', async () => { + const { agents } = libs; + let error: Error | null = null; + try { + await agents.enroll(getUser('INVALID_KEY'), 'PERMANENT', undefined, 'agent-1'); + } catch (err) { + error = err; + } + + expect(error).toBeDefined(); + expect((error as Error).message).toBe('Enrollment apiKey is not valid: Not a valid api key'); + }); + + it('Should enroll a new PERMANENT agent', async () => { + const { agents } = libs; + + const agent = await agents.enroll( + getUser('VALID_KEY_WITH_POLICY'), + 'PERMANENT', + undefined, + 'agent-1' + ); + + expect(agent).toBeDefined(); + expect(agent).toMatchObject({ + access_api_key: 'mock-access-api-key-1', + policy_id: 'policyId', + }); + }); + + it('Should allow to enroll a new PERMANENT agent again if this agent is active', async () => { + const { agents } = libs; + + const agent1 = await agents.enroll(getUser('VALID_KEY'), 'PERMANENT', undefined, 'agent-1'); + + // Desactivate this agent + await agents.delete(getUser(), agent1); + + const agent2 = await agents.enroll(getUser('VALID_KEY'), 'PERMANENT', undefined, 'agent-1'); + + expect(agent2).toBeDefined(); + expect(agent2).toMatchObject({ + access_api_key: 'mock-access-api-key-2', + }); + }); + + it('Should not enroll a new PERMANENT agent if this agent is already active', async () => { + const { agents } = libs; + + await agents.enroll(getUser('VALID_KEY'), 'PERMANENT', undefined, 'agent-1'); + let error: Error | null = null; + + try { + await agents.enroll(getUser('VALID_KEY'), 'PERMANENT', undefined, 'agent-1'); + } catch (err) { + error = err; + } + + expect(error).toBeDefined(); + expect((error as Error).message).toBe('Impossible to enroll an already active agent'); + }); + + it('Should enroll a new EPHEMERAL agent', async () => { + const { agents } = libs; + + const agent = await agents.enroll(getUser('VALID_KEY_WITH_POLICY'), 'EPHEMERAL', undefined); + + expect(agent).toBeDefined(); + expect(agent).toMatchObject({ + access_api_key: 'mock-access-api-key-1', + policy_id: 'policyId', + }); + }); + }); + + describe('Delete', () => { + it('should delete ephemeral instances', async () => { + const { agents } = libs; + const [agentId] = await loadFixtures([ + { + type: 'EPHEMERAL', + active: true, + }, + ]); + + await agents.delete(getUser(), { + id: agentId, + type: 'EPHEMERAL', + } as Agent); + + const agent = await getAgentById(agentId); + expect(agent).toBeNull(); + }); + + it('should desactivate other agent', async () => { + const { agents } = libs; + const [agentId] = await loadFixtures([ + { + type: 'PERMANENT', + active: true, + }, + ]); + + await agents.delete(getUser(), { + id: agentId, + type: 'PERMANENT', + } as Agent); + + const agent = await getAgentById(agentId); + expect(agent).toBeDefined(); + expect((agent as SavedObject).attributes.active).toBeFalsy(); + }); + }); + + describe('list', () => { + it('should return all agents', async () => { + const { agents } = libs; + await loadFixtures([ + { + type: 'PERMANENT', + active: true, + }, + { + type: 'PERMANENT', + active: true, + }, + ]); + + const res = await agents.list(getUser()); + + expect(res).toBeDefined(); + expect(res.total).toBe(2); + expect(res.agents).toHaveLength(2); + }); + }); + + describe('checkin', () => { + it('should throw if the agens do not exists', async () => { + const { agents } = libs; + + await expect( + agents.checkin(getUser('VALID_KEY'), [ + { + timestamp: '2019-09-05T15:41:26+0000', + type: 'STATE', + subtype: 'STARTING', + message: 'State changed from PAUSE to STARTING', + }, + ]) + ).rejects.toThrowError(/Agent not found/); + }); + + it('should throw is the agent is not active', async () => { + const { agents } = libs; + await loadFixtures([ + { + actions: [], + active: false, + policy_id: 'policy:1', + access_api_key_id: 'key1', + }, + ]); + + await expect(agents.checkin(getUser('VALID_KEY', 'key1'), [])).rejects.toThrowError( + /Agent inactive/ + ); + }); + + it('should persist new events', async () => { + const { agents } = libs; + const [agentId] = await loadFixtures([ + { + actions: [], + active: true, + policy_id: 'policy:1', + access_api_key_id: 'key1', + }, + ]); + + await agents.checkin(getUser('VALID_KEY', 'key1'), [ + { + timestamp: '2019-09-05T15:41:26+0000', + type: 'STATE', + subtype: 'STARTING', + message: 'State changed from PAUSE to STARTING', + }, + ]); + + const { saved_objects: events } = await soAdapter.find(getUser(), { + type: 'agent_events', + search: agentId, + searchFields: ['agent_id'], + }); + expect(events).toHaveLength(1); + expect(events[0].attributes).toMatchObject({ + timestamp: '2019-09-05T15:41:26+0000', + type: 'STATE', + subtype: 'STARTING', + message: 'State changed from PAUSE to STARTING', + }); + }); + + it('should not update agent metadata if none are provided', async () => { + const { agents } = libs; + const [agentId] = await loadFixtures([ + { + local_metadata: { key: 'local1' }, + user_provided_metadata: { key: 'user1' }, + actions: [], + active: true, + policy_id: 'policy:1', + access_api_key_id: 'key1', + }, + ]); + + await agents.checkin(getUser('VALID_KEY', 'key1'), []); + + const refreshAgent = await getAgentById(agentId); + expect( + JSON.parse((refreshAgent as SavedObject).attributes.local_metadata as string) + ).toMatchObject({ + key: 'local1', + }); + }); + + it('should return the full policy for this agent', async () => { + const { agents } = libs; + await loadFixtures([ + { + local_metadata: { key: 'local1' }, + user_provided_metadata: { key: 'user1' }, + actions: [], + active: true, + policy_id: 'policy:1', + access_api_key_id: 'key1', + }, + ]); + + const { policy } = await agents.checkin(getUser('VALID_KEY', 'key1'), []); + + expect(policy).toMatchObject({ + id: 'policy:1', + }); + }); + + it('should update agent metadata if provided', async () => { + const { agents } = libs; + const [agentId] = await loadFixtures([ + { + local_metadata: { key: 'local1' }, + user_provided_metadata: { key: 'user1' }, + actions: [], + active: true, + policy_id: 'policy:1', + access_api_key_id: 'key1', + }, + ]); + + await agents.checkin(getUser('VALID_KEY', 'key1'), [], { key: 'local2' }); + + const refreshAgent = await getAgentById(agentId); + expect( + JSON.parse((refreshAgent as SavedObject).attributes.local_metadata as string) + ).toMatchObject({ + key: 'local2', + }); + }); + + it('should return new actions', async () => { + const { agents } = libs; + await loadFixtures([ + { + active: true, + policy_id: 'policy:1', + access_api_key_id: 'key1', + actions: [ + { + created_at: '2019-09-05T15:43:26+0000', + type: 'PAUSE', + id: 'this-a-unique-id', + }, + { + created_at: '2019-09-05T15:41:26+0000', + type: 'PAUSE', + sent_at: '2019-09-05T15:42:26+0000', + id: 'this-a-unique-id-already-sent', + }, + ], + }, + ]); + const { actions } = await agents.checkin(getUser('VALID_KEY', 'key1'), []); + + expect(actions).toHaveLength(1); + expect(actions[0]).toMatchObject({ + type: 'PAUSE', + id: 'this-a-unique-id', + }); + }); + }); + + describe('unenroll', () => { + it('should set the list of agents as inactive', async () => { + const { agents } = libs; + const [agent1Id, agent2Id] = await loadFixtures([ + { + local_metadata: { key: 'local1' }, + user_provided_metadata: { key: 'user1' }, + actions: [], + active: true, + policy_id: 'policy:1', + }, + { + local_metadata: { key: 'local1' }, + user_provided_metadata: { key: 'user1' }, + actions: [], + active: true, + policy_id: 'policy:1', + }, + ]); + + await agents.unenroll(getUser(), [agent1Id, agent2Id]); + + const refreshAgent1 = (await getAgentById(agent1Id)) as SavedObject; + const refreshAgent2 = (await getAgentById(agent2Id)) as SavedObject; + + expect(refreshAgent1.attributes.active).toBeFalsy(); + expect(refreshAgent2.attributes.active).toBeFalsy(); + }); + }); + + describe('unenrollForPolicy', () => { + it('should set all the of agents for this policy as inactive', async () => { + const { agents } = libs; + const [agent1Id, agent2Id] = await loadFixtures([ + { + local_metadata: { key: 'local1' }, + user_provided_metadata: { key: 'user1' }, + actions: [], + active: true, + policy_id: 'policy:1', + }, + { + local_metadata: { key: 'local1' }, + user_provided_metadata: { key: 'user1' }, + actions: [], + active: true, + policy_id: 'policy:1', + }, + ]); + + await agents.unenrollForPolicy(getUser(), 'policy:1'); + + const refreshAgent1 = (await getAgentById(agent1Id)) as SavedObject; + const refreshAgent2 = (await getAgentById(agent2Id)) as SavedObject; + + expect(refreshAgent1.attributes.active).toBeFalsy(); + expect(refreshAgent2.attributes.active).toBeFalsy(); + }); + }); + + describe('addAction', () => { + it('should throw if the agent do not exists', async () => { + const { agents } = libs; + + await expect( + agents.addAction(getUser(), 'agent:1', { + type: 'PAUSE', + }) + ).rejects.toThrowError(/Agent not found/); + }); + }); +}); diff --git a/x-pack/legacy/plugins/fleet/server/libs/agent.test.ts b/x-pack/legacy/plugins/fleet/server/libs/agent.test.ts deleted file mode 100644 index 3eed31bcdf998..0000000000000 --- a/x-pack/legacy/plugins/fleet/server/libs/agent.test.ts +++ /dev/null @@ -1,429 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License; - * you may not use this file except in compliance with the Elastic License. - */ - -import { AgentLib } from './agent'; -import { ApiKeyLib } from './api_keys'; -import { PolicyLib } from './policy'; -import { InMemoryAgentsRepository } from '../repositories/agents/in_memory'; -import { Agent } from '../repositories/agents/types'; -import { PoliciesRepository } from '../repositories/policies/default'; -import { FrameworkUser, internalAuthData } from '../adapters/framework/adapter_types'; -import { InMemoryAgentEventsRepository } from '../repositories/agent_events/in_memory'; - -jest.mock('./api_keys'); -jest.mock('./policy'); - -function getMockedApiKeyLib() { - // @ts-ignore - return new ApiKeyLib(); -} - -function compose() { - const apiKeyLib = getMockedApiKeyLib(); - const policy = new PolicyLib({} as PoliciesRepository); - const agentsRepository = new InMemoryAgentsRepository(); - const agentsEventsRepository = new InMemoryAgentEventsRepository(); - const agentLib = new AgentLib(agentsRepository, agentsEventsRepository, apiKeyLib, policy); - - return { - agentLib, - agentsRepository, - agentsEventsRepository, - }; -} - -function getUser(apiKey?: string, apiKeyId?: string) { - if (!apiKey) { - return {} as FrameworkUser; - } - return ({ - kind: 'authenticated', - [internalAuthData]: { - authorization: `ApiKey ${Buffer.from(`${apiKeyId || 'key_id'}:${apiKey}`).toString( - 'base64' - )}`, - }, - } as unknown) as FrameworkUser; -} - -describe('Agent lib', () => { - describe('Enroll', () => { - it('Should throw if the enrollment api key is not valid', async () => { - const { agentLib } = compose(); - let error: Error | null = null; - try { - await agentLib.enroll(getUser('INVALID_KEY'), 'PERMANENT', undefined, 'agent-1'); - } catch (err) { - error = err; - } - - expect(error).toBeDefined(); - expect((error as Error).message).toBe('Enrollment apiKey is not valid: Not a valid api key'); - }); - - it('Should enroll a new PERMANENT agent', async () => { - const { agentLib } = compose(); - - const agent = await agentLib.enroll( - getUser('VALID_KEY_WITH_POLICY'), - 'PERMANENT', - undefined, - 'agent-1' - ); - - expect(agent).toBeDefined(); - expect(agent).toMatchObject({ - access_api_key: 'mock-access-api-key-1', - policy_id: 'policyId', - }); - }); - - it('Should allow to enroll a new PERMANENT agent again if this agent is active', async () => { - const { agentLib, agentsRepository } = compose(); - - const agent1 = await agentLib.enroll(getUser('VALID_KEY'), 'PERMANENT', undefined, 'agent-1'); - - // Desactivate this agent - agentsRepository.agents[agent1.id].active = false; - - const agent2 = await agentLib.enroll(getUser('VALID_KEY'), 'PERMANENT', undefined, 'agent-1'); - - expect(agent2).toBeDefined(); - expect(agent2).toMatchObject({ - access_api_key: 'mock-access-api-key-2', - }); - }); - - it('Should not enroll a new PERMANENT agent if this agent is already active', async () => { - const { agentLib } = compose(); - - await agentLib.enroll(getUser('VALID_KEY'), 'PERMANENT', undefined, 'agent-1'); - let error: Error | null = null; - - try { - await agentLib.enroll(getUser('VALID_KEY'), 'PERMANENT', undefined, 'agent-1'); - } catch (err) { - error = err; - } - - expect(error).toBeDefined(); - expect((error as Error).message).toBe('Impossible to enroll an already active agent'); - }); - - it('Should enroll a new EPHEMERAL agent', async () => { - const { agentLib } = compose(); - - const agent = await agentLib.enroll(getUser('VALID_KEY_WITH_POLICY'), 'EPHEMERAL', undefined); - - expect(agent).toBeDefined(); - expect(agent).toMatchObject({ - access_api_key: 'mock-access-api-key-1', - policy_id: 'policyId', - }); - }); - }); - - describe('Delete', () => { - it('should delete ephemeral instances', async () => { - const { agentLib, agentsRepository } = compose(); - agentsRepository.delete = jest.fn(async () => {}); - - await agentLib.delete(getUser(), { - id: 'agent:1', - type: 'EPHEMERAL', - } as Agent); - - expect(agentsRepository.delete).toHaveBeenCalled(); - }); - - it('should desactivate other agent', async () => { - const { agentLib, agentsRepository } = compose(); - agentsRepository.update = jest.fn(async () => {}); - - await agentLib.delete(getUser(), { - id: 'agent:1', - type: 'PERMANENT', - } as Agent); - - expect(agentsRepository.update).toHaveBeenCalledWith({}, 'agent:1', { - active: false, - }); - }); - }); - - describe('list', () => { - it('should return all agents', async () => { - const { agentLib, agentsRepository } = compose(); - agentsRepository.agents['agent:1'] = { id: 'agent:1' } as Agent; - agentsRepository.agents['agent:2'] = { id: 'agent:2' } as Agent; - - const res = await agentLib.list(getUser()); - - expect(res).toBeDefined(); - expect(res.total).toBe(2); - expect(res.agents).toHaveLength(2); - }); - }); - - describe('checkin', () => { - it('should throw if the agens do not exists', async () => { - const { agentLib } = compose(); - - await expect( - agentLib.checkin(getUser('VALID_KEY'), [ - { - timestamp: '2019-09-05T15:41:26+0000', - type: 'STATE', - subtype: 'STARTING', - message: 'State changed from PAUSE to STARTING', - }, - ]) - ).rejects.toThrowError(/Agent not found/); - }); - - it('should throw is the agent is not active', async () => { - const { agentLib, agentsRepository } = compose(); - agentsRepository.agents['agent:1'] = ({ - id: 'agent:1', - actions: [], - active: false, - policy_id: 'policy:1', - access_api_key_id: 'key1', - } as unknown) as Agent; - - await expect(agentLib.checkin(getUser('VALID_KEY', 'key1'), [])).rejects.toThrowError( - /Agent inactive/ - ); - }); - - it('should persist new events', async () => { - const { agentLib, agentsRepository, agentsEventsRepository } = compose(); - agentsRepository.agents['agent:1'] = ({ - id: 'agent:1', - actions: [], - active: true, - policy_id: 'policy:1', - access_api_key_id: 'key1', - } as unknown) as Agent; - - await agentLib.checkin(getUser('VALID_KEY', 'key1'), [ - { - timestamp: '2019-09-05T15:41:26+0000', - type: 'STATE', - subtype: 'STARTING', - message: 'State changed from PAUSE to STARTING', - }, - ]); - - const { items: events } = await agentsEventsRepository.getEventsForAgent( - getUser(), - 'agent:1' - ); - expect(events).toHaveLength(1); - expect(events[0]).toMatchObject({ - timestamp: '2019-09-05T15:41:26+0000', - type: 'STATE', - subtype: 'STARTING', - message: 'State changed from PAUSE to STARTING', - }); - }); - - it('should not update agent metadata if none are provided', async () => { - const { agentLib, agentsRepository } = compose(); - agentsRepository.agents['agent:1'] = ({ - id: 'agent:1', - local_metadata: { key: 'local1' }, - user_provided_metadata: { key: 'user1' }, - actions: [], - events: [], - active: true, - policy_id: 'policy:1', - access_api_key_id: 'key1', - } as unknown) as Agent; - - await agentLib.checkin(getUser('VALID_KEY', 'key1'), []); - - const refreshAgent = (await agentsRepository.getById(getUser(), 'agent:1')) as Agent; - expect(refreshAgent.local_metadata).toMatchObject({ - key: 'local1', - }); - }); - - it('should return the full policy for this agent', async () => { - const { agentLib, agentsRepository } = compose(); - agentsRepository.agents['agent:1'] = ({ - id: 'agent:1', - local_metadata: { key: 'local1' }, - user_provided_metadata: { key: 'user1' }, - actions: [], - events: [], - active: true, - policy_id: 'policy:1', - access_api_key_id: 'key1', - } as unknown) as Agent; - - const { policy } = await agentLib.checkin(getUser('VALID_KEY', 'key1'), []); - - expect(policy).toMatchObject({ - id: 'policy:1', - }); - }); - - it('should update agent metadata if provided', async () => { - const { agentLib, agentsRepository } = compose(); - agentsRepository.agents['agent:1'] = ({ - id: 'agent:1', - local_metadata: { key: 'local1' }, - user_provided_metadata: { key: 'user1' }, - actions: [], - events: [], - active: true, - policy_id: 'policy:1', - access_api_key_id: 'key1', - } as unknown) as Agent; - - await agentLib.checkin(getUser('VALID_KEY', 'key1'), [], { key: 'local2' }); - - const refreshAgent = (await agentsRepository.getById(getUser(), 'agent:1')) as Agent; - expect(refreshAgent.local_metadata).toMatchObject({ - key: 'local2', - }); - }); - - it('should return new actions', async () => { - const { agentLib, agentsRepository } = compose(); - agentsRepository.agents['agent:1'] = ({ - id: 'agent:1', - active: true, - policy_id: 'policy:1', - access_api_key_id: 'key1', - actions: [ - { - created_at: '2019-09-05T15:43:26+0000', - type: 'PAUSE', - id: 'this-a-unique-id', - }, - { - created_at: '2019-09-05T15:41:26+0000', - type: 'PAUSE', - sent_at: '2019-09-05T15:42:26+0000', - id: 'this-a-unique-id-already-sent', - }, - ], - events: [], - } as unknown) as Agent; - const { actions } = await agentLib.checkin(getUser('VALID_KEY', 'key1'), []); - - expect(actions).toHaveLength(1); - expect(actions[0]).toMatchObject({ - type: 'PAUSE', - id: 'this-a-unique-id', - }); - - const refreshAgent = (await agentsRepository.getById(getUser(), 'agent:1')) as Agent; - expect(refreshAgent.actions[0].sent_at).toBeDefined(); - }); - }); - - describe('unenroll', () => { - it('should set the list of agents as inactive', async () => { - const { agentLib, agentsRepository } = compose(); - agentsRepository.agents['agent:1'] = ({ - id: 'agent:1', - local_metadata: { key: 'local1' }, - user_provided_metadata: { key: 'user1' }, - actions: [], - events: [], - active: true, - policy_id: 'policy:1', - } as unknown) as Agent; - agentsRepository.agents['agent:2'] = ({ - id: 'agent:2', - local_metadata: { key: 'local1' }, - user_provided_metadata: { key: 'user1' }, - actions: [], - events: [], - active: true, - policy_id: 'policy:1', - } as unknown) as Agent; - - await agentLib.unenroll(getUser(), ['agent:1', 'agent:2']); - - const refreshAgent1 = (await agentsRepository.getById(getUser(), 'agent:1')) as Agent; - const refreshAgent2 = (await agentsRepository.getById(getUser(), 'agent:2')) as Agent; - - expect(refreshAgent1.active).toBeFalsy(); - expect(refreshAgent2.active).toBeFalsy(); - }); - }); - - describe('unenrollForPolicy', () => { - it('should set all the of agents for this policy as inactive', async () => { - const { agentLib, agentsRepository } = compose(); - agentsRepository.agents['agent:1'] = ({ - id: 'agent:1', - local_metadata: { key: 'local1' }, - user_provided_metadata: { key: 'user1' }, - actions: [], - events: [], - active: true, - policy_id: 'policy:1', - } as unknown) as Agent; - agentsRepository.agents['agent:2'] = ({ - id: 'agent:2', - local_metadata: { key: 'local1' }, - user_provided_metadata: { key: 'user1' }, - actions: [], - events: [], - active: true, - policy_id: 'policy:1', - } as unknown) as Agent; - - await agentLib.unenrollForPolicy(getUser(), 'policy:1'); - - const refreshAgent1 = (await agentsRepository.getById(getUser(), 'agent:1')) as Agent; - const refreshAgent2 = (await agentsRepository.getById(getUser(), 'agent:2')) as Agent; - - expect(refreshAgent1.active).toBeFalsy(); - expect(refreshAgent2.active).toBeFalsy(); - }); - }); - - describe('addAction', () => { - it('should throw if the agent do not exists', async () => { - const { agentLib } = compose(); - - await expect( - agentLib.addAction(getUser(), 'agent:1', { - type: 'PAUSE', - }) - ).rejects.toThrowError(/Agent not found/); - }); - - it('should add the action', async () => { - const { agentLib, agentsRepository } = compose(); - agentsRepository.agents['agent:1'] = { - id: 'agent:1', - actions: [], - active: true, - type: 'PERMANENT', - policy_id: 'config1', - }; - const spy = jest.spyOn(agentsRepository, 'update'); - - const action = await agentLib.addAction(getUser(), 'agent:1', { - type: 'PAUSE', - }); - - expect(action.id).toBeDefined(); - expect(action.created_at).toBeDefined(); - expect(action.type).toBe('PAUSE'); - expect(spy).toHaveBeenCalled(); - - spy.mockRestore(); - }); - }); -}); diff --git a/x-pack/legacy/plugins/fleet/server/libs/agent.ts b/x-pack/legacy/plugins/fleet/server/libs/agent.ts index b2f7dcb7eef5d..e80e251ff4a88 100644 --- a/x-pack/legacy/plugins/fleet/server/libs/agent.ts +++ b/x-pack/legacy/plugins/fleet/server/libs/agent.ts @@ -79,7 +79,7 @@ export class AgentLib { } const accessApiKey = await this.apiKeys.generateAccessApiKey(agent.id, policyId); - await this.agentsRepository.update(user, agent.id, { + await this.agentsRepository.update(internalUser, agent.id, { access_api_key_id: accessApiKey.id, }); diff --git a/x-pack/legacy/plugins/fleet/server/libs/api_keys.contract.test.ts b/x-pack/legacy/plugins/fleet/server/libs/api_keys.contract.test.ts new file mode 100644 index 0000000000000..6687ee2d35fd4 --- /dev/null +++ b/x-pack/legacy/plugins/fleet/server/libs/api_keys.contract.test.ts @@ -0,0 +1,187 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License; + * you may not use this file except in compliance with the Elastic License. + */ + +import Slapshot from '@mattapperson/slapshot'; +import uuid from 'uuid'; +import { FrameworkUser, internalAuthData } from '../adapters/framework/adapter_types'; +import { MemorizeSODatabaseAdapter } from '../adapters/saved_objects_database/memorize_adapter'; +import { SODatabaseAdapter } from '../adapters/saved_objects_database/default'; +import { FleetServerLib } from './types'; +import { compose } from './compose/memorized'; +import { MemorizedElasticsearchAdapter } from '../adapters/elasticsearch/memorize_adapter'; +import { ElasticsearchAdapter } from '../adapters/elasticsearch/default'; + +jest.mock('./framework'); + +function getUser(): FrameworkUser { + return ({ + kind: 'authenticated', + [internalAuthData]: { + authorization: `Basic ${Buffer.from(`elastic:changeme`).toString('base64')}`, + }, + } as unknown) as FrameworkUser; +} + +function apiKeyToString(apiKey: { id: string; api_key: string }) { + return Buffer.from(`${apiKey.id}:${apiKey.api_key}`).toString('base64'); +} + +function getUserForApiKey(apiKey: { id: string; api_key: string }) { + return { + kind: 'authenticated', + [internalAuthData]: { + authorization: `ApiKey ${apiKeyToString(apiKey)}`, + }, + } as FrameworkUser; +} + +describe('ApiKeys Lib', () => { + let servers: any; + let soAdapter: MemorizeSODatabaseAdapter; + let esAdapter: MemorizedElasticsearchAdapter; + let libs: FleetServerLib; + + async function clearFixtures() { + const { saved_objects: savedObjects } = await soAdapter.find(getUser(), { + type: 'enrollment_api_keys', + perPage: 1000, + }); + for (const so of savedObjects) { + await soAdapter.delete(getUser(), 'enrollment_api_keys', so.id); + } + } + + async function createESApiKey() { + return await esAdapter.createApiKey(getUser(), { + name: `TEST API KEY: ${uuid.v4()}`, + }); + } + beforeAll(async () => { + await Slapshot.callWhenOnline(async () => { + const { createKibanaServer } = await import( + '../../../../../test_utils/jest/contract_tests/servers' + ); + servers = await createKibanaServer({ + security: { enabled: false }, + }); + esAdapter = new MemorizedElasticsearchAdapter( + new ElasticsearchAdapter(servers.kbnServer.plugins.elasticsearch) + ); + soAdapter = new MemorizeSODatabaseAdapter( + new SODatabaseAdapter( + servers.kbnServer.savedObjects, + servers.kbnServer.plugins.elasticsearch + ) + ); + }); + + if (!soAdapter) { + soAdapter = new MemorizeSODatabaseAdapter(); + } + if (!esAdapter) { + esAdapter = new MemorizedElasticsearchAdapter(); + } + }); + + afterAll(async () => { + if (servers) { + await servers.shutdown; + } + }); + beforeEach(async () => { + await clearFixtures(); + libs = compose(servers ? servers.kbnServer : undefined); + }); + describe('verifyAccessApiKey', () => { + it('should verify a valid api key', async () => { + const { apiKeys } = libs; + const apiKey = await createESApiKey(); + + const res = await apiKeys.verifyAccessApiKey(getUserForApiKey(apiKey)); + expect(res).toMatchObject({ + valid: true, + }); + }); + it('should not verify invalid ApiKey', async () => { + const { apiKeys } = libs; + const res = await apiKeys.verifyAccessApiKey( + getUserForApiKey({ id: 'invalid', api_key: 'NOT_A_VALID_API_KEY' }) + ); + expect(res).toMatchObject({ + valid: false, + reason: 'ApiKey is not valid', + }); + }); + }); + describe('verifyEnrollmentApiKey', () => { + it('should verify a valid api key', async () => { + const { apiKeys } = libs; + const apiKey = await createESApiKey(); + await soAdapter.create(getUser(), 'enrollment_api_keys', { + active: true, + api_key_id: apiKey.id, + api_key: apiKeyToString(apiKey), + }); + + const res = await apiKeys.verifyEnrollmentApiKey(getUserForApiKey(apiKey)); + + expect(res).toMatchObject({ + valid: true, + }); + }); + + it('should not verify a inactive enrollemnt api key', async () => { + const { apiKeys } = libs; + const apiKey = await createESApiKey(); + await soAdapter.create(getUser(), 'enrollment_api_keys', { + active: false, + api_key_id: apiKey.id, + api_key: apiKeyToString(apiKey), + }); + + const res = await apiKeys.verifyEnrollmentApiKey(getUserForApiKey(apiKey)); + + expect(res).toMatchObject({ + valid: false, + reason: 'Enrollement api key does not exists or is not active', + }); + }); + + it('should not verify a inactive an enrollemnt api key not persisted', async () => { + const { apiKeys } = libs; + const apiKey = await createESApiKey(); + const res = await apiKeys.verifyEnrollmentApiKey(getUserForApiKey(apiKey)); + + expect(res).toMatchObject({ + valid: false, + reason: 'Enrollement api key does not exists or is not active', + }); + }); + + it('should not verify invalid ApiKey', async () => { + const { apiKeys } = libs; + const res = await apiKeys.verifyEnrollmentApiKey( + getUserForApiKey({ id: 'not valid', api_key: 'invalid' }) + ); + expect(res).toMatchObject({ + valid: false, + reason: 'ApiKey is not valid', + }); + }); + }); + + describe('generateEnrollmentApiKey', () => { + it('should generate a valid ApiKey', async () => { + const { apiKeys } = libs; + + const apiKey = await apiKeys.generateEnrollmentApiKey(getUser(), { + policyId: 'policy1', + }); + + expect(apiKey).toBeDefined(); + }); + }); +}); diff --git a/x-pack/legacy/plugins/fleet/server/libs/api_keys.test.ts b/x-pack/legacy/plugins/fleet/server/libs/api_keys.test.ts deleted file mode 100644 index 0f28dcd6e3ef8..0000000000000 --- a/x-pack/legacy/plugins/fleet/server/libs/api_keys.test.ts +++ /dev/null @@ -1,142 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License; - * you may not use this file except in compliance with the Elastic License. - */ - -import { ApiKeyLib } from './api_keys'; -import { FrameworkLib } from './framework'; -import { MemoryEnrollmentApiKeysRepository } from '../repositories/enrollment_api_keys/memory'; -import { FrameworkAdapter } from '../adapters/framework/default'; -import { FrameworkUser, internalAuthData } from '../adapters/framework/adapter_types'; -import { InMemoryElasticsearchAdapter } from '../adapters/elasticsearch/in_memory'; - -jest.mock('./framework'); - -function getUser() { - return {} as FrameworkUser; -} - -function getUserForApiKey(apiKey: string) { - return { - kind: 'authenticated', - [internalAuthData]: { - authorization: `ApiKey ${apiKey}`, - }, - } as FrameworkUser; -} - -function compose() { - const enrollmentApiKeyRepository = new MemoryEnrollmentApiKeysRepository(); - const esAdapter = new InMemoryElasticsearchAdapter(); - const apiKeys = new ApiKeyLib( - enrollmentApiKeyRepository, - esAdapter, - new FrameworkLib({} as FrameworkAdapter) - ); - - return { apiKeys, enrollmentApiKeyRepository, esAdapter }; -} - -describe('ApiKeys Lib', () => { - describe('verifyAccessApiKey', () => { - it('should verify a valid api key', async () => { - const { apiKeys, esAdapter } = compose(); - const apiKey = await esAdapter.createApiKey(getUser(), { - name: 'test-api-key', - }); - - const res = await apiKeys.verifyAccessApiKey(getUserForApiKey(apiKey.api_key)); - - expect(res).toMatchObject({ - valid: true, - }); - }); - it('should not verify invalid ApiKey', async () => { - const { apiKeys, esAdapter } = compose(); - esAdapter.authenticate = () => { - throw new Error('ApiKey not valid'); - }; - const res = await apiKeys.verifyAccessApiKey(getUserForApiKey('NOT_A_VALID_API_KEY')); - expect(res).toMatchObject({ - valid: false, - reason: 'ApiKey not valid', - }); - }); - }); - describe('verifyEnrollmentApiKey', () => { - it('should verify a valid api key', async () => { - const { apiKeys, esAdapter, enrollmentApiKeyRepository } = compose(); - const apiKey = await esAdapter.createApiKey(getUser(), { - name: 'test-api-key', - }); - enrollmentApiKeyRepository.create(getUser(), { - active: true, - apiKeyId: apiKey.id, - apiKey: apiKey.api_key, - }); - - const res = await apiKeys.verifyEnrollmentApiKey(getUserForApiKey(apiKey.api_key)); - - expect(res).toMatchObject({ - valid: true, - }); - }); - - it('should not verify a inactive enrollemnt api key', async () => { - const { apiKeys, esAdapter, enrollmentApiKeyRepository } = compose(); - const apiKey = await esAdapter.createApiKey(getUser(), { - name: 'test-api-key', - }); - enrollmentApiKeyRepository.create(getUser(), { - active: false, - apiKeyId: apiKey.id, - apiKey: apiKey.api_key, - }); - - const res = await apiKeys.verifyEnrollmentApiKey(getUserForApiKey(apiKey.api_key)); - - expect(res).toMatchObject({ - valid: false, - reason: 'Enrollement api key does not exists or is not active', - }); - }); - - it('should not verify a inactive an enrollemnt api key not persisted', async () => { - const { apiKeys, esAdapter } = compose(); - const apiKey = await esAdapter.createApiKey(getUser(), { - name: 'test-api-key', - }); - const res = await apiKeys.verifyEnrollmentApiKey(getUserForApiKey(apiKey.api_key)); - - expect(res).toMatchObject({ - valid: false, - reason: 'Enrollement api key does not exists or is not active', - }); - }); - - it('should not verify invalid ApiKey', async () => { - const { apiKeys, esAdapter } = compose(); - esAdapter.authenticate = () => { - throw new Error('ApiKey not valid'); - }; - const res = await apiKeys.verifyEnrollmentApiKey(getUserForApiKey('NOT_A_VALID_API_KEY')); - expect(res).toMatchObject({ - valid: false, - reason: 'ApiKey not valid', - }); - }); - }); - - describe('generateEnrollmentApiKey', () => { - it('should generate a valid ApiKey', async () => { - const { apiKeys } = compose(); - - const apiKey = await apiKeys.generateEnrollmentApiKey(getUser(), { - policyId: 'policy1', - }); - - expect(apiKey).toBeDefined(); - }); - }); -}); diff --git a/x-pack/legacy/plugins/fleet/server/libs/api_keys.ts b/x-pack/legacy/plugins/fleet/server/libs/api_keys.ts index 1ff633d65f3a8..2b47c2868212e 100644 --- a/x-pack/legacy/plugins/fleet/server/libs/api_keys.ts +++ b/x-pack/legacy/plugins/fleet/server/libs/api_keys.ts @@ -63,7 +63,7 @@ export class ApiKeyLib { } catch (error) { return { valid: false, - reason: error.message, + reason: error.message || 'ApiKey is not valid', }; } } @@ -84,7 +84,7 @@ export class ApiKeyLib { } catch (error) { return { valid: false, - reason: error.message, + reason: error.message || 'ApiKey is not valid', }; } } diff --git a/x-pack/legacy/plugins/fleet/server/libs/compose/memorized.ts b/x-pack/legacy/plugins/fleet/server/libs/compose/memorized.ts new file mode 100644 index 0000000000000..2314757afa0f6 --- /dev/null +++ b/x-pack/legacy/plugins/fleet/server/libs/compose/memorized.ts @@ -0,0 +1,69 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License; + * you may not use this file except in compliance with the Elastic License. + */ + +import os from 'os'; +import { ApiKeyLib } from '../api_keys'; +import { AgentLib } from '../agent'; +import { FrameworkLib } from '../framework'; +import { AgentsRepository } from '../../repositories/agents/default'; +import { SODatabaseAdapter } from '../../adapters/saved_objects_database/default'; +import { EnrollmentApiKeysRepository } from '../../repositories/enrollment_api_keys/default'; +import { FrameworkAdapter } from '../../adapters/framework/default'; +import { PolicyLib } from '../policy'; +import { EncryptedSavedObjects } from '../../adapters/encrypted_saved_objects/default'; +import { FleetServerLib } from '../types'; +import { PoliciesRepository } from '../../repositories/policies/default'; +import { ArtifactLib } from '../artifact'; +import { FileSystemArtifactRepository } from '../../repositories/artifacts/file_system'; +import { HttpAdapter } from '../../adapters/http_adapter/default'; +import { AgentEventsRepository } from '../../repositories/agent_events/default'; +import { InstallLib } from '../install'; +import { ElasticsearchAdapter } from '../../adapters/elasticsearch/default'; +import { MemorizeSODatabaseAdapter } from '../../adapters/saved_objects_database/memorize_adapter'; +import { MemorizedElasticsearchAdapter } from '../../adapters/elasticsearch/memorize_adapter'; +import { MemorizeEncryptedSavedObjects } from '../../adapters/encrypted_saved_objects/memorize_adapter'; + +export function compose(server?: any): FleetServerLib { + const frameworkAdapter = new FrameworkAdapter(server); + const policyAdapter = new PoliciesRepository(server ? server.plugins.ingest.policy : undefined); + + const framework = new FrameworkLib(frameworkAdapter); + const soDatabaseAdapter = new MemorizeSODatabaseAdapter( + server ? new SODatabaseAdapter(server.savedObjects, server.plugins.elasticsearch) : undefined + ); + const esAdapter = new MemorizedElasticsearchAdapter( + server ? new ElasticsearchAdapter(server.plugins.elasticsearch) : undefined + ); + const encryptedObjectAdapter = new MemorizeEncryptedSavedObjects( + server + ? new EncryptedSavedObjects(server.newPlatform.start.plugins.encryptedSavedObjects) + : undefined + ); + const agentsRepository = new AgentsRepository(soDatabaseAdapter); + const agentEventsRepository = new AgentEventsRepository(soDatabaseAdapter); + const enrollmentApiKeysRepository = new EnrollmentApiKeysRepository( + soDatabaseAdapter, + encryptedObjectAdapter + ); + + const policies = new PolicyLib(policyAdapter); + const apiKeys = new ApiKeyLib(enrollmentApiKeysRepository, esAdapter, framework); + const agents = new AgentLib(agentsRepository, agentEventsRepository, apiKeys, policies); + + const artifactRepository = new FileSystemArtifactRepository(os.tmpdir()); + const artifacts = new ArtifactLib(artifactRepository, new HttpAdapter()); + + const install = new InstallLib(framework); + + return { + agents, + apiKeys, + policies, + artifacts, + install, + framework, + }; +} diff --git a/x-pack/legacy/plugins/fleet/server/libs/policy.test.ts b/x-pack/legacy/plugins/fleet/server/libs/policy.test.ts deleted file mode 100644 index 9d748b80544ef..0000000000000 --- a/x-pack/legacy/plugins/fleet/server/libs/policy.test.ts +++ /dev/null @@ -1,27 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License; - * you may not use this file except in compliance with the Elastic License. - */ - -import { PolicyLib } from './policy'; -import { InMemoryPoliciesRepository } from '../repositories/policies/in_memory'; -import { FullPolicyFile } from '../repositories/policies/types'; - -describe('Policy lib', () => { - describe('getFull', () => { - it('return the policy from the policy adapter', async () => { - const adapter = new InMemoryPoliciesRepository(); - adapter.policies['policy:1'] = ({ - id: 'policy:1', - name: 'Policy', - } as unknown) as FullPolicyFile; - const lib = new PolicyLib(adapter); - - const policy = await lib.getFullPolicy('policy:1'); - - expect(policy).toBeDefined(); - expect(policy.id).toBe('policy:1'); - }); - }); -}); diff --git a/x-pack/legacy/plugins/fleet/server/libs/policy.ts b/x-pack/legacy/plugins/fleet/server/libs/policy.ts index 5571d00d451c5..c8bd6d01ec625 100644 --- a/x-pack/legacy/plugins/fleet/server/libs/policy.ts +++ b/x-pack/legacy/plugins/fleet/server/libs/policy.ts @@ -9,7 +9,7 @@ import { PoliciesRepository, FullPolicyFile } from '../repositories/policies/typ export class PolicyLib { constructor(private readonly policyAdapter: PoliciesRepository) {} - public async getFullPolicy(policyId: string): Promise { + public async getFullPolicy(policyId: string): Promise { return await this.policyAdapter.getFullPolicy(policyId); } } diff --git a/x-pack/legacy/plugins/fleet/server/repositories/agent_events/__memorize_snapshots__/default.contract.test.slap_snap b/x-pack/legacy/plugins/fleet/server/repositories/agent_events/__memorize_snapshots__/default.contract.test.slap_snap index c0d06c08c313d..f2de3916fb5ad 100644 --- a/x-pack/legacy/plugins/fleet/server/repositories/agent_events/__memorize_snapshots__/default.contract.test.slap_snap +++ b/x-pack/legacy/plugins/fleet/server/repositories/agent_events/__memorize_snapshots__/default.contract.test.slap_snap @@ -2,7 +2,7 @@ exports['AgentsEventsRepository createEventsForAgent Create events for an agent - create:agent_events (1)'] = { "results": { "type": "agent_events", - "id": "de47c380-fa55-11e9-a4c5-8377241f6276", + "id": "ac97d650-0625-11ea-a248-f38bbc6424e4", "attributes": { "type": "STATE", "subtype": "STARTING", @@ -11,19 +11,19 @@ exports['AgentsEventsRepository createEventsForAgent Create events for an agent "agent_id": "agent:1" }, "references": [], - "updated_at": "2019-10-29T14:10:31.992Z", - "version": "WzMsMV0=" + "updated_at": "2019-11-13T14:55:46.741Z", + "version": "WzI4MSwxXQ==" } } -exports['AgentsEventsRepository createEventsForAgent Create events for an agent - bulkCreate:[{"attributes":{"agent_id":"agent:1","type":"STATE","subtype":"STARTING","timestamp":"2019-09-27T18:50:33+0000","message":"..."},"type":"agent_events"},{"attributes":{"agent_id":"agent:1","type":"STATE","subtype":"STARTING","timestamp":"2019-09-27T18:50:34+0000","message":"..."},"type":"agent_events"}]:{} (2)'] = { +exports['AgentsEventsRepository createEventsForAgent Create events for an agent - bulkCreate (2)'] = { "results": { "saved_objects": [ { - "id": "agent_events:decd4730-fa55-11e9-a4c5-8377241f6276", + "id": "agent_events:acd9e860-0625-11ea-a248-f38bbc6424e4", "type": "agent_events", - "updated_at": "2019-10-29T14:10:32.866Z", - "version": "WzQsMV0=", + "updated_at": "2019-11-13T14:55:47.174Z", + "version": "WzI4MiwxXQ==", "attributes": { "agent_id": "agent:1", "type": "STATE", @@ -34,10 +34,10 @@ exports['AgentsEventsRepository createEventsForAgent Create events for an agent "references": [] }, { - "id": "agent_events:decd4731-fa55-11e9-a4c5-8377241f6276", + "id": "agent_events:acd9e861-0625-11ea-a248-f38bbc6424e4", "type": "agent_events", - "updated_at": "2019-10-29T14:10:32.866Z", - "version": "WzUsMV0=", + "updated_at": "2019-11-13T14:55:47.174Z", + "version": "WzI4MywxXQ==", "attributes": { "agent_id": "agent:1", "type": "STATE", @@ -55,11 +55,25 @@ exports['AgentsEventsRepository createEventsForAgent Create events for an agent "results": { "page": 1, "per_page": 20, - "total": 3, + "total": 4, "saved_objects": [ { "type": "agent_events", - "id": "de47c380-fa55-11e9-a4c5-8377241f6276", + "id": "97bd3ea0-0625-11ea-9674-75a3ee7c8618", + "attributes": { + "agent_id": "96890460-0625-11ea-9674-75a3ee7c8618", + "timestamp": "2019-09-05T15:41:26+0000", + "type": "STATE", + "subtype": "STARTING", + "message": "State changed from PAUSE to STARTING" + }, + "references": [], + "updated_at": "2019-11-13T14:55:11.754Z", + "version": "WzI1NSwxXQ==" + }, + { + "type": "agent_events", + "id": "ac97d650-0625-11ea-a248-f38bbc6424e4", "attributes": { "type": "STATE", "subtype": "STARTING", @@ -68,12 +82,12 @@ exports['AgentsEventsRepository createEventsForAgent Create events for an agent "agent_id": "agent:1" }, "references": [], - "updated_at": "2019-10-29T14:10:31.992Z", - "version": "WzMsMV0=" + "updated_at": "2019-11-13T14:55:46.741Z", + "version": "WzI4MSwxXQ==" }, { "type": "agent_events", - "id": "decd4730-fa55-11e9-a4c5-8377241f6276", + "id": "acd9e860-0625-11ea-a248-f38bbc6424e4", "attributes": { "agent_id": "agent:1", "type": "STATE", @@ -82,12 +96,12 @@ exports['AgentsEventsRepository createEventsForAgent Create events for an agent "message": "..." }, "references": [], - "updated_at": "2019-10-29T14:10:32.866Z", - "version": "WzQsMV0=" + "updated_at": "2019-11-13T14:55:47.174Z", + "version": "WzI4MiwxXQ==" }, { "type": "agent_events", - "id": "decd4731-fa55-11e9-a4c5-8377241f6276", + "id": "acd9e861-0625-11ea-a248-f38bbc6424e4", "attributes": { "agent_id": "agent:1", "type": "STATE", @@ -96,8 +110,8 @@ exports['AgentsEventsRepository createEventsForAgent Create events for an agent "message": "..." }, "references": [], - "updated_at": "2019-10-29T14:10:32.866Z", - "version": "WzUsMV0=" + "updated_at": "2019-11-13T14:55:47.174Z", + "version": "WzI4MywxXQ==" } ] } @@ -107,11 +121,25 @@ exports['AgentsEventsRepository createEventsForAgent Create events for an agent "results": { "page": 1, "per_page": 1000, - "total": 3, + "total": 4, "saved_objects": [ { "type": "agent_events", - "id": "de47c380-fa55-11e9-a4c5-8377241f6276", + "id": "97bd3ea0-0625-11ea-9674-75a3ee7c8618", + "attributes": { + "agent_id": "96890460-0625-11ea-9674-75a3ee7c8618", + "timestamp": "2019-09-05T15:41:26+0000", + "type": "STATE", + "subtype": "STARTING", + "message": "State changed from PAUSE to STARTING" + }, + "references": [], + "updated_at": "2019-11-13T14:55:11.754Z", + "version": "WzI1NSwxXQ==" + }, + { + "type": "agent_events", + "id": "ac97d650-0625-11ea-a248-f38bbc6424e4", "attributes": { "type": "STATE", "subtype": "STARTING", @@ -120,12 +148,12 @@ exports['AgentsEventsRepository createEventsForAgent Create events for an agent "agent_id": "agent:1" }, "references": [], - "updated_at": "2019-10-29T14:10:31.992Z", - "version": "WzMsMV0=" + "updated_at": "2019-11-13T14:55:46.741Z", + "version": "WzI4MSwxXQ==" }, { "type": "agent_events", - "id": "decd4730-fa55-11e9-a4c5-8377241f6276", + "id": "acd9e860-0625-11ea-a248-f38bbc6424e4", "attributes": { "agent_id": "agent:1", "type": "STATE", @@ -134,12 +162,12 @@ exports['AgentsEventsRepository createEventsForAgent Create events for an agent "message": "..." }, "references": [], - "updated_at": "2019-10-29T14:10:32.866Z", - "version": "WzQsMV0=" + "updated_at": "2019-11-13T14:55:47.174Z", + "version": "WzI4MiwxXQ==" }, { "type": "agent_events", - "id": "decd4731-fa55-11e9-a4c5-8377241f6276", + "id": "acd9e861-0625-11ea-a248-f38bbc6424e4", "attributes": { "agent_id": "agent:1", "type": "STATE", @@ -148,29 +176,33 @@ exports['AgentsEventsRepository createEventsForAgent Create events for an agent "message": "..." }, "references": [], - "updated_at": "2019-10-29T14:10:32.866Z", - "version": "WzUsMV0=" + "updated_at": "2019-11-13T14:55:47.174Z", + "version": "WzI4MywxXQ==" } ] } } -exports['AgentsEventsRepository createEventsForAgent Create events for an agent - delete:agent_events:de47c380-fa55-11e9-a4c5-8377241f6276:{} (5)'] = { +exports['AgentsEventsRepository createEventsForAgent Create events for an agent - delete (5)'] = { + "results": {} +} + +exports['AgentsEventsRepository createEventsForAgent Create events for an agent - delete (6)'] = { "results": {} } -exports['AgentsEventsRepository createEventsForAgent Create events for an agent - delete:agent_events:decd4730-fa55-11e9-a4c5-8377241f6276:{} (6)'] = { +exports['AgentsEventsRepository createEventsForAgent Create events for an agent - delete (7)'] = { "results": {} } -exports['AgentsEventsRepository createEventsForAgent Create events for an agent - delete:agent_events:decd4731-fa55-11e9-a4c5-8377241f6276:{} (7)'] = { +exports['AgentsEventsRepository createEventsForAgent Create events for an agent - delete (8)'] = { "results": {} } exports['AgentsEventsRepository deleteEventsForAgent Delete correctly all events for the agent - create:agent_events (1)'] = { "results": { "type": "agent_events", - "id": "e13805a0-fa55-11e9-a4c5-8377241f6276", + "id": "affcd340-0625-11ea-a248-f38bbc6424e4", "attributes": { "type": "STATE", "subtype": "STARTING", @@ -179,15 +211,15 @@ exports['AgentsEventsRepository deleteEventsForAgent Delete correctly all events "agent_id": "agent:1" }, "references": [], - "updated_at": "2019-10-29T14:10:36.922Z", - "version": "WzksMV0=" + "updated_at": "2019-11-13T14:55:52.436Z", + "version": "WzI4OCwxXQ==" } } exports['AgentsEventsRepository deleteEventsForAgent Delete correctly all events for the agent - create:agent_events (2)'] = { "results": { "type": "agent_events", - "id": "e1d3f780-fa55-11e9-a4c5-8377241f6276", + "id": "b097dac0-0625-11ea-a248-f38bbc6424e4", "attributes": { "type": "STATE", "subtype": "STARTING", @@ -196,15 +228,15 @@ exports['AgentsEventsRepository deleteEventsForAgent Delete correctly all events "agent_id": "agent:1" }, "references": [], - "updated_at": "2019-10-29T14:10:37.944Z", - "version": "WzEwLDFd" + "updated_at": "2019-11-13T14:55:53.452Z", + "version": "WzI4OSwxXQ==" } } exports['AgentsEventsRepository deleteEventsForAgent Delete correctly all events for the agent - create:agent_events (3)'] = { "results": { "type": "agent_events", - "id": "e26f9b40-fa55-11e9-a4c5-8377241f6276", + "id": "b13468e0-0625-11ea-a248-f38bbc6424e4", "attributes": { "type": "STATE", "subtype": "STARTING", @@ -213,15 +245,15 @@ exports['AgentsEventsRepository deleteEventsForAgent Delete correctly all events "agent_id": "agent:1" }, "references": [], - "updated_at": "2019-10-29T14:10:38.964Z", - "version": "WzExLDFd" + "updated_at": "2019-11-13T14:55:54.478Z", + "version": "WzI5MCwxXQ==" } } exports['AgentsEventsRepository deleteEventsForAgent Delete correctly all events for the agent - create:agent_events (4)'] = { "results": { "type": "agent_events", - "id": "e30aa2c0-fa55-11e9-a4c5-8377241f6276", + "id": "b1ce5ef0-0625-11ea-a248-f38bbc6424e4", "attributes": { "type": "STATE", "subtype": "STARTING", @@ -230,8 +262,8 @@ exports['AgentsEventsRepository deleteEventsForAgent Delete correctly all events "agent_id": "agent:2" }, "references": [], - "updated_at": "2019-10-29T14:10:39.980Z", - "version": "WzEyLDFd" + "updated_at": "2019-11-13T14:55:55.487Z", + "version": "WzI5MSwxXQ==" } } @@ -243,38 +275,38 @@ exports['AgentsEventsRepository deleteEventsForAgent Delete correctly all events "saved_objects": [ { "type": "agent_events", - "id": "e13805a0-fa55-11e9-a4c5-8377241f6276", + "id": "affcd340-0625-11ea-a248-f38bbc6424e4", "references": [], - "updated_at": "2019-10-29T14:10:36.922Z", - "version": "WzksMV0=" + "updated_at": "2019-11-13T14:55:52.436Z", + "version": "WzI4OCwxXQ==" }, { "type": "agent_events", - "id": "e1d3f780-fa55-11e9-a4c5-8377241f6276", + "id": "b097dac0-0625-11ea-a248-f38bbc6424e4", "references": [], - "updated_at": "2019-10-29T14:10:37.944Z", - "version": "WzEwLDFd" + "updated_at": "2019-11-13T14:55:53.452Z", + "version": "WzI4OSwxXQ==" }, { "type": "agent_events", - "id": "e26f9b40-fa55-11e9-a4c5-8377241f6276", + "id": "b13468e0-0625-11ea-a248-f38bbc6424e4", "references": [], - "updated_at": "2019-10-29T14:10:38.964Z", - "version": "WzExLDFd" + "updated_at": "2019-11-13T14:55:54.478Z", + "version": "WzI5MCwxXQ==" } ] } } -exports['AgentsEventsRepository deleteEventsForAgent Delete correctly all events for the agent - delete:agent_events:e13805a0-fa55-11e9-a4c5-8377241f6276:{} (6)'] = { +exports['AgentsEventsRepository deleteEventsForAgent Delete correctly all events for the agent - delete (6)'] = { "results": {} } -exports['AgentsEventsRepository deleteEventsForAgent Delete correctly all events for the agent - delete:agent_events:e1d3f780-fa55-11e9-a4c5-8377241f6276:{} (7)'] = { +exports['AgentsEventsRepository deleteEventsForAgent Delete correctly all events for the agent - delete (7)'] = { "results": {} } -exports['AgentsEventsRepository deleteEventsForAgent Delete correctly all events for the agent - delete:agent_events:e26f9b40-fa55-11e9-a4c5-8377241f6276:{} (8)'] = { +exports['AgentsEventsRepository deleteEventsForAgent Delete correctly all events for the agent - delete (8)'] = { "results": {} } @@ -295,7 +327,7 @@ exports['AgentsEventsRepository deleteEventsForAgent Delete correctly all events "saved_objects": [ { "type": "agent_events", - "id": "e30aa2c0-fa55-11e9-a4c5-8377241f6276", + "id": "b1ce5ef0-0625-11ea-a248-f38bbc6424e4", "attributes": { "type": "STATE", "subtype": "STARTING", @@ -304,8 +336,8 @@ exports['AgentsEventsRepository deleteEventsForAgent Delete correctly all events "agent_id": "agent:2" }, "references": [], - "updated_at": "2019-10-29T14:10:39.980Z", - "version": "WzEyLDFd" + "updated_at": "2019-11-13T14:55:55.487Z", + "version": "WzI5MSwxXQ==" } ] } @@ -319,7 +351,7 @@ exports['AgentsEventsRepository deleteEventsForAgent Delete correctly all events "saved_objects": [ { "type": "agent_events", - "id": "e30aa2c0-fa55-11e9-a4c5-8377241f6276", + "id": "b1ce5ef0-0625-11ea-a248-f38bbc6424e4", "attributes": { "type": "STATE", "subtype": "STARTING", @@ -328,21 +360,21 @@ exports['AgentsEventsRepository deleteEventsForAgent Delete correctly all events "agent_id": "agent:2" }, "references": [], - "updated_at": "2019-10-29T14:10:39.980Z", - "version": "WzEyLDFd" + "updated_at": "2019-11-13T14:55:55.487Z", + "version": "WzI5MSwxXQ==" } ] } } -exports['AgentsEventsRepository deleteEventsForAgent Delete correctly all events for the agent - delete:agent_events:e30aa2c0-fa55-11e9-a4c5-8377241f6276:{} (12)'] = { +exports['AgentsEventsRepository deleteEventsForAgent Delete correctly all events for the agent - delete (12)'] = { "results": {} } exports['AgentsEventsRepository getEventsForAgent Get events for the agent - create:agent_events (1)'] = { "results": { "type": "agent_events", - "id": "e611c840-fa55-11e9-a4c5-8377241f6276", + "id": "b4d388a0-0625-11ea-a248-f38bbc6424e4", "attributes": { "type": "STATE", "subtype": "STARTING", @@ -353,15 +385,15 @@ exports['AgentsEventsRepository getEventsForAgent Get events for the agent - cre "agent_id": "agent:1" }, "references": [], - "updated_at": "2019-10-29T14:10:45.060Z", - "version": "WzE3LDFd" + "updated_at": "2019-11-13T14:56:00.554Z", + "version": "WzI5NiwxXQ==" } } exports['AgentsEventsRepository getEventsForAgent Get events for the agent - create:agent_events (2)'] = { "results": { "type": "agent_events", - "id": "e6accfc0-fa55-11e9-a4c5-8377241f6276", + "id": "b56e6910-0625-11ea-a248-f38bbc6424e4", "attributes": { "type": "STATE", "subtype": "STOPPED", @@ -370,15 +402,15 @@ exports['AgentsEventsRepository getEventsForAgent Get events for the agent - cre "agent_id": "agent:1" }, "references": [], - "updated_at": "2019-10-29T14:10:46.076Z", - "version": "WzE4LDFd" + "updated_at": "2019-11-13T14:56:01.569Z", + "version": "WzI5NywxXQ==" } } exports['AgentsEventsRepository getEventsForAgent Get events for the agent - create:agent_events (3)'] = { "results": { "type": "agent_events", - "id": "e7476210-fa55-11e9-a4c5-8377241f6276", + "id": "b606d880-0625-11ea-a248-f38bbc6424e4", "attributes": { "type": "STATE", "subtype": "STARTING", @@ -387,15 +419,15 @@ exports['AgentsEventsRepository getEventsForAgent Get events for the agent - cre "agent_id": "agent:1" }, "references": [], - "updated_at": "2019-10-29T14:10:47.088Z", - "version": "WzE5LDFd" + "updated_at": "2019-11-13T14:56:02.568Z", + "version": "WzI5OCwxXQ==" } } exports['AgentsEventsRepository getEventsForAgent Get events for the agent - create:agent_events (4)'] = { "results": { "type": "agent_events", - "id": "e7dfd180-fa55-11e9-a4c5-8377241f6276", + "id": "b6a45100-0625-11ea-a248-f38bbc6424e4", "attributes": { "type": "STATE", "subtype": "STARTING", @@ -404,8 +436,8 @@ exports['AgentsEventsRepository getEventsForAgent Get events for the agent - cre "agent_id": "agent:2" }, "references": [], - "updated_at": "2019-10-29T14:10:48.088Z", - "version": "WzIwLDFd" + "updated_at": "2019-11-13T14:56:03.599Z", + "version": "WzI5OSwxXQ==" } } @@ -417,7 +449,7 @@ exports['AgentsEventsRepository getEventsForAgent Get events for the agent - fin "saved_objects": [ { "type": "agent_events", - "id": "e7476210-fa55-11e9-a4c5-8377241f6276", + "id": "b606d880-0625-11ea-a248-f38bbc6424e4", "attributes": { "type": "STATE", "subtype": "STARTING", @@ -426,12 +458,12 @@ exports['AgentsEventsRepository getEventsForAgent Get events for the agent - fin "agent_id": "agent:1" }, "references": [], - "updated_at": "2019-10-29T14:10:47.088Z", - "version": "WzE5LDFd" + "updated_at": "2019-11-13T14:56:02.568Z", + "version": "WzI5OCwxXQ==" }, { "type": "agent_events", - "id": "e6accfc0-fa55-11e9-a4c5-8377241f6276", + "id": "b56e6910-0625-11ea-a248-f38bbc6424e4", "attributes": { "type": "STATE", "subtype": "STOPPED", @@ -440,12 +472,12 @@ exports['AgentsEventsRepository getEventsForAgent Get events for the agent - fin "agent_id": "agent:1" }, "references": [], - "updated_at": "2019-10-29T14:10:46.076Z", - "version": "WzE4LDFd" + "updated_at": "2019-11-13T14:56:01.569Z", + "version": "WzI5NywxXQ==" }, { "type": "agent_events", - "id": "e611c840-fa55-11e9-a4c5-8377241f6276", + "id": "b4d388a0-0625-11ea-a248-f38bbc6424e4", "attributes": { "type": "STATE", "subtype": "STARTING", @@ -456,8 +488,8 @@ exports['AgentsEventsRepository getEventsForAgent Get events for the agent - fin "agent_id": "agent:1" }, "references": [], - "updated_at": "2019-10-29T14:10:45.060Z", - "version": "WzE3LDFd" + "updated_at": "2019-11-13T14:56:00.554Z", + "version": "WzI5NiwxXQ==" } ] } @@ -471,7 +503,7 @@ exports['AgentsEventsRepository getEventsForAgent Get events for the agent - fin "saved_objects": [ { "type": "agent_events", - "id": "e611c840-fa55-11e9-a4c5-8377241f6276", + "id": "b4d388a0-0625-11ea-a248-f38bbc6424e4", "attributes": { "type": "STATE", "subtype": "STARTING", @@ -482,12 +514,12 @@ exports['AgentsEventsRepository getEventsForAgent Get events for the agent - fin "agent_id": "agent:1" }, "references": [], - "updated_at": "2019-10-29T14:10:45.060Z", - "version": "WzE3LDFd" + "updated_at": "2019-11-13T14:56:00.554Z", + "version": "WzI5NiwxXQ==" }, { "type": "agent_events", - "id": "e6accfc0-fa55-11e9-a4c5-8377241f6276", + "id": "b56e6910-0625-11ea-a248-f38bbc6424e4", "attributes": { "type": "STATE", "subtype": "STOPPED", @@ -496,12 +528,12 @@ exports['AgentsEventsRepository getEventsForAgent Get events for the agent - fin "agent_id": "agent:1" }, "references": [], - "updated_at": "2019-10-29T14:10:46.076Z", - "version": "WzE4LDFd" + "updated_at": "2019-11-13T14:56:01.569Z", + "version": "WzI5NywxXQ==" }, { "type": "agent_events", - "id": "e7476210-fa55-11e9-a4c5-8377241f6276", + "id": "b606d880-0625-11ea-a248-f38bbc6424e4", "attributes": { "type": "STATE", "subtype": "STARTING", @@ -510,12 +542,12 @@ exports['AgentsEventsRepository getEventsForAgent Get events for the agent - fin "agent_id": "agent:1" }, "references": [], - "updated_at": "2019-10-29T14:10:47.088Z", - "version": "WzE5LDFd" + "updated_at": "2019-11-13T14:56:02.568Z", + "version": "WzI5OCwxXQ==" }, { "type": "agent_events", - "id": "e7dfd180-fa55-11e9-a4c5-8377241f6276", + "id": "b6a45100-0625-11ea-a248-f38bbc6424e4", "attributes": { "type": "STATE", "subtype": "STARTING", @@ -524,33 +556,33 @@ exports['AgentsEventsRepository getEventsForAgent Get events for the agent - fin "agent_id": "agent:2" }, "references": [], - "updated_at": "2019-10-29T14:10:48.088Z", - "version": "WzIwLDFd" + "updated_at": "2019-11-13T14:56:03.599Z", + "version": "WzI5OSwxXQ==" } ] } } -exports['AgentsEventsRepository getEventsForAgent Get events for the agent - delete:agent_events:e611c840-fa55-11e9-a4c5-8377241f6276:{} (7)'] = { +exports['AgentsEventsRepository getEventsForAgent Get events for the agent - delete (7)'] = { "results": {} } -exports['AgentsEventsRepository getEventsForAgent Get events for the agent - delete:agent_events:e6accfc0-fa55-11e9-a4c5-8377241f6276:{} (8)'] = { +exports['AgentsEventsRepository getEventsForAgent Get events for the agent - delete (8)'] = { "results": {} } -exports['AgentsEventsRepository getEventsForAgent Get events for the agent - delete:agent_events:e7476210-fa55-11e9-a4c5-8377241f6276:{} (9)'] = { +exports['AgentsEventsRepository getEventsForAgent Get events for the agent - delete (9)'] = { "results": {} } -exports['AgentsEventsRepository getEventsForAgent Get events for the agent - delete:agent_events:e7dfd180-fa55-11e9-a4c5-8377241f6276:{} (10)'] = { +exports['AgentsEventsRepository getEventsForAgent Get events for the agent - delete (10)'] = { "results": {} } exports['AgentsEventsRepository getEventsForAgent allow to filter using KQL - create:agent_events (1)'] = { "results": { "type": "agent_events", - "id": "eae8a4b0-fa55-11e9-a4c5-8377241f6276", + "id": "b9a9c8d0-0625-11ea-a248-f38bbc6424e4", "attributes": { "type": "STATE", "subtype": "STARTING", @@ -561,15 +593,15 @@ exports['AgentsEventsRepository getEventsForAgent allow to filter using KQL - cr "agent_id": "agent:1" }, "references": [], - "updated_at": "2019-10-29T14:10:53.179Z", - "version": "WzI1LDFd" + "updated_at": "2019-11-13T14:56:08.669Z", + "version": "WzMwNCwxXQ==" } } exports['AgentsEventsRepository getEventsForAgent allow to filter using KQL - create:agent_events (2)'] = { "results": { "type": "agent_events", - "id": "eb830ff0-fa55-11e9-a4c5-8377241f6276", + "id": "ba44f760-0625-11ea-a248-f38bbc6424e4", "attributes": { "type": "STATE", "subtype": "STOPPED", @@ -578,15 +610,15 @@ exports['AgentsEventsRepository getEventsForAgent allow to filter using KQL - cr "agent_id": "agent:1" }, "references": [], - "updated_at": "2019-10-29T14:10:54.191Z", - "version": "WzI2LDFd" + "updated_at": "2019-11-13T14:56:09.686Z", + "version": "WzMwNSwxXQ==" } } exports['AgentsEventsRepository getEventsForAgent allow to filter using KQL - create:agent_events (3)'] = { "results": { "type": "agent_events", - "id": "ec1d7b30-fa55-11e9-a4c5-8377241f6276", + "id": "badf3b90-0625-11ea-a248-f38bbc6424e4", "attributes": { "type": "STATE", "subtype": "STARTING", @@ -595,15 +627,15 @@ exports['AgentsEventsRepository getEventsForAgent allow to filter using KQL - cr "agent_id": "agent:1" }, "references": [], - "updated_at": "2019-10-29T14:10:55.203Z", - "version": "WzI3LDFd" + "updated_at": "2019-11-13T14:56:10.697Z", + "version": "WzMwNiwxXQ==" } } exports['AgentsEventsRepository getEventsForAgent allow to filter using KQL - create:agent_events (4)'] = { "results": { "type": "agent_events", - "id": "ecb80d80-fa55-11e9-a4c5-8377241f6276", + "id": "bb7958b0-0625-11ea-a248-f38bbc6424e4", "attributes": { "type": "STATE", "subtype": "STARTING", @@ -612,8 +644,8 @@ exports['AgentsEventsRepository getEventsForAgent allow to filter using KQL - cr "agent_id": "agent:2" }, "references": [], - "updated_at": "2019-10-29T14:10:56.216Z", - "version": "WzI4LDFd" + "updated_at": "2019-11-13T14:56:11.707Z", + "version": "WzMwNywxXQ==" } } @@ -625,7 +657,7 @@ exports['AgentsEventsRepository getEventsForAgent allow to filter using KQL - fi "saved_objects": [ { "type": "agent_events", - "id": "eb830ff0-fa55-11e9-a4c5-8377241f6276", + "id": "ba44f760-0625-11ea-a248-f38bbc6424e4", "attributes": { "type": "STATE", "subtype": "STOPPED", @@ -634,8 +666,8 @@ exports['AgentsEventsRepository getEventsForAgent allow to filter using KQL - fi "agent_id": "agent:1" }, "references": [], - "updated_at": "2019-10-29T14:10:54.191Z", - "version": "WzI2LDFd" + "updated_at": "2019-11-13T14:56:09.686Z", + "version": "WzMwNSwxXQ==" } ] } @@ -649,7 +681,7 @@ exports['AgentsEventsRepository getEventsForAgent allow to filter using KQL - fi "saved_objects": [ { "type": "agent_events", - "id": "eae8a4b0-fa55-11e9-a4c5-8377241f6276", + "id": "b9a9c8d0-0625-11ea-a248-f38bbc6424e4", "attributes": { "type": "STATE", "subtype": "STARTING", @@ -660,12 +692,12 @@ exports['AgentsEventsRepository getEventsForAgent allow to filter using KQL - fi "agent_id": "agent:1" }, "references": [], - "updated_at": "2019-10-29T14:10:53.179Z", - "version": "WzI1LDFd" + "updated_at": "2019-11-13T14:56:08.669Z", + "version": "WzMwNCwxXQ==" }, { "type": "agent_events", - "id": "eb830ff0-fa55-11e9-a4c5-8377241f6276", + "id": "ba44f760-0625-11ea-a248-f38bbc6424e4", "attributes": { "type": "STATE", "subtype": "STOPPED", @@ -674,12 +706,12 @@ exports['AgentsEventsRepository getEventsForAgent allow to filter using KQL - fi "agent_id": "agent:1" }, "references": [], - "updated_at": "2019-10-29T14:10:54.191Z", - "version": "WzI2LDFd" + "updated_at": "2019-11-13T14:56:09.686Z", + "version": "WzMwNSwxXQ==" }, { "type": "agent_events", - "id": "ec1d7b30-fa55-11e9-a4c5-8377241f6276", + "id": "badf3b90-0625-11ea-a248-f38bbc6424e4", "attributes": { "type": "STATE", "subtype": "STARTING", @@ -688,12 +720,12 @@ exports['AgentsEventsRepository getEventsForAgent allow to filter using KQL - fi "agent_id": "agent:1" }, "references": [], - "updated_at": "2019-10-29T14:10:55.203Z", - "version": "WzI3LDFd" + "updated_at": "2019-11-13T14:56:10.697Z", + "version": "WzMwNiwxXQ==" }, { "type": "agent_events", - "id": "ecb80d80-fa55-11e9-a4c5-8377241f6276", + "id": "bb7958b0-0625-11ea-a248-f38bbc6424e4", "attributes": { "type": "STATE", "subtype": "STARTING", @@ -702,25 +734,25 @@ exports['AgentsEventsRepository getEventsForAgent allow to filter using KQL - fi "agent_id": "agent:2" }, "references": [], - "updated_at": "2019-10-29T14:10:56.216Z", - "version": "WzI4LDFd" + "updated_at": "2019-11-13T14:56:11.707Z", + "version": "WzMwNywxXQ==" } ] } } -exports['AgentsEventsRepository getEventsForAgent allow to filter using KQL - delete:agent_events:eae8a4b0-fa55-11e9-a4c5-8377241f6276:{} (7)'] = { +exports['AgentsEventsRepository getEventsForAgent allow to filter using KQL - delete (7)'] = { "results": {} } -exports['AgentsEventsRepository getEventsForAgent allow to filter using KQL - delete:agent_events:eb830ff0-fa55-11e9-a4c5-8377241f6276:{} (8)'] = { +exports['AgentsEventsRepository getEventsForAgent allow to filter using KQL - delete (8)'] = { "results": {} } -exports['AgentsEventsRepository getEventsForAgent allow to filter using KQL - delete:agent_events:ec1d7b30-fa55-11e9-a4c5-8377241f6276:{} (9)'] = { +exports['AgentsEventsRepository getEventsForAgent allow to filter using KQL - delete (9)'] = { "results": {} } -exports['AgentsEventsRepository getEventsForAgent allow to filter using KQL - delete:agent_events:ecb80d80-fa55-11e9-a4c5-8377241f6276:{} (10)'] = { +exports['AgentsEventsRepository getEventsForAgent allow to filter using KQL - delete (10)'] = { "results": {} } diff --git a/x-pack/legacy/plugins/fleet/server/repositories/agent_events/in_memory.ts b/x-pack/legacy/plugins/fleet/server/repositories/agent_events/in_memory.ts deleted file mode 100644 index 0c4f1e4cd1e84..0000000000000 --- a/x-pack/legacy/plugins/fleet/server/repositories/agent_events/in_memory.ts +++ /dev/null @@ -1,50 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License; - * you may not use this file except in compliance with the Elastic License. - */ - -import { FrameworkUser } from '../../adapters/framework/adapter_types'; -import { AgentEventsRepository as AgentEventsRepositoryType, AgentEvent } from './types'; - -/** - * In memory agent events repository for test purposes only - */ -export class InMemoryAgentEventsRepository implements AgentEventsRepositoryType { - private events: Array<{ agentId: string; event: AgentEvent }> = []; - public async createEventsForAgent( - user: FrameworkUser, - agentId: string, - events: AgentEvent[] - ): Promise { - for (const event of events) { - this.events.push({ - agentId, - event: { ...event }, - }); - } - } - public async getEventsForAgent( - user: FrameworkUser, - agentId: string, - options: { - search?: string; - page: number; - perPage: number; - } = { - page: 1, - perPage: 25, - } - ) { - const { page, perPage } = options; - const allItems = this.events.filter(e => e.agentId === agentId); - - const items = allItems.slice((page - 1) * perPage, page * perPage).map(e => ({ ...e.event })); - - return { items, total: allItems.length }; - } - - public async deleteEventsForAgent(user: FrameworkUser, agentId: string): Promise { - this.events = this.events.filter(e => e.agentId !== agentId); - } -} diff --git a/x-pack/legacy/plugins/fleet/server/repositories/agents/__memorize_snapshots__/default.contract.test.slap_snap b/x-pack/legacy/plugins/fleet/server/repositories/agents/__memorize_snapshots__/default.contract.test.slap_snap index 041c6e540e6f2..d78c5d4f9622f 100644 --- a/x-pack/legacy/plugins/fleet/server/repositories/agents/__memorize_snapshots__/default.contract.test.slap_snap +++ b/x-pack/legacy/plugins/fleet/server/repositories/agents/__memorize_snapshots__/default.contract.test.slap_snap @@ -2,7 +2,7 @@ exports['AgentsRepository create should create a new agent - create:agents (1)'] = { "results": { "type": "agents", - "id": "f81fab60-fa55-11e9-8237-65a0c5e0a0f7", + "id": "02796c10-0625-11ea-bdb3-e10a3f6667b0", "attributes": { "shared_id": "agent1", "active": false, @@ -16,8 +16,8 @@ exports['AgentsRepository create should create a new agent - create:agents (1)'] "actions": [] }, "references": [], - "updated_at": "2019-10-29T14:11:15.350Z", - "version": "WzMzLDFd" + "updated_at": "2019-11-13T14:51:01.329Z", + "version": "WzE3LDFd" } } @@ -29,7 +29,7 @@ exports['AgentsRepository create should create a new agent - find:"agents" (2)'] "saved_objects": [ { "type": "agents", - "id": "f81fab60-fa55-11e9-8237-65a0c5e0a0f7", + "id": "02796c10-0625-11ea-bdb3-e10a3f6667b0", "attributes": { "shared_id": "agent1", "active": false, @@ -43,14 +43,14 @@ exports['AgentsRepository create should create a new agent - find:"agents" (2)'] "actions": [] }, "references": [], - "updated_at": "2019-10-29T14:11:15.350Z", - "version": "WzMzLDFd" + "updated_at": "2019-11-13T14:51:01.329Z", + "version": "WzE3LDFd" } ] } } -exports['AgentsRepository create should create a new agent - delete:agents:f81fab60-fa55-11e9-8237-65a0c5e0a0f7:{} (3)'] = { +exports['AgentsRepository create should create a new agent - delete (3)'] = { "results": {} } @@ -71,8 +71,8 @@ exports['AgentsRepository create should create a new agent with the specified id "actions": [] }, "references": [], - "updated_at": "2019-10-29T14:11:17.342Z", - "version": "WzM1LDFd" + "updated_at": "2019-11-13T14:51:02.951Z", + "version": "WzE5LDFd" } } @@ -98,14 +98,14 @@ exports['AgentsRepository create should create a new agent with the specified id "actions": [] }, "references": [], - "updated_at": "2019-10-29T14:11:17.342Z", - "version": "WzM1LDFd" + "updated_at": "2019-11-13T14:51:02.951Z", + "version": "WzE5LDFd" } ] } } -exports['AgentsRepository create should create a new agent with the specified id if specified - delete:agents:test-agent-id-1:{} (3)'] = { +exports['AgentsRepository create should create a new agent with the specified id if specified - delete (3)'] = { "results": {} } @@ -126,8 +126,8 @@ exports['AgentsRepository create should allow to create a new agent with the sam "actions": [] }, "references": [], - "updated_at": "2019-10-29T14:11:19.367Z", - "version": "WzM3LDFd" + "updated_at": "2019-11-13T14:51:04.996Z", + "version": "WzIxLDFd" } } @@ -148,8 +148,8 @@ exports['AgentsRepository create should allow to create a new agent with the sam "actions": [] }, "references": [], - "updated_at": "2019-10-29T14:11:20.381Z", - "version": "WzM4LDFd" + "updated_at": "2019-11-13T14:51:06.007Z", + "version": "WzIyLDFd" } } @@ -175,21 +175,21 @@ exports['AgentsRepository create should allow to create a new agent with the sam "actions": [] }, "references": [], - "updated_at": "2019-10-29T14:11:20.381Z", - "version": "WzM4LDFd" + "updated_at": "2019-11-13T14:51:06.007Z", + "version": "WzIyLDFd" } ] } } -exports['AgentsRepository create should allow to create a new agent with the same id two time if override is true - delete:agents:test-agent-id-2:{} (4)'] = { +exports['AgentsRepository create should allow to create a new agent with the same id two time if override is true - delete (4)'] = { "results": {} } exports['AgentsRepository create should allow to create a new agent with the same id two time if override is true - create:agents (5)'] = { "results": { "type": "agents", - "id": "fc55db00-fa55-11e9-8237-65a0c5e0a0f7", + "id": "067c56b0-0625-11ea-bdb3-e10a3f6667b0", "attributes": { "shared_id": "agent1", "active": false, @@ -202,29 +202,29 @@ exports['AgentsRepository create should allow to create a new agent with the sam "enrolled_at": "2019-08-05T19:35:14.861Z" }, "references": [], - "updated_at": "2019-10-29T14:11:22.415Z", - "version": "WzQwLDFd" + "updated_at": "2019-11-13T14:51:08.058Z", + "version": "WzI0LDFd" } } -exports['AgentsRepository update should allow to update an agent - get:agents:fc55db00-fa55-11e9-8237-65a0c5e0a0f7:{"active":true}:{} (1)'] = { +exports['AgentsRepository update should allow to update an agent - update:agents (1)'] = { "results": { - "id": "fc55db00-fa55-11e9-8237-65a0c5e0a0f7", + "id": "067c56b0-0625-11ea-bdb3-e10a3f6667b0", "type": "agents", - "updated_at": "2019-10-29T14:11:23.425Z", - "version": "WzQxLDFd", + "updated_at": "2019-11-13T14:51:09.079Z", + "version": "WzI1LDFd", "attributes": { "active": true } } } -exports['AgentsRepository update should allow to update an agent - get:agents:fc55db00-fa55-11e9-8237-65a0c5e0a0f7:{} (2)'] = { +exports['AgentsRepository update should allow to update an agent - get:agents (2)'] = { "results": { - "id": "fc55db00-fa55-11e9-8237-65a0c5e0a0f7", + "id": "067c56b0-0625-11ea-bdb3-e10a3f6667b0", "type": "agents", - "updated_at": "2019-10-29T14:11:23.425Z", - "version": "WzQxLDFd", + "updated_at": "2019-11-13T14:51:09.079Z", + "version": "WzI1LDFd", "attributes": { "shared_id": "agent1", "active": true, @@ -248,7 +248,7 @@ exports['AgentsRepository update should allow to update an agent - find:"agents" "saved_objects": [ { "type": "agents", - "id": "fc55db00-fa55-11e9-8237-65a0c5e0a0f7", + "id": "067c56b0-0625-11ea-bdb3-e10a3f6667b0", "attributes": { "shared_id": "agent1", "active": true, @@ -261,21 +261,21 @@ exports['AgentsRepository update should allow to update an agent - find:"agents" "enrolled_at": "2019-08-05T19:35:14.861Z" }, "references": [], - "updated_at": "2019-10-29T14:11:23.425Z", - "version": "WzQxLDFd" + "updated_at": "2019-11-13T14:51:09.079Z", + "version": "WzI1LDFd" } ] } } -exports['AgentsRepository update should allow to update an agent - delete:agents:fc55db00-fa55-11e9-8237-65a0c5e0a0f7:{} (4)'] = { +exports['AgentsRepository update should allow to update an agent - delete (4)'] = { "results": {} } exports['AgentsRepository update should allow to update an agent - create:agents (5)'] = { "results": { "type": "agents", - "id": "fe24cea0-fa55-11e9-8237-65a0c5e0a0f7", + "id": "084dbb50-0625-11ea-bdb3-e10a3f6667b0", "attributes": { "shared_id": "agent1", "active": false, @@ -288,16 +288,16 @@ exports['AgentsRepository update should allow to update an agent - create:agents "enrolled_at": "2019-08-05T19:35:14.861Z" }, "references": [], - "updated_at": "2019-10-29T14:11:25.450Z", - "version": "WzQzLDFd" + "updated_at": "2019-11-13T14:51:11.109Z", + "version": "WzI3LDFd" } } -exports['AgentsRepository delete should delete an agent - delete:agents:fe24cea0-fa55-11e9-8237-65a0c5e0a0f7:{} (1)'] = { +exports['AgentsRepository delete should delete an agent - delete (1)'] = { "results": {} } -exports['AgentsRepository delete should delete an agent - get:agents:fe24cea0-fa55-11e9-8237-65a0c5e0a0f7:{} (2)'] = { +exports['AgentsRepository delete should delete an agent - get:agents (2)'] = { "results": null } @@ -313,7 +313,7 @@ exports['AgentsRepository delete should delete an agent - find:"agents" (3)'] = exports['AgentsRepository list should list all active agents - create:agents (1)'] = { "results": { "type": "agents", - "id": "ff5bc800-fa55-11e9-8237-65a0c5e0a0f7", + "id": "09874cc0-0625-11ea-bdb3-e10a3f6667b0", "attributes": { "shared_id": "agent0", "active": true, @@ -326,15 +326,15 @@ exports['AgentsRepository list should list all active agents - create:agents (1) "enrolled_at": "2019-08-07T19:35:14.861Z" }, "references": [], - "updated_at": "2019-10-29T14:11:27.488Z", - "version": "WzQ1LDFd" + "updated_at": "2019-11-13T14:51:13.164Z", + "version": "WzI5LDFd" } } exports['AgentsRepository list should list all active agents - create:agents (2)'] = { "results": { "type": "agents", - "id": "fff4d3b0-fa55-11e9-8237-65a0c5e0a0f7", + "id": "0a1dc060-0625-11ea-bdb3-e10a3f6667b0", "attributes": { "shared_id": "agent1", "active": true, @@ -347,15 +347,15 @@ exports['AgentsRepository list should list all active agents - create:agents (2) "enrolled_at": "2019-08-08T19:35:14.861Z" }, "references": [], - "updated_at": "2019-10-29T14:11:28.491Z", - "version": "WzQ2LDFd" + "updated_at": "2019-11-13T14:51:14.150Z", + "version": "WzMwLDFd" } } exports['AgentsRepository list should list all active agents - create:agents (3)'] = { "results": { "type": "agents", - "id": "008f8d10-fa56-11e9-8237-65a0c5e0a0f7", + "id": "0abbae10-0625-11ea-bdb3-e10a3f6667b0", "attributes": { "shared_id": "agent2", "active": true, @@ -368,15 +368,15 @@ exports['AgentsRepository list should list all active agents - create:agents (3) "enrolled_at": "2019-08-09T19:35:14.861Z" }, "references": [], - "updated_at": "2019-10-29T14:11:29.505Z", - "version": "WzQ3LDFd" + "updated_at": "2019-11-13T14:51:15.185Z", + "version": "WzMxLDFd" } } exports['AgentsRepository list should list all active agents - create:agents (4)'] = { "results": { "type": "agents", - "id": "012898c0-fa56-11e9-8237-65a0c5e0a0f7", + "id": "0b756120-0625-11ea-bdb3-e10a3f6667b0", "attributes": { "shared_id": "agent3", "active": true, @@ -389,15 +389,15 @@ exports['AgentsRepository list should list all active agents - create:agents (4) "enrolled_at": "2019-08-10T19:35:14.861Z" }, "references": [], - "updated_at": "2019-10-29T14:11:30.508Z", - "version": "WzQ4LDFd" + "updated_at": "2019-11-13T14:51:16.402Z", + "version": "WzMyLDFd" } } exports['AgentsRepository list should list all active agents - create:agents (5)'] = { "results": { "type": "agents", - "id": "01c770d0-fa56-11e9-8237-65a0c5e0a0f7", + "id": "0c11ef40-0625-11ea-bdb3-e10a3f6667b0", "attributes": { "shared_id": "agent4", "active": true, @@ -410,15 +410,15 @@ exports['AgentsRepository list should list all active agents - create:agents (5) "enrolled_at": "2019-08-11T19:35:14.861Z" }, "references": [], - "updated_at": "2019-10-29T14:11:31.549Z", - "version": "WzQ5LDFd" + "updated_at": "2019-11-13T14:51:17.427Z", + "version": "WzMzLDFd" } } exports['AgentsRepository list should list all active agents - create:agents (6)'] = { "results": { "type": "agents", - "id": "02622a30-fa56-11e9-8237-65a0c5e0a0f7", + "id": "0cabbe40-0625-11ea-bdb3-e10a3f6667b0", "attributes": { "shared_id": "agent5", "active": true, @@ -431,15 +431,15 @@ exports['AgentsRepository list should list all active agents - create:agents (6) "enrolled_at": "2019-08-12T19:35:14.861Z" }, "references": [], - "updated_at": "2019-10-29T14:11:32.563Z", - "version": "WzUwLDFd" + "updated_at": "2019-11-13T14:51:18.436Z", + "version": "WzM0LDFd" } } exports['AgentsRepository list should list all active agents - create:agents (7)'] = { "results": { "type": "agents", - "id": "02fd31b0-fa56-11e9-8237-65a0c5e0a0f7", + "id": "0d469eb0-0625-11ea-bdb3-e10a3f6667b0", "attributes": { "shared_id": "agent6", "active": true, @@ -452,15 +452,15 @@ exports['AgentsRepository list should list all active agents - create:agents (7) "enrolled_at": "2019-08-13T19:35:14.861Z" }, "references": [], - "updated_at": "2019-10-29T14:11:33.579Z", - "version": "WzUxLDFd" + "updated_at": "2019-11-13T14:51:19.451Z", + "version": "WzM1LDFd" } } exports['AgentsRepository list should list all active agents - create:agents (8)'] = { "results": { "type": "agents", - "id": "03979cf0-fa56-11e9-8237-65a0c5e0a0f7", + "id": "0de13100-0625-11ea-bdb3-e10a3f6667b0", "attributes": { "shared_id": "agent7", "active": true, @@ -473,15 +473,15 @@ exports['AgentsRepository list should list all active agents - create:agents (8) "enrolled_at": "2019-08-14T19:35:14.861Z" }, "references": [], - "updated_at": "2019-10-29T14:11:34.591Z", - "version": "WzUyLDFd" + "updated_at": "2019-11-13T14:51:20.464Z", + "version": "WzM2LDFd" } } exports['AgentsRepository list should list all active agents - create:agents (9)'] = { "results": { "type": "agents", - "id": "04325650-fa56-11e9-8237-65a0c5e0a0f7", + "id": "0e7cadb0-0625-11ea-bdb3-e10a3f6667b0", "attributes": { "shared_id": "agent8", "active": true, @@ -494,15 +494,15 @@ exports['AgentsRepository list should list all active agents - create:agents (9) "enrolled_at": "2019-08-15T19:35:14.861Z" }, "references": [], - "updated_at": "2019-10-29T14:11:35.605Z", - "version": "WzUzLDFd" + "updated_at": "2019-11-13T14:51:21.483Z", + "version": "WzM3LDFd" } } exports['AgentsRepository list should list all active agents - create:agents (10)'] = { "results": { "type": "agents", - "id": "04cc7370-fa56-11e9-8237-65a0c5e0a0f7", + "id": "0f180350-0625-11ea-bdb3-e10a3f6667b0", "attributes": { "shared_id": "agent9", "active": true, @@ -515,15 +515,15 @@ exports['AgentsRepository list should list all active agents - create:agents (10 "enrolled_at": "2019-08-16T19:35:14.861Z" }, "references": [], - "updated_at": "2019-10-29T14:11:36.615Z", - "version": "WzU0LDFd" + "updated_at": "2019-11-13T14:51:22.500Z", + "version": "WzM4LDFd" } } exports['AgentsRepository list should list all active agents - create:agents (11)'] = { "results": { "type": "agents", - "id": "056705c0-fa56-11e9-8237-65a0c5e0a0f7", + "id": "0fb30ad0-0625-11ea-bdb3-e10a3f6667b0", "attributes": { "shared_id": "agent10", "active": true, @@ -536,15 +536,15 @@ exports['AgentsRepository list should list all active agents - create:agents (11 "enrolled_at": "2019-08-17T19:35:14.861Z" }, "references": [], - "updated_at": "2019-10-29T14:11:37.628Z", - "version": "WzU1LDFd" + "updated_at": "2019-11-13T14:51:23.517Z", + "version": "WzM5LDFd" } } exports['AgentsRepository list should list all active agents - create:agents (12)'] = { "results": { "type": "agents", - "id": "06019810-fa56-11e9-8237-65a0c5e0a0f7", + "id": "104d4f00-0625-11ea-bdb3-e10a3f6667b0", "attributes": { "shared_id": "agent11", "active": true, @@ -557,15 +557,15 @@ exports['AgentsRepository list should list all active agents - create:agents (12 "enrolled_at": "2019-08-18T19:35:14.861Z" }, "references": [], - "updated_at": "2019-10-29T14:11:38.641Z", - "version": "WzU2LDFd" + "updated_at": "2019-11-13T14:51:24.528Z", + "version": "WzQwLDFd" } } exports['AgentsRepository list should list all active agents - create:agents (13)'] = { "results": { "type": "agents", - "id": "069c0350-fa56-11e9-8237-65a0c5e0a0f7", + "id": "10eb3cb0-0625-11ea-bdb3-e10a3f6667b0", "attributes": { "shared_id": "agent12", "active": true, @@ -578,15 +578,15 @@ exports['AgentsRepository list should list all active agents - create:agents (13 "enrolled_at": "2019-08-19T19:35:14.861Z" }, "references": [], - "updated_at": "2019-10-29T14:11:39.652Z", - "version": "WzU3LDFd" + "updated_at": "2019-11-13T14:51:25.563Z", + "version": "WzQxLDFd" } } exports['AgentsRepository list should list all active agents - create:agents (14)'] = { "results": { "type": "agents", - "id": "073731e0-fa56-11e9-8237-65a0c5e0a0f7", + "id": "11888e20-0625-11ea-bdb3-e10a3f6667b0", "attributes": { "shared_id": "agent13", "active": true, @@ -599,15 +599,15 @@ exports['AgentsRepository list should list all active agents - create:agents (14 "enrolled_at": "2019-08-20T19:35:14.861Z" }, "references": [], - "updated_at": "2019-10-29T14:11:40.670Z", - "version": "WzU4LDFd" + "updated_at": "2019-11-13T14:51:26.594Z", + "version": "WzQyLDFd" } } exports['AgentsRepository list should list all active agents - create:agents (15)'] = { "results": { "type": "agents", - "id": "07d19d20-fa56-11e9-8237-65a0c5e0a0f7", + "id": "12240ad0-0625-11ea-bdb3-e10a3f6667b0", "attributes": { "shared_id": "agent14", "active": true, @@ -620,15 +620,15 @@ exports['AgentsRepository list should list all active agents - create:agents (15 "enrolled_at": "2019-08-21T19:35:14.861Z" }, "references": [], - "updated_at": "2019-10-29T14:11:41.682Z", - "version": "WzU5LDFd" + "updated_at": "2019-11-13T14:51:27.613Z", + "version": "WzQzLDFd" } } exports['AgentsRepository list should list all active agents - create:agents (16)'] = { "results": { "type": "agents", - "id": "086c5680-fa56-11e9-8237-65a0c5e0a0f7", + "id": "12be9d20-0625-11ea-bdb3-e10a3f6667b0", "attributes": { "shared_id": "agent15", "active": true, @@ -641,15 +641,15 @@ exports['AgentsRepository list should list all active agents - create:agents (16 "enrolled_at": "2019-08-22T19:35:14.861Z" }, "references": [], - "updated_at": "2019-10-29T14:11:42.696Z", - "version": "WzYwLDFd" + "updated_at": "2019-11-13T14:51:28.626Z", + "version": "WzQ0LDFd" } } exports['AgentsRepository list should list all active agents - create:agents (17)'] = { "results": { "type": "agents", - "id": "09075e00-fa56-11e9-8237-65a0c5e0a0f7", + "id": "13595680-0625-11ea-bdb3-e10a3f6667b0", "attributes": { "shared_id": "agent16", "active": true, @@ -662,15 +662,15 @@ exports['AgentsRepository list should list all active agents - create:agents (17 "enrolled_at": "2019-08-23T19:35:14.861Z" }, "references": [], - "updated_at": "2019-10-29T14:11:43.712Z", - "version": "WzYxLDFd" + "updated_at": "2019-11-13T14:51:29.639Z", + "version": "WzQ1LDFd" } } exports['AgentsRepository list should list all active agents - create:agents (18)'] = { "results": { "type": "agents", - "id": "09a23e70-fa56-11e9-8237-65a0c5e0a0f7", + "id": "13f436f0-0625-11ea-bdb3-e10a3f6667b0", "attributes": { "shared_id": "agent17", "active": true, @@ -683,15 +683,15 @@ exports['AgentsRepository list should list all active agents - create:agents (18 "enrolled_at": "2019-08-24T19:35:14.861Z" }, "references": [], - "updated_at": "2019-10-29T14:11:44.727Z", - "version": "WzYyLDFd" + "updated_at": "2019-11-13T14:51:30.655Z", + "version": "WzQ2LDFd" } } exports['AgentsRepository list should list all active agents - create:agents (19)'] = { "results": { "type": "agents", - "id": "0a3d45f0-fa56-11e9-8237-65a0c5e0a0f7", + "id": "148e2d00-0625-11ea-bdb3-e10a3f6667b0", "attributes": { "shared_id": "agent18", "active": true, @@ -704,15 +704,15 @@ exports['AgentsRepository list should list all active agents - create:agents (19 "enrolled_at": "2019-08-25T19:35:14.861Z" }, "references": [], - "updated_at": "2019-10-29T14:11:45.743Z", - "version": "WzYzLDFd" + "updated_at": "2019-11-13T14:51:31.664Z", + "version": "WzQ3LDFd" } } exports['AgentsRepository list should list all active agents - create:agents (20)'] = { "results": { "type": "agents", - "id": "0ad78a20-fa56-11e9-8237-65a0c5e0a0f7", + "id": "152b5760-0625-11ea-bdb3-e10a3f6667b0", "attributes": { "shared_id": "agent19", "active": true, @@ -725,15 +725,15 @@ exports['AgentsRepository list should list all active agents - create:agents (20 "enrolled_at": "2019-08-26T19:35:14.861Z" }, "references": [], - "updated_at": "2019-10-29T14:11:46.754Z", - "version": "WzY0LDFd" + "updated_at": "2019-11-13T14:51:32.694Z", + "version": "WzQ4LDFd" } } exports['AgentsRepository list should list all active agents - create:agents (21)'] = { "results": { "type": "agents", - "id": "0b718030-fa56-11e9-8237-65a0c5e0a0f7", + "id": "15c4b130-0625-11ea-bdb3-e10a3f6667b0", "attributes": { "shared_id": "inactive_agent_1", "active": false, @@ -746,15 +746,15 @@ exports['AgentsRepository list should list all active agents - create:agents (21 "enrolled_at": "2019-11-13T20:35:14.861Z" }, "references": [], - "updated_at": "2019-10-29T14:11:47.763Z", - "version": "WzY1LDFd" + "updated_at": "2019-11-13T14:51:33.699Z", + "version": "WzQ5LDFd" } } exports['AgentsRepository list should list all active agents - create:agents (22)'] = { "results": { "type": "agents", - "id": "0c0beb70-fa56-11e9-8237-65a0c5e0a0f7", + "id": "166202a0-0625-11ea-bdb3-e10a3f6667b0", "attributes": { "shared_id": "inactive_agent_2", "active": true, @@ -764,19 +764,19 @@ exports['AgentsRepository list should list all active agents - create:agents (22 "version": "1", "local_metadata": "{\"host\":\"test.fr\"}", "user_provided_metadata": "{\"color\":\"red\"}", - "last_checkin": "2019-10-27T14:11:27.486Z", + "last_checkin": "2019-11-11T14:51:13.162Z", "enrolled_at": "2019-08-05T19:35:14.861Z" }, "references": [], - "updated_at": "2019-10-29T14:11:48.775Z", - "version": "WzY2LDFd" + "updated_at": "2019-11-13T14:51:34.730Z", + "version": "WzUwLDFd" } } exports['AgentsRepository list should list all active agents - create:agents (23)'] = { "results": { "type": "agents", - "id": "0ca87990-fa56-11e9-8237-65a0c5e0a0f7", + "id": "16fc46d0-0625-11ea-bdb3-e10a3f6667b0", "attributes": { "shared_id": "ephemeral1", "active": true, @@ -786,12 +786,12 @@ exports['AgentsRepository list should list all active agents - create:agents (23 "version": "1", "local_metadata": "{\"host\":\"test.fr\"}", "user_provided_metadata": "{\"color\":\"red\"}", - "last_checkin": "2019-10-29T14:11:27.486Z", + "last_checkin": "2019-11-13T14:51:13.161Z", "enrolled_at": "2019-08-05T19:35:14.861Z" }, "references": [], - "updated_at": "2019-10-29T14:11:49.801Z", - "version": "WzY3LDFd" + "updated_at": "2019-11-13T14:51:35.741Z", + "version": "WzUxLDFd" } } @@ -803,7 +803,7 @@ exports['AgentsRepository list should list all active agents - find:"agents" (24 "saved_objects": [ { "type": "agents", - "id": "0ad78a20-fa56-11e9-8237-65a0c5e0a0f7", + "id": "152b5760-0625-11ea-bdb3-e10a3f6667b0", "attributes": { "shared_id": "agent19", "active": true, @@ -816,12 +816,12 @@ exports['AgentsRepository list should list all active agents - find:"agents" (24 "enrolled_at": "2019-08-26T19:35:14.861Z" }, "references": [], - "updated_at": "2019-10-29T14:11:46.754Z", - "version": "WzY0LDFd" + "updated_at": "2019-11-13T14:51:32.694Z", + "version": "WzQ4LDFd" }, { "type": "agents", - "id": "0a3d45f0-fa56-11e9-8237-65a0c5e0a0f7", + "id": "148e2d00-0625-11ea-bdb3-e10a3f6667b0", "attributes": { "shared_id": "agent18", "active": true, @@ -834,12 +834,12 @@ exports['AgentsRepository list should list all active agents - find:"agents" (24 "enrolled_at": "2019-08-25T19:35:14.861Z" }, "references": [], - "updated_at": "2019-10-29T14:11:45.743Z", - "version": "WzYzLDFd" + "updated_at": "2019-11-13T14:51:31.664Z", + "version": "WzQ3LDFd" }, { "type": "agents", - "id": "09a23e70-fa56-11e9-8237-65a0c5e0a0f7", + "id": "13f436f0-0625-11ea-bdb3-e10a3f6667b0", "attributes": { "shared_id": "agent17", "active": true, @@ -852,12 +852,12 @@ exports['AgentsRepository list should list all active agents - find:"agents" (24 "enrolled_at": "2019-08-24T19:35:14.861Z" }, "references": [], - "updated_at": "2019-10-29T14:11:44.727Z", - "version": "WzYyLDFd" + "updated_at": "2019-11-13T14:51:30.655Z", + "version": "WzQ2LDFd" }, { "type": "agents", - "id": "09075e00-fa56-11e9-8237-65a0c5e0a0f7", + "id": "13595680-0625-11ea-bdb3-e10a3f6667b0", "attributes": { "shared_id": "agent16", "active": true, @@ -870,12 +870,12 @@ exports['AgentsRepository list should list all active agents - find:"agents" (24 "enrolled_at": "2019-08-23T19:35:14.861Z" }, "references": [], - "updated_at": "2019-10-29T14:11:43.712Z", - "version": "WzYxLDFd" + "updated_at": "2019-11-13T14:51:29.639Z", + "version": "WzQ1LDFd" }, { "type": "agents", - "id": "086c5680-fa56-11e9-8237-65a0c5e0a0f7", + "id": "12be9d20-0625-11ea-bdb3-e10a3f6667b0", "attributes": { "shared_id": "agent15", "active": true, @@ -888,12 +888,12 @@ exports['AgentsRepository list should list all active agents - find:"agents" (24 "enrolled_at": "2019-08-22T19:35:14.861Z" }, "references": [], - "updated_at": "2019-10-29T14:11:42.696Z", - "version": "WzYwLDFd" + "updated_at": "2019-11-13T14:51:28.626Z", + "version": "WzQ0LDFd" }, { "type": "agents", - "id": "07d19d20-fa56-11e9-8237-65a0c5e0a0f7", + "id": "12240ad0-0625-11ea-bdb3-e10a3f6667b0", "attributes": { "shared_id": "agent14", "active": true, @@ -906,12 +906,12 @@ exports['AgentsRepository list should list all active agents - find:"agents" (24 "enrolled_at": "2019-08-21T19:35:14.861Z" }, "references": [], - "updated_at": "2019-10-29T14:11:41.682Z", - "version": "WzU5LDFd" + "updated_at": "2019-11-13T14:51:27.613Z", + "version": "WzQzLDFd" }, { "type": "agents", - "id": "073731e0-fa56-11e9-8237-65a0c5e0a0f7", + "id": "11888e20-0625-11ea-bdb3-e10a3f6667b0", "attributes": { "shared_id": "agent13", "active": true, @@ -924,12 +924,12 @@ exports['AgentsRepository list should list all active agents - find:"agents" (24 "enrolled_at": "2019-08-20T19:35:14.861Z" }, "references": [], - "updated_at": "2019-10-29T14:11:40.670Z", - "version": "WzU4LDFd" + "updated_at": "2019-11-13T14:51:26.594Z", + "version": "WzQyLDFd" }, { "type": "agents", - "id": "069c0350-fa56-11e9-8237-65a0c5e0a0f7", + "id": "10eb3cb0-0625-11ea-bdb3-e10a3f6667b0", "attributes": { "shared_id": "agent12", "active": true, @@ -942,12 +942,12 @@ exports['AgentsRepository list should list all active agents - find:"agents" (24 "enrolled_at": "2019-08-19T19:35:14.861Z" }, "references": [], - "updated_at": "2019-10-29T14:11:39.652Z", - "version": "WzU3LDFd" + "updated_at": "2019-11-13T14:51:25.563Z", + "version": "WzQxLDFd" }, { "type": "agents", - "id": "06019810-fa56-11e9-8237-65a0c5e0a0f7", + "id": "104d4f00-0625-11ea-bdb3-e10a3f6667b0", "attributes": { "shared_id": "agent11", "active": true, @@ -960,12 +960,12 @@ exports['AgentsRepository list should list all active agents - find:"agents" (24 "enrolled_at": "2019-08-18T19:35:14.861Z" }, "references": [], - "updated_at": "2019-10-29T14:11:38.641Z", - "version": "WzU2LDFd" + "updated_at": "2019-11-13T14:51:24.528Z", + "version": "WzQwLDFd" }, { "type": "agents", - "id": "056705c0-fa56-11e9-8237-65a0c5e0a0f7", + "id": "0fb30ad0-0625-11ea-bdb3-e10a3f6667b0", "attributes": { "shared_id": "agent10", "active": true, @@ -978,12 +978,12 @@ exports['AgentsRepository list should list all active agents - find:"agents" (24 "enrolled_at": "2019-08-17T19:35:14.861Z" }, "references": [], - "updated_at": "2019-10-29T14:11:37.628Z", - "version": "WzU1LDFd" + "updated_at": "2019-11-13T14:51:23.517Z", + "version": "WzM5LDFd" }, { "type": "agents", - "id": "04cc7370-fa56-11e9-8237-65a0c5e0a0f7", + "id": "0f180350-0625-11ea-bdb3-e10a3f6667b0", "attributes": { "shared_id": "agent9", "active": true, @@ -996,12 +996,12 @@ exports['AgentsRepository list should list all active agents - find:"agents" (24 "enrolled_at": "2019-08-16T19:35:14.861Z" }, "references": [], - "updated_at": "2019-10-29T14:11:36.615Z", - "version": "WzU0LDFd" + "updated_at": "2019-11-13T14:51:22.500Z", + "version": "WzM4LDFd" }, { "type": "agents", - "id": "04325650-fa56-11e9-8237-65a0c5e0a0f7", + "id": "0e7cadb0-0625-11ea-bdb3-e10a3f6667b0", "attributes": { "shared_id": "agent8", "active": true, @@ -1014,12 +1014,12 @@ exports['AgentsRepository list should list all active agents - find:"agents" (24 "enrolled_at": "2019-08-15T19:35:14.861Z" }, "references": [], - "updated_at": "2019-10-29T14:11:35.605Z", - "version": "WzUzLDFd" + "updated_at": "2019-11-13T14:51:21.483Z", + "version": "WzM3LDFd" }, { "type": "agents", - "id": "03979cf0-fa56-11e9-8237-65a0c5e0a0f7", + "id": "0de13100-0625-11ea-bdb3-e10a3f6667b0", "attributes": { "shared_id": "agent7", "active": true, @@ -1032,12 +1032,12 @@ exports['AgentsRepository list should list all active agents - find:"agents" (24 "enrolled_at": "2019-08-14T19:35:14.861Z" }, "references": [], - "updated_at": "2019-10-29T14:11:34.591Z", - "version": "WzUyLDFd" + "updated_at": "2019-11-13T14:51:20.464Z", + "version": "WzM2LDFd" }, { "type": "agents", - "id": "02fd31b0-fa56-11e9-8237-65a0c5e0a0f7", + "id": "0d469eb0-0625-11ea-bdb3-e10a3f6667b0", "attributes": { "shared_id": "agent6", "active": true, @@ -1050,12 +1050,12 @@ exports['AgentsRepository list should list all active agents - find:"agents" (24 "enrolled_at": "2019-08-13T19:35:14.861Z" }, "references": [], - "updated_at": "2019-10-29T14:11:33.579Z", - "version": "WzUxLDFd" + "updated_at": "2019-11-13T14:51:19.451Z", + "version": "WzM1LDFd" }, { "type": "agents", - "id": "02622a30-fa56-11e9-8237-65a0c5e0a0f7", + "id": "0cabbe40-0625-11ea-bdb3-e10a3f6667b0", "attributes": { "shared_id": "agent5", "active": true, @@ -1068,12 +1068,12 @@ exports['AgentsRepository list should list all active agents - find:"agents" (24 "enrolled_at": "2019-08-12T19:35:14.861Z" }, "references": [], - "updated_at": "2019-10-29T14:11:32.563Z", - "version": "WzUwLDFd" + "updated_at": "2019-11-13T14:51:18.436Z", + "version": "WzM0LDFd" }, { "type": "agents", - "id": "01c770d0-fa56-11e9-8237-65a0c5e0a0f7", + "id": "0c11ef40-0625-11ea-bdb3-e10a3f6667b0", "attributes": { "shared_id": "agent4", "active": true, @@ -1086,12 +1086,12 @@ exports['AgentsRepository list should list all active agents - find:"agents" (24 "enrolled_at": "2019-08-11T19:35:14.861Z" }, "references": [], - "updated_at": "2019-10-29T14:11:31.549Z", - "version": "WzQ5LDFd" + "updated_at": "2019-11-13T14:51:17.427Z", + "version": "WzMzLDFd" }, { "type": "agents", - "id": "012898c0-fa56-11e9-8237-65a0c5e0a0f7", + "id": "0b756120-0625-11ea-bdb3-e10a3f6667b0", "attributes": { "shared_id": "agent3", "active": true, @@ -1104,12 +1104,12 @@ exports['AgentsRepository list should list all active agents - find:"agents" (24 "enrolled_at": "2019-08-10T19:35:14.861Z" }, "references": [], - "updated_at": "2019-10-29T14:11:30.508Z", - "version": "WzQ4LDFd" + "updated_at": "2019-11-13T14:51:16.402Z", + "version": "WzMyLDFd" }, { "type": "agents", - "id": "008f8d10-fa56-11e9-8237-65a0c5e0a0f7", + "id": "0abbae10-0625-11ea-bdb3-e10a3f6667b0", "attributes": { "shared_id": "agent2", "active": true, @@ -1122,12 +1122,12 @@ exports['AgentsRepository list should list all active agents - find:"agents" (24 "enrolled_at": "2019-08-09T19:35:14.861Z" }, "references": [], - "updated_at": "2019-10-29T14:11:29.505Z", - "version": "WzQ3LDFd" + "updated_at": "2019-11-13T14:51:15.185Z", + "version": "WzMxLDFd" }, { "type": "agents", - "id": "fff4d3b0-fa55-11e9-8237-65a0c5e0a0f7", + "id": "0a1dc060-0625-11ea-bdb3-e10a3f6667b0", "attributes": { "shared_id": "agent1", "active": true, @@ -1140,12 +1140,12 @@ exports['AgentsRepository list should list all active agents - find:"agents" (24 "enrolled_at": "2019-08-08T19:35:14.861Z" }, "references": [], - "updated_at": "2019-10-29T14:11:28.491Z", - "version": "WzQ2LDFd" + "updated_at": "2019-11-13T14:51:14.150Z", + "version": "WzMwLDFd" }, { "type": "agents", - "id": "ff5bc800-fa55-11e9-8237-65a0c5e0a0f7", + "id": "09874cc0-0625-11ea-bdb3-e10a3f6667b0", "attributes": { "shared_id": "agent0", "active": true, @@ -1158,12 +1158,12 @@ exports['AgentsRepository list should list all active agents - find:"agents" (24 "enrolled_at": "2019-08-07T19:35:14.861Z" }, "references": [], - "updated_at": "2019-10-29T14:11:27.488Z", - "version": "WzQ1LDFd" + "updated_at": "2019-11-13T14:51:13.164Z", + "version": "WzI5LDFd" }, { "type": "agents", - "id": "0ca87990-fa56-11e9-8237-65a0c5e0a0f7", + "id": "16fc46d0-0625-11ea-bdb3-e10a3f6667b0", "attributes": { "shared_id": "ephemeral1", "active": true, @@ -1173,12 +1173,12 @@ exports['AgentsRepository list should list all active agents - find:"agents" (24 "version": "1", "local_metadata": "{\"host\":\"test.fr\"}", "user_provided_metadata": "{\"color\":\"red\"}", - "last_checkin": "2019-10-29T14:11:27.486Z", + "last_checkin": "2019-11-13T14:51:13.161Z", "enrolled_at": "2019-08-05T19:35:14.861Z" }, "references": [], - "updated_at": "2019-10-29T14:11:49.801Z", - "version": "WzY3LDFd" + "updated_at": "2019-11-13T14:51:35.741Z", + "version": "WzUxLDFd" } ] } @@ -1192,7 +1192,7 @@ exports['AgentsRepository list should list all active agents - find:"agents" (25 "saved_objects": [ { "type": "agents", - "id": "ff5bc800-fa55-11e9-8237-65a0c5e0a0f7", + "id": "09874cc0-0625-11ea-bdb3-e10a3f6667b0", "attributes": { "shared_id": "agent0", "active": true, @@ -1205,14 +1205,14 @@ exports['AgentsRepository list should list all active agents - find:"agents" (25 "enrolled_at": "2019-08-07T19:35:14.861Z" }, "references": [], - "updated_at": "2019-10-29T14:11:27.488Z", - "version": "WzQ1LDFd" + "updated_at": "2019-11-13T14:51:13.164Z", + "version": "WzI5LDFd" }, { "type": "agents", - "id": "008f8d10-fa56-11e9-8237-65a0c5e0a0f7", + "id": "0a1dc060-0625-11ea-bdb3-e10a3f6667b0", "attributes": { - "shared_id": "agent2", + "shared_id": "agent1", "active": true, "access_api_key_id": "api_key_1", "policy_id": "policy_id_1", @@ -1220,17 +1220,17 @@ exports['AgentsRepository list should list all active agents - find:"agents" (25 "version": "1", "local_metadata": "{\"host\":\"test.fr\"}", "user_provided_metadata": "{\"color\":\"red\"}", - "enrolled_at": "2019-08-09T19:35:14.861Z" + "enrolled_at": "2019-08-08T19:35:14.861Z" }, "references": [], - "updated_at": "2019-10-29T14:11:29.505Z", - "version": "WzQ3LDFd" + "updated_at": "2019-11-13T14:51:14.150Z", + "version": "WzMwLDFd" }, { "type": "agents", - "id": "fff4d3b0-fa55-11e9-8237-65a0c5e0a0f7", + "id": "0fb30ad0-0625-11ea-bdb3-e10a3f6667b0", "attributes": { - "shared_id": "agent1", + "shared_id": "agent10", "active": true, "access_api_key_id": "api_key_1", "policy_id": "policy_id_1", @@ -1238,17 +1238,17 @@ exports['AgentsRepository list should list all active agents - find:"agents" (25 "version": "1", "local_metadata": "{\"host\":\"test.fr\"}", "user_provided_metadata": "{\"color\":\"red\"}", - "enrolled_at": "2019-08-08T19:35:14.861Z" + "enrolled_at": "2019-08-17T19:35:14.861Z" }, "references": [], - "updated_at": "2019-10-29T14:11:28.491Z", - "version": "WzQ2LDFd" + "updated_at": "2019-11-13T14:51:23.517Z", + "version": "WzM5LDFd" }, { "type": "agents", - "id": "056705c0-fa56-11e9-8237-65a0c5e0a0f7", + "id": "0de13100-0625-11ea-bdb3-e10a3f6667b0", "attributes": { - "shared_id": "agent10", + "shared_id": "agent7", "active": true, "access_api_key_id": "api_key_1", "policy_id": "policy_id_1", @@ -1256,17 +1256,17 @@ exports['AgentsRepository list should list all active agents - find:"agents" (25 "version": "1", "local_metadata": "{\"host\":\"test.fr\"}", "user_provided_metadata": "{\"color\":\"red\"}", - "enrolled_at": "2019-08-17T19:35:14.861Z" + "enrolled_at": "2019-08-14T19:35:14.861Z" }, "references": [], - "updated_at": "2019-10-29T14:11:37.628Z", - "version": "WzU1LDFd" + "updated_at": "2019-11-13T14:51:20.464Z", + "version": "WzM2LDFd" }, { "type": "agents", - "id": "06019810-fa56-11e9-8237-65a0c5e0a0f7", + "id": "0e7cadb0-0625-11ea-bdb3-e10a3f6667b0", "attributes": { - "shared_id": "agent11", + "shared_id": "agent8", "active": true, "access_api_key_id": "api_key_1", "policy_id": "policy_id_1", @@ -1274,17 +1274,17 @@ exports['AgentsRepository list should list all active agents - find:"agents" (25 "version": "1", "local_metadata": "{\"host\":\"test.fr\"}", "user_provided_metadata": "{\"color\":\"red\"}", - "enrolled_at": "2019-08-18T19:35:14.861Z" + "enrolled_at": "2019-08-15T19:35:14.861Z" }, "references": [], - "updated_at": "2019-10-29T14:11:38.641Z", - "version": "WzU2LDFd" + "updated_at": "2019-11-13T14:51:21.483Z", + "version": "WzM3LDFd" }, { "type": "agents", - "id": "012898c0-fa56-11e9-8237-65a0c5e0a0f7", + "id": "0f180350-0625-11ea-bdb3-e10a3f6667b0", "attributes": { - "shared_id": "agent3", + "shared_id": "agent9", "active": true, "access_api_key_id": "api_key_1", "policy_id": "policy_id_1", @@ -1292,17 +1292,17 @@ exports['AgentsRepository list should list all active agents - find:"agents" (25 "version": "1", "local_metadata": "{\"host\":\"test.fr\"}", "user_provided_metadata": "{\"color\":\"red\"}", - "enrolled_at": "2019-08-10T19:35:14.861Z" + "enrolled_at": "2019-08-16T19:35:14.861Z" }, "references": [], - "updated_at": "2019-10-29T14:11:30.508Z", - "version": "WzQ4LDFd" + "updated_at": "2019-11-13T14:51:22.500Z", + "version": "WzM4LDFd" }, { "type": "agents", - "id": "01c770d0-fa56-11e9-8237-65a0c5e0a0f7", + "id": "0d469eb0-0625-11ea-bdb3-e10a3f6667b0", "attributes": { - "shared_id": "agent4", + "shared_id": "agent6", "active": true, "access_api_key_id": "api_key_1", "policy_id": "policy_id_1", @@ -1310,17 +1310,17 @@ exports['AgentsRepository list should list all active agents - find:"agents" (25 "version": "1", "local_metadata": "{\"host\":\"test.fr\"}", "user_provided_metadata": "{\"color\":\"red\"}", - "enrolled_at": "2019-08-11T19:35:14.861Z" + "enrolled_at": "2019-08-13T19:35:14.861Z" }, "references": [], - "updated_at": "2019-10-29T14:11:31.549Z", - "version": "WzQ5LDFd" + "updated_at": "2019-11-13T14:51:19.451Z", + "version": "WzM1LDFd" }, { "type": "agents", - "id": "02622a30-fa56-11e9-8237-65a0c5e0a0f7", + "id": "0abbae10-0625-11ea-bdb3-e10a3f6667b0", "attributes": { - "shared_id": "agent5", + "shared_id": "agent2", "active": true, "access_api_key_id": "api_key_1", "policy_id": "policy_id_1", @@ -1328,17 +1328,17 @@ exports['AgentsRepository list should list all active agents - find:"agents" (25 "version": "1", "local_metadata": "{\"host\":\"test.fr\"}", "user_provided_metadata": "{\"color\":\"red\"}", - "enrolled_at": "2019-08-12T19:35:14.861Z" + "enrolled_at": "2019-08-09T19:35:14.861Z" }, "references": [], - "updated_at": "2019-10-29T14:11:32.563Z", - "version": "WzUwLDFd" + "updated_at": "2019-11-13T14:51:15.185Z", + "version": "WzMxLDFd" }, { "type": "agents", - "id": "02fd31b0-fa56-11e9-8237-65a0c5e0a0f7", + "id": "0b756120-0625-11ea-bdb3-e10a3f6667b0", "attributes": { - "shared_id": "agent6", + "shared_id": "agent3", "active": true, "access_api_key_id": "api_key_1", "policy_id": "policy_id_1", @@ -1346,17 +1346,17 @@ exports['AgentsRepository list should list all active agents - find:"agents" (25 "version": "1", "local_metadata": "{\"host\":\"test.fr\"}", "user_provided_metadata": "{\"color\":\"red\"}", - "enrolled_at": "2019-08-13T19:35:14.861Z" + "enrolled_at": "2019-08-10T19:35:14.861Z" }, "references": [], - "updated_at": "2019-10-29T14:11:33.579Z", - "version": "WzUxLDFd" + "updated_at": "2019-11-13T14:51:16.402Z", + "version": "WzMyLDFd" }, { "type": "agents", - "id": "03979cf0-fa56-11e9-8237-65a0c5e0a0f7", + "id": "0c11ef40-0625-11ea-bdb3-e10a3f6667b0", "attributes": { - "shared_id": "agent7", + "shared_id": "agent4", "active": true, "access_api_key_id": "api_key_1", "policy_id": "policy_id_1", @@ -1364,17 +1364,17 @@ exports['AgentsRepository list should list all active agents - find:"agents" (25 "version": "1", "local_metadata": "{\"host\":\"test.fr\"}", "user_provided_metadata": "{\"color\":\"red\"}", - "enrolled_at": "2019-08-14T19:35:14.861Z" + "enrolled_at": "2019-08-11T19:35:14.861Z" }, "references": [], - "updated_at": "2019-10-29T14:11:34.591Z", - "version": "WzUyLDFd" + "updated_at": "2019-11-13T14:51:17.427Z", + "version": "WzMzLDFd" }, { "type": "agents", - "id": "04325650-fa56-11e9-8237-65a0c5e0a0f7", + "id": "0cabbe40-0625-11ea-bdb3-e10a3f6667b0", "attributes": { - "shared_id": "agent8", + "shared_id": "agent5", "active": true, "access_api_key_id": "api_key_1", "policy_id": "policy_id_1", @@ -1382,17 +1382,17 @@ exports['AgentsRepository list should list all active agents - find:"agents" (25 "version": "1", "local_metadata": "{\"host\":\"test.fr\"}", "user_provided_metadata": "{\"color\":\"red\"}", - "enrolled_at": "2019-08-15T19:35:14.861Z" + "enrolled_at": "2019-08-12T19:35:14.861Z" }, "references": [], - "updated_at": "2019-10-29T14:11:35.605Z", - "version": "WzUzLDFd" + "updated_at": "2019-11-13T14:51:18.436Z", + "version": "WzM0LDFd" }, { "type": "agents", - "id": "04cc7370-fa56-11e9-8237-65a0c5e0a0f7", + "id": "10eb3cb0-0625-11ea-bdb3-e10a3f6667b0", "attributes": { - "shared_id": "agent9", + "shared_id": "agent12", "active": true, "access_api_key_id": "api_key_1", "policy_id": "policy_id_1", @@ -1400,35 +1400,35 @@ exports['AgentsRepository list should list all active agents - find:"agents" (25 "version": "1", "local_metadata": "{\"host\":\"test.fr\"}", "user_provided_metadata": "{\"color\":\"red\"}", - "enrolled_at": "2019-08-16T19:35:14.861Z" + "enrolled_at": "2019-08-19T19:35:14.861Z" }, "references": [], - "updated_at": "2019-10-29T14:11:36.615Z", - "version": "WzU0LDFd" + "updated_at": "2019-11-13T14:51:25.563Z", + "version": "WzQxLDFd" }, { "type": "agents", - "id": "0b718030-fa56-11e9-8237-65a0c5e0a0f7", + "id": "11888e20-0625-11ea-bdb3-e10a3f6667b0", "attributes": { - "shared_id": "inactive_agent_1", - "active": false, + "shared_id": "agent13", + "active": true, "access_api_key_id": "api_key_1", "policy_id": "policy_id_1", "type": "PERMANENT", "version": "1", "local_metadata": "{\"host\":\"test.fr\"}", "user_provided_metadata": "{\"color\":\"red\"}", - "enrolled_at": "2019-11-13T20:35:14.861Z" + "enrolled_at": "2019-08-20T19:35:14.861Z" }, "references": [], - "updated_at": "2019-10-29T14:11:47.763Z", - "version": "WzY1LDFd" + "updated_at": "2019-11-13T14:51:26.594Z", + "version": "WzQyLDFd" }, { "type": "agents", - "id": "069c0350-fa56-11e9-8237-65a0c5e0a0f7", + "id": "12240ad0-0625-11ea-bdb3-e10a3f6667b0", "attributes": { - "shared_id": "agent12", + "shared_id": "agent14", "active": true, "access_api_key_id": "api_key_1", "policy_id": "policy_id_1", @@ -1436,17 +1436,17 @@ exports['AgentsRepository list should list all active agents - find:"agents" (25 "version": "1", "local_metadata": "{\"host\":\"test.fr\"}", "user_provided_metadata": "{\"color\":\"red\"}", - "enrolled_at": "2019-08-19T19:35:14.861Z" + "enrolled_at": "2019-08-21T19:35:14.861Z" }, "references": [], - "updated_at": "2019-10-29T14:11:39.652Z", - "version": "WzU3LDFd" + "updated_at": "2019-11-13T14:51:27.613Z", + "version": "WzQzLDFd" }, { "type": "agents", - "id": "073731e0-fa56-11e9-8237-65a0c5e0a0f7", + "id": "12be9d20-0625-11ea-bdb3-e10a3f6667b0", "attributes": { - "shared_id": "agent13", + "shared_id": "agent15", "active": true, "access_api_key_id": "api_key_1", "policy_id": "policy_id_1", @@ -1454,17 +1454,17 @@ exports['AgentsRepository list should list all active agents - find:"agents" (25 "version": "1", "local_metadata": "{\"host\":\"test.fr\"}", "user_provided_metadata": "{\"color\":\"red\"}", - "enrolled_at": "2019-08-20T19:35:14.861Z" + "enrolled_at": "2019-08-22T19:35:14.861Z" }, "references": [], - "updated_at": "2019-10-29T14:11:40.670Z", - "version": "WzU4LDFd" + "updated_at": "2019-11-13T14:51:28.626Z", + "version": "WzQ0LDFd" }, { "type": "agents", - "id": "07d19d20-fa56-11e9-8237-65a0c5e0a0f7", + "id": "13595680-0625-11ea-bdb3-e10a3f6667b0", "attributes": { - "shared_id": "agent14", + "shared_id": "agent16", "active": true, "access_api_key_id": "api_key_1", "policy_id": "policy_id_1", @@ -1472,17 +1472,17 @@ exports['AgentsRepository list should list all active agents - find:"agents" (25 "version": "1", "local_metadata": "{\"host\":\"test.fr\"}", "user_provided_metadata": "{\"color\":\"red\"}", - "enrolled_at": "2019-08-21T19:35:14.861Z" + "enrolled_at": "2019-08-23T19:35:14.861Z" }, "references": [], - "updated_at": "2019-10-29T14:11:41.682Z", - "version": "WzU5LDFd" + "updated_at": "2019-11-13T14:51:29.639Z", + "version": "WzQ1LDFd" }, { "type": "agents", - "id": "086c5680-fa56-11e9-8237-65a0c5e0a0f7", + "id": "13f436f0-0625-11ea-bdb3-e10a3f6667b0", "attributes": { - "shared_id": "agent15", + "shared_id": "agent17", "active": true, "access_api_key_id": "api_key_1", "policy_id": "policy_id_1", @@ -1490,17 +1490,17 @@ exports['AgentsRepository list should list all active agents - find:"agents" (25 "version": "1", "local_metadata": "{\"host\":\"test.fr\"}", "user_provided_metadata": "{\"color\":\"red\"}", - "enrolled_at": "2019-08-22T19:35:14.861Z" + "enrolled_at": "2019-08-24T19:35:14.861Z" }, "references": [], - "updated_at": "2019-10-29T14:11:42.696Z", - "version": "WzYwLDFd" + "updated_at": "2019-11-13T14:51:30.655Z", + "version": "WzQ2LDFd" }, { "type": "agents", - "id": "09075e00-fa56-11e9-8237-65a0c5e0a0f7", + "id": "148e2d00-0625-11ea-bdb3-e10a3f6667b0", "attributes": { - "shared_id": "agent16", + "shared_id": "agent18", "active": true, "access_api_key_id": "api_key_1", "policy_id": "policy_id_1", @@ -1508,17 +1508,17 @@ exports['AgentsRepository list should list all active agents - find:"agents" (25 "version": "1", "local_metadata": "{\"host\":\"test.fr\"}", "user_provided_metadata": "{\"color\":\"red\"}", - "enrolled_at": "2019-08-23T19:35:14.861Z" + "enrolled_at": "2019-08-25T19:35:14.861Z" }, "references": [], - "updated_at": "2019-10-29T14:11:43.712Z", - "version": "WzYxLDFd" + "updated_at": "2019-11-13T14:51:31.664Z", + "version": "WzQ3LDFd" }, { "type": "agents", - "id": "09a23e70-fa56-11e9-8237-65a0c5e0a0f7", + "id": "152b5760-0625-11ea-bdb3-e10a3f6667b0", "attributes": { - "shared_id": "agent17", + "shared_id": "agent19", "active": true, "access_api_key_id": "api_key_1", "policy_id": "policy_id_1", @@ -1526,17 +1526,17 @@ exports['AgentsRepository list should list all active agents - find:"agents" (25 "version": "1", "local_metadata": "{\"host\":\"test.fr\"}", "user_provided_metadata": "{\"color\":\"red\"}", - "enrolled_at": "2019-08-24T19:35:14.861Z" + "enrolled_at": "2019-08-26T19:35:14.861Z" }, "references": [], - "updated_at": "2019-10-29T14:11:44.727Z", - "version": "WzYyLDFd" + "updated_at": "2019-11-13T14:51:32.694Z", + "version": "WzQ4LDFd" }, { "type": "agents", - "id": "0a3d45f0-fa56-11e9-8237-65a0c5e0a0f7", + "id": "104d4f00-0625-11ea-bdb3-e10a3f6667b0", "attributes": { - "shared_id": "agent18", + "shared_id": "agent11", "active": true, "access_api_key_id": "api_key_1", "policy_id": "policy_id_1", @@ -1544,33 +1544,33 @@ exports['AgentsRepository list should list all active agents - find:"agents" (25 "version": "1", "local_metadata": "{\"host\":\"test.fr\"}", "user_provided_metadata": "{\"color\":\"red\"}", - "enrolled_at": "2019-08-25T19:35:14.861Z" + "enrolled_at": "2019-08-18T19:35:14.861Z" }, "references": [], - "updated_at": "2019-10-29T14:11:45.743Z", - "version": "WzYzLDFd" + "updated_at": "2019-11-13T14:51:24.528Z", + "version": "WzQwLDFd" }, { "type": "agents", - "id": "0ad78a20-fa56-11e9-8237-65a0c5e0a0f7", + "id": "15c4b130-0625-11ea-bdb3-e10a3f6667b0", "attributes": { - "shared_id": "agent19", - "active": true, + "shared_id": "inactive_agent_1", + "active": false, "access_api_key_id": "api_key_1", "policy_id": "policy_id_1", "type": "PERMANENT", "version": "1", "local_metadata": "{\"host\":\"test.fr\"}", "user_provided_metadata": "{\"color\":\"red\"}", - "enrolled_at": "2019-08-26T19:35:14.861Z" + "enrolled_at": "2019-11-13T20:35:14.861Z" }, "references": [], - "updated_at": "2019-10-29T14:11:46.754Z", - "version": "WzY0LDFd" + "updated_at": "2019-11-13T14:51:33.699Z", + "version": "WzQ5LDFd" }, { "type": "agents", - "id": "0c0beb70-fa56-11e9-8237-65a0c5e0a0f7", + "id": "166202a0-0625-11ea-bdb3-e10a3f6667b0", "attributes": { "shared_id": "inactive_agent_2", "active": true, @@ -1580,16 +1580,16 @@ exports['AgentsRepository list should list all active agents - find:"agents" (25 "version": "1", "local_metadata": "{\"host\":\"test.fr\"}", "user_provided_metadata": "{\"color\":\"red\"}", - "last_checkin": "2019-10-27T14:11:27.486Z", + "last_checkin": "2019-11-11T14:51:13.162Z", "enrolled_at": "2019-08-05T19:35:14.861Z" }, "references": [], - "updated_at": "2019-10-29T14:11:48.775Z", - "version": "WzY2LDFd" + "updated_at": "2019-11-13T14:51:34.730Z", + "version": "WzUwLDFd" }, { "type": "agents", - "id": "0ca87990-fa56-11e9-8237-65a0c5e0a0f7", + "id": "16fc46d0-0625-11ea-bdb3-e10a3f6667b0", "attributes": { "shared_id": "ephemeral1", "active": true, @@ -1599,113 +1599,113 @@ exports['AgentsRepository list should list all active agents - find:"agents" (25 "version": "1", "local_metadata": "{\"host\":\"test.fr\"}", "user_provided_metadata": "{\"color\":\"red\"}", - "last_checkin": "2019-10-29T14:11:27.486Z", + "last_checkin": "2019-11-13T14:51:13.161Z", "enrolled_at": "2019-08-05T19:35:14.861Z" }, "references": [], - "updated_at": "2019-10-29T14:11:49.801Z", - "version": "WzY3LDFd" + "updated_at": "2019-11-13T14:51:35.741Z", + "version": "WzUxLDFd" } ] } } -exports['AgentsRepository list should list all active agents - delete:agents:ff5bc800-fa55-11e9-8237-65a0c5e0a0f7:{} (26)'] = { +exports['AgentsRepository list should list all active agents - delete (26)'] = { "results": {} } -exports['AgentsRepository list should list all active agents - delete:agents:008f8d10-fa56-11e9-8237-65a0c5e0a0f7:{} (27)'] = { +exports['AgentsRepository list should list all active agents - delete (27)'] = { "results": {} } -exports['AgentsRepository list should list all active agents - delete:agents:fff4d3b0-fa55-11e9-8237-65a0c5e0a0f7:{} (28)'] = { +exports['AgentsRepository list should list all active agents - delete (28)'] = { "results": {} } -exports['AgentsRepository list should list all active agents - delete:agents:056705c0-fa56-11e9-8237-65a0c5e0a0f7:{} (29)'] = { +exports['AgentsRepository list should list all active agents - delete (29)'] = { "results": {} } -exports['AgentsRepository list should list all active agents - delete:agents:06019810-fa56-11e9-8237-65a0c5e0a0f7:{} (30)'] = { +exports['AgentsRepository list should list all active agents - delete (30)'] = { "results": {} } -exports['AgentsRepository list should list all active agents - delete:agents:012898c0-fa56-11e9-8237-65a0c5e0a0f7:{} (31)'] = { +exports['AgentsRepository list should list all active agents - delete (31)'] = { "results": {} } -exports['AgentsRepository list should list all active agents - delete:agents:01c770d0-fa56-11e9-8237-65a0c5e0a0f7:{} (32)'] = { +exports['AgentsRepository list should list all active agents - delete (32)'] = { "results": {} } -exports['AgentsRepository list should list all active agents - delete:agents:02622a30-fa56-11e9-8237-65a0c5e0a0f7:{} (33)'] = { +exports['AgentsRepository list should list all active agents - delete (33)'] = { "results": {} } -exports['AgentsRepository list should list all active agents - delete:agents:02fd31b0-fa56-11e9-8237-65a0c5e0a0f7:{} (34)'] = { +exports['AgentsRepository list should list all active agents - delete (34)'] = { "results": {} } -exports['AgentsRepository list should list all active agents - delete:agents:03979cf0-fa56-11e9-8237-65a0c5e0a0f7:{} (35)'] = { +exports['AgentsRepository list should list all active agents - delete (35)'] = { "results": {} } -exports['AgentsRepository list should list all active agents - delete:agents:04325650-fa56-11e9-8237-65a0c5e0a0f7:{} (36)'] = { +exports['AgentsRepository list should list all active agents - delete (36)'] = { "results": {} } -exports['AgentsRepository list should list all active agents - delete:agents:04cc7370-fa56-11e9-8237-65a0c5e0a0f7:{} (37)'] = { +exports['AgentsRepository list should list all active agents - delete (37)'] = { "results": {} } -exports['AgentsRepository list should list all active agents - delete:agents:0b718030-fa56-11e9-8237-65a0c5e0a0f7:{} (38)'] = { +exports['AgentsRepository list should list all active agents - delete (38)'] = { "results": {} } -exports['AgentsRepository list should list all active agents - delete:agents:069c0350-fa56-11e9-8237-65a0c5e0a0f7:{} (39)'] = { +exports['AgentsRepository list should list all active agents - delete (39)'] = { "results": {} } -exports['AgentsRepository list should list all active agents - delete:agents:073731e0-fa56-11e9-8237-65a0c5e0a0f7:{} (40)'] = { +exports['AgentsRepository list should list all active agents - delete (40)'] = { "results": {} } -exports['AgentsRepository list should list all active agents - delete:agents:07d19d20-fa56-11e9-8237-65a0c5e0a0f7:{} (41)'] = { +exports['AgentsRepository list should list all active agents - delete (41)'] = { "results": {} } -exports['AgentsRepository list should list all active agents - delete:agents:086c5680-fa56-11e9-8237-65a0c5e0a0f7:{} (42)'] = { +exports['AgentsRepository list should list all active agents - delete (42)'] = { "results": {} } -exports['AgentsRepository list should list all active agents - delete:agents:09075e00-fa56-11e9-8237-65a0c5e0a0f7:{} (43)'] = { +exports['AgentsRepository list should list all active agents - delete (43)'] = { "results": {} } -exports['AgentsRepository list should list all active agents - delete:agents:09a23e70-fa56-11e9-8237-65a0c5e0a0f7:{} (44)'] = { +exports['AgentsRepository list should list all active agents - delete (44)'] = { "results": {} } -exports['AgentsRepository list should list all active agents - delete:agents:0a3d45f0-fa56-11e9-8237-65a0c5e0a0f7:{} (45)'] = { +exports['AgentsRepository list should list all active agents - delete (45)'] = { "results": {} } -exports['AgentsRepository list should list all active agents - delete:agents:0ad78a20-fa56-11e9-8237-65a0c5e0a0f7:{} (46)'] = { +exports['AgentsRepository list should list all active agents - delete (46)'] = { "results": {} } -exports['AgentsRepository list should list all active agents - delete:agents:0c0beb70-fa56-11e9-8237-65a0c5e0a0f7:{} (47)'] = { +exports['AgentsRepository list should list all active agents - delete (47)'] = { "results": {} } -exports['AgentsRepository list should list all active agents - delete:agents:0ca87990-fa56-11e9-8237-65a0c5e0a0f7:{} (48)'] = { +exports['AgentsRepository list should list all active agents - delete (48)'] = { "results": {} } exports['AgentsRepository list should list all agents with showInactive set to true - create:agents (1)'] = { "results": { "type": "agents", - "id": "1b26f460-fa56-11e9-8237-65a0c5e0a0f7", + "id": "25885630-0625-11ea-bdb3-e10a3f6667b0", "attributes": { "shared_id": "agent0", "active": true, @@ -1718,15 +1718,15 @@ exports['AgentsRepository list should list all agents with showInactive set to t "enrolled_at": "2019-08-07T19:35:14.861Z" }, "references": [], - "updated_at": "2019-10-29T14:12:14.118Z", - "version": "WzkxLDFd" + "updated_at": "2019-11-13T14:52:00.147Z", + "version": "Wzc1LDFd" } } exports['AgentsRepository list should list all agents with showInactive set to true - create:agents (2)'] = { "results": { "type": "agents", - "id": "1bc186b0-fa56-11e9-8237-65a0c5e0a0f7", + "id": "262113c0-0625-11ea-bdb3-e10a3f6667b0", "attributes": { "shared_id": "agent1", "active": true, @@ -1739,15 +1739,15 @@ exports['AgentsRepository list should list all agents with showInactive set to t "enrolled_at": "2019-08-08T19:35:14.861Z" }, "references": [], - "updated_at": "2019-10-29T14:12:15.131Z", - "version": "WzkyLDFd" + "updated_at": "2019-11-13T14:52:01.148Z", + "version": "Wzc2LDFd" } } exports['AgentsRepository list should list all agents with showInactive set to true - create:agents (3)'] = { "results": { "type": "agents", - "id": "1c5b55b0-fa56-11e9-8237-65a0c5e0a0f7", + "id": "26d91920-0625-11ea-bdb3-e10a3f6667b0", "attributes": { "shared_id": "agent2", "active": true, @@ -1760,15 +1760,15 @@ exports['AgentsRepository list should list all agents with showInactive set to t "enrolled_at": "2019-08-09T19:35:14.861Z" }, "references": [], - "updated_at": "2019-10-29T14:12:16.138Z", - "version": "WzkzLDFd" + "updated_at": "2019-11-13T14:52:02.354Z", + "version": "Wzc3LDFd" } } exports['AgentsRepository list should list all agents with showInactive set to true - create:agents (4)'] = { "results": { "type": "agents", - "id": "1cf7e3d0-fa56-11e9-8237-65a0c5e0a0f7", + "id": "27758030-0625-11ea-bdb3-e10a3f6667b0", "attributes": { "shared_id": "agent3", "active": true, @@ -1781,15 +1781,15 @@ exports['AgentsRepository list should list all agents with showInactive set to t "enrolled_at": "2019-08-10T19:35:14.861Z" }, "references": [], - "updated_at": "2019-10-29T14:12:17.165Z", - "version": "Wzk0LDFd" + "updated_at": "2019-11-13T14:52:03.379Z", + "version": "Wzc4LDFd" } } exports['AgentsRepository list should list all agents with showInactive set to true - create:agents (5)'] = { "results": { "type": "agents", - "id": "1d90c870-fa56-11e9-8237-65a0c5e0a0f7", + "id": "281b5d20-0625-11ea-bdb3-e10a3f6667b0", "attributes": { "shared_id": "agent4", "active": true, @@ -1802,15 +1802,15 @@ exports['AgentsRepository list should list all agents with showInactive set to t "enrolled_at": "2019-08-11T19:35:14.861Z" }, "references": [], - "updated_at": "2019-10-29T14:12:18.167Z", - "version": "Wzk1LDFd" + "updated_at": "2019-11-13T14:52:04.466Z", + "version": "Wzc5LDFd" } } exports['AgentsRepository list should list all agents with showInactive set to true - create:agents (6)'] = { "results": { "type": "agents", - "id": "1e2d0870-fa56-11e9-8237-65a0c5e0a0f7", + "id": "28b4b6f0-0625-11ea-bdb3-e10a3f6667b0", "attributes": { "shared_id": "agent5", "active": true, @@ -1823,15 +1823,15 @@ exports['AgentsRepository list should list all agents with showInactive set to t "enrolled_at": "2019-08-12T19:35:14.861Z" }, "references": [], - "updated_at": "2019-10-29T14:12:19.191Z", - "version": "Wzk2LDFd" + "updated_at": "2019-11-13T14:52:05.471Z", + "version": "WzgwLDFd" } } exports['AgentsRepository list should list all agents with showInactive set to true - create:agents (7)'] = { "results": { "type": "agents", - "id": "1ec74ca0-fa56-11e9-8237-65a0c5e0a0f7", + "id": "294f9760-0625-11ea-bdb3-e10a3f6667b0", "attributes": { "shared_id": "agent6", "active": true, @@ -1844,15 +1844,15 @@ exports['AgentsRepository list should list all agents with showInactive set to t "enrolled_at": "2019-08-13T19:35:14.861Z" }, "references": [], - "updated_at": "2019-10-29T14:12:20.202Z", - "version": "Wzk3LDFd" + "updated_at": "2019-11-13T14:52:06.486Z", + "version": "WzgxLDFd" } } exports['AgentsRepository list should list all agents with showInactive set to true - create:agents (8)'] = { "results": { "type": "agents", - "id": "1f607f60-fa56-11e9-8237-65a0c5e0a0f7", + "id": "29e9b480-0625-11ea-bdb3-e10a3f6667b0", "attributes": { "shared_id": "agent7", "active": true, @@ -1865,15 +1865,15 @@ exports['AgentsRepository list should list all agents with showInactive set to t "enrolled_at": "2019-08-14T19:35:14.861Z" }, "references": [], - "updated_at": "2019-10-29T14:12:21.205Z", - "version": "Wzk4LDFd" + "updated_at": "2019-11-13T14:52:07.496Z", + "version": "WzgyLDFd" } } exports['AgentsRepository list should list all agents with showInactive set to true - create:agents (9)'] = { "results": { "type": "agents", - "id": "1ffbd500-fa56-11e9-8237-65a0c5e0a0f7", + "id": "2a846de0-0625-11ea-bdb3-e10a3f6667b0", "attributes": { "shared_id": "agent8", "active": true, @@ -1886,15 +1886,15 @@ exports['AgentsRepository list should list all agents with showInactive set to t "enrolled_at": "2019-08-15T19:35:14.861Z" }, "references": [], - "updated_at": "2019-10-29T14:12:22.224Z", - "version": "Wzk5LDFd" + "updated_at": "2019-11-13T14:52:08.510Z", + "version": "WzgzLDFd" } } exports['AgentsRepository list should list all agents with showInactive set to true - create:agents (10)'] = { "results": { "type": "agents", - "id": "20964040-fa56-11e9-8237-65a0c5e0a0f7", + "id": "2b1dc7b0-0625-11ea-bdb3-e10a3f6667b0", "attributes": { "shared_id": "agent9", "active": true, @@ -1907,15 +1907,15 @@ exports['AgentsRepository list should list all agents with showInactive set to t "enrolled_at": "2019-08-16T19:35:14.861Z" }, "references": [], - "updated_at": "2019-10-29T14:12:23.236Z", - "version": "WzEwMCwxXQ==" + "updated_at": "2019-11-13T14:52:09.515Z", + "version": "Wzg0LDFd" } } exports['AgentsRepository list should list all agents with showInactive set to true - create:agents (11)'] = { "results": { "type": "agents", - "id": "2130d290-fa56-11e9-8237-65a0c5e0a0f7", + "id": "2bb76fa0-0625-11ea-bdb3-e10a3f6667b0", "attributes": { "shared_id": "agent10", "active": true, @@ -1928,15 +1928,15 @@ exports['AgentsRepository list should list all agents with showInactive set to t "enrolled_at": "2019-08-17T19:35:14.861Z" }, "references": [], - "updated_at": "2019-10-29T14:12:24.249Z", - "version": "WzEwMSwxXQ==" + "updated_at": "2019-11-13T14:52:10.522Z", + "version": "Wzg1LDFd" } } exports['AgentsRepository list should list all agents with showInactive set to true - create:agents (12)'] = { "results": { "type": "agents", - "id": "21cbda10-fa56-11e9-8237-65a0c5e0a0f7", + "id": "2c53afa0-0625-11ea-bdb3-e10a3f6667b0", "attributes": { "shared_id": "agent11", "active": true, @@ -1949,15 +1949,15 @@ exports['AgentsRepository list should list all agents with showInactive set to t "enrolled_at": "2019-08-18T19:35:14.861Z" }, "references": [], - "updated_at": "2019-10-29T14:12:25.265Z", - "version": "WzEwMiwxXQ==" + "updated_at": "2019-11-13T14:52:11.546Z", + "version": "Wzg2LDFd" } } exports['AgentsRepository list should list all agents with showInactive set to true - create:agents (13)'] = { "results": { "type": "agents", - "id": "22677dd0-fa56-11e9-8237-65a0c5e0a0f7", + "id": "2ced7ea0-0625-11ea-bdb3-e10a3f6667b0", "attributes": { "shared_id": "agent12", "active": true, @@ -1970,15 +1970,15 @@ exports['AgentsRepository list should list all agents with showInactive set to t "enrolled_at": "2019-08-19T19:35:14.861Z" }, "references": [], - "updated_at": "2019-10-29T14:12:26.285Z", - "version": "WzEwMywxXQ==" + "updated_at": "2019-11-13T14:52:12.554Z", + "version": "Wzg3LDFd" } } exports['AgentsRepository list should list all agents with showInactive set to true - create:agents (14)'] = { "results": { "type": "agents", - "id": "23023730-fa56-11e9-8237-65a0c5e0a0f7", + "id": "2d88d440-0625-11ea-bdb3-e10a3f6667b0", "attributes": { "shared_id": "agent13", "active": true, @@ -1991,15 +1991,15 @@ exports['AgentsRepository list should list all agents with showInactive set to t "enrolled_at": "2019-08-20T19:35:14.861Z" }, "references": [], - "updated_at": "2019-10-29T14:12:27.299Z", - "version": "WzEwNCwxXQ==" + "updated_at": "2019-11-13T14:52:13.571Z", + "version": "Wzg4LDFd" } } exports['AgentsRepository list should list all agents with showInactive set to true - create:agents (15)'] = { "results": { "type": "agents", - "id": "239d17a0-fa56-11e9-8237-65a0c5e0a0f7", + "id": "2e22f160-0625-11ea-bdb3-e10a3f6667b0", "attributes": { "shared_id": "agent14", "active": true, @@ -2012,15 +2012,15 @@ exports['AgentsRepository list should list all agents with showInactive set to t "enrolled_at": "2019-08-21T19:35:14.861Z" }, "references": [], - "updated_at": "2019-10-29T14:12:28.314Z", - "version": "WzEwNSwxXQ==" + "updated_at": "2019-11-13T14:52:14.582Z", + "version": "Wzg5LDFd" } } exports['AgentsRepository list should list all agents with showInactive set to true - create:agents (16)'] = { "results": { "type": "agents", - "id": "24381f20-fa56-11e9-8237-65a0c5e0a0f7", + "id": "2ebce770-0625-11ea-bdb3-e10a3f6667b0", "attributes": { "shared_id": "agent15", "active": true, @@ -2033,15 +2033,15 @@ exports['AgentsRepository list should list all agents with showInactive set to t "enrolled_at": "2019-08-22T19:35:14.861Z" }, "references": [], - "updated_at": "2019-10-29T14:12:29.330Z", - "version": "WzEwNiwxXQ==" + "updated_at": "2019-11-13T14:52:15.591Z", + "version": "WzkwLDFd" } } exports['AgentsRepository list should list all agents with showInactive set to true - create:agents (17)'] = { "results": { "type": "agents", - "id": "24d2b170-fa56-11e9-8237-65a0c5e0a0f7", + "id": "2f5779c0-0625-11ea-bdb3-e10a3f6667b0", "attributes": { "shared_id": "agent16", "active": true, @@ -2054,15 +2054,15 @@ exports['AgentsRepository list should list all agents with showInactive set to t "enrolled_at": "2019-08-23T19:35:14.861Z" }, "references": [], - "updated_at": "2019-10-29T14:12:30.343Z", - "version": "WzEwNywxXQ==" + "updated_at": "2019-11-13T14:52:16.604Z", + "version": "WzkxLDFd" } } exports['AgentsRepository list should list all agents with showInactive set to true - create:agents (18)'] = { "results": { "type": "agents", - "id": "256d91e0-fa56-11e9-8237-65a0c5e0a0f7", + "id": "2ff56770-0625-11ea-bdb3-e10a3f6667b0", "attributes": { "shared_id": "agent17", "active": true, @@ -2075,15 +2075,15 @@ exports['AgentsRepository list should list all agents with showInactive set to t "enrolled_at": "2019-08-24T19:35:14.861Z" }, "references": [], - "updated_at": "2019-10-29T14:12:31.357Z", - "version": "WzEwOCwxXQ==" + "updated_at": "2019-11-13T14:52:17.639Z", + "version": "WzkyLDFd" } } exports['AgentsRepository list should list all agents with showInactive set to true - create:agents (19)'] = { "results": { "type": "agents", - "id": "260760e0-fa56-11e9-8237-65a0c5e0a0f7", + "id": "308faba0-0625-11ea-bdb3-e10a3f6667b0", "attributes": { "shared_id": "agent18", "active": true, @@ -2096,15 +2096,15 @@ exports['AgentsRepository list should list all agents with showInactive set to t "enrolled_at": "2019-08-25T19:35:14.861Z" }, "references": [], - "updated_at": "2019-10-29T14:12:32.365Z", - "version": "WzEwOSwxXQ==" + "updated_at": "2019-11-13T14:52:18.650Z", + "version": "WzkzLDFd" } } exports['AgentsRepository list should list all agents with showInactive set to true - create:agents (20)'] = { "results": { "type": "agents", - "id": "26a21a40-fa56-11e9-8237-65a0c5e0a0f7", + "id": "312a3df0-0625-11ea-bdb3-e10a3f6667b0", "attributes": { "shared_id": "agent19", "active": true, @@ -2117,15 +2117,15 @@ exports['AgentsRepository list should list all agents with showInactive set to t "enrolled_at": "2019-08-26T19:35:14.861Z" }, "references": [], - "updated_at": "2019-10-29T14:12:33.380Z", - "version": "WzExMCwxXQ==" + "updated_at": "2019-11-13T14:52:19.663Z", + "version": "Wzk0LDFd" } } exports['AgentsRepository list should list all agents with showInactive set to true - create:agents (21)'] = { "results": { "type": "agents", - "id": "273c3760-fa56-11e9-8237-65a0c5e0a0f7", + "id": "31c6a500-0625-11ea-bdb3-e10a3f6667b0", "attributes": { "shared_id": "inactive_agent_1", "active": false, @@ -2138,15 +2138,15 @@ exports['AgentsRepository list should list all agents with showInactive set to t "enrolled_at": "2019-11-13T20:35:14.861Z" }, "references": [], - "updated_at": "2019-10-29T14:12:34.390Z", - "version": "WzExMSwxXQ==" + "updated_at": "2019-11-13T14:52:20.688Z", + "version": "Wzk1LDFd" } } exports['AgentsRepository list should list all agents with showInactive set to true - create:agents (22)'] = { "results": { "type": "agents", - "id": "27d988d0-fa56-11e9-8237-65a0c5e0a0f7", + "id": "32609b10-0625-11ea-bdb3-e10a3f6667b0", "attributes": { "shared_id": "inactive_agent_2", "active": true, @@ -2156,19 +2156,19 @@ exports['AgentsRepository list should list all agents with showInactive set to t "version": "1", "local_metadata": "{\"host\":\"test.fr\"}", "user_provided_metadata": "{\"color\":\"red\"}", - "last_checkin": "2019-10-27T14:12:14.115Z", + "last_checkin": "2019-11-11T14:52:00.144Z", "enrolled_at": "2019-08-05T19:35:14.861Z" }, "references": [], - "updated_at": "2019-10-29T14:12:35.421Z", - "version": "WzExMiwxXQ==" + "updated_at": "2019-11-13T14:52:21.697Z", + "version": "Wzk2LDFd" } } exports['AgentsRepository list should list all agents with showInactive set to true - create:agents (23)'] = { "results": { "type": "agents", - "id": "2873cd00-fa56-11e9-8237-65a0c5e0a0f7", + "id": "32fc17c0-0625-11ea-bdb3-e10a3f6667b0", "attributes": { "shared_id": "ephemeral1", "active": true, @@ -2178,12 +2178,12 @@ exports['AgentsRepository list should list all agents with showInactive set to t "version": "1", "local_metadata": "{\"host\":\"test.fr\"}", "user_provided_metadata": "{\"color\":\"red\"}", - "last_checkin": "2019-10-29T14:12:14.115Z", + "last_checkin": "2019-11-13T14:52:00.144Z", "enrolled_at": "2019-08-05T19:35:14.861Z" }, "references": [], - "updated_at": "2019-10-29T14:12:36.432Z", - "version": "WzExMywxXQ==" + "updated_at": "2019-11-13T14:52:22.716Z", + "version": "Wzk3LDFd" } } @@ -2195,7 +2195,7 @@ exports['AgentsRepository list should list all agents with showInactive set to t "saved_objects": [ { "type": "agents", - "id": "273c3760-fa56-11e9-8237-65a0c5e0a0f7", + "id": "31c6a500-0625-11ea-bdb3-e10a3f6667b0", "attributes": { "shared_id": "inactive_agent_1", "active": false, @@ -2208,12 +2208,12 @@ exports['AgentsRepository list should list all agents with showInactive set to t "enrolled_at": "2019-11-13T20:35:14.861Z" }, "references": [], - "updated_at": "2019-10-29T14:12:34.390Z", - "version": "WzExMSwxXQ==" + "updated_at": "2019-11-13T14:52:20.688Z", + "version": "Wzk1LDFd" }, { "type": "agents", - "id": "26a21a40-fa56-11e9-8237-65a0c5e0a0f7", + "id": "312a3df0-0625-11ea-bdb3-e10a3f6667b0", "attributes": { "shared_id": "agent19", "active": true, @@ -2226,12 +2226,12 @@ exports['AgentsRepository list should list all agents with showInactive set to t "enrolled_at": "2019-08-26T19:35:14.861Z" }, "references": [], - "updated_at": "2019-10-29T14:12:33.380Z", - "version": "WzExMCwxXQ==" + "updated_at": "2019-11-13T14:52:19.663Z", + "version": "Wzk0LDFd" }, { "type": "agents", - "id": "260760e0-fa56-11e9-8237-65a0c5e0a0f7", + "id": "308faba0-0625-11ea-bdb3-e10a3f6667b0", "attributes": { "shared_id": "agent18", "active": true, @@ -2244,12 +2244,12 @@ exports['AgentsRepository list should list all agents with showInactive set to t "enrolled_at": "2019-08-25T19:35:14.861Z" }, "references": [], - "updated_at": "2019-10-29T14:12:32.365Z", - "version": "WzEwOSwxXQ==" + "updated_at": "2019-11-13T14:52:18.650Z", + "version": "WzkzLDFd" }, { "type": "agents", - "id": "256d91e0-fa56-11e9-8237-65a0c5e0a0f7", + "id": "2ff56770-0625-11ea-bdb3-e10a3f6667b0", "attributes": { "shared_id": "agent17", "active": true, @@ -2262,12 +2262,12 @@ exports['AgentsRepository list should list all agents with showInactive set to t "enrolled_at": "2019-08-24T19:35:14.861Z" }, "references": [], - "updated_at": "2019-10-29T14:12:31.357Z", - "version": "WzEwOCwxXQ==" + "updated_at": "2019-11-13T14:52:17.639Z", + "version": "WzkyLDFd" }, { "type": "agents", - "id": "24d2b170-fa56-11e9-8237-65a0c5e0a0f7", + "id": "2f5779c0-0625-11ea-bdb3-e10a3f6667b0", "attributes": { "shared_id": "agent16", "active": true, @@ -2280,12 +2280,12 @@ exports['AgentsRepository list should list all agents with showInactive set to t "enrolled_at": "2019-08-23T19:35:14.861Z" }, "references": [], - "updated_at": "2019-10-29T14:12:30.343Z", - "version": "WzEwNywxXQ==" + "updated_at": "2019-11-13T14:52:16.604Z", + "version": "WzkxLDFd" }, { "type": "agents", - "id": "24381f20-fa56-11e9-8237-65a0c5e0a0f7", + "id": "2ebce770-0625-11ea-bdb3-e10a3f6667b0", "attributes": { "shared_id": "agent15", "active": true, @@ -2298,12 +2298,12 @@ exports['AgentsRepository list should list all agents with showInactive set to t "enrolled_at": "2019-08-22T19:35:14.861Z" }, "references": [], - "updated_at": "2019-10-29T14:12:29.330Z", - "version": "WzEwNiwxXQ==" + "updated_at": "2019-11-13T14:52:15.591Z", + "version": "WzkwLDFd" }, { "type": "agents", - "id": "239d17a0-fa56-11e9-8237-65a0c5e0a0f7", + "id": "2e22f160-0625-11ea-bdb3-e10a3f6667b0", "attributes": { "shared_id": "agent14", "active": true, @@ -2316,12 +2316,12 @@ exports['AgentsRepository list should list all agents with showInactive set to t "enrolled_at": "2019-08-21T19:35:14.861Z" }, "references": [], - "updated_at": "2019-10-29T14:12:28.314Z", - "version": "WzEwNSwxXQ==" + "updated_at": "2019-11-13T14:52:14.582Z", + "version": "Wzg5LDFd" }, { "type": "agents", - "id": "23023730-fa56-11e9-8237-65a0c5e0a0f7", + "id": "2d88d440-0625-11ea-bdb3-e10a3f6667b0", "attributes": { "shared_id": "agent13", "active": true, @@ -2334,12 +2334,12 @@ exports['AgentsRepository list should list all agents with showInactive set to t "enrolled_at": "2019-08-20T19:35:14.861Z" }, "references": [], - "updated_at": "2019-10-29T14:12:27.299Z", - "version": "WzEwNCwxXQ==" + "updated_at": "2019-11-13T14:52:13.571Z", + "version": "Wzg4LDFd" }, { "type": "agents", - "id": "22677dd0-fa56-11e9-8237-65a0c5e0a0f7", + "id": "2ced7ea0-0625-11ea-bdb3-e10a3f6667b0", "attributes": { "shared_id": "agent12", "active": true, @@ -2352,12 +2352,12 @@ exports['AgentsRepository list should list all agents with showInactive set to t "enrolled_at": "2019-08-19T19:35:14.861Z" }, "references": [], - "updated_at": "2019-10-29T14:12:26.285Z", - "version": "WzEwMywxXQ==" + "updated_at": "2019-11-13T14:52:12.554Z", + "version": "Wzg3LDFd" }, { "type": "agents", - "id": "21cbda10-fa56-11e9-8237-65a0c5e0a0f7", + "id": "2c53afa0-0625-11ea-bdb3-e10a3f6667b0", "attributes": { "shared_id": "agent11", "active": true, @@ -2370,12 +2370,12 @@ exports['AgentsRepository list should list all agents with showInactive set to t "enrolled_at": "2019-08-18T19:35:14.861Z" }, "references": [], - "updated_at": "2019-10-29T14:12:25.265Z", - "version": "WzEwMiwxXQ==" + "updated_at": "2019-11-13T14:52:11.546Z", + "version": "Wzg2LDFd" }, { "type": "agents", - "id": "2130d290-fa56-11e9-8237-65a0c5e0a0f7", + "id": "2bb76fa0-0625-11ea-bdb3-e10a3f6667b0", "attributes": { "shared_id": "agent10", "active": true, @@ -2388,12 +2388,12 @@ exports['AgentsRepository list should list all agents with showInactive set to t "enrolled_at": "2019-08-17T19:35:14.861Z" }, "references": [], - "updated_at": "2019-10-29T14:12:24.249Z", - "version": "WzEwMSwxXQ==" + "updated_at": "2019-11-13T14:52:10.522Z", + "version": "Wzg1LDFd" }, { "type": "agents", - "id": "20964040-fa56-11e9-8237-65a0c5e0a0f7", + "id": "2b1dc7b0-0625-11ea-bdb3-e10a3f6667b0", "attributes": { "shared_id": "agent9", "active": true, @@ -2406,12 +2406,12 @@ exports['AgentsRepository list should list all agents with showInactive set to t "enrolled_at": "2019-08-16T19:35:14.861Z" }, "references": [], - "updated_at": "2019-10-29T14:12:23.236Z", - "version": "WzEwMCwxXQ==" + "updated_at": "2019-11-13T14:52:09.515Z", + "version": "Wzg0LDFd" }, { "type": "agents", - "id": "1ffbd500-fa56-11e9-8237-65a0c5e0a0f7", + "id": "2a846de0-0625-11ea-bdb3-e10a3f6667b0", "attributes": { "shared_id": "agent8", "active": true, @@ -2424,12 +2424,12 @@ exports['AgentsRepository list should list all agents with showInactive set to t "enrolled_at": "2019-08-15T19:35:14.861Z" }, "references": [], - "updated_at": "2019-10-29T14:12:22.224Z", - "version": "Wzk5LDFd" + "updated_at": "2019-11-13T14:52:08.510Z", + "version": "WzgzLDFd" }, { "type": "agents", - "id": "1f607f60-fa56-11e9-8237-65a0c5e0a0f7", + "id": "29e9b480-0625-11ea-bdb3-e10a3f6667b0", "attributes": { "shared_id": "agent7", "active": true, @@ -2442,12 +2442,12 @@ exports['AgentsRepository list should list all agents with showInactive set to t "enrolled_at": "2019-08-14T19:35:14.861Z" }, "references": [], - "updated_at": "2019-10-29T14:12:21.205Z", - "version": "Wzk4LDFd" + "updated_at": "2019-11-13T14:52:07.496Z", + "version": "WzgyLDFd" }, { "type": "agents", - "id": "1ec74ca0-fa56-11e9-8237-65a0c5e0a0f7", + "id": "294f9760-0625-11ea-bdb3-e10a3f6667b0", "attributes": { "shared_id": "agent6", "active": true, @@ -2460,12 +2460,12 @@ exports['AgentsRepository list should list all agents with showInactive set to t "enrolled_at": "2019-08-13T19:35:14.861Z" }, "references": [], - "updated_at": "2019-10-29T14:12:20.202Z", - "version": "Wzk3LDFd" + "updated_at": "2019-11-13T14:52:06.486Z", + "version": "WzgxLDFd" }, { "type": "agents", - "id": "1e2d0870-fa56-11e9-8237-65a0c5e0a0f7", + "id": "28b4b6f0-0625-11ea-bdb3-e10a3f6667b0", "attributes": { "shared_id": "agent5", "active": true, @@ -2478,12 +2478,12 @@ exports['AgentsRepository list should list all agents with showInactive set to t "enrolled_at": "2019-08-12T19:35:14.861Z" }, "references": [], - "updated_at": "2019-10-29T14:12:19.191Z", - "version": "Wzk2LDFd" + "updated_at": "2019-11-13T14:52:05.471Z", + "version": "WzgwLDFd" }, { "type": "agents", - "id": "1d90c870-fa56-11e9-8237-65a0c5e0a0f7", + "id": "281b5d20-0625-11ea-bdb3-e10a3f6667b0", "attributes": { "shared_id": "agent4", "active": true, @@ -2496,12 +2496,12 @@ exports['AgentsRepository list should list all agents with showInactive set to t "enrolled_at": "2019-08-11T19:35:14.861Z" }, "references": [], - "updated_at": "2019-10-29T14:12:18.167Z", - "version": "Wzk1LDFd" + "updated_at": "2019-11-13T14:52:04.466Z", + "version": "Wzc5LDFd" }, { "type": "agents", - "id": "1cf7e3d0-fa56-11e9-8237-65a0c5e0a0f7", + "id": "27758030-0625-11ea-bdb3-e10a3f6667b0", "attributes": { "shared_id": "agent3", "active": true, @@ -2514,12 +2514,12 @@ exports['AgentsRepository list should list all agents with showInactive set to t "enrolled_at": "2019-08-10T19:35:14.861Z" }, "references": [], - "updated_at": "2019-10-29T14:12:17.165Z", - "version": "Wzk0LDFd" + "updated_at": "2019-11-13T14:52:03.379Z", + "version": "Wzc4LDFd" }, { "type": "agents", - "id": "1c5b55b0-fa56-11e9-8237-65a0c5e0a0f7", + "id": "26d91920-0625-11ea-bdb3-e10a3f6667b0", "attributes": { "shared_id": "agent2", "active": true, @@ -2532,12 +2532,12 @@ exports['AgentsRepository list should list all agents with showInactive set to t "enrolled_at": "2019-08-09T19:35:14.861Z" }, "references": [], - "updated_at": "2019-10-29T14:12:16.138Z", - "version": "WzkzLDFd" + "updated_at": "2019-11-13T14:52:02.354Z", + "version": "Wzc3LDFd" }, { "type": "agents", - "id": "1bc186b0-fa56-11e9-8237-65a0c5e0a0f7", + "id": "262113c0-0625-11ea-bdb3-e10a3f6667b0", "attributes": { "shared_id": "agent1", "active": true, @@ -2550,12 +2550,12 @@ exports['AgentsRepository list should list all agents with showInactive set to t "enrolled_at": "2019-08-08T19:35:14.861Z" }, "references": [], - "updated_at": "2019-10-29T14:12:15.131Z", - "version": "WzkyLDFd" + "updated_at": "2019-11-13T14:52:01.148Z", + "version": "Wzc2LDFd" }, { "type": "agents", - "id": "1b26f460-fa56-11e9-8237-65a0c5e0a0f7", + "id": "25885630-0625-11ea-bdb3-e10a3f6667b0", "attributes": { "shared_id": "agent0", "active": true, @@ -2568,12 +2568,12 @@ exports['AgentsRepository list should list all agents with showInactive set to t "enrolled_at": "2019-08-07T19:35:14.861Z" }, "references": [], - "updated_at": "2019-10-29T14:12:14.118Z", - "version": "WzkxLDFd" + "updated_at": "2019-11-13T14:52:00.147Z", + "version": "Wzc1LDFd" }, { "type": "agents", - "id": "27d988d0-fa56-11e9-8237-65a0c5e0a0f7", + "id": "32609b10-0625-11ea-bdb3-e10a3f6667b0", "attributes": { "shared_id": "inactive_agent_2", "active": true, @@ -2583,16 +2583,16 @@ exports['AgentsRepository list should list all agents with showInactive set to t "version": "1", "local_metadata": "{\"host\":\"test.fr\"}", "user_provided_metadata": "{\"color\":\"red\"}", - "last_checkin": "2019-10-27T14:12:14.115Z", + "last_checkin": "2019-11-11T14:52:00.144Z", "enrolled_at": "2019-08-05T19:35:14.861Z" }, "references": [], - "updated_at": "2019-10-29T14:12:35.421Z", - "version": "WzExMiwxXQ==" + "updated_at": "2019-11-13T14:52:21.697Z", + "version": "Wzk2LDFd" }, { "type": "agents", - "id": "2873cd00-fa56-11e9-8237-65a0c5e0a0f7", + "id": "32fc17c0-0625-11ea-bdb3-e10a3f6667b0", "attributes": { "shared_id": "ephemeral1", "active": true, @@ -2602,12 +2602,12 @@ exports['AgentsRepository list should list all agents with showInactive set to t "version": "1", "local_metadata": "{\"host\":\"test.fr\"}", "user_provided_metadata": "{\"color\":\"red\"}", - "last_checkin": "2019-10-29T14:12:14.115Z", + "last_checkin": "2019-11-13T14:52:00.144Z", "enrolled_at": "2019-08-05T19:35:14.861Z" }, "references": [], - "updated_at": "2019-10-29T14:12:36.432Z", - "version": "WzExMywxXQ==" + "updated_at": "2019-11-13T14:52:22.716Z", + "version": "Wzk3LDFd" } ] } @@ -2621,9 +2621,9 @@ exports['AgentsRepository list should list all agents with showInactive set to t "saved_objects": [ { "type": "agents", - "id": "1bc186b0-fa56-11e9-8237-65a0c5e0a0f7", + "id": "25885630-0625-11ea-bdb3-e10a3f6667b0", "attributes": { - "shared_id": "agent1", + "shared_id": "agent0", "active": true, "access_api_key_id": "api_key_1", "policy_id": "policy_id_1", @@ -2631,17 +2631,17 @@ exports['AgentsRepository list should list all agents with showInactive set to t "version": "1", "local_metadata": "{\"host\":\"test.fr\"}", "user_provided_metadata": "{\"color\":\"red\"}", - "enrolled_at": "2019-08-08T19:35:14.861Z" + "enrolled_at": "2019-08-07T19:35:14.861Z" }, "references": [], - "updated_at": "2019-10-29T14:12:15.131Z", - "version": "WzkyLDFd" + "updated_at": "2019-11-13T14:52:00.147Z", + "version": "Wzc1LDFd" }, { "type": "agents", - "id": "1b26f460-fa56-11e9-8237-65a0c5e0a0f7", + "id": "26d91920-0625-11ea-bdb3-e10a3f6667b0", "attributes": { - "shared_id": "agent0", + "shared_id": "agent2", "active": true, "access_api_key_id": "api_key_1", "policy_id": "policy_id_1", @@ -2649,17 +2649,17 @@ exports['AgentsRepository list should list all agents with showInactive set to t "version": "1", "local_metadata": "{\"host\":\"test.fr\"}", "user_provided_metadata": "{\"color\":\"red\"}", - "enrolled_at": "2019-08-07T19:35:14.861Z" + "enrolled_at": "2019-08-09T19:35:14.861Z" }, "references": [], - "updated_at": "2019-10-29T14:12:14.118Z", - "version": "WzkxLDFd" + "updated_at": "2019-11-13T14:52:02.354Z", + "version": "Wzc3LDFd" }, { "type": "agents", - "id": "2130d290-fa56-11e9-8237-65a0c5e0a0f7", + "id": "27758030-0625-11ea-bdb3-e10a3f6667b0", "attributes": { - "shared_id": "agent10", + "shared_id": "agent3", "active": true, "access_api_key_id": "api_key_1", "policy_id": "policy_id_1", @@ -2667,17 +2667,17 @@ exports['AgentsRepository list should list all agents with showInactive set to t "version": "1", "local_metadata": "{\"host\":\"test.fr\"}", "user_provided_metadata": "{\"color\":\"red\"}", - "enrolled_at": "2019-08-17T19:35:14.861Z" + "enrolled_at": "2019-08-10T19:35:14.861Z" }, "references": [], - "updated_at": "2019-10-29T14:12:24.249Z", - "version": "WzEwMSwxXQ==" + "updated_at": "2019-11-13T14:52:03.379Z", + "version": "Wzc4LDFd" }, { "type": "agents", - "id": "1c5b55b0-fa56-11e9-8237-65a0c5e0a0f7", + "id": "281b5d20-0625-11ea-bdb3-e10a3f6667b0", "attributes": { - "shared_id": "agent2", + "shared_id": "agent4", "active": true, "access_api_key_id": "api_key_1", "policy_id": "policy_id_1", @@ -2685,17 +2685,17 @@ exports['AgentsRepository list should list all agents with showInactive set to t "version": "1", "local_metadata": "{\"host\":\"test.fr\"}", "user_provided_metadata": "{\"color\":\"red\"}", - "enrolled_at": "2019-08-09T19:35:14.861Z" + "enrolled_at": "2019-08-11T19:35:14.861Z" }, "references": [], - "updated_at": "2019-10-29T14:12:16.138Z", - "version": "WzkzLDFd" + "updated_at": "2019-11-13T14:52:04.466Z", + "version": "Wzc5LDFd" }, { "type": "agents", - "id": "1cf7e3d0-fa56-11e9-8237-65a0c5e0a0f7", + "id": "28b4b6f0-0625-11ea-bdb3-e10a3f6667b0", "attributes": { - "shared_id": "agent3", + "shared_id": "agent5", "active": true, "access_api_key_id": "api_key_1", "policy_id": "policy_id_1", @@ -2703,17 +2703,17 @@ exports['AgentsRepository list should list all agents with showInactive set to t "version": "1", "local_metadata": "{\"host\":\"test.fr\"}", "user_provided_metadata": "{\"color\":\"red\"}", - "enrolled_at": "2019-08-10T19:35:14.861Z" + "enrolled_at": "2019-08-12T19:35:14.861Z" }, "references": [], - "updated_at": "2019-10-29T14:12:17.165Z", - "version": "Wzk0LDFd" + "updated_at": "2019-11-13T14:52:05.471Z", + "version": "WzgwLDFd" }, { "type": "agents", - "id": "1d90c870-fa56-11e9-8237-65a0c5e0a0f7", + "id": "29e9b480-0625-11ea-bdb3-e10a3f6667b0", "attributes": { - "shared_id": "agent4", + "shared_id": "agent7", "active": true, "access_api_key_id": "api_key_1", "policy_id": "policy_id_1", @@ -2721,17 +2721,17 @@ exports['AgentsRepository list should list all agents with showInactive set to t "version": "1", "local_metadata": "{\"host\":\"test.fr\"}", "user_provided_metadata": "{\"color\":\"red\"}", - "enrolled_at": "2019-08-11T19:35:14.861Z" + "enrolled_at": "2019-08-14T19:35:14.861Z" }, "references": [], - "updated_at": "2019-10-29T14:12:18.167Z", - "version": "Wzk1LDFd" + "updated_at": "2019-11-13T14:52:07.496Z", + "version": "WzgyLDFd" }, { "type": "agents", - "id": "1e2d0870-fa56-11e9-8237-65a0c5e0a0f7", + "id": "2a846de0-0625-11ea-bdb3-e10a3f6667b0", "attributes": { - "shared_id": "agent5", + "shared_id": "agent8", "active": true, "access_api_key_id": "api_key_1", "policy_id": "policy_id_1", @@ -2739,17 +2739,17 @@ exports['AgentsRepository list should list all agents with showInactive set to t "version": "1", "local_metadata": "{\"host\":\"test.fr\"}", "user_provided_metadata": "{\"color\":\"red\"}", - "enrolled_at": "2019-08-12T19:35:14.861Z" + "enrolled_at": "2019-08-15T19:35:14.861Z" }, "references": [], - "updated_at": "2019-10-29T14:12:19.191Z", - "version": "Wzk2LDFd" + "updated_at": "2019-11-13T14:52:08.510Z", + "version": "WzgzLDFd" }, { "type": "agents", - "id": "1ec74ca0-fa56-11e9-8237-65a0c5e0a0f7", + "id": "2b1dc7b0-0625-11ea-bdb3-e10a3f6667b0", "attributes": { - "shared_id": "agent6", + "shared_id": "agent9", "active": true, "access_api_key_id": "api_key_1", "policy_id": "policy_id_1", @@ -2757,17 +2757,17 @@ exports['AgentsRepository list should list all agents with showInactive set to t "version": "1", "local_metadata": "{\"host\":\"test.fr\"}", "user_provided_metadata": "{\"color\":\"red\"}", - "enrolled_at": "2019-08-13T19:35:14.861Z" + "enrolled_at": "2019-08-16T19:35:14.861Z" }, "references": [], - "updated_at": "2019-10-29T14:12:20.202Z", - "version": "Wzk3LDFd" + "updated_at": "2019-11-13T14:52:09.515Z", + "version": "Wzg0LDFd" }, { "type": "agents", - "id": "1f607f60-fa56-11e9-8237-65a0c5e0a0f7", + "id": "262113c0-0625-11ea-bdb3-e10a3f6667b0", "attributes": { - "shared_id": "agent7", + "shared_id": "agent1", "active": true, "access_api_key_id": "api_key_1", "policy_id": "policy_id_1", @@ -2775,17 +2775,17 @@ exports['AgentsRepository list should list all agents with showInactive set to t "version": "1", "local_metadata": "{\"host\":\"test.fr\"}", "user_provided_metadata": "{\"color\":\"red\"}", - "enrolled_at": "2019-08-14T19:35:14.861Z" + "enrolled_at": "2019-08-08T19:35:14.861Z" }, "references": [], - "updated_at": "2019-10-29T14:12:21.205Z", - "version": "Wzk4LDFd" + "updated_at": "2019-11-13T14:52:01.148Z", + "version": "Wzc2LDFd" }, { "type": "agents", - "id": "1ffbd500-fa56-11e9-8237-65a0c5e0a0f7", + "id": "294f9760-0625-11ea-bdb3-e10a3f6667b0", "attributes": { - "shared_id": "agent8", + "shared_id": "agent6", "active": true, "access_api_key_id": "api_key_1", "policy_id": "policy_id_1", @@ -2793,17 +2793,17 @@ exports['AgentsRepository list should list all agents with showInactive set to t "version": "1", "local_metadata": "{\"host\":\"test.fr\"}", "user_provided_metadata": "{\"color\":\"red\"}", - "enrolled_at": "2019-08-15T19:35:14.861Z" + "enrolled_at": "2019-08-13T19:35:14.861Z" }, "references": [], - "updated_at": "2019-10-29T14:12:22.224Z", - "version": "Wzk5LDFd" + "updated_at": "2019-11-13T14:52:06.486Z", + "version": "WzgxLDFd" }, { "type": "agents", - "id": "20964040-fa56-11e9-8237-65a0c5e0a0f7", + "id": "2bb76fa0-0625-11ea-bdb3-e10a3f6667b0", "attributes": { - "shared_id": "agent9", + "shared_id": "agent10", "active": true, "access_api_key_id": "api_key_1", "policy_id": "policy_id_1", @@ -2811,15 +2811,15 @@ exports['AgentsRepository list should list all agents with showInactive set to t "version": "1", "local_metadata": "{\"host\":\"test.fr\"}", "user_provided_metadata": "{\"color\":\"red\"}", - "enrolled_at": "2019-08-16T19:35:14.861Z" + "enrolled_at": "2019-08-17T19:35:14.861Z" }, "references": [], - "updated_at": "2019-10-29T14:12:23.236Z", - "version": "WzEwMCwxXQ==" + "updated_at": "2019-11-13T14:52:10.522Z", + "version": "Wzg1LDFd" }, { "type": "agents", - "id": "22677dd0-fa56-11e9-8237-65a0c5e0a0f7", + "id": "2ced7ea0-0625-11ea-bdb3-e10a3f6667b0", "attributes": { "shared_id": "agent12", "active": true, @@ -2832,12 +2832,12 @@ exports['AgentsRepository list should list all agents with showInactive set to t "enrolled_at": "2019-08-19T19:35:14.861Z" }, "references": [], - "updated_at": "2019-10-29T14:12:26.285Z", - "version": "WzEwMywxXQ==" + "updated_at": "2019-11-13T14:52:12.554Z", + "version": "Wzg3LDFd" }, { "type": "agents", - "id": "23023730-fa56-11e9-8237-65a0c5e0a0f7", + "id": "2d88d440-0625-11ea-bdb3-e10a3f6667b0", "attributes": { "shared_id": "agent13", "active": true, @@ -2850,14 +2850,14 @@ exports['AgentsRepository list should list all agents with showInactive set to t "enrolled_at": "2019-08-20T19:35:14.861Z" }, "references": [], - "updated_at": "2019-10-29T14:12:27.299Z", - "version": "WzEwNCwxXQ==" + "updated_at": "2019-11-13T14:52:13.571Z", + "version": "Wzg4LDFd" }, { "type": "agents", - "id": "239d17a0-fa56-11e9-8237-65a0c5e0a0f7", + "id": "2ebce770-0625-11ea-bdb3-e10a3f6667b0", "attributes": { - "shared_id": "agent14", + "shared_id": "agent15", "active": true, "access_api_key_id": "api_key_1", "policy_id": "policy_id_1", @@ -2865,17 +2865,17 @@ exports['AgentsRepository list should list all agents with showInactive set to t "version": "1", "local_metadata": "{\"host\":\"test.fr\"}", "user_provided_metadata": "{\"color\":\"red\"}", - "enrolled_at": "2019-08-21T19:35:14.861Z" + "enrolled_at": "2019-08-22T19:35:14.861Z" }, "references": [], - "updated_at": "2019-10-29T14:12:28.314Z", - "version": "WzEwNSwxXQ==" + "updated_at": "2019-11-13T14:52:15.591Z", + "version": "WzkwLDFd" }, { "type": "agents", - "id": "24381f20-fa56-11e9-8237-65a0c5e0a0f7", + "id": "2f5779c0-0625-11ea-bdb3-e10a3f6667b0", "attributes": { - "shared_id": "agent15", + "shared_id": "agent16", "active": true, "access_api_key_id": "api_key_1", "policy_id": "policy_id_1", @@ -2883,17 +2883,17 @@ exports['AgentsRepository list should list all agents with showInactive set to t "version": "1", "local_metadata": "{\"host\":\"test.fr\"}", "user_provided_metadata": "{\"color\":\"red\"}", - "enrolled_at": "2019-08-22T19:35:14.861Z" + "enrolled_at": "2019-08-23T19:35:14.861Z" }, "references": [], - "updated_at": "2019-10-29T14:12:29.330Z", - "version": "WzEwNiwxXQ==" + "updated_at": "2019-11-13T14:52:16.604Z", + "version": "WzkxLDFd" }, { "type": "agents", - "id": "24d2b170-fa56-11e9-8237-65a0c5e0a0f7", + "id": "2ff56770-0625-11ea-bdb3-e10a3f6667b0", "attributes": { - "shared_id": "agent16", + "shared_id": "agent17", "active": true, "access_api_key_id": "api_key_1", "policy_id": "policy_id_1", @@ -2901,17 +2901,17 @@ exports['AgentsRepository list should list all agents with showInactive set to t "version": "1", "local_metadata": "{\"host\":\"test.fr\"}", "user_provided_metadata": "{\"color\":\"red\"}", - "enrolled_at": "2019-08-23T19:35:14.861Z" + "enrolled_at": "2019-08-24T19:35:14.861Z" }, "references": [], - "updated_at": "2019-10-29T14:12:30.343Z", - "version": "WzEwNywxXQ==" + "updated_at": "2019-11-13T14:52:17.639Z", + "version": "WzkyLDFd" }, { "type": "agents", - "id": "256d91e0-fa56-11e9-8237-65a0c5e0a0f7", + "id": "308faba0-0625-11ea-bdb3-e10a3f6667b0", "attributes": { - "shared_id": "agent17", + "shared_id": "agent18", "active": true, "access_api_key_id": "api_key_1", "policy_id": "policy_id_1", @@ -2919,17 +2919,17 @@ exports['AgentsRepository list should list all agents with showInactive set to t "version": "1", "local_metadata": "{\"host\":\"test.fr\"}", "user_provided_metadata": "{\"color\":\"red\"}", - "enrolled_at": "2019-08-24T19:35:14.861Z" + "enrolled_at": "2019-08-25T19:35:14.861Z" }, "references": [], - "updated_at": "2019-10-29T14:12:31.357Z", - "version": "WzEwOCwxXQ==" + "updated_at": "2019-11-13T14:52:18.650Z", + "version": "WzkzLDFd" }, { "type": "agents", - "id": "260760e0-fa56-11e9-8237-65a0c5e0a0f7", + "id": "2c53afa0-0625-11ea-bdb3-e10a3f6667b0", "attributes": { - "shared_id": "agent18", + "shared_id": "agent11", "active": true, "access_api_key_id": "api_key_1", "policy_id": "policy_id_1", @@ -2937,17 +2937,17 @@ exports['AgentsRepository list should list all agents with showInactive set to t "version": "1", "local_metadata": "{\"host\":\"test.fr\"}", "user_provided_metadata": "{\"color\":\"red\"}", - "enrolled_at": "2019-08-25T19:35:14.861Z" + "enrolled_at": "2019-08-18T19:35:14.861Z" }, "references": [], - "updated_at": "2019-10-29T14:12:32.365Z", - "version": "WzEwOSwxXQ==" + "updated_at": "2019-11-13T14:52:11.546Z", + "version": "Wzg2LDFd" }, { "type": "agents", - "id": "26a21a40-fa56-11e9-8237-65a0c5e0a0f7", + "id": "2e22f160-0625-11ea-bdb3-e10a3f6667b0", "attributes": { - "shared_id": "agent19", + "shared_id": "agent14", "active": true, "access_api_key_id": "api_key_1", "policy_id": "policy_id_1", @@ -2955,17 +2955,17 @@ exports['AgentsRepository list should list all agents with showInactive set to t "version": "1", "local_metadata": "{\"host\":\"test.fr\"}", "user_provided_metadata": "{\"color\":\"red\"}", - "enrolled_at": "2019-08-26T19:35:14.861Z" + "enrolled_at": "2019-08-21T19:35:14.861Z" }, "references": [], - "updated_at": "2019-10-29T14:12:33.380Z", - "version": "WzExMCwxXQ==" + "updated_at": "2019-11-13T14:52:14.582Z", + "version": "Wzg5LDFd" }, { "type": "agents", - "id": "21cbda10-fa56-11e9-8237-65a0c5e0a0f7", + "id": "312a3df0-0625-11ea-bdb3-e10a3f6667b0", "attributes": { - "shared_id": "agent11", + "shared_id": "agent19", "active": true, "access_api_key_id": "api_key_1", "policy_id": "policy_id_1", @@ -2973,15 +2973,15 @@ exports['AgentsRepository list should list all agents with showInactive set to t "version": "1", "local_metadata": "{\"host\":\"test.fr\"}", "user_provided_metadata": "{\"color\":\"red\"}", - "enrolled_at": "2019-08-18T19:35:14.861Z" + "enrolled_at": "2019-08-26T19:35:14.861Z" }, "references": [], - "updated_at": "2019-10-29T14:12:25.265Z", - "version": "WzEwMiwxXQ==" + "updated_at": "2019-11-13T14:52:19.663Z", + "version": "Wzk0LDFd" }, { "type": "agents", - "id": "273c3760-fa56-11e9-8237-65a0c5e0a0f7", + "id": "31c6a500-0625-11ea-bdb3-e10a3f6667b0", "attributes": { "shared_id": "inactive_agent_1", "active": false, @@ -2994,12 +2994,12 @@ exports['AgentsRepository list should list all agents with showInactive set to t "enrolled_at": "2019-11-13T20:35:14.861Z" }, "references": [], - "updated_at": "2019-10-29T14:12:34.390Z", - "version": "WzExMSwxXQ==" + "updated_at": "2019-11-13T14:52:20.688Z", + "version": "Wzk1LDFd" }, { "type": "agents", - "id": "27d988d0-fa56-11e9-8237-65a0c5e0a0f7", + "id": "32609b10-0625-11ea-bdb3-e10a3f6667b0", "attributes": { "shared_id": "inactive_agent_2", "active": true, @@ -3009,16 +3009,16 @@ exports['AgentsRepository list should list all agents with showInactive set to t "version": "1", "local_metadata": "{\"host\":\"test.fr\"}", "user_provided_metadata": "{\"color\":\"red\"}", - "last_checkin": "2019-10-27T14:12:14.115Z", + "last_checkin": "2019-11-11T14:52:00.144Z", "enrolled_at": "2019-08-05T19:35:14.861Z" }, "references": [], - "updated_at": "2019-10-29T14:12:35.421Z", - "version": "WzExMiwxXQ==" + "updated_at": "2019-11-13T14:52:21.697Z", + "version": "Wzk2LDFd" }, { "type": "agents", - "id": "2873cd00-fa56-11e9-8237-65a0c5e0a0f7", + "id": "32fc17c0-0625-11ea-bdb3-e10a3f6667b0", "attributes": { "shared_id": "ephemeral1", "active": true, @@ -3028,113 +3028,113 @@ exports['AgentsRepository list should list all agents with showInactive set to t "version": "1", "local_metadata": "{\"host\":\"test.fr\"}", "user_provided_metadata": "{\"color\":\"red\"}", - "last_checkin": "2019-10-29T14:12:14.115Z", + "last_checkin": "2019-11-13T14:52:00.144Z", "enrolled_at": "2019-08-05T19:35:14.861Z" }, "references": [], - "updated_at": "2019-10-29T14:12:36.432Z", - "version": "WzExMywxXQ==" + "updated_at": "2019-11-13T14:52:22.716Z", + "version": "Wzk3LDFd" } ] } } -exports['AgentsRepository list should list all agents with showInactive set to true - delete:agents:1bc186b0-fa56-11e9-8237-65a0c5e0a0f7:{} (26)'] = { +exports['AgentsRepository list should list all agents with showInactive set to true - delete (26)'] = { "results": {} } -exports['AgentsRepository list should list all agents with showInactive set to true - delete:agents:1b26f460-fa56-11e9-8237-65a0c5e0a0f7:{} (27)'] = { +exports['AgentsRepository list should list all agents with showInactive set to true - delete (27)'] = { "results": {} } -exports['AgentsRepository list should list all agents with showInactive set to true - delete:agents:2130d290-fa56-11e9-8237-65a0c5e0a0f7:{} (28)'] = { +exports['AgentsRepository list should list all agents with showInactive set to true - delete (28)'] = { "results": {} } -exports['AgentsRepository list should list all agents with showInactive set to true - delete:agents:1c5b55b0-fa56-11e9-8237-65a0c5e0a0f7:{} (29)'] = { +exports['AgentsRepository list should list all agents with showInactive set to true - delete (29)'] = { "results": {} } -exports['AgentsRepository list should list all agents with showInactive set to true - delete:agents:1cf7e3d0-fa56-11e9-8237-65a0c5e0a0f7:{} (30)'] = { +exports['AgentsRepository list should list all agents with showInactive set to true - delete (30)'] = { "results": {} } -exports['AgentsRepository list should list all agents with showInactive set to true - delete:agents:1d90c870-fa56-11e9-8237-65a0c5e0a0f7:{} (31)'] = { +exports['AgentsRepository list should list all agents with showInactive set to true - delete (31)'] = { "results": {} } -exports['AgentsRepository list should list all agents with showInactive set to true - delete:agents:1e2d0870-fa56-11e9-8237-65a0c5e0a0f7:{} (32)'] = { +exports['AgentsRepository list should list all agents with showInactive set to true - delete (32)'] = { "results": {} } -exports['AgentsRepository list should list all agents with showInactive set to true - delete:agents:1ec74ca0-fa56-11e9-8237-65a0c5e0a0f7:{} (33)'] = { +exports['AgentsRepository list should list all agents with showInactive set to true - delete (33)'] = { "results": {} } -exports['AgentsRepository list should list all agents with showInactive set to true - delete:agents:1f607f60-fa56-11e9-8237-65a0c5e0a0f7:{} (34)'] = { +exports['AgentsRepository list should list all agents with showInactive set to true - delete (34)'] = { "results": {} } -exports['AgentsRepository list should list all agents with showInactive set to true - delete:agents:1ffbd500-fa56-11e9-8237-65a0c5e0a0f7:{} (35)'] = { +exports['AgentsRepository list should list all agents with showInactive set to true - delete (35)'] = { "results": {} } -exports['AgentsRepository list should list all agents with showInactive set to true - delete:agents:20964040-fa56-11e9-8237-65a0c5e0a0f7:{} (36)'] = { +exports['AgentsRepository list should list all agents with showInactive set to true - delete (36)'] = { "results": {} } -exports['AgentsRepository list should list all agents with showInactive set to true - delete:agents:22677dd0-fa56-11e9-8237-65a0c5e0a0f7:{} (37)'] = { +exports['AgentsRepository list should list all agents with showInactive set to true - delete (37)'] = { "results": {} } -exports['AgentsRepository list should list all agents with showInactive set to true - delete:agents:23023730-fa56-11e9-8237-65a0c5e0a0f7:{} (38)'] = { +exports['AgentsRepository list should list all agents with showInactive set to true - delete (38)'] = { "results": {} } -exports['AgentsRepository list should list all agents with showInactive set to true - delete:agents:239d17a0-fa56-11e9-8237-65a0c5e0a0f7:{} (39)'] = { +exports['AgentsRepository list should list all agents with showInactive set to true - delete (39)'] = { "results": {} } -exports['AgentsRepository list should list all agents with showInactive set to true - delete:agents:24381f20-fa56-11e9-8237-65a0c5e0a0f7:{} (40)'] = { +exports['AgentsRepository list should list all agents with showInactive set to true - delete (40)'] = { "results": {} } -exports['AgentsRepository list should list all agents with showInactive set to true - delete:agents:24d2b170-fa56-11e9-8237-65a0c5e0a0f7:{} (41)'] = { +exports['AgentsRepository list should list all agents with showInactive set to true - delete (41)'] = { "results": {} } -exports['AgentsRepository list should list all agents with showInactive set to true - delete:agents:256d91e0-fa56-11e9-8237-65a0c5e0a0f7:{} (42)'] = { +exports['AgentsRepository list should list all agents with showInactive set to true - delete (42)'] = { "results": {} } -exports['AgentsRepository list should list all agents with showInactive set to true - delete:agents:260760e0-fa56-11e9-8237-65a0c5e0a0f7:{} (43)'] = { +exports['AgentsRepository list should list all agents with showInactive set to true - delete (43)'] = { "results": {} } -exports['AgentsRepository list should list all agents with showInactive set to true - delete:agents:26a21a40-fa56-11e9-8237-65a0c5e0a0f7:{} (44)'] = { +exports['AgentsRepository list should list all agents with showInactive set to true - delete (44)'] = { "results": {} } -exports['AgentsRepository list should list all agents with showInactive set to true - delete:agents:21cbda10-fa56-11e9-8237-65a0c5e0a0f7:{} (45)'] = { +exports['AgentsRepository list should list all agents with showInactive set to true - delete (45)'] = { "results": {} } -exports['AgentsRepository list should list all agents with showInactive set to true - delete:agents:273c3760-fa56-11e9-8237-65a0c5e0a0f7:{} (46)'] = { +exports['AgentsRepository list should list all agents with showInactive set to true - delete (46)'] = { "results": {} } -exports['AgentsRepository list should list all agents with showInactive set to true - delete:agents:27d988d0-fa56-11e9-8237-65a0c5e0a0f7:{} (47)'] = { +exports['AgentsRepository list should list all agents with showInactive set to true - delete (47)'] = { "results": {} } -exports['AgentsRepository list should list all agents with showInactive set to true - delete:agents:2873cd00-fa56-11e9-8237-65a0c5e0a0f7:{} (48)'] = { +exports['AgentsRepository list should list all agents with showInactive set to true - delete (48)'] = { "results": {} } exports['AgentsRepository list should support to sort by enrolled_at date ASC - create:agents (1)'] = { "results": { "type": "agents", - "id": "36f443a0-fa56-11e9-8237-65a0c5e0a0f7", + "id": "41856800-0625-11ea-bdb3-e10a3f6667b0", "attributes": { "shared_id": "agent0", "active": true, @@ -3147,15 +3147,15 @@ exports['AgentsRepository list should support to sort by enrolled_at date ASC - "enrolled_at": "2019-08-07T19:35:14.861Z" }, "references": [], - "updated_at": "2019-10-29T14:13:00.762Z", - "version": "WzEzNywxXQ==" + "updated_at": "2019-11-13T14:52:47.104Z", + "version": "WzEyMSwxXQ==" } } exports['AgentsRepository list should support to sort by enrolled_at date ASC - create:agents (2)'] = { "results": { "type": "agents", - "id": "378dc480-fa56-11e9-8237-65a0c5e0a0f7", + "id": "422132d0-0625-11ea-bdb3-e10a3f6667b0", "attributes": { "shared_id": "agent1", "active": true, @@ -3168,15 +3168,15 @@ exports['AgentsRepository list should support to sort by enrolled_at date ASC - "enrolled_at": "2019-08-08T19:35:14.861Z" }, "references": [], - "updated_at": "2019-10-29T14:13:01.768Z", - "version": "WzEzOCwxXQ==" + "updated_at": "2019-11-13T14:52:48.125Z", + "version": "WzEyMiwxXQ==" } } exports['AgentsRepository list should support to sort by enrolled_at date ASC - create:agents (3)'] = { "results": { "type": "agents", - "id": "382a79b0-fa56-11e9-8237-65a0c5e0a0f7", + "id": "42bbc520-0625-11ea-bdb3-e10a3f6667b0", "attributes": { "shared_id": "agent2", "active": true, @@ -3189,15 +3189,15 @@ exports['AgentsRepository list should support to sort by enrolled_at date ASC - "enrolled_at": "2019-08-09T19:35:14.861Z" }, "references": [], - "updated_at": "2019-10-29T14:13:02.795Z", - "version": "WzEzOSwxXQ==" + "updated_at": "2019-11-13T14:52:49.137Z", + "version": "WzEyMywxXQ==" } } exports['AgentsRepository list should support to sort by enrolled_at date ASC - create:agents (4)'] = { "results": { "type": "agents", - "id": "38c46fc0-fa56-11e9-8237-65a0c5e0a0f7", + "id": "4356a590-0625-11ea-bdb3-e10a3f6667b0", "attributes": { "shared_id": "agent3", "active": true, @@ -3210,15 +3210,15 @@ exports['AgentsRepository list should support to sort by enrolled_at date ASC - "enrolled_at": "2019-08-10T19:35:14.861Z" }, "references": [], - "updated_at": "2019-10-29T14:13:03.804Z", - "version": "WzE0MCwxXQ==" + "updated_at": "2019-11-13T14:52:50.153Z", + "version": "WzEyNCwxXQ==" } } exports['AgentsRepository list should support to sort by enrolled_at date ASC - create:agents (5)'] = { "results": { "type": "agents", - "id": "395fec70-fa56-11e9-8237-65a0c5e0a0f7", + "id": "43f22240-0625-11ea-bdb3-e10a3f6667b0", "attributes": { "shared_id": "agent4", "active": true, @@ -3231,15 +3231,15 @@ exports['AgentsRepository list should support to sort by enrolled_at date ASC - "enrolled_at": "2019-08-11T19:35:14.861Z" }, "references": [], - "updated_at": "2019-10-29T14:13:04.823Z", - "version": "WzE0MSwxXQ==" + "updated_at": "2019-11-13T14:52:51.172Z", + "version": "WzEyNSwxXQ==" } } exports['AgentsRepository list should support to sort by enrolled_at date ASC - create:agents (6)'] = { "results": { "type": "agents", - "id": "39fa57b0-fa56-11e9-8237-65a0c5e0a0f7", + "id": "44a8ef20-0625-11ea-bdb3-e10a3f6667b0", "attributes": { "shared_id": "agent5", "active": true, @@ -3252,15 +3252,15 @@ exports['AgentsRepository list should support to sort by enrolled_at date ASC - "enrolled_at": "2019-08-12T19:35:14.861Z" }, "references": [], - "updated_at": "2019-10-29T14:13:05.834Z", - "version": "WzE0MiwxXQ==" + "updated_at": "2019-11-13T14:52:52.370Z", + "version": "WzEyNiwxXQ==" } } exports['AgentsRepository list should support to sort by enrolled_at date ASC - create:agents (7)'] = { "results": { "type": "agents", - "id": "3a93ffa0-fa56-11e9-8237-65a0c5e0a0f7", + "id": "45441db0-0625-11ea-bdb3-e10a3f6667b0", "attributes": { "shared_id": "agent6", "active": true, @@ -3273,15 +3273,15 @@ exports['AgentsRepository list should support to sort by enrolled_at date ASC - "enrolled_at": "2019-08-13T19:35:14.861Z" }, "references": [], - "updated_at": "2019-10-29T14:13:06.842Z", - "version": "WzE0MywxXQ==" + "updated_at": "2019-11-13T14:52:53.387Z", + "version": "WzEyNywxXQ==" } } exports['AgentsRepository list should support to sort by enrolled_at date ASC - create:agents (8)'] = { "results": { "type": "agents", - "id": "3b2e43d0-fa56-11e9-8237-65a0c5e0a0f7", + "id": "45e76290-0625-11ea-bdb3-e10a3f6667b0", "attributes": { "shared_id": "agent7", "active": true, @@ -3294,15 +3294,15 @@ exports['AgentsRepository list should support to sort by enrolled_at date ASC - "enrolled_at": "2019-08-14T19:35:14.861Z" }, "references": [], - "updated_at": "2019-10-29T14:13:07.853Z", - "version": "WzE0NCwxXQ==" + "updated_at": "2019-11-13T14:52:54.457Z", + "version": "WzEyOCwxXQ==" } } exports['AgentsRepository list should support to sort by enrolled_at date ASC - create:agents (9)'] = { "results": { "type": "agents", - "id": "3bc88800-fa56-11e9-8237-65a0c5e0a0f7", + "id": "46821bf0-0625-11ea-bdb3-e10a3f6667b0", "attributes": { "shared_id": "agent8", "active": true, @@ -3315,15 +3315,15 @@ exports['AgentsRepository list should support to sort by enrolled_at date ASC - "enrolled_at": "2019-08-15T19:35:14.861Z" }, "references": [], - "updated_at": "2019-10-29T14:13:08.863Z", - "version": "WzE0NSwxXQ==" + "updated_at": "2019-11-13T14:52:55.471Z", + "version": "WzEyOSwxXQ==" } } exports['AgentsRepository list should support to sort by enrolled_at date ASC - create:agents (10)'] = { "results": { "type": "agents", - "id": "3c62cc30-fa56-11e9-8237-65a0c5e0a0f7", + "id": "471f6d60-0625-11ea-bdb3-e10a3f6667b0", "attributes": { "shared_id": "agent9", "active": true, @@ -3336,15 +3336,15 @@ exports['AgentsRepository list should support to sort by enrolled_at date ASC - "enrolled_at": "2019-08-16T19:35:14.861Z" }, "references": [], - "updated_at": "2019-10-29T14:13:09.875Z", - "version": "WzE0NiwxXQ==" + "updated_at": "2019-11-13T14:52:56.502Z", + "version": "WzEzMCwxXQ==" } } exports['AgentsRepository list should support to sort by enrolled_at date ASC - create:agents (11)'] = { "results": { "type": "agents", - "id": "3cfbfef0-fa56-11e9-8237-65a0c5e0a0f7", + "id": "47baea10-0625-11ea-bdb3-e10a3f6667b0", "attributes": { "shared_id": "agent10", "active": true, @@ -3357,15 +3357,15 @@ exports['AgentsRepository list should support to sort by enrolled_at date ASC - "enrolled_at": "2019-08-17T19:35:14.861Z" }, "references": [], - "updated_at": "2019-10-29T14:13:10.879Z", - "version": "WzE0NywxXQ==" + "updated_at": "2019-11-13T14:52:57.521Z", + "version": "WzEzMSwxXQ==" } } exports['AgentsRepository list should support to sort by enrolled_at date ASC - create:agents (12)'] = { "results": { "type": "agents", - "id": "3d98b420-fa56-11e9-8237-65a0c5e0a0f7", + "id": "48552e40-0625-11ea-bdb3-e10a3f6667b0", "attributes": { "shared_id": "agent11", "active": true, @@ -3378,15 +3378,15 @@ exports['AgentsRepository list should support to sort by enrolled_at date ASC - "enrolled_at": "2019-08-18T19:35:14.861Z" }, "references": [], - "updated_at": "2019-10-29T14:13:11.906Z", - "version": "WzE0OCwxXQ==" + "updated_at": "2019-11-13T14:52:58.532Z", + "version": "WzEzMiwxXQ==" } } exports['AgentsRepository list should support to sort by enrolled_at date ASC - create:agents (13)'] = { "results": { "type": "agents", - "id": "3e331f60-fa56-11e9-8237-65a0c5e0a0f7", + "id": "48f16e40-0625-11ea-bdb3-e10a3f6667b0", "attributes": { "shared_id": "agent12", "active": true, @@ -3399,15 +3399,15 @@ exports['AgentsRepository list should support to sort by enrolled_at date ASC - "enrolled_at": "2019-08-19T19:35:14.861Z" }, "references": [], - "updated_at": "2019-10-29T14:13:12.918Z", - "version": "WzE0OSwxXQ==" + "updated_at": "2019-11-13T14:52:59.556Z", + "version": "WzEzMywxXQ==" } } exports['AgentsRepository list should support to sort by enrolled_at date ASC - create:agents (14)'] = { "results": { "type": "agents", - "id": "3ecd1570-fa56-11e9-8237-65a0c5e0a0f7", + "id": "498a04c0-0625-11ea-bdb3-e10a3f6667b0", "attributes": { "shared_id": "agent13", "active": true, @@ -3420,15 +3420,15 @@ exports['AgentsRepository list should support to sort by enrolled_at date ASC - "enrolled_at": "2019-08-20T19:35:14.861Z" }, "references": [], - "updated_at": "2019-10-29T14:13:13.927Z", - "version": "WzE1MCwxXQ==" + "updated_at": "2019-11-13T14:53:00.556Z", + "version": "WzEzNCwxXQ==" } } exports['AgentsRepository list should support to sort by enrolled_at date ASC - create:agents (15)'] = { "results": { "type": "agents", - "id": "3f66bd60-fa56-11e9-8237-65a0c5e0a0f7", + "id": "4a249710-0625-11ea-bdb3-e10a3f6667b0", "attributes": { "shared_id": "agent14", "active": true, @@ -3441,15 +3441,15 @@ exports['AgentsRepository list should support to sort by enrolled_at date ASC - "enrolled_at": "2019-08-21T19:35:14.861Z" }, "references": [], - "updated_at": "2019-10-29T14:13:14.934Z", - "version": "WzE1MSwxXQ==" + "updated_at": "2019-11-13T14:53:01.569Z", + "version": "WzEzNSwxXQ==" } } exports['AgentsRepository list should support to sort by enrolled_at date ASC - create:agents (16)'] = { "results": { "type": "agents", - "id": "400128a0-fa56-11e9-8237-65a0c5e0a0f7", + "id": "4abd54a0-0625-11ea-bdb3-e10a3f6667b0", "attributes": { "shared_id": "agent15", "active": true, @@ -3462,15 +3462,15 @@ exports['AgentsRepository list should support to sort by enrolled_at date ASC - "enrolled_at": "2019-08-22T19:35:14.861Z" }, "references": [], - "updated_at": "2019-10-29T14:13:15.945Z", - "version": "WzE1MiwxXQ==" + "updated_at": "2019-11-13T14:53:02.570Z", + "version": "WzEzNiwxXQ==" } } exports['AgentsRepository list should support to sort by enrolled_at date ASC - create:agents (17)'] = { "results": { "type": "agents", - "id": "409af7a0-fa56-11e9-8237-65a0c5e0a0f7", + "id": "4b5a09d0-0625-11ea-bdb3-e10a3f6667b0", "attributes": { "shared_id": "agent16", "active": true, @@ -3483,15 +3483,15 @@ exports['AgentsRepository list should support to sort by enrolled_at date ASC - "enrolled_at": "2019-08-23T19:35:14.861Z" }, "references": [], - "updated_at": "2019-10-29T14:13:16.954Z", - "version": "WzE1MywxXQ==" + "updated_at": "2019-11-13T14:53:03.597Z", + "version": "WzEzNywxXQ==" } } exports['AgentsRepository list should support to sort by enrolled_at date ASC - create:agents (18)'] = { "results": { "type": "agents", - "id": "41336710-fa56-11e9-8237-65a0c5e0a0f7", + "id": "4bf3ffe0-0625-11ea-bdb3-e10a3f6667b0", "attributes": { "shared_id": "agent17", "active": true, @@ -3504,15 +3504,15 @@ exports['AgentsRepository list should support to sort by enrolled_at date ASC - "enrolled_at": "2019-08-24T19:35:14.861Z" }, "references": [], - "updated_at": "2019-10-29T14:13:17.953Z", - "version": "WzE1NCwxXQ==" + "updated_at": "2019-11-13T14:53:04.606Z", + "version": "WzEzOCwxXQ==" } } exports['AgentsRepository list should support to sort by enrolled_at date ASC - create:agents (19)'] = { "results": { "type": "agents", - "id": "41d01c40-fa56-11e9-8237-65a0c5e0a0f7", + "id": "4c8e6b20-0625-11ea-bdb3-e10a3f6667b0", "attributes": { "shared_id": "agent18", "active": true, @@ -3525,15 +3525,15 @@ exports['AgentsRepository list should support to sort by enrolled_at date ASC - "enrolled_at": "2019-08-25T19:35:14.861Z" }, "references": [], - "updated_at": "2019-10-29T14:13:18.979Z", - "version": "WzE1NSwxXQ==" + "updated_at": "2019-11-13T14:53:05.618Z", + "version": "WzEzOSwxXQ==" } } exports['AgentsRepository list should support to sort by enrolled_at date ASC - create:agents (20)'] = { "results": { "type": "agents", - "id": "4269c430-fa56-11e9-8237-65a0c5e0a0f7", + "id": "4d2aab20-0625-11ea-bdb3-e10a3f6667b0", "attributes": { "shared_id": "agent19", "active": true, @@ -3546,15 +3546,15 @@ exports['AgentsRepository list should support to sort by enrolled_at date ASC - "enrolled_at": "2019-08-26T19:35:14.861Z" }, "references": [], - "updated_at": "2019-10-29T14:13:19.987Z", - "version": "WzE1NiwxXQ==" + "updated_at": "2019-11-13T14:53:06.642Z", + "version": "WzE0MCwxXQ==" } } exports['AgentsRepository list should support to sort by enrolled_at date ASC - create:agents (21)'] = { "results": { "type": "agents", - "id": "430540e0-fa56-11e9-8237-65a0c5e0a0f7", + "id": "4dc51660-0625-11ea-bdb3-e10a3f6667b0", "attributes": { "shared_id": "inactive_agent_1", "active": false, @@ -3567,15 +3567,15 @@ exports['AgentsRepository list should support to sort by enrolled_at date ASC - "enrolled_at": "2019-11-13T20:35:14.861Z" }, "references": [], - "updated_at": "2019-10-29T14:13:21.005Z", - "version": "WzE1NywxXQ==" + "updated_at": "2019-11-13T14:53:07.654Z", + "version": "WzE0MSwxXQ==" } } exports['AgentsRepository list should support to sort by enrolled_at date ASC - create:agents (22)'] = { "results": { "type": "agents", - "id": "439f0fe0-fa56-11e9-8237-65a0c5e0a0f7", + "id": "4e5fcfc0-0625-11ea-bdb3-e10a3f6667b0", "attributes": { "shared_id": "inactive_agent_2", "active": true, @@ -3585,19 +3585,19 @@ exports['AgentsRepository list should support to sort by enrolled_at date ASC - "version": "1", "local_metadata": "{\"host\":\"test.fr\"}", "user_provided_metadata": "{\"color\":\"red\"}", - "last_checkin": "2019-10-27T14:13:00.758Z", + "last_checkin": "2019-11-11T14:52:47.100Z", "enrolled_at": "2019-08-05T19:35:14.861Z" }, "references": [], - "updated_at": "2019-10-29T14:13:22.014Z", - "version": "WzE1OCwxXQ==" + "updated_at": "2019-11-13T14:53:08.668Z", + "version": "WzE0MiwxXQ==" } } exports['AgentsRepository list should support to sort by enrolled_at date ASC - create:agents (23)'] = { "results": { "type": "agents", - "id": "443a1760-fa56-11e9-8237-65a0c5e0a0f7", + "id": "4efa8920-0625-11ea-bdb3-e10a3f6667b0", "attributes": { "shared_id": "ephemeral1", "active": true, @@ -3607,12 +3607,12 @@ exports['AgentsRepository list should support to sort by enrolled_at date ASC - "version": "1", "local_metadata": "{\"host\":\"test.fr\"}", "user_provided_metadata": "{\"color\":\"red\"}", - "last_checkin": "2019-10-29T14:13:00.758Z", + "last_checkin": "2019-11-13T14:52:47.100Z", "enrolled_at": "2019-08-05T19:35:14.861Z" }, "references": [], - "updated_at": "2019-10-29T14:13:23.030Z", - "version": "WzE1OSwxXQ==" + "updated_at": "2019-11-13T14:53:09.681Z", + "version": "WzE0MywxXQ==" } } @@ -3624,7 +3624,7 @@ exports['AgentsRepository list should support to sort by enrolled_at date ASC - "saved_objects": [ { "type": "agents", - "id": "443a1760-fa56-11e9-8237-65a0c5e0a0f7", + "id": "4efa8920-0625-11ea-bdb3-e10a3f6667b0", "attributes": { "shared_id": "ephemeral1", "active": true, @@ -3634,16 +3634,16 @@ exports['AgentsRepository list should support to sort by enrolled_at date ASC - "version": "1", "local_metadata": "{\"host\":\"test.fr\"}", "user_provided_metadata": "{\"color\":\"red\"}", - "last_checkin": "2019-10-29T14:13:00.758Z", + "last_checkin": "2019-11-13T14:52:47.100Z", "enrolled_at": "2019-08-05T19:35:14.861Z" }, "references": [], - "updated_at": "2019-10-29T14:13:23.030Z", - "version": "WzE1OSwxXQ==" + "updated_at": "2019-11-13T14:53:09.681Z", + "version": "WzE0MywxXQ==" }, { "type": "agents", - "id": "36f443a0-fa56-11e9-8237-65a0c5e0a0f7", + "id": "41856800-0625-11ea-bdb3-e10a3f6667b0", "attributes": { "shared_id": "agent0", "active": true, @@ -3656,12 +3656,12 @@ exports['AgentsRepository list should support to sort by enrolled_at date ASC - "enrolled_at": "2019-08-07T19:35:14.861Z" }, "references": [], - "updated_at": "2019-10-29T14:13:00.762Z", - "version": "WzEzNywxXQ==" + "updated_at": "2019-11-13T14:52:47.104Z", + "version": "WzEyMSwxXQ==" }, { "type": "agents", - "id": "378dc480-fa56-11e9-8237-65a0c5e0a0f7", + "id": "422132d0-0625-11ea-bdb3-e10a3f6667b0", "attributes": { "shared_id": "agent1", "active": true, @@ -3674,8 +3674,8 @@ exports['AgentsRepository list should support to sort by enrolled_at date ASC - "enrolled_at": "2019-08-08T19:35:14.861Z" }, "references": [], - "updated_at": "2019-10-29T14:13:01.768Z", - "version": "WzEzOCwxXQ==" + "updated_at": "2019-11-13T14:52:48.125Z", + "version": "WzEyMiwxXQ==" } ] } @@ -3689,7 +3689,7 @@ exports['AgentsRepository list should support to sort by enrolled_at date ASC - "saved_objects": [ { "type": "agents", - "id": "36f443a0-fa56-11e9-8237-65a0c5e0a0f7", + "id": "41856800-0625-11ea-bdb3-e10a3f6667b0", "attributes": { "shared_id": "agent0", "active": true, @@ -3702,12 +3702,12 @@ exports['AgentsRepository list should support to sort by enrolled_at date ASC - "enrolled_at": "2019-08-07T19:35:14.861Z" }, "references": [], - "updated_at": "2019-10-29T14:13:00.762Z", - "version": "WzEzNywxXQ==" + "updated_at": "2019-11-13T14:52:47.104Z", + "version": "WzEyMSwxXQ==" }, { "type": "agents", - "id": "382a79b0-fa56-11e9-8237-65a0c5e0a0f7", + "id": "42bbc520-0625-11ea-bdb3-e10a3f6667b0", "attributes": { "shared_id": "agent2", "active": true, @@ -3720,12 +3720,12 @@ exports['AgentsRepository list should support to sort by enrolled_at date ASC - "enrolled_at": "2019-08-09T19:35:14.861Z" }, "references": [], - "updated_at": "2019-10-29T14:13:02.795Z", - "version": "WzEzOSwxXQ==" + "updated_at": "2019-11-13T14:52:49.137Z", + "version": "WzEyMywxXQ==" }, { "type": "agents", - "id": "38c46fc0-fa56-11e9-8237-65a0c5e0a0f7", + "id": "4356a590-0625-11ea-bdb3-e10a3f6667b0", "attributes": { "shared_id": "agent3", "active": true, @@ -3738,12 +3738,12 @@ exports['AgentsRepository list should support to sort by enrolled_at date ASC - "enrolled_at": "2019-08-10T19:35:14.861Z" }, "references": [], - "updated_at": "2019-10-29T14:13:03.804Z", - "version": "WzE0MCwxXQ==" + "updated_at": "2019-11-13T14:52:50.153Z", + "version": "WzEyNCwxXQ==" }, { "type": "agents", - "id": "395fec70-fa56-11e9-8237-65a0c5e0a0f7", + "id": "43f22240-0625-11ea-bdb3-e10a3f6667b0", "attributes": { "shared_id": "agent4", "active": true, @@ -3756,12 +3756,12 @@ exports['AgentsRepository list should support to sort by enrolled_at date ASC - "enrolled_at": "2019-08-11T19:35:14.861Z" }, "references": [], - "updated_at": "2019-10-29T14:13:04.823Z", - "version": "WzE0MSwxXQ==" + "updated_at": "2019-11-13T14:52:51.172Z", + "version": "WzEyNSwxXQ==" }, { "type": "agents", - "id": "39fa57b0-fa56-11e9-8237-65a0c5e0a0f7", + "id": "44a8ef20-0625-11ea-bdb3-e10a3f6667b0", "attributes": { "shared_id": "agent5", "active": true, @@ -3774,14 +3774,14 @@ exports['AgentsRepository list should support to sort by enrolled_at date ASC - "enrolled_at": "2019-08-12T19:35:14.861Z" }, "references": [], - "updated_at": "2019-10-29T14:13:05.834Z", - "version": "WzE0MiwxXQ==" + "updated_at": "2019-11-13T14:52:52.370Z", + "version": "WzEyNiwxXQ==" }, { "type": "agents", - "id": "3a93ffa0-fa56-11e9-8237-65a0c5e0a0f7", + "id": "45e76290-0625-11ea-bdb3-e10a3f6667b0", "attributes": { - "shared_id": "agent6", + "shared_id": "agent7", "active": true, "access_api_key_id": "api_key_1", "policy_id": "policy_id_1", @@ -3789,17 +3789,17 @@ exports['AgentsRepository list should support to sort by enrolled_at date ASC - "version": "1", "local_metadata": "{\"host\":\"test.fr\"}", "user_provided_metadata": "{\"color\":\"red\"}", - "enrolled_at": "2019-08-13T19:35:14.861Z" + "enrolled_at": "2019-08-14T19:35:14.861Z" }, "references": [], - "updated_at": "2019-10-29T14:13:06.842Z", - "version": "WzE0MywxXQ==" + "updated_at": "2019-11-13T14:52:54.457Z", + "version": "WzEyOCwxXQ==" }, { "type": "agents", - "id": "3b2e43d0-fa56-11e9-8237-65a0c5e0a0f7", + "id": "46821bf0-0625-11ea-bdb3-e10a3f6667b0", "attributes": { - "shared_id": "agent7", + "shared_id": "agent8", "active": true, "access_api_key_id": "api_key_1", "policy_id": "policy_id_1", @@ -3807,17 +3807,17 @@ exports['AgentsRepository list should support to sort by enrolled_at date ASC - "version": "1", "local_metadata": "{\"host\":\"test.fr\"}", "user_provided_metadata": "{\"color\":\"red\"}", - "enrolled_at": "2019-08-14T19:35:14.861Z" + "enrolled_at": "2019-08-15T19:35:14.861Z" }, "references": [], - "updated_at": "2019-10-29T14:13:07.853Z", - "version": "WzE0NCwxXQ==" + "updated_at": "2019-11-13T14:52:55.471Z", + "version": "WzEyOSwxXQ==" }, { "type": "agents", - "id": "3bc88800-fa56-11e9-8237-65a0c5e0a0f7", + "id": "422132d0-0625-11ea-bdb3-e10a3f6667b0", "attributes": { - "shared_id": "agent8", + "shared_id": "agent1", "active": true, "access_api_key_id": "api_key_1", "policy_id": "policy_id_1", @@ -3825,17 +3825,17 @@ exports['AgentsRepository list should support to sort by enrolled_at date ASC - "version": "1", "local_metadata": "{\"host\":\"test.fr\"}", "user_provided_metadata": "{\"color\":\"red\"}", - "enrolled_at": "2019-08-15T19:35:14.861Z" + "enrolled_at": "2019-08-08T19:35:14.861Z" }, "references": [], - "updated_at": "2019-10-29T14:13:08.863Z", - "version": "WzE0NSwxXQ==" + "updated_at": "2019-11-13T14:52:48.125Z", + "version": "WzEyMiwxXQ==" }, { "type": "agents", - "id": "3c62cc30-fa56-11e9-8237-65a0c5e0a0f7", + "id": "45441db0-0625-11ea-bdb3-e10a3f6667b0", "attributes": { - "shared_id": "agent9", + "shared_id": "agent6", "active": true, "access_api_key_id": "api_key_1", "policy_id": "policy_id_1", @@ -3843,17 +3843,17 @@ exports['AgentsRepository list should support to sort by enrolled_at date ASC - "version": "1", "local_metadata": "{\"host\":\"test.fr\"}", "user_provided_metadata": "{\"color\":\"red\"}", - "enrolled_at": "2019-08-16T19:35:14.861Z" + "enrolled_at": "2019-08-13T19:35:14.861Z" }, "references": [], - "updated_at": "2019-10-29T14:13:09.875Z", - "version": "WzE0NiwxXQ==" + "updated_at": "2019-11-13T14:52:53.387Z", + "version": "WzEyNywxXQ==" }, { "type": "agents", - "id": "378dc480-fa56-11e9-8237-65a0c5e0a0f7", + "id": "47baea10-0625-11ea-bdb3-e10a3f6667b0", "attributes": { - "shared_id": "agent1", + "shared_id": "agent10", "active": true, "access_api_key_id": "api_key_1", "policy_id": "policy_id_1", @@ -3861,17 +3861,17 @@ exports['AgentsRepository list should support to sort by enrolled_at date ASC - "version": "1", "local_metadata": "{\"host\":\"test.fr\"}", "user_provided_metadata": "{\"color\":\"red\"}", - "enrolled_at": "2019-08-08T19:35:14.861Z" + "enrolled_at": "2019-08-17T19:35:14.861Z" }, "references": [], - "updated_at": "2019-10-29T14:13:01.768Z", - "version": "WzEzOCwxXQ==" + "updated_at": "2019-11-13T14:52:57.521Z", + "version": "WzEzMSwxXQ==" }, { "type": "agents", - "id": "3cfbfef0-fa56-11e9-8237-65a0c5e0a0f7", + "id": "48f16e40-0625-11ea-bdb3-e10a3f6667b0", "attributes": { - "shared_id": "agent10", + "shared_id": "agent12", "active": true, "access_api_key_id": "api_key_1", "policy_id": "policy_id_1", @@ -3879,17 +3879,17 @@ exports['AgentsRepository list should support to sort by enrolled_at date ASC - "version": "1", "local_metadata": "{\"host\":\"test.fr\"}", "user_provided_metadata": "{\"color\":\"red\"}", - "enrolled_at": "2019-08-17T19:35:14.861Z" + "enrolled_at": "2019-08-19T19:35:14.861Z" }, "references": [], - "updated_at": "2019-10-29T14:13:10.879Z", - "version": "WzE0NywxXQ==" + "updated_at": "2019-11-13T14:52:59.556Z", + "version": "WzEzMywxXQ==" }, { "type": "agents", - "id": "3e331f60-fa56-11e9-8237-65a0c5e0a0f7", + "id": "498a04c0-0625-11ea-bdb3-e10a3f6667b0", "attributes": { - "shared_id": "agent12", + "shared_id": "agent13", "active": true, "access_api_key_id": "api_key_1", "policy_id": "policy_id_1", @@ -3897,17 +3897,17 @@ exports['AgentsRepository list should support to sort by enrolled_at date ASC - "version": "1", "local_metadata": "{\"host\":\"test.fr\"}", "user_provided_metadata": "{\"color\":\"red\"}", - "enrolled_at": "2019-08-19T19:35:14.861Z" + "enrolled_at": "2019-08-20T19:35:14.861Z" }, "references": [], - "updated_at": "2019-10-29T14:13:12.918Z", - "version": "WzE0OSwxXQ==" + "updated_at": "2019-11-13T14:53:00.556Z", + "version": "WzEzNCwxXQ==" }, { "type": "agents", - "id": "3ecd1570-fa56-11e9-8237-65a0c5e0a0f7", + "id": "4a249710-0625-11ea-bdb3-e10a3f6667b0", "attributes": { - "shared_id": "agent13", + "shared_id": "agent14", "active": true, "access_api_key_id": "api_key_1", "policy_id": "policy_id_1", @@ -3915,15 +3915,15 @@ exports['AgentsRepository list should support to sort by enrolled_at date ASC - "version": "1", "local_metadata": "{\"host\":\"test.fr\"}", "user_provided_metadata": "{\"color\":\"red\"}", - "enrolled_at": "2019-08-20T19:35:14.861Z" + "enrolled_at": "2019-08-21T19:35:14.861Z" }, "references": [], - "updated_at": "2019-10-29T14:13:13.927Z", - "version": "WzE1MCwxXQ==" + "updated_at": "2019-11-13T14:53:01.569Z", + "version": "WzEzNSwxXQ==" }, { "type": "agents", - "id": "400128a0-fa56-11e9-8237-65a0c5e0a0f7", + "id": "4abd54a0-0625-11ea-bdb3-e10a3f6667b0", "attributes": { "shared_id": "agent15", "active": true, @@ -3936,12 +3936,12 @@ exports['AgentsRepository list should support to sort by enrolled_at date ASC - "enrolled_at": "2019-08-22T19:35:14.861Z" }, "references": [], - "updated_at": "2019-10-29T14:13:15.945Z", - "version": "WzE1MiwxXQ==" + "updated_at": "2019-11-13T14:53:02.570Z", + "version": "WzEzNiwxXQ==" }, { "type": "agents", - "id": "409af7a0-fa56-11e9-8237-65a0c5e0a0f7", + "id": "4b5a09d0-0625-11ea-bdb3-e10a3f6667b0", "attributes": { "shared_id": "agent16", "active": true, @@ -3954,12 +3954,12 @@ exports['AgentsRepository list should support to sort by enrolled_at date ASC - "enrolled_at": "2019-08-23T19:35:14.861Z" }, "references": [], - "updated_at": "2019-10-29T14:13:16.954Z", - "version": "WzE1MywxXQ==" + "updated_at": "2019-11-13T14:53:03.597Z", + "version": "WzEzNywxXQ==" }, { "type": "agents", - "id": "41336710-fa56-11e9-8237-65a0c5e0a0f7", + "id": "4bf3ffe0-0625-11ea-bdb3-e10a3f6667b0", "attributes": { "shared_id": "agent17", "active": true, @@ -3972,14 +3972,14 @@ exports['AgentsRepository list should support to sort by enrolled_at date ASC - "enrolled_at": "2019-08-24T19:35:14.861Z" }, "references": [], - "updated_at": "2019-10-29T14:13:17.953Z", - "version": "WzE1NCwxXQ==" + "updated_at": "2019-11-13T14:53:04.606Z", + "version": "WzEzOCwxXQ==" }, { "type": "agents", - "id": "41d01c40-fa56-11e9-8237-65a0c5e0a0f7", + "id": "48552e40-0625-11ea-bdb3-e10a3f6667b0", "attributes": { - "shared_id": "agent18", + "shared_id": "agent11", "active": true, "access_api_key_id": "api_key_1", "policy_id": "policy_id_1", @@ -3987,17 +3987,17 @@ exports['AgentsRepository list should support to sort by enrolled_at date ASC - "version": "1", "local_metadata": "{\"host\":\"test.fr\"}", "user_provided_metadata": "{\"color\":\"red\"}", - "enrolled_at": "2019-08-25T19:35:14.861Z" + "enrolled_at": "2019-08-18T19:35:14.861Z" }, "references": [], - "updated_at": "2019-10-29T14:13:18.979Z", - "version": "WzE1NSwxXQ==" + "updated_at": "2019-11-13T14:52:58.532Z", + "version": "WzEzMiwxXQ==" }, { "type": "agents", - "id": "3d98b420-fa56-11e9-8237-65a0c5e0a0f7", + "id": "471f6d60-0625-11ea-bdb3-e10a3f6667b0", "attributes": { - "shared_id": "agent11", + "shared_id": "agent9", "active": true, "access_api_key_id": "api_key_1", "policy_id": "policy_id_1", @@ -4005,17 +4005,17 @@ exports['AgentsRepository list should support to sort by enrolled_at date ASC - "version": "1", "local_metadata": "{\"host\":\"test.fr\"}", "user_provided_metadata": "{\"color\":\"red\"}", - "enrolled_at": "2019-08-18T19:35:14.861Z" + "enrolled_at": "2019-08-16T19:35:14.861Z" }, "references": [], - "updated_at": "2019-10-29T14:13:11.906Z", - "version": "WzE0OCwxXQ==" + "updated_at": "2019-11-13T14:52:56.502Z", + "version": "WzEzMCwxXQ==" }, { "type": "agents", - "id": "3f66bd60-fa56-11e9-8237-65a0c5e0a0f7", + "id": "4c8e6b20-0625-11ea-bdb3-e10a3f6667b0", "attributes": { - "shared_id": "agent14", + "shared_id": "agent18", "active": true, "access_api_key_id": "api_key_1", "policy_id": "policy_id_1", @@ -4023,15 +4023,15 @@ exports['AgentsRepository list should support to sort by enrolled_at date ASC - "version": "1", "local_metadata": "{\"host\":\"test.fr\"}", "user_provided_metadata": "{\"color\":\"red\"}", - "enrolled_at": "2019-08-21T19:35:14.861Z" + "enrolled_at": "2019-08-25T19:35:14.861Z" }, "references": [], - "updated_at": "2019-10-29T14:13:14.934Z", - "version": "WzE1MSwxXQ==" + "updated_at": "2019-11-13T14:53:05.618Z", + "version": "WzEzOSwxXQ==" }, { "type": "agents", - "id": "4269c430-fa56-11e9-8237-65a0c5e0a0f7", + "id": "4d2aab20-0625-11ea-bdb3-e10a3f6667b0", "attributes": { "shared_id": "agent19", "active": true, @@ -4044,12 +4044,12 @@ exports['AgentsRepository list should support to sort by enrolled_at date ASC - "enrolled_at": "2019-08-26T19:35:14.861Z" }, "references": [], - "updated_at": "2019-10-29T14:13:19.987Z", - "version": "WzE1NiwxXQ==" + "updated_at": "2019-11-13T14:53:06.642Z", + "version": "WzE0MCwxXQ==" }, { "type": "agents", - "id": "430540e0-fa56-11e9-8237-65a0c5e0a0f7", + "id": "4dc51660-0625-11ea-bdb3-e10a3f6667b0", "attributes": { "shared_id": "inactive_agent_1", "active": false, @@ -4062,12 +4062,12 @@ exports['AgentsRepository list should support to sort by enrolled_at date ASC - "enrolled_at": "2019-11-13T20:35:14.861Z" }, "references": [], - "updated_at": "2019-10-29T14:13:21.005Z", - "version": "WzE1NywxXQ==" + "updated_at": "2019-11-13T14:53:07.654Z", + "version": "WzE0MSwxXQ==" }, { "type": "agents", - "id": "439f0fe0-fa56-11e9-8237-65a0c5e0a0f7", + "id": "4e5fcfc0-0625-11ea-bdb3-e10a3f6667b0", "attributes": { "shared_id": "inactive_agent_2", "active": true, @@ -4077,16 +4077,16 @@ exports['AgentsRepository list should support to sort by enrolled_at date ASC - "version": "1", "local_metadata": "{\"host\":\"test.fr\"}", "user_provided_metadata": "{\"color\":\"red\"}", - "last_checkin": "2019-10-27T14:13:00.758Z", + "last_checkin": "2019-11-11T14:52:47.100Z", "enrolled_at": "2019-08-05T19:35:14.861Z" }, "references": [], - "updated_at": "2019-10-29T14:13:22.014Z", - "version": "WzE1OCwxXQ==" + "updated_at": "2019-11-13T14:53:08.668Z", + "version": "WzE0MiwxXQ==" }, { "type": "agents", - "id": "443a1760-fa56-11e9-8237-65a0c5e0a0f7", + "id": "4efa8920-0625-11ea-bdb3-e10a3f6667b0", "attributes": { "shared_id": "ephemeral1", "active": true, @@ -4096,113 +4096,113 @@ exports['AgentsRepository list should support to sort by enrolled_at date ASC - "version": "1", "local_metadata": "{\"host\":\"test.fr\"}", "user_provided_metadata": "{\"color\":\"red\"}", - "last_checkin": "2019-10-29T14:13:00.758Z", + "last_checkin": "2019-11-13T14:52:47.100Z", "enrolled_at": "2019-08-05T19:35:14.861Z" }, "references": [], - "updated_at": "2019-10-29T14:13:23.030Z", - "version": "WzE1OSwxXQ==" + "updated_at": "2019-11-13T14:53:09.681Z", + "version": "WzE0MywxXQ==" } ] } } -exports['AgentsRepository list should support to sort by enrolled_at date ASC - delete:agents:36f443a0-fa56-11e9-8237-65a0c5e0a0f7:{} (26)'] = { +exports['AgentsRepository list should support to sort by enrolled_at date ASC - delete (26)'] = { "results": {} } -exports['AgentsRepository list should support to sort by enrolled_at date ASC - delete:agents:382a79b0-fa56-11e9-8237-65a0c5e0a0f7:{} (27)'] = { +exports['AgentsRepository list should support to sort by enrolled_at date ASC - delete (27)'] = { "results": {} } -exports['AgentsRepository list should support to sort by enrolled_at date ASC - delete:agents:38c46fc0-fa56-11e9-8237-65a0c5e0a0f7:{} (28)'] = { +exports['AgentsRepository list should support to sort by enrolled_at date ASC - delete (28)'] = { "results": {} } -exports['AgentsRepository list should support to sort by enrolled_at date ASC - delete:agents:395fec70-fa56-11e9-8237-65a0c5e0a0f7:{} (29)'] = { +exports['AgentsRepository list should support to sort by enrolled_at date ASC - delete (29)'] = { "results": {} } -exports['AgentsRepository list should support to sort by enrolled_at date ASC - delete:agents:39fa57b0-fa56-11e9-8237-65a0c5e0a0f7:{} (30)'] = { +exports['AgentsRepository list should support to sort by enrolled_at date ASC - delete (30)'] = { "results": {} } -exports['AgentsRepository list should support to sort by enrolled_at date ASC - delete:agents:3a93ffa0-fa56-11e9-8237-65a0c5e0a0f7:{} (31)'] = { +exports['AgentsRepository list should support to sort by enrolled_at date ASC - delete (31)'] = { "results": {} } -exports['AgentsRepository list should support to sort by enrolled_at date ASC - delete:agents:3b2e43d0-fa56-11e9-8237-65a0c5e0a0f7:{} (32)'] = { +exports['AgentsRepository list should support to sort by enrolled_at date ASC - delete (32)'] = { "results": {} } -exports['AgentsRepository list should support to sort by enrolled_at date ASC - delete:agents:3bc88800-fa56-11e9-8237-65a0c5e0a0f7:{} (33)'] = { +exports['AgentsRepository list should support to sort by enrolled_at date ASC - delete (33)'] = { "results": {} } -exports['AgentsRepository list should support to sort by enrolled_at date ASC - delete:agents:3c62cc30-fa56-11e9-8237-65a0c5e0a0f7:{} (34)'] = { +exports['AgentsRepository list should support to sort by enrolled_at date ASC - delete (34)'] = { "results": {} } -exports['AgentsRepository list should support to sort by enrolled_at date ASC - delete:agents:378dc480-fa56-11e9-8237-65a0c5e0a0f7:{} (35)'] = { +exports['AgentsRepository list should support to sort by enrolled_at date ASC - delete (35)'] = { "results": {} } -exports['AgentsRepository list should support to sort by enrolled_at date ASC - delete:agents:3cfbfef0-fa56-11e9-8237-65a0c5e0a0f7:{} (36)'] = { +exports['AgentsRepository list should support to sort by enrolled_at date ASC - delete (36)'] = { "results": {} } -exports['AgentsRepository list should support to sort by enrolled_at date ASC - delete:agents:3e331f60-fa56-11e9-8237-65a0c5e0a0f7:{} (37)'] = { +exports['AgentsRepository list should support to sort by enrolled_at date ASC - delete (37)'] = { "results": {} } -exports['AgentsRepository list should support to sort by enrolled_at date ASC - delete:agents:3ecd1570-fa56-11e9-8237-65a0c5e0a0f7:{} (38)'] = { +exports['AgentsRepository list should support to sort by enrolled_at date ASC - delete (38)'] = { "results": {} } -exports['AgentsRepository list should support to sort by enrolled_at date ASC - delete:agents:400128a0-fa56-11e9-8237-65a0c5e0a0f7:{} (39)'] = { +exports['AgentsRepository list should support to sort by enrolled_at date ASC - delete (39)'] = { "results": {} } -exports['AgentsRepository list should support to sort by enrolled_at date ASC - delete:agents:409af7a0-fa56-11e9-8237-65a0c5e0a0f7:{} (40)'] = { +exports['AgentsRepository list should support to sort by enrolled_at date ASC - delete (40)'] = { "results": {} } -exports['AgentsRepository list should support to sort by enrolled_at date ASC - delete:agents:41336710-fa56-11e9-8237-65a0c5e0a0f7:{} (41)'] = { +exports['AgentsRepository list should support to sort by enrolled_at date ASC - delete (41)'] = { "results": {} } -exports['AgentsRepository list should support to sort by enrolled_at date ASC - delete:agents:41d01c40-fa56-11e9-8237-65a0c5e0a0f7:{} (42)'] = { +exports['AgentsRepository list should support to sort by enrolled_at date ASC - delete (42)'] = { "results": {} } -exports['AgentsRepository list should support to sort by enrolled_at date ASC - delete:agents:3d98b420-fa56-11e9-8237-65a0c5e0a0f7:{} (43)'] = { +exports['AgentsRepository list should support to sort by enrolled_at date ASC - delete (43)'] = { "results": {} } -exports['AgentsRepository list should support to sort by enrolled_at date ASC - delete:agents:3f66bd60-fa56-11e9-8237-65a0c5e0a0f7:{} (44)'] = { +exports['AgentsRepository list should support to sort by enrolled_at date ASC - delete (44)'] = { "results": {} } -exports['AgentsRepository list should support to sort by enrolled_at date ASC - delete:agents:4269c430-fa56-11e9-8237-65a0c5e0a0f7:{} (45)'] = { +exports['AgentsRepository list should support to sort by enrolled_at date ASC - delete (45)'] = { "results": {} } -exports['AgentsRepository list should support to sort by enrolled_at date ASC - delete:agents:430540e0-fa56-11e9-8237-65a0c5e0a0f7:{} (46)'] = { +exports['AgentsRepository list should support to sort by enrolled_at date ASC - delete (46)'] = { "results": {} } -exports['AgentsRepository list should support to sort by enrolled_at date ASC - delete:agents:439f0fe0-fa56-11e9-8237-65a0c5e0a0f7:{} (47)'] = { +exports['AgentsRepository list should support to sort by enrolled_at date ASC - delete (47)'] = { "results": {} } -exports['AgentsRepository list should support to sort by enrolled_at date ASC - delete:agents:443a1760-fa56-11e9-8237-65a0c5e0a0f7:{} (48)'] = { +exports['AgentsRepository list should support to sort by enrolled_at date ASC - delete (48)'] = { "results": {} } exports['AgentsRepository list should support to sort by enrolled_at date DESC - create:agents (1)'] = { "results": { "type": "agents", - "id": "52ba8e00-fa56-11e9-8237-65a0c5e0a0f7", + "id": "5d7f4580-0625-11ea-bdb3-e10a3f6667b0", "attributes": { "shared_id": "agent0", "active": true, @@ -4215,15 +4215,15 @@ exports['AgentsRepository list should support to sort by enrolled_at date DESC - "enrolled_at": "2019-08-07T19:35:14.861Z" }, "references": [], - "updated_at": "2019-10-29T14:13:47.360Z", - "version": "WzE4MywxXQ==" + "updated_at": "2019-11-13T14:53:34.040Z", + "version": "WzE2NywxXQ==" } } exports['AgentsRepository list should support to sort by enrolled_at date DESC - create:agents (2)'] = { "results": { "type": "agents", - "id": "535631c0-fa56-11e9-8237-65a0c5e0a0f7", + "id": "5e1a25f0-0625-11ea-bdb3-e10a3f6667b0", "attributes": { "shared_id": "agent1", "active": true, @@ -4236,15 +4236,15 @@ exports['AgentsRepository list should support to sort by enrolled_at date DESC - "enrolled_at": "2019-08-08T19:35:14.861Z" }, "references": [], - "updated_at": "2019-10-29T14:13:48.380Z", - "version": "WzE4NCwxXQ==" + "updated_at": "2019-11-13T14:53:35.055Z", + "version": "WzE2OCwxXQ==" } } exports['AgentsRepository list should support to sort by enrolled_at date DESC - create:agents (3)'] = { "results": { "type": "agents", - "id": "53f18760-fa56-11e9-8237-65a0c5e0a0f7", + "id": "5eb55480-0625-11ea-bdb3-e10a3f6667b0", "attributes": { "shared_id": "agent2", "active": true, @@ -4257,15 +4257,15 @@ exports['AgentsRepository list should support to sort by enrolled_at date DESC - "enrolled_at": "2019-08-09T19:35:14.861Z" }, "references": [], - "updated_at": "2019-10-29T14:13:49.398Z", - "version": "WzE4NSwxXQ==" + "updated_at": "2019-11-13T14:53:36.072Z", + "version": "WzE2OSwxXQ==" } } exports['AgentsRepository list should support to sort by enrolled_at date DESC - create:agents (4)'] = { "results": { "type": "agents", - "id": "548bcb90-fa56-11e9-8237-65a0c5e0a0f7", + "id": "5f4fbfc0-0625-11ea-bdb3-e10a3f6667b0", "attributes": { "shared_id": "agent3", "active": true, @@ -4278,15 +4278,15 @@ exports['AgentsRepository list should support to sort by enrolled_at date DESC - "enrolled_at": "2019-08-10T19:35:14.861Z" }, "references": [], - "updated_at": "2019-10-29T14:13:50.409Z", - "version": "WzE4NiwxXQ==" + "updated_at": "2019-11-13T14:53:37.084Z", + "version": "WzE3MCwxXQ==" } } exports['AgentsRepository list should support to sort by enrolled_at date DESC - create:agents (5)'] = { "results": { "type": "agents", - "id": "5525c1a0-fa56-11e9-8237-65a0c5e0a0f7", + "id": "5fe9b5d0-0625-11ea-bdb3-e10a3f6667b0", "attributes": { "shared_id": "agent4", "active": true, @@ -4299,15 +4299,15 @@ exports['AgentsRepository list should support to sort by enrolled_at date DESC - "enrolled_at": "2019-08-11T19:35:14.861Z" }, "references": [], - "updated_at": "2019-10-29T14:13:51.418Z", - "version": "WzE4NywxXQ==" + "updated_at": "2019-11-13T14:53:38.093Z", + "version": "WzE3MSwxXQ==" } } exports['AgentsRepository list should support to sort by enrolled_at date DESC - create:agents (6)'] = { "results": { "type": "agents", - "id": "55c005d0-fa56-11e9-8237-65a0c5e0a0f7", + "id": "6085a7b0-0625-11ea-bdb3-e10a3f6667b0", "attributes": { "shared_id": "agent5", "active": true, @@ -4320,15 +4320,15 @@ exports['AgentsRepository list should support to sort by enrolled_at date DESC - "enrolled_at": "2019-08-12T19:35:14.861Z" }, "references": [], - "updated_at": "2019-10-29T14:13:52.429Z", - "version": "WzE4OCwxXQ==" + "updated_at": "2019-11-13T14:53:39.115Z", + "version": "WzE3MiwxXQ==" } } exports['AgentsRepository list should support to sort by enrolled_at date DESC - create:agents (7)'] = { "results": { "type": "agents", - "id": "565a9820-fa56-11e9-8237-65a0c5e0a0f7", + "id": "611f2890-0625-11ea-bdb3-e10a3f6667b0", "attributes": { "shared_id": "agent6", "active": true, @@ -4341,15 +4341,15 @@ exports['AgentsRepository list should support to sort by enrolled_at date DESC - "enrolled_at": "2019-08-13T19:35:14.861Z" }, "references": [], - "updated_at": "2019-10-29T14:13:53.442Z", - "version": "WzE4OSwxXQ==" + "updated_at": "2019-11-13T14:53:40.121Z", + "version": "WzE3MywxXQ==" } } exports['AgentsRepository list should support to sort by enrolled_at date DESC - create:agents (8)'] = { "results": { "type": "agents", - "id": "56f44010-fa56-11e9-8237-65a0c5e0a0f7", + "id": "61ba0900-0625-11ea-bdb3-e10a3f6667b0", "attributes": { "shared_id": "agent7", "active": true, @@ -4362,15 +4362,15 @@ exports['AgentsRepository list should support to sort by enrolled_at date DESC - "enrolled_at": "2019-08-14T19:35:14.861Z" }, "references": [], - "updated_at": "2019-10-29T14:13:54.448Z", - "version": "WzE5MCwxXQ==" + "updated_at": "2019-11-13T14:53:41.136Z", + "version": "WzE3NCwxXQ==" } } exports['AgentsRepository list should support to sort by enrolled_at date DESC - create:agents (9)'] = { "results": { "type": "agents", - "id": "578ed260-fa56-11e9-8237-65a0c5e0a0f7", + "id": "625362d0-0625-11ea-bdb3-e10a3f6667b0", "attributes": { "shared_id": "agent8", "active": true, @@ -4383,15 +4383,15 @@ exports['AgentsRepository list should support to sort by enrolled_at date DESC - "enrolled_at": "2019-08-15T19:35:14.861Z" }, "references": [], - "updated_at": "2019-10-29T14:13:55.462Z", - "version": "WzE5MSwxXQ==" + "updated_at": "2019-11-13T14:53:42.141Z", + "version": "WzE3NSwxXQ==" } } exports['AgentsRepository list should support to sort by enrolled_at date DESC - create:agents (10)'] = { "results": { "type": "agents", - "id": "58280520-fa56-11e9-8237-65a0c5e0a0f7", + "id": "62f15080-0625-11ea-bdb3-e10a3f6667b0", "attributes": { "shared_id": "agent9", "active": true, @@ -4404,15 +4404,15 @@ exports['AgentsRepository list should support to sort by enrolled_at date DESC - "enrolled_at": "2019-08-16T19:35:14.861Z" }, "references": [], - "updated_at": "2019-10-29T14:13:56.466Z", - "version": "WzE5MiwxXQ==" + "updated_at": "2019-11-13T14:53:43.176Z", + "version": "WzE3NiwxXQ==" } } exports['AgentsRepository list should support to sort by enrolled_at date DESC - create:agents (11)'] = { "results": { "type": "agents", - "id": "58c2be80-fa56-11e9-8237-65a0c5e0a0f7", + "id": "63a7a830-0625-11ea-bdb3-e10a3f6667b0", "attributes": { "shared_id": "agent10", "active": true, @@ -4425,15 +4425,15 @@ exports['AgentsRepository list should support to sort by enrolled_at date DESC - "enrolled_at": "2019-08-17T19:35:14.861Z" }, "references": [], - "updated_at": "2019-10-29T14:13:57.480Z", - "version": "WzE5MywxXQ==" + "updated_at": "2019-11-13T14:53:44.371Z", + "version": "WzE3NywxXQ==" } } exports['AgentsRepository list should support to sort by enrolled_at date DESC - create:agents (12)'] = { "results": { "type": "agents", - "id": "595e1420-fa56-11e9-8237-65a0c5e0a0f7", + "id": "644288a0-0625-11ea-bdb3-e10a3f6667b0", "attributes": { "shared_id": "agent11", "active": true, @@ -4446,15 +4446,15 @@ exports['AgentsRepository list should support to sort by enrolled_at date DESC - "enrolled_at": "2019-08-18T19:35:14.861Z" }, "references": [], - "updated_at": "2019-10-29T14:13:58.498Z", - "version": "WzE5NCwxXQ==" + "updated_at": "2019-11-13T14:53:45.386Z", + "version": "WzE3OCwxXQ==" } } exports['AgentsRepository list should support to sort by enrolled_at date DESC - create:agents (13)'] = { "results": { "type": "agents", - "id": "59f8a670-fa56-11e9-8237-65a0c5e0a0f7", + "id": "64e6b7e0-0625-11ea-bdb3-e10a3f6667b0", "attributes": { "shared_id": "agent12", "active": true, @@ -4467,15 +4467,15 @@ exports['AgentsRepository list should support to sort by enrolled_at date DESC - "enrolled_at": "2019-08-19T19:35:14.861Z" }, "references": [], - "updated_at": "2019-10-29T14:13:59.511Z", - "version": "WzE5NSwxXQ==" + "updated_at": "2019-11-13T14:53:46.462Z", + "version": "WzE3OSwxXQ==" } } exports['AgentsRepository list should support to sort by enrolled_at date DESC - create:agents (14)'] = { "results": { "type": "agents", - "id": "5a92c390-fa56-11e9-8237-65a0c5e0a0f7", + "id": "6582d0d0-0625-11ea-bdb3-e10a3f6667b0", "attributes": { "shared_id": "agent13", "active": true, @@ -4488,15 +4488,15 @@ exports['AgentsRepository list should support to sort by enrolled_at date DESC - "enrolled_at": "2019-08-20T19:35:14.861Z" }, "references": [], - "updated_at": "2019-10-29T14:14:00.521Z", - "version": "WzE5NiwxXQ==" + "updated_at": "2019-11-13T14:53:47.485Z", + "version": "WzE4MCwxXQ==" } } exports['AgentsRepository list should support to sort by enrolled_at date DESC - create:agents (15)'] = { "results": { "type": "agents", - "id": "5b2f9fd0-fa56-11e9-8237-65a0c5e0a0f7", + "id": "661d1500-0625-11ea-bdb3-e10a3f6667b0", "attributes": { "shared_id": "agent14", "active": true, @@ -4509,15 +4509,15 @@ exports['AgentsRepository list should support to sort by enrolled_at date DESC - "enrolled_at": "2019-08-21T19:35:14.861Z" }, "references": [], - "updated_at": "2019-10-29T14:14:01.549Z", - "version": "WzE5NywxXQ==" + "updated_at": "2019-11-13T14:53:48.496Z", + "version": "WzE4MSwxXQ==" } } exports['AgentsRepository list should support to sort by enrolled_at date DESC - create:agents (16)'] = { "results": { "type": "agents", - "id": "5bc995e0-fa56-11e9-8237-65a0c5e0a0f7", + "id": "66b7ce60-0625-11ea-bdb3-e10a3f6667b0", "attributes": { "shared_id": "agent15", "active": true, @@ -4530,15 +4530,15 @@ exports['AgentsRepository list should support to sort by enrolled_at date DESC - "enrolled_at": "2019-08-22T19:35:14.861Z" }, "references": [], - "updated_at": "2019-10-29T14:14:02.558Z", - "version": "WzE5OCwxXQ==" + "updated_at": "2019-11-13T14:53:49.510Z", + "version": "WzE4MiwxXQ==" } } exports['AgentsRepository list should support to sort by enrolled_at date DESC - create:agents (17)'] = { "results": { "type": "agents", - "id": "5c63b300-fa56-11e9-8237-65a0c5e0a0f7", + "id": "6752aed0-0625-11ea-bdb3-e10a3f6667b0", "attributes": { "shared_id": "agent16", "active": true, @@ -4551,15 +4551,15 @@ exports['AgentsRepository list should support to sort by enrolled_at date DESC - "enrolled_at": "2019-08-23T19:35:14.861Z" }, "references": [], - "updated_at": "2019-10-29T14:14:03.568Z", - "version": "WzE5OSwxXQ==" + "updated_at": "2019-11-13T14:53:50.525Z", + "version": "WzE4MywxXQ==" } } exports['AgentsRepository list should support to sort by enrolled_at date DESC - create:agents (18)'] = { "results": { "type": "agents", - "id": "5cfe4550-fa56-11e9-8237-65a0c5e0a0f7", + "id": "67ed6830-0625-11ea-bdb3-e10a3f6667b0", "attributes": { "shared_id": "agent17", "active": true, @@ -4572,15 +4572,15 @@ exports['AgentsRepository list should support to sort by enrolled_at date DESC - "enrolled_at": "2019-08-24T19:35:14.861Z" }, "references": [], - "updated_at": "2019-10-29T14:14:04.581Z", - "version": "WzIwMCwxXQ==" + "updated_at": "2019-11-13T14:53:51.538Z", + "version": "WzE4NCwxXQ==" } } exports['AgentsRepository list should support to sort by enrolled_at date DESC - create:agents (19)'] = { "results": { "type": "agents", - "id": "5d97c630-fa56-11e9-8237-65a0c5e0a0f7", + "id": "688848a0-0625-11ea-bdb3-e10a3f6667b0", "attributes": { "shared_id": "agent18", "active": true, @@ -4593,15 +4593,15 @@ exports['AgentsRepository list should support to sort by enrolled_at date DESC - "enrolled_at": "2019-08-25T19:35:14.861Z" }, "references": [], - "updated_at": "2019-10-29T14:14:05.587Z", - "version": "WzIwMSwxXQ==" + "updated_at": "2019-11-13T14:53:52.554Z", + "version": "WzE4NSwxXQ==" } } exports['AgentsRepository list should support to sort by enrolled_at date DESC - create:agents (20)'] = { "results": { "type": "agents", - "id": "5e342d40-fa56-11e9-8237-65a0c5e0a0f7", + "id": "69230200-0625-11ea-bdb3-e10a3f6667b0", "attributes": { "shared_id": "agent19", "active": true, @@ -4614,15 +4614,15 @@ exports['AgentsRepository list should support to sort by enrolled_at date DESC - "enrolled_at": "2019-08-26T19:35:14.861Z" }, "references": [], - "updated_at": "2019-10-29T14:14:06.612Z", - "version": "WzIwMiwxXQ==" + "updated_at": "2019-11-13T14:53:53.568Z", + "version": "WzE4NiwxXQ==" } } exports['AgentsRepository list should support to sort by enrolled_at date DESC - create:agents (21)'] = { "results": { "type": "agents", - "id": "5ecdae20-fa56-11e9-8237-65a0c5e0a0f7", + "id": "69bbbf90-0625-11ea-bdb3-e10a3f6667b0", "attributes": { "shared_id": "inactive_agent_1", "active": false, @@ -4635,15 +4635,15 @@ exports['AgentsRepository list should support to sort by enrolled_at date DESC - "enrolled_at": "2019-11-13T20:35:14.861Z" }, "references": [], - "updated_at": "2019-10-29T14:14:07.617Z", - "version": "WzIwMywxXQ==" + "updated_at": "2019-11-13T14:53:54.569Z", + "version": "WzE4NywxXQ==" } } exports['AgentsRepository list should support to sort by enrolled_at date DESC - create:agents (22)'] = { "results": { "type": "agents", - "id": "5f688e90-fa56-11e9-8237-65a0c5e0a0f7", + "id": "6a57ff90-0625-11ea-bdb3-e10a3f6667b0", "attributes": { "shared_id": "inactive_agent_2", "active": true, @@ -4653,19 +4653,19 @@ exports['AgentsRepository list should support to sort by enrolled_at date DESC - "version": "1", "local_metadata": "{\"host\":\"test.fr\"}", "user_provided_metadata": "{\"color\":\"red\"}", - "last_checkin": "2019-10-27T14:13:47.356Z", + "last_checkin": "2019-11-11T14:53:34.035Z", "enrolled_at": "2019-08-05T19:35:14.861Z" }, "references": [], - "updated_at": "2019-10-29T14:14:08.633Z", - "version": "WzIwNCwxXQ==" + "updated_at": "2019-11-13T14:53:55.593Z", + "version": "WzE4OCwxXQ==" } } exports['AgentsRepository list should support to sort by enrolled_at date DESC - create:agents (23)'] = { "results": { "type": "agents", - "id": "6001e860-fa56-11e9-8237-65a0c5e0a0f7", + "id": "6af15960-0625-11ea-bdb3-e10a3f6667b0", "attributes": { "shared_id": "ephemeral1", "active": true, @@ -4675,12 +4675,12 @@ exports['AgentsRepository list should support to sort by enrolled_at date DESC - "version": "1", "local_metadata": "{\"host\":\"test.fr\"}", "user_provided_metadata": "{\"color\":\"red\"}", - "last_checkin": "2019-10-29T14:13:47.356Z", + "last_checkin": "2019-11-13T14:53:34.035Z", "enrolled_at": "2019-08-05T19:35:14.861Z" }, "references": [], - "updated_at": "2019-10-29T14:14:09.638Z", - "version": "WzIwNSwxXQ==" + "updated_at": "2019-11-13T14:53:56.597Z", + "version": "WzE4OSwxXQ==" } } @@ -4692,7 +4692,7 @@ exports['AgentsRepository list should support to sort by enrolled_at date DESC - "saved_objects": [ { "type": "agents", - "id": "5e342d40-fa56-11e9-8237-65a0c5e0a0f7", + "id": "69230200-0625-11ea-bdb3-e10a3f6667b0", "attributes": { "shared_id": "agent19", "active": true, @@ -4705,12 +4705,12 @@ exports['AgentsRepository list should support to sort by enrolled_at date DESC - "enrolled_at": "2019-08-26T19:35:14.861Z" }, "references": [], - "updated_at": "2019-10-29T14:14:06.612Z", - "version": "WzIwMiwxXQ==" + "updated_at": "2019-11-13T14:53:53.568Z", + "version": "WzE4NiwxXQ==" }, { "type": "agents", - "id": "5d97c630-fa56-11e9-8237-65a0c5e0a0f7", + "id": "688848a0-0625-11ea-bdb3-e10a3f6667b0", "attributes": { "shared_id": "agent18", "active": true, @@ -4723,12 +4723,12 @@ exports['AgentsRepository list should support to sort by enrolled_at date DESC - "enrolled_at": "2019-08-25T19:35:14.861Z" }, "references": [], - "updated_at": "2019-10-29T14:14:05.587Z", - "version": "WzIwMSwxXQ==" + "updated_at": "2019-11-13T14:53:52.554Z", + "version": "WzE4NSwxXQ==" }, { "type": "agents", - "id": "5cfe4550-fa56-11e9-8237-65a0c5e0a0f7", + "id": "67ed6830-0625-11ea-bdb3-e10a3f6667b0", "attributes": { "shared_id": "agent17", "active": true, @@ -4741,8 +4741,8 @@ exports['AgentsRepository list should support to sort by enrolled_at date DESC - "enrolled_at": "2019-08-24T19:35:14.861Z" }, "references": [], - "updated_at": "2019-10-29T14:14:04.581Z", - "version": "WzIwMCwxXQ==" + "updated_at": "2019-11-13T14:53:51.538Z", + "version": "WzE4NCwxXQ==" } ] } @@ -4756,7 +4756,7 @@ exports['AgentsRepository list should support to sort by enrolled_at date DESC - "saved_objects": [ { "type": "agents", - "id": "52ba8e00-fa56-11e9-8237-65a0c5e0a0f7", + "id": "5d7f4580-0625-11ea-bdb3-e10a3f6667b0", "attributes": { "shared_id": "agent0", "active": true, @@ -4769,12 +4769,12 @@ exports['AgentsRepository list should support to sort by enrolled_at date DESC - "enrolled_at": "2019-08-07T19:35:14.861Z" }, "references": [], - "updated_at": "2019-10-29T14:13:47.360Z", - "version": "WzE4MywxXQ==" + "updated_at": "2019-11-13T14:53:34.040Z", + "version": "WzE2NywxXQ==" }, { "type": "agents", - "id": "53f18760-fa56-11e9-8237-65a0c5e0a0f7", + "id": "5eb55480-0625-11ea-bdb3-e10a3f6667b0", "attributes": { "shared_id": "agent2", "active": true, @@ -4787,12 +4787,12 @@ exports['AgentsRepository list should support to sort by enrolled_at date DESC - "enrolled_at": "2019-08-09T19:35:14.861Z" }, "references": [], - "updated_at": "2019-10-29T14:13:49.398Z", - "version": "WzE4NSwxXQ==" + "updated_at": "2019-11-13T14:53:36.072Z", + "version": "WzE2OSwxXQ==" }, { "type": "agents", - "id": "548bcb90-fa56-11e9-8237-65a0c5e0a0f7", + "id": "5f4fbfc0-0625-11ea-bdb3-e10a3f6667b0", "attributes": { "shared_id": "agent3", "active": true, @@ -4805,12 +4805,12 @@ exports['AgentsRepository list should support to sort by enrolled_at date DESC - "enrolled_at": "2019-08-10T19:35:14.861Z" }, "references": [], - "updated_at": "2019-10-29T14:13:50.409Z", - "version": "WzE4NiwxXQ==" + "updated_at": "2019-11-13T14:53:37.084Z", + "version": "WzE3MCwxXQ==" }, { "type": "agents", - "id": "5525c1a0-fa56-11e9-8237-65a0c5e0a0f7", + "id": "5fe9b5d0-0625-11ea-bdb3-e10a3f6667b0", "attributes": { "shared_id": "agent4", "active": true, @@ -4823,12 +4823,12 @@ exports['AgentsRepository list should support to sort by enrolled_at date DESC - "enrolled_at": "2019-08-11T19:35:14.861Z" }, "references": [], - "updated_at": "2019-10-29T14:13:51.418Z", - "version": "WzE4NywxXQ==" + "updated_at": "2019-11-13T14:53:38.093Z", + "version": "WzE3MSwxXQ==" }, { "type": "agents", - "id": "55c005d0-fa56-11e9-8237-65a0c5e0a0f7", + "id": "6085a7b0-0625-11ea-bdb3-e10a3f6667b0", "attributes": { "shared_id": "agent5", "active": true, @@ -4841,30 +4841,12 @@ exports['AgentsRepository list should support to sort by enrolled_at date DESC - "enrolled_at": "2019-08-12T19:35:14.861Z" }, "references": [], - "updated_at": "2019-10-29T14:13:52.429Z", - "version": "WzE4OCwxXQ==" + "updated_at": "2019-11-13T14:53:39.115Z", + "version": "WzE3MiwxXQ==" }, { "type": "agents", - "id": "565a9820-fa56-11e9-8237-65a0c5e0a0f7", - "attributes": { - "shared_id": "agent6", - "active": true, - "access_api_key_id": "api_key_1", - "policy_id": "policy_id_1", - "type": "PERMANENT", - "version": "1", - "local_metadata": "{\"host\":\"test.fr\"}", - "user_provided_metadata": "{\"color\":\"red\"}", - "enrolled_at": "2019-08-13T19:35:14.861Z" - }, - "references": [], - "updated_at": "2019-10-29T14:13:53.442Z", - "version": "WzE4OSwxXQ==" - }, - { - "type": "agents", - "id": "56f44010-fa56-11e9-8237-65a0c5e0a0f7", + "id": "61ba0900-0625-11ea-bdb3-e10a3f6667b0", "attributes": { "shared_id": "agent7", "active": true, @@ -4877,14 +4859,14 @@ exports['AgentsRepository list should support to sort by enrolled_at date DESC - "enrolled_at": "2019-08-14T19:35:14.861Z" }, "references": [], - "updated_at": "2019-10-29T14:13:54.448Z", - "version": "WzE5MCwxXQ==" + "updated_at": "2019-11-13T14:53:41.136Z", + "version": "WzE3NCwxXQ==" }, { "type": "agents", - "id": "578ed260-fa56-11e9-8237-65a0c5e0a0f7", + "id": "5e1a25f0-0625-11ea-bdb3-e10a3f6667b0", "attributes": { - "shared_id": "agent8", + "shared_id": "agent1", "active": true, "access_api_key_id": "api_key_1", "policy_id": "policy_id_1", @@ -4892,17 +4874,17 @@ exports['AgentsRepository list should support to sort by enrolled_at date DESC - "version": "1", "local_metadata": "{\"host\":\"test.fr\"}", "user_provided_metadata": "{\"color\":\"red\"}", - "enrolled_at": "2019-08-15T19:35:14.861Z" + "enrolled_at": "2019-08-08T19:35:14.861Z" }, "references": [], - "updated_at": "2019-10-29T14:13:55.462Z", - "version": "WzE5MSwxXQ==" + "updated_at": "2019-11-13T14:53:35.055Z", + "version": "WzE2OCwxXQ==" }, { "type": "agents", - "id": "535631c0-fa56-11e9-8237-65a0c5e0a0f7", + "id": "611f2890-0625-11ea-bdb3-e10a3f6667b0", "attributes": { - "shared_id": "agent1", + "shared_id": "agent6", "active": true, "access_api_key_id": "api_key_1", "policy_id": "policy_id_1", @@ -4910,15 +4892,15 @@ exports['AgentsRepository list should support to sort by enrolled_at date DESC - "version": "1", "local_metadata": "{\"host\":\"test.fr\"}", "user_provided_metadata": "{\"color\":\"red\"}", - "enrolled_at": "2019-08-08T19:35:14.861Z" + "enrolled_at": "2019-08-13T19:35:14.861Z" }, "references": [], - "updated_at": "2019-10-29T14:13:48.380Z", - "version": "WzE4NCwxXQ==" + "updated_at": "2019-11-13T14:53:40.121Z", + "version": "WzE3MywxXQ==" }, { "type": "agents", - "id": "58c2be80-fa56-11e9-8237-65a0c5e0a0f7", + "id": "63a7a830-0625-11ea-bdb3-e10a3f6667b0", "attributes": { "shared_id": "agent10", "active": true, @@ -4931,12 +4913,12 @@ exports['AgentsRepository list should support to sort by enrolled_at date DESC - "enrolled_at": "2019-08-17T19:35:14.861Z" }, "references": [], - "updated_at": "2019-10-29T14:13:57.480Z", - "version": "WzE5MywxXQ==" + "updated_at": "2019-11-13T14:53:44.371Z", + "version": "WzE3NywxXQ==" }, { "type": "agents", - "id": "59f8a670-fa56-11e9-8237-65a0c5e0a0f7", + "id": "64e6b7e0-0625-11ea-bdb3-e10a3f6667b0", "attributes": { "shared_id": "agent12", "active": true, @@ -4949,12 +4931,12 @@ exports['AgentsRepository list should support to sort by enrolled_at date DESC - "enrolled_at": "2019-08-19T19:35:14.861Z" }, "references": [], - "updated_at": "2019-10-29T14:13:59.511Z", - "version": "WzE5NSwxXQ==" + "updated_at": "2019-11-13T14:53:46.462Z", + "version": "WzE3OSwxXQ==" }, { "type": "agents", - "id": "5a92c390-fa56-11e9-8237-65a0c5e0a0f7", + "id": "6582d0d0-0625-11ea-bdb3-e10a3f6667b0", "attributes": { "shared_id": "agent13", "active": true, @@ -4967,12 +4949,12 @@ exports['AgentsRepository list should support to sort by enrolled_at date DESC - "enrolled_at": "2019-08-20T19:35:14.861Z" }, "references": [], - "updated_at": "2019-10-29T14:14:00.521Z", - "version": "WzE5NiwxXQ==" + "updated_at": "2019-11-13T14:53:47.485Z", + "version": "WzE4MCwxXQ==" }, { "type": "agents", - "id": "5b2f9fd0-fa56-11e9-8237-65a0c5e0a0f7", + "id": "661d1500-0625-11ea-bdb3-e10a3f6667b0", "attributes": { "shared_id": "agent14", "active": true, @@ -4985,12 +4967,12 @@ exports['AgentsRepository list should support to sort by enrolled_at date DESC - "enrolled_at": "2019-08-21T19:35:14.861Z" }, "references": [], - "updated_at": "2019-10-29T14:14:01.549Z", - "version": "WzE5NywxXQ==" + "updated_at": "2019-11-13T14:53:48.496Z", + "version": "WzE4MSwxXQ==" }, { "type": "agents", - "id": "5bc995e0-fa56-11e9-8237-65a0c5e0a0f7", + "id": "66b7ce60-0625-11ea-bdb3-e10a3f6667b0", "attributes": { "shared_id": "agent15", "active": true, @@ -5003,12 +4985,12 @@ exports['AgentsRepository list should support to sort by enrolled_at date DESC - "enrolled_at": "2019-08-22T19:35:14.861Z" }, "references": [], - "updated_at": "2019-10-29T14:14:02.558Z", - "version": "WzE5OCwxXQ==" + "updated_at": "2019-11-13T14:53:49.510Z", + "version": "WzE4MiwxXQ==" }, { "type": "agents", - "id": "5c63b300-fa56-11e9-8237-65a0c5e0a0f7", + "id": "6752aed0-0625-11ea-bdb3-e10a3f6667b0", "attributes": { "shared_id": "agent16", "active": true, @@ -5021,14 +5003,14 @@ exports['AgentsRepository list should support to sort by enrolled_at date DESC - "enrolled_at": "2019-08-23T19:35:14.861Z" }, "references": [], - "updated_at": "2019-10-29T14:14:03.568Z", - "version": "WzE5OSwxXQ==" + "updated_at": "2019-11-13T14:53:50.525Z", + "version": "WzE4MywxXQ==" }, { "type": "agents", - "id": "5cfe4550-fa56-11e9-8237-65a0c5e0a0f7", + "id": "644288a0-0625-11ea-bdb3-e10a3f6667b0", "attributes": { - "shared_id": "agent17", + "shared_id": "agent11", "active": true, "access_api_key_id": "api_key_1", "policy_id": "policy_id_1", @@ -5036,17 +5018,17 @@ exports['AgentsRepository list should support to sort by enrolled_at date DESC - "version": "1", "local_metadata": "{\"host\":\"test.fr\"}", "user_provided_metadata": "{\"color\":\"red\"}", - "enrolled_at": "2019-08-24T19:35:14.861Z" + "enrolled_at": "2019-08-18T19:35:14.861Z" }, "references": [], - "updated_at": "2019-10-29T14:14:04.581Z", - "version": "WzIwMCwxXQ==" + "updated_at": "2019-11-13T14:53:45.386Z", + "version": "WzE3OCwxXQ==" }, { "type": "agents", - "id": "595e1420-fa56-11e9-8237-65a0c5e0a0f7", + "id": "625362d0-0625-11ea-bdb3-e10a3f6667b0", "attributes": { - "shared_id": "agent11", + "shared_id": "agent8", "active": true, "access_api_key_id": "api_key_1", "policy_id": "policy_id_1", @@ -5054,15 +5036,15 @@ exports['AgentsRepository list should support to sort by enrolled_at date DESC - "version": "1", "local_metadata": "{\"host\":\"test.fr\"}", "user_provided_metadata": "{\"color\":\"red\"}", - "enrolled_at": "2019-08-18T19:35:14.861Z" + "enrolled_at": "2019-08-15T19:35:14.861Z" }, "references": [], - "updated_at": "2019-10-29T14:13:58.498Z", - "version": "WzE5NCwxXQ==" + "updated_at": "2019-11-13T14:53:42.141Z", + "version": "WzE3NSwxXQ==" }, { "type": "agents", - "id": "58280520-fa56-11e9-8237-65a0c5e0a0f7", + "id": "62f15080-0625-11ea-bdb3-e10a3f6667b0", "attributes": { "shared_id": "agent9", "active": true, @@ -5075,12 +5057,30 @@ exports['AgentsRepository list should support to sort by enrolled_at date DESC - "enrolled_at": "2019-08-16T19:35:14.861Z" }, "references": [], - "updated_at": "2019-10-29T14:13:56.466Z", - "version": "WzE5MiwxXQ==" + "updated_at": "2019-11-13T14:53:43.176Z", + "version": "WzE3NiwxXQ==" }, { "type": "agents", - "id": "5d97c630-fa56-11e9-8237-65a0c5e0a0f7", + "id": "67ed6830-0625-11ea-bdb3-e10a3f6667b0", + "attributes": { + "shared_id": "agent17", + "active": true, + "access_api_key_id": "api_key_1", + "policy_id": "policy_id_1", + "type": "PERMANENT", + "version": "1", + "local_metadata": "{\"host\":\"test.fr\"}", + "user_provided_metadata": "{\"color\":\"red\"}", + "enrolled_at": "2019-08-24T19:35:14.861Z" + }, + "references": [], + "updated_at": "2019-11-13T14:53:51.538Z", + "version": "WzE4NCwxXQ==" + }, + { + "type": "agents", + "id": "688848a0-0625-11ea-bdb3-e10a3f6667b0", "attributes": { "shared_id": "agent18", "active": true, @@ -5093,12 +5093,12 @@ exports['AgentsRepository list should support to sort by enrolled_at date DESC - "enrolled_at": "2019-08-25T19:35:14.861Z" }, "references": [], - "updated_at": "2019-10-29T14:14:05.587Z", - "version": "WzIwMSwxXQ==" + "updated_at": "2019-11-13T14:53:52.554Z", + "version": "WzE4NSwxXQ==" }, { "type": "agents", - "id": "5e342d40-fa56-11e9-8237-65a0c5e0a0f7", + "id": "69230200-0625-11ea-bdb3-e10a3f6667b0", "attributes": { "shared_id": "agent19", "active": true, @@ -5111,12 +5111,12 @@ exports['AgentsRepository list should support to sort by enrolled_at date DESC - "enrolled_at": "2019-08-26T19:35:14.861Z" }, "references": [], - "updated_at": "2019-10-29T14:14:06.612Z", - "version": "WzIwMiwxXQ==" + "updated_at": "2019-11-13T14:53:53.568Z", + "version": "WzE4NiwxXQ==" }, { "type": "agents", - "id": "5ecdae20-fa56-11e9-8237-65a0c5e0a0f7", + "id": "69bbbf90-0625-11ea-bdb3-e10a3f6667b0", "attributes": { "shared_id": "inactive_agent_1", "active": false, @@ -5129,12 +5129,12 @@ exports['AgentsRepository list should support to sort by enrolled_at date DESC - "enrolled_at": "2019-11-13T20:35:14.861Z" }, "references": [], - "updated_at": "2019-10-29T14:14:07.617Z", - "version": "WzIwMywxXQ==" + "updated_at": "2019-11-13T14:53:54.569Z", + "version": "WzE4NywxXQ==" }, { "type": "agents", - "id": "5f688e90-fa56-11e9-8237-65a0c5e0a0f7", + "id": "6a57ff90-0625-11ea-bdb3-e10a3f6667b0", "attributes": { "shared_id": "inactive_agent_2", "active": true, @@ -5144,16 +5144,16 @@ exports['AgentsRepository list should support to sort by enrolled_at date DESC - "version": "1", "local_metadata": "{\"host\":\"test.fr\"}", "user_provided_metadata": "{\"color\":\"red\"}", - "last_checkin": "2019-10-27T14:13:47.356Z", + "last_checkin": "2019-11-11T14:53:34.035Z", "enrolled_at": "2019-08-05T19:35:14.861Z" }, "references": [], - "updated_at": "2019-10-29T14:14:08.633Z", - "version": "WzIwNCwxXQ==" + "updated_at": "2019-11-13T14:53:55.593Z", + "version": "WzE4OCwxXQ==" }, { "type": "agents", - "id": "6001e860-fa56-11e9-8237-65a0c5e0a0f7", + "id": "6af15960-0625-11ea-bdb3-e10a3f6667b0", "attributes": { "shared_id": "ephemeral1", "active": true, @@ -5163,113 +5163,113 @@ exports['AgentsRepository list should support to sort by enrolled_at date DESC - "version": "1", "local_metadata": "{\"host\":\"test.fr\"}", "user_provided_metadata": "{\"color\":\"red\"}", - "last_checkin": "2019-10-29T14:13:47.356Z", + "last_checkin": "2019-11-13T14:53:34.035Z", "enrolled_at": "2019-08-05T19:35:14.861Z" }, "references": [], - "updated_at": "2019-10-29T14:14:09.638Z", - "version": "WzIwNSwxXQ==" + "updated_at": "2019-11-13T14:53:56.597Z", + "version": "WzE4OSwxXQ==" } ] } } -exports['AgentsRepository list should support to sort by enrolled_at date DESC - delete:agents:52ba8e00-fa56-11e9-8237-65a0c5e0a0f7:{} (26)'] = { +exports['AgentsRepository list should support to sort by enrolled_at date DESC - delete (26)'] = { "results": {} } -exports['AgentsRepository list should support to sort by enrolled_at date DESC - delete:agents:53f18760-fa56-11e9-8237-65a0c5e0a0f7:{} (27)'] = { +exports['AgentsRepository list should support to sort by enrolled_at date DESC - delete (27)'] = { "results": {} } -exports['AgentsRepository list should support to sort by enrolled_at date DESC - delete:agents:548bcb90-fa56-11e9-8237-65a0c5e0a0f7:{} (28)'] = { +exports['AgentsRepository list should support to sort by enrolled_at date DESC - delete (28)'] = { "results": {} } -exports['AgentsRepository list should support to sort by enrolled_at date DESC - delete:agents:5525c1a0-fa56-11e9-8237-65a0c5e0a0f7:{} (29)'] = { +exports['AgentsRepository list should support to sort by enrolled_at date DESC - delete (29)'] = { "results": {} } -exports['AgentsRepository list should support to sort by enrolled_at date DESC - delete:agents:55c005d0-fa56-11e9-8237-65a0c5e0a0f7:{} (30)'] = { +exports['AgentsRepository list should support to sort by enrolled_at date DESC - delete (30)'] = { "results": {} } -exports['AgentsRepository list should support to sort by enrolled_at date DESC - delete:agents:565a9820-fa56-11e9-8237-65a0c5e0a0f7:{} (31)'] = { +exports['AgentsRepository list should support to sort by enrolled_at date DESC - delete (31)'] = { "results": {} } -exports['AgentsRepository list should support to sort by enrolled_at date DESC - delete:agents:56f44010-fa56-11e9-8237-65a0c5e0a0f7:{} (32)'] = { +exports['AgentsRepository list should support to sort by enrolled_at date DESC - delete (32)'] = { "results": {} } -exports['AgentsRepository list should support to sort by enrolled_at date DESC - delete:agents:578ed260-fa56-11e9-8237-65a0c5e0a0f7:{} (33)'] = { +exports['AgentsRepository list should support to sort by enrolled_at date DESC - delete (33)'] = { "results": {} } -exports['AgentsRepository list should support to sort by enrolled_at date DESC - delete:agents:535631c0-fa56-11e9-8237-65a0c5e0a0f7:{} (34)'] = { +exports['AgentsRepository list should support to sort by enrolled_at date DESC - delete (34)'] = { "results": {} } -exports['AgentsRepository list should support to sort by enrolled_at date DESC - delete:agents:58c2be80-fa56-11e9-8237-65a0c5e0a0f7:{} (35)'] = { +exports['AgentsRepository list should support to sort by enrolled_at date DESC - delete (35)'] = { "results": {} } -exports['AgentsRepository list should support to sort by enrolled_at date DESC - delete:agents:59f8a670-fa56-11e9-8237-65a0c5e0a0f7:{} (36)'] = { +exports['AgentsRepository list should support to sort by enrolled_at date DESC - delete (36)'] = { "results": {} } -exports['AgentsRepository list should support to sort by enrolled_at date DESC - delete:agents:5a92c390-fa56-11e9-8237-65a0c5e0a0f7:{} (37)'] = { +exports['AgentsRepository list should support to sort by enrolled_at date DESC - delete (37)'] = { "results": {} } -exports['AgentsRepository list should support to sort by enrolled_at date DESC - delete:agents:5b2f9fd0-fa56-11e9-8237-65a0c5e0a0f7:{} (38)'] = { +exports['AgentsRepository list should support to sort by enrolled_at date DESC - delete (38)'] = { "results": {} } -exports['AgentsRepository list should support to sort by enrolled_at date DESC - delete:agents:5bc995e0-fa56-11e9-8237-65a0c5e0a0f7:{} (39)'] = { +exports['AgentsRepository list should support to sort by enrolled_at date DESC - delete (39)'] = { "results": {} } -exports['AgentsRepository list should support to sort by enrolled_at date DESC - delete:agents:5c63b300-fa56-11e9-8237-65a0c5e0a0f7:{} (40)'] = { +exports['AgentsRepository list should support to sort by enrolled_at date DESC - delete (40)'] = { "results": {} } -exports['AgentsRepository list should support to sort by enrolled_at date DESC - delete:agents:5cfe4550-fa56-11e9-8237-65a0c5e0a0f7:{} (41)'] = { +exports['AgentsRepository list should support to sort by enrolled_at date DESC - delete (41)'] = { "results": {} } -exports['AgentsRepository list should support to sort by enrolled_at date DESC - delete:agents:595e1420-fa56-11e9-8237-65a0c5e0a0f7:{} (42)'] = { +exports['AgentsRepository list should support to sort by enrolled_at date DESC - delete (42)'] = { "results": {} } -exports['AgentsRepository list should support to sort by enrolled_at date DESC - delete:agents:58280520-fa56-11e9-8237-65a0c5e0a0f7:{} (43)'] = { +exports['AgentsRepository list should support to sort by enrolled_at date DESC - delete (43)'] = { "results": {} } -exports['AgentsRepository list should support to sort by enrolled_at date DESC - delete:agents:5d97c630-fa56-11e9-8237-65a0c5e0a0f7:{} (44)'] = { +exports['AgentsRepository list should support to sort by enrolled_at date DESC - delete (44)'] = { "results": {} } -exports['AgentsRepository list should support to sort by enrolled_at date DESC - delete:agents:5e342d40-fa56-11e9-8237-65a0c5e0a0f7:{} (45)'] = { +exports['AgentsRepository list should support to sort by enrolled_at date DESC - delete (45)'] = { "results": {} } -exports['AgentsRepository list should support to sort by enrolled_at date DESC - delete:agents:5ecdae20-fa56-11e9-8237-65a0c5e0a0f7:{} (46)'] = { +exports['AgentsRepository list should support to sort by enrolled_at date DESC - delete (46)'] = { "results": {} } -exports['AgentsRepository list should support to sort by enrolled_at date DESC - delete:agents:5f688e90-fa56-11e9-8237-65a0c5e0a0f7:{} (47)'] = { +exports['AgentsRepository list should support to sort by enrolled_at date DESC - delete (47)'] = { "results": {} } -exports['AgentsRepository list should support to sort by enrolled_at date DESC - delete:agents:6001e860-fa56-11e9-8237-65a0c5e0a0f7:{} (48)'] = { +exports['AgentsRepository list should support to sort by enrolled_at date DESC - delete (48)'] = { "results": {} } exports['AgentsRepository list for policy should allow to list agents for a policy - create:agents (1)'] = { "results": { "type": "agents", - "id": "6e808a40-fa56-11e9-8237-65a0c5e0a0f7", + "id": "79797120-0625-11ea-bdb3-e10a3f6667b0", "attributes": { "shared_id": "agent1", "active": true, @@ -5282,15 +5282,15 @@ exports['AgentsRepository list for policy should allow to list agents for a poli "enrolled_at": "2019-08-05T19:35:14.861Z" }, "references": [], - "updated_at": "2019-10-29T14:14:33.956Z", - "version": "WzIyOSwxXQ==" + "updated_at": "2019-11-13T14:54:20.978Z", + "version": "WzIxMywxXQ==" } } exports['AgentsRepository list for policy should allow to list agents for a policy - create:agents (2)'] = { "results": { "type": "agents", - "id": "6f1b43a0-fa56-11e9-8237-65a0c5e0a0f7", + "id": "7a142a80-0625-11ea-bdb3-e10a3f6667b0", "attributes": { "shared_id": "agent2", "active": true, @@ -5303,15 +5303,15 @@ exports['AgentsRepository list for policy should allow to list agents for a poli "enrolled_at": "2019-08-05T19:35:14.861Z" }, "references": [], - "updated_at": "2019-10-29T14:14:34.970Z", - "version": "WzIzMCwxXQ==" + "updated_at": "2019-11-13T14:54:21.992Z", + "version": "WzIxNCwxXQ==" } } exports['AgentsRepository list for policy should allow to list agents for a policy - create:agents (3)'] = { "results": { "type": "agents", - "id": "6fb539b0-fa56-11e9-8237-65a0c5e0a0f7", + "id": "7aae6eb0-0625-11ea-bdb3-e10a3f6667b0", "attributes": { "shared_id": "agent3", "active": true, @@ -5324,8 +5324,8 @@ exports['AgentsRepository list for policy should allow to list agents for a poli "enrolled_at": "2019-08-05T19:35:14.861Z" }, "references": [], - "updated_at": "2019-10-29T14:14:35.979Z", - "version": "WzIzMSwxXQ==" + "updated_at": "2019-11-13T14:54:23.003Z", + "version": "WzIxNSwxXQ==" } } @@ -5337,7 +5337,7 @@ exports['AgentsRepository list for policy should allow to list agents for a poli "saved_objects": [ { "type": "agents", - "id": "6e808a40-fa56-11e9-8237-65a0c5e0a0f7", + "id": "79797120-0625-11ea-bdb3-e10a3f6667b0", "attributes": { "shared_id": "agent1", "active": true, @@ -5350,12 +5350,12 @@ exports['AgentsRepository list for policy should allow to list agents for a poli "enrolled_at": "2019-08-05T19:35:14.861Z" }, "references": [], - "updated_at": "2019-10-29T14:14:33.956Z", - "version": "WzIyOSwxXQ==" + "updated_at": "2019-11-13T14:54:20.978Z", + "version": "WzIxMywxXQ==" }, { "type": "agents", - "id": "6f1b43a0-fa56-11e9-8237-65a0c5e0a0f7", + "id": "7a142a80-0625-11ea-bdb3-e10a3f6667b0", "attributes": { "shared_id": "agent2", "active": true, @@ -5368,8 +5368,8 @@ exports['AgentsRepository list for policy should allow to list agents for a poli "enrolled_at": "2019-08-05T19:35:14.861Z" }, "references": [], - "updated_at": "2019-10-29T14:14:34.970Z", - "version": "WzIzMCwxXQ==" + "updated_at": "2019-11-13T14:54:21.992Z", + "version": "WzIxNCwxXQ==" } ] } @@ -5383,7 +5383,7 @@ exports['AgentsRepository list for policy should allow to list agents for a poli "saved_objects": [ { "type": "agents", - "id": "6e808a40-fa56-11e9-8237-65a0c5e0a0f7", + "id": "79797120-0625-11ea-bdb3-e10a3f6667b0", "attributes": { "shared_id": "agent1", "active": true, @@ -5396,12 +5396,12 @@ exports['AgentsRepository list for policy should allow to list agents for a poli "enrolled_at": "2019-08-05T19:35:14.861Z" }, "references": [], - "updated_at": "2019-10-29T14:14:33.956Z", - "version": "WzIyOSwxXQ==" + "updated_at": "2019-11-13T14:54:20.978Z", + "version": "WzIxMywxXQ==" }, { "type": "agents", - "id": "6f1b43a0-fa56-11e9-8237-65a0c5e0a0f7", + "id": "7a142a80-0625-11ea-bdb3-e10a3f6667b0", "attributes": { "shared_id": "agent2", "active": true, @@ -5414,12 +5414,12 @@ exports['AgentsRepository list for policy should allow to list agents for a poli "enrolled_at": "2019-08-05T19:35:14.861Z" }, "references": [], - "updated_at": "2019-10-29T14:14:34.970Z", - "version": "WzIzMCwxXQ==" + "updated_at": "2019-11-13T14:54:21.992Z", + "version": "WzIxNCwxXQ==" }, { "type": "agents", - "id": "6fb539b0-fa56-11e9-8237-65a0c5e0a0f7", + "id": "7aae6eb0-0625-11ea-bdb3-e10a3f6667b0", "attributes": { "shared_id": "agent3", "active": true, @@ -5432,29 +5432,29 @@ exports['AgentsRepository list for policy should allow to list agents for a poli "enrolled_at": "2019-08-05T19:35:14.861Z" }, "references": [], - "updated_at": "2019-10-29T14:14:35.979Z", - "version": "WzIzMSwxXQ==" + "updated_at": "2019-11-13T14:54:23.003Z", + "version": "WzIxNSwxXQ==" } ] } } -exports['AgentsRepository list for policy should allow to list agents for a policy - delete:agents:6e808a40-fa56-11e9-8237-65a0c5e0a0f7:{} (6)'] = { +exports['AgentsRepository list for policy should allow to list agents for a policy - delete (6)'] = { "results": {} } -exports['AgentsRepository list for policy should allow to list agents for a policy - delete:agents:6f1b43a0-fa56-11e9-8237-65a0c5e0a0f7:{} (7)'] = { +exports['AgentsRepository list for policy should allow to list agents for a policy - delete (7)'] = { "results": {} } -exports['AgentsRepository list for policy should allow to list agents for a policy - delete:agents:6fb539b0-fa56-11e9-8237-65a0c5e0a0f7:{} (8)'] = { +exports['AgentsRepository list for policy should allow to list agents for a policy - delete (8)'] = { "results": {} } exports['AgentsRepository findByMetadata should allow to find agents by local metadata - create:agents (1)'] = { "results": { "type": "agents", - "id": "721f82f0-fa56-11e9-8237-65a0c5e0a0f7", + "id": "7d192d20-0625-11ea-bdb3-e10a3f6667b0", "attributes": { "shared_id": "agent1", "active": false, @@ -5467,15 +5467,15 @@ exports['AgentsRepository findByMetadata should allow to find agents by local me "enrolled_at": "2019-08-05T19:35:14.861Z" }, "references": [], - "updated_at": "2019-10-29T14:14:40.031Z", - "version": "WzIzNSwxXQ==" + "updated_at": "2019-11-13T14:54:27.058Z", + "version": "WzIxOSwxXQ==" } } exports['AgentsRepository findByMetadata should allow to find agents by local metadata - create:agents (2)'] = { "results": { "type": "agents", - "id": "72b903d0-fa56-11e9-8237-65a0c5e0a0f7", + "id": "7db1eab0-0625-11ea-bdb3-e10a3f6667b0", "attributes": { "shared_id": "agent2", "active": false, @@ -5488,8 +5488,8 @@ exports['AgentsRepository findByMetadata should allow to find agents by local me "enrolled_at": "2019-08-05T19:35:14.861Z" }, "references": [], - "updated_at": "2019-10-29T14:14:41.037Z", - "version": "WzIzNiwxXQ==" + "updated_at": "2019-11-13T14:54:28.059Z", + "version": "WzIyMCwxXQ==" } } @@ -5501,7 +5501,7 @@ exports['AgentsRepository findByMetadata should allow to find agents by local me "saved_objects": [ { "type": "agents", - "id": "72b903d0-fa56-11e9-8237-65a0c5e0a0f7", + "id": "7db1eab0-0625-11ea-bdb3-e10a3f6667b0", "attributes": { "shared_id": "agent2", "active": false, @@ -5514,8 +5514,8 @@ exports['AgentsRepository findByMetadata should allow to find agents by local me "enrolled_at": "2019-08-05T19:35:14.861Z" }, "references": [], - "updated_at": "2019-10-29T14:14:41.037Z", - "version": "WzIzNiwxXQ==" + "updated_at": "2019-11-13T14:54:28.059Z", + "version": "WzIyMCwxXQ==" } ] } @@ -5529,7 +5529,7 @@ exports['AgentsRepository findByMetadata should allow to find agents by local me "saved_objects": [ { "type": "agents", - "id": "721f82f0-fa56-11e9-8237-65a0c5e0a0f7", + "id": "7d192d20-0625-11ea-bdb3-e10a3f6667b0", "attributes": { "shared_id": "agent1", "active": false, @@ -5542,12 +5542,12 @@ exports['AgentsRepository findByMetadata should allow to find agents by local me "enrolled_at": "2019-08-05T19:35:14.861Z" }, "references": [], - "updated_at": "2019-10-29T14:14:40.031Z", - "version": "WzIzNSwxXQ==" + "updated_at": "2019-11-13T14:54:27.058Z", + "version": "WzIxOSwxXQ==" }, { "type": "agents", - "id": "72b903d0-fa56-11e9-8237-65a0c5e0a0f7", + "id": "7db1eab0-0625-11ea-bdb3-e10a3f6667b0", "attributes": { "shared_id": "agent2", "active": false, @@ -5560,25 +5560,25 @@ exports['AgentsRepository findByMetadata should allow to find agents by local me "enrolled_at": "2019-08-05T19:35:14.861Z" }, "references": [], - "updated_at": "2019-10-29T14:14:41.037Z", - "version": "WzIzNiwxXQ==" + "updated_at": "2019-11-13T14:54:28.059Z", + "version": "WzIyMCwxXQ==" } ] } } -exports['AgentsRepository findByMetadata should allow to find agents by local metadata - delete:agents:721f82f0-fa56-11e9-8237-65a0c5e0a0f7:{} (5)'] = { +exports['AgentsRepository findByMetadata should allow to find agents by local metadata - delete (5)'] = { "results": {} } -exports['AgentsRepository findByMetadata should allow to find agents by local metadata - delete:agents:72b903d0-fa56-11e9-8237-65a0c5e0a0f7:{} (6)'] = { +exports['AgentsRepository findByMetadata should allow to find agents by local metadata - delete (6)'] = { "results": {} } exports['AgentsRepository findByMetadata should allow to find agents by user provided metadata - create:agents (1)'] = { "results": { "type": "agents", - "id": "748b04b0-fa56-11e9-8237-65a0c5e0a0f7", + "id": "7f857230-0625-11ea-bdb3-e10a3f6667b0", "attributes": { "shared_id": "agent1", "active": false, @@ -5591,15 +5591,15 @@ exports['AgentsRepository findByMetadata should allow to find agents by user pro "enrolled_at": "2019-08-05T19:35:14.861Z" }, "references": [], - "updated_at": "2019-10-29T14:14:44.090Z", - "version": "WzIzOSwxXQ==" + "updated_at": "2019-11-13T14:54:31.123Z", + "version": "WzIyMywxXQ==" } } exports['AgentsRepository findByMetadata should allow to find agents by user provided metadata - create:agents (2)'] = { "results": { "type": "agents", - "id": "7524fac0-fa56-11e9-8237-65a0c5e0a0f7", + "id": "801d9380-0625-11ea-bdb3-e10a3f6667b0", "attributes": { "shared_id": "agent2", "active": false, @@ -5612,8 +5612,8 @@ exports['AgentsRepository findByMetadata should allow to find agents by user pro "enrolled_at": "2019-08-05T19:35:14.861Z" }, "references": [], - "updated_at": "2019-10-29T14:14:45.100Z", - "version": "WzI0MCwxXQ==" + "updated_at": "2019-11-13T14:54:32.120Z", + "version": "WzIyNCwxXQ==" } } @@ -5625,7 +5625,7 @@ exports['AgentsRepository findByMetadata should allow to find agents by user pro "saved_objects": [ { "type": "agents", - "id": "748b04b0-fa56-11e9-8237-65a0c5e0a0f7", + "id": "7f857230-0625-11ea-bdb3-e10a3f6667b0", "attributes": { "shared_id": "agent1", "active": false, @@ -5638,8 +5638,8 @@ exports['AgentsRepository findByMetadata should allow to find agents by user pro "enrolled_at": "2019-08-05T19:35:14.861Z" }, "references": [], - "updated_at": "2019-10-29T14:14:44.090Z", - "version": "WzIzOSwxXQ==" + "updated_at": "2019-11-13T14:54:31.123Z", + "version": "WzIyMywxXQ==" } ] } @@ -5653,7 +5653,7 @@ exports['AgentsRepository findByMetadata should allow to find agents by user pro "saved_objects": [ { "type": "agents", - "id": "748b04b0-fa56-11e9-8237-65a0c5e0a0f7", + "id": "7f857230-0625-11ea-bdb3-e10a3f6667b0", "attributes": { "shared_id": "agent1", "active": false, @@ -5666,12 +5666,12 @@ exports['AgentsRepository findByMetadata should allow to find agents by user pro "enrolled_at": "2019-08-05T19:35:14.861Z" }, "references": [], - "updated_at": "2019-10-29T14:14:44.090Z", - "version": "WzIzOSwxXQ==" + "updated_at": "2019-11-13T14:54:31.123Z", + "version": "WzIyMywxXQ==" }, { "type": "agents", - "id": "7524fac0-fa56-11e9-8237-65a0c5e0a0f7", + "id": "801d9380-0625-11ea-bdb3-e10a3f6667b0", "attributes": { "shared_id": "agent2", "active": false, @@ -5684,17 +5684,17 @@ exports['AgentsRepository findByMetadata should allow to find agents by user pro "enrolled_at": "2019-08-05T19:35:14.861Z" }, "references": [], - "updated_at": "2019-10-29T14:14:45.100Z", - "version": "WzI0MCwxXQ==" + "updated_at": "2019-11-13T14:54:32.120Z", + "version": "WzIyNCwxXQ==" } ] } } -exports['AgentsRepository findByMetadata should allow to find agents by user provided metadata - delete:agents:748b04b0-fa56-11e9-8237-65a0c5e0a0f7:{} (5)'] = { +exports['AgentsRepository findByMetadata should allow to find agents by user provided metadata - delete (5)'] = { "results": {} } -exports['AgentsRepository findByMetadata should allow to find agents by user provided metadata - delete:agents:7524fac0-fa56-11e9-8237-65a0c5e0a0f7:{} (6)'] = { +exports['AgentsRepository findByMetadata should allow to find agents by user provided metadata - delete (6)'] = { "results": {} } diff --git a/x-pack/legacy/plugins/fleet/server/repositories/agents/in_memory.ts b/x-pack/legacy/plugins/fleet/server/repositories/agents/in_memory.ts deleted file mode 100644 index 0cbccaf6bfc19..0000000000000 --- a/x-pack/legacy/plugins/fleet/server/repositories/agents/in_memory.ts +++ /dev/null @@ -1,98 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License; - * you may not use this file except in compliance with the Elastic License. - */ - -import { AgentsRepository, Agent, NewAgent, ListOptions } from './types'; -import { DEFAULT_AGENTS_PAGE_SIZE } from '../../../common/constants'; -import { FrameworkUser } from '../../adapters/framework/adapter_types'; - -/** - * In memory adapter, for testing purpose, all the created agents, are accessible under the public property agents - */ -export class InMemoryAgentsRepository implements AgentsRepository { - public agents: { [k: string]: Agent } = {}; - private id = 1; - - public async create( - user: FrameworkUser, - agent: NewAgent, - options: { id?: string; overwrite?: boolean } - ): Promise { - const newAgent = { - ...agent, - id: (options && options.id) || `agent-${this.id++}`, - last_updated: undefined, - last_checkin: undefined, - events: [], - actions: [], - }; - - this.agents[newAgent.id] = newAgent; - - return newAgent; - } - - public async delete(user: FrameworkUser, agent: Agent): Promise { - delete this.agents[agent.id]; - } - - public async getById(user: FrameworkUser, id: string): Promise { - return this.agents[id] || null; - } - - public async getBySharedId(user: FrameworkUser, sharedId: string): Promise { - const agent = Object.values(this.agents).find(a => a.shared_id === sharedId); - - return agent || null; - } - - public async getByAccessApiKeyId( - user: FrameworkUser, - accessApiKeyId: string - ): Promise { - const agent = Object.values(this.agents).find(a => a.access_api_key_id === accessApiKeyId); - - return agent || null; - } - - public async update(user: FrameworkUser, id: string, newData: Partial): Promise { - if (this.agents[id]) { - Object.assign(this.agents[id], newData); - } - } - - public async findByMetadata( - user: FrameworkUser, - metadata: { local?: any; userProvided?: any } - ): Promise { - return []; - } - - public async list( - user: FrameworkUser, - options: ListOptions = {} - ): Promise<{ agents: Agent[]; total: number; page: number; perPage: number }> { - const { page = 1, perPage = DEFAULT_AGENTS_PAGE_SIZE } = options; - const start = (page - 1) * perPage; - const agents = Object.values(this.agents).slice(start, start + perPage); - const total = Object.keys(this.agents).length; - - return { agents, total, page, perPage }; - } - - public async listForPolicy( - user: FrameworkUser, - policyId: string, - options: ListOptions = {} - ): Promise<{ agents: Agent[]; total: number; page: number; perPage: number }> { - const { page = 1, perPage = DEFAULT_AGENTS_PAGE_SIZE } = options; - const start = (page - 1) * perPage; - const allAgents = Object.values(this.agents).filter(a => a.policy_id === policyId); - const agents = Object.values(allAgents).slice(start, start + perPage); - const total = Object.keys(allAgents).length; - - return { agents, total, page, perPage }; - } -} diff --git a/x-pack/legacy/plugins/fleet/server/repositories/enrollment_api_keys/__memorize_snapshots__/default.contract.test.slap_snap b/x-pack/legacy/plugins/fleet/server/repositories/enrollment_api_keys/__memorize_snapshots__/default.contract.test.slap_snap index 4f93ed1c96826..c5a3dcd3cd17e 100644 --- a/x-pack/legacy/plugins/fleet/server/repositories/enrollment_api_keys/__memorize_snapshots__/default.contract.test.slap_snap +++ b/x-pack/legacy/plugins/fleet/server/repositories/enrollment_api_keys/__memorize_snapshots__/default.contract.test.slap_snap @@ -2,28 +2,28 @@ exports['Enrollment api key Repository create allow to create an enrollment api key - create:enrollment_api_keys (1)'] = { "results": { "type": "enrollment_api_keys", - "id": "98565dd9-e74f-45c2-a972-a1520e7cd91b", + "id": "35ee683c-3364-4727-932f-69cc4c3936b1", "attributes": { - "created_at": "2019-10-29T14:14:55.616Z", + "created_at": "2019-11-13T14:50:40.104Z", "api_key_id": "key-id-123", "policy_id": "policyId", "active": true, "enrollment_rules": [] }, "references": [], - "updated_at": "2019-10-29T14:14:55.636Z", - "version": "WzI0MywxXQ==" + "updated_at": "2019-11-13T14:50:40.128Z", + "version": "WzIsMV0=" } } -exports['Enrollment api key Repository create allow to create an enrollment api key - get:enrollment_api_keys:98565dd9-e74f-45c2-a972-a1520e7cd91b:{} (2)'] = { +exports['Enrollment api key Repository create allow to create an enrollment api key - get:enrollment_api_keys (2)'] = { "results": { - "id": "98565dd9-e74f-45c2-a972-a1520e7cd91b", + "id": "35ee683c-3364-4727-932f-69cc4c3936b1", "type": "enrollment_api_keys", - "updated_at": "2019-10-29T14:14:55.636Z", - "version": "WzI0MywxXQ==", + "updated_at": "2019-11-13T14:50:40.128Z", + "version": "WzIsMV0=", "attributes": { - "created_at": "2019-10-29T14:14:55.616Z", + "created_at": "2019-11-13T14:50:40.104Z", "api_key_id": "key-id-123", "policy_id": "policyId", "active": true, @@ -41,58 +41,58 @@ exports['Enrollment api key Repository create allow to create an enrollment api "saved_objects": [ { "type": "enrollment_api_keys", - "id": "98565dd9-e74f-45c2-a972-a1520e7cd91b", + "id": "35ee683c-3364-4727-932f-69cc4c3936b1", "attributes": { - "created_at": "2019-10-29T14:14:55.616Z", + "created_at": "2019-11-13T14:50:40.104Z", "api_key_id": "key-id-123", "policy_id": "policyId", "active": true, "enrollment_rules": [] }, "references": [], - "updated_at": "2019-10-29T14:14:55.636Z", - "version": "WzI0MywxXQ==" + "updated_at": "2019-11-13T14:50:40.128Z", + "version": "WzIsMV0=" } ] } } -exports['Enrollment api key Repository create allow to create an enrollment api key - delete:enrollment_api_keys:98565dd9-e74f-45c2-a972-a1520e7cd91b:{} (4)'] = { +exports['Enrollment api key Repository create allow to create an enrollment api key - delete (4)'] = { "results": {} } exports['Enrollment api key Repository update allow to update a key - create:enrollment_api_keys (1)'] = { "results": { "type": "enrollment_api_keys", - "id": "6ac9632a-295d-45f5-a2f5-79a27483ba77", + "id": "74d24a9f-78f9-49d0-9bfb-fcb235c33469", "attributes": { "active": true, "policy_id": "policyId" }, "references": [], - "updated_at": "2019-10-29T14:14:57.178Z", - "version": "WzI0NSwxXQ==" + "updated_at": "2019-11-13T14:50:41.723Z", + "version": "WzQsMV0=" } } -exports['Enrollment api key Repository update allow to update a key - get:enrollment_api_keys:6ac9632a-295d-45f5-a2f5-79a27483ba77:{"active":false,"api_key":"notencryptedapikey"}:{} (2)'] = { +exports['Enrollment api key Repository update allow to update a key - update:enrollment_api_keys (2)'] = { "results": { - "id": "6ac9632a-295d-45f5-a2f5-79a27483ba77", + "id": "74d24a9f-78f9-49d0-9bfb-fcb235c33469", "type": "enrollment_api_keys", - "updated_at": "2019-10-29T14:14:58.185Z", - "version": "WzI0NiwxXQ==", + "updated_at": "2019-11-13T14:50:42.735Z", + "version": "WzUsMV0=", "attributes": { "active": false } } } -exports['Enrollment api key Repository update allow to update a key - get:enrollment_api_keys:6ac9632a-295d-45f5-a2f5-79a27483ba77:{} (3)'] = { +exports['Enrollment api key Repository update allow to update a key - get:enrollment_api_keys (3)'] = { "results": { - "id": "6ac9632a-295d-45f5-a2f5-79a27483ba77", + "id": "74d24a9f-78f9-49d0-9bfb-fcb235c33469", "type": "enrollment_api_keys", - "updated_at": "2019-10-29T14:14:58.185Z", - "version": "WzI0NiwxXQ==", + "updated_at": "2019-11-13T14:50:42.735Z", + "version": "WzUsMV0=", "attributes": { "active": false, "policy_id": "policyId" @@ -109,48 +109,48 @@ exports['Enrollment api key Repository update allow to update a key - find:"enro "saved_objects": [ { "type": "enrollment_api_keys", - "id": "6ac9632a-295d-45f5-a2f5-79a27483ba77", + "id": "74d24a9f-78f9-49d0-9bfb-fcb235c33469", "attributes": { "active": false, "policy_id": "policyId" }, "references": [], - "updated_at": "2019-10-29T14:14:58.185Z", - "version": "WzI0NiwxXQ==" + "updated_at": "2019-11-13T14:50:42.735Z", + "version": "WzUsMV0=" } ] } } -exports['Enrollment api key Repository update allow to update a key - delete:enrollment_api_keys:6ac9632a-295d-45f5-a2f5-79a27483ba77:{} (5)'] = { +exports['Enrollment api key Repository update allow to update a key - delete (5)'] = { "results": {} } exports['Enrollment api key Repository getByApiKeyId allow to find a key - create:enrollment_api_keys (1)'] = { "results": { "type": "enrollment_api_keys", - "id": "5b943598-d218-4bd0-a5e9-ad2dd93d6031", + "id": "14be4e73-de40-4098-8025-242d6c10001d", "attributes": { "active": true, "api_key_id": "api-key-1" }, "references": [], - "updated_at": "2019-10-29T14:15:00.207Z", - "version": "WzI0OCwxXQ==" + "updated_at": "2019-11-13T14:50:44.764Z", + "version": "WzcsMV0=" } } exports['Enrollment api key Repository getByApiKeyId allow to find a key - create:enrollment_api_keys (2)'] = { "results": { "type": "enrollment_api_keys", - "id": "4ef59475-a86c-480e-8934-817ee67236c1", + "id": "14df091e-5c35-4522-bceb-da050432ec56", "attributes": { "active": true, "api_key_id": "api-key-2" }, "references": [], - "updated_at": "2019-10-29T14:15:00.207Z", - "version": "WzI0OSwxXQ==" + "updated_at": "2019-11-13T14:50:44.765Z", + "version": "WzgsMV0=" } } @@ -162,25 +162,25 @@ exports['Enrollment api key Repository getByApiKeyId allow to find a key - find: "saved_objects": [ { "type": "enrollment_api_keys", - "id": "4ef59475-a86c-480e-8934-817ee67236c1", + "id": "14df091e-5c35-4522-bceb-da050432ec56", "attributes": { "active": true, "api_key_id": "api-key-2" }, "references": [], - "updated_at": "2019-10-29T14:15:00.207Z", - "version": "WzI0OSwxXQ==" + "updated_at": "2019-11-13T14:50:44.765Z", + "version": "WzgsMV0=" } ] } } -exports['Enrollment api key Repository getByApiKeyId allow to find a key - getDecryptedAsInternalUser:enrollment_api_keys:4ef59475-a86c-480e-8934-817ee67236c1 (4)'] = { +exports['Enrollment api key Repository getByApiKeyId allow to find a key - getDecryptedAsInternalUser:enrollment_api_keys:14df091e-5c35-4522-bceb-da050432ec56 (4)'] = { "results": { - "id": "4ef59475-a86c-480e-8934-817ee67236c1", + "id": "14df091e-5c35-4522-bceb-da050432ec56", "type": "enrollment_api_keys", - "updated_at": "2019-10-29T14:15:00.207Z", - "version": "WzI0OSwxXQ==", + "updated_at": "2019-11-13T14:50:44.765Z", + "version": "WzgsMV0=", "attributes": { "active": true, "api_key_id": "api-key-2" @@ -197,63 +197,63 @@ exports['Enrollment api key Repository getByApiKeyId allow to find a key - find: "saved_objects": [ { "type": "enrollment_api_keys", - "id": "5b943598-d218-4bd0-a5e9-ad2dd93d6031", + "id": "14be4e73-de40-4098-8025-242d6c10001d", "attributes": { "active": true, "api_key_id": "api-key-1" }, "references": [], - "updated_at": "2019-10-29T14:15:00.207Z", - "version": "WzI0OCwxXQ==" + "updated_at": "2019-11-13T14:50:44.764Z", + "version": "WzcsMV0=" }, { "type": "enrollment_api_keys", - "id": "4ef59475-a86c-480e-8934-817ee67236c1", + "id": "14df091e-5c35-4522-bceb-da050432ec56", "attributes": { "active": true, "api_key_id": "api-key-2" }, "references": [], - "updated_at": "2019-10-29T14:15:00.207Z", - "version": "WzI0OSwxXQ==" + "updated_at": "2019-11-13T14:50:44.765Z", + "version": "WzgsMV0=" } ] } } -exports['Enrollment api key Repository getByApiKeyId allow to find a key - delete:enrollment_api_keys:5b943598-d218-4bd0-a5e9-ad2dd93d6031:{} (6)'] = { +exports['Enrollment api key Repository getByApiKeyId allow to find a key - delete (6)'] = { "results": {} } -exports['Enrollment api key Repository getByApiKeyId allow to find a key - delete:enrollment_api_keys:4ef59475-a86c-480e-8934-817ee67236c1:{} (7)'] = { +exports['Enrollment api key Repository getByApiKeyId allow to find a key - delete (7)'] = { "results": {} } exports['Enrollment api key Repository getByApiKeyId return null if the key does not exists - create:enrollment_api_keys (1)'] = { "results": { "type": "enrollment_api_keys", - "id": "79551426-5c54-4937-bc0d-baa25a209c12", + "id": "c8ee74f7-f0ec-4086-85e3-db386515a5ee", "attributes": { "active": true, "api_key_id": "api-key-1" }, "references": [], - "updated_at": "2019-10-29T14:15:03.244Z", - "version": "WzI1MiwxXQ==" + "updated_at": "2019-11-13T14:50:47.813Z", + "version": "WzExLDFd" } } exports['Enrollment api key Repository getByApiKeyId return null if the key does not exists - create:enrollment_api_keys (2)'] = { "results": { "type": "enrollment_api_keys", - "id": "0aa92e81-eabf-4f63-a8c9-aca8dd1d426e", + "id": "44b848c9-785f-4107-a5fa-1186af23746c", "attributes": { "active": true, "api_key_id": "api-key-2" }, "references": [], - "updated_at": "2019-10-29T14:15:03.244Z", - "version": "WzI1MywxXQ==" + "updated_at": "2019-11-13T14:50:47.813Z", + "version": "WzEyLDFd" } } @@ -274,57 +274,57 @@ exports['Enrollment api key Repository getByApiKeyId return null if the key does "saved_objects": [ { "type": "enrollment_api_keys", - "id": "79551426-5c54-4937-bc0d-baa25a209c12", + "id": "c8ee74f7-f0ec-4086-85e3-db386515a5ee", "attributes": { "active": true, "api_key_id": "api-key-1" }, "references": [], - "updated_at": "2019-10-29T14:15:03.244Z", - "version": "WzI1MiwxXQ==" + "updated_at": "2019-11-13T14:50:47.813Z", + "version": "WzExLDFd" }, { "type": "enrollment_api_keys", - "id": "0aa92e81-eabf-4f63-a8c9-aca8dd1d426e", + "id": "44b848c9-785f-4107-a5fa-1186af23746c", "attributes": { "active": true, "api_key_id": "api-key-2" }, "references": [], - "updated_at": "2019-10-29T14:15:03.244Z", - "version": "WzI1MywxXQ==" + "updated_at": "2019-11-13T14:50:47.813Z", + "version": "WzEyLDFd" } ] } } -exports['Enrollment api key Repository getByApiKeyId return null if the key does not exists - delete:enrollment_api_keys:79551426-5c54-4937-bc0d-baa25a209c12:{} (5)'] = { +exports['Enrollment api key Repository getByApiKeyId return null if the key does not exists - delete (5)'] = { "results": {} } -exports['Enrollment api key Repository getByApiKeyId return null if the key does not exists - delete:enrollment_api_keys:0aa92e81-eabf-4f63-a8c9-aca8dd1d426e:{} (6)'] = { +exports['Enrollment api key Repository getByApiKeyId return null if the key does not exists - delete (6)'] = { "results": {} } exports['Enrollment api key Repository delete allow to delete a enrollmentApiKey - create:enrollment_api_keys (1)'] = { "results": { "type": "enrollment_api_keys", - "id": "8eea627e-dd8c-4ff9-b4a4-dc80f183ba9a", + "id": "11206128-6a69-45a2-bc01-4dc2d27a0ca0", "attributes": { "active": true, "api_key_id": "qwerty" }, "references": [], - "updated_at": "2019-10-29T14:15:06.272Z", - "version": "WzI1NiwxXQ==" + "updated_at": "2019-11-13T14:50:50.881Z", + "version": "WzE1LDFd" } } -exports['Enrollment api key Repository delete allow to delete a enrollmentApiKey - delete:enrollment_api_keys:8eea627e-dd8c-4ff9-b4a4-dc80f183ba9a:{} (2)'] = { +exports['Enrollment api key Repository delete allow to delete a enrollmentApiKey - delete (2)'] = { "results": {} } -exports['Enrollment api key Repository delete allow to delete a enrollmentApiKey - get:enrollment_api_keys:8eea627e-dd8c-4ff9-b4a4-dc80f183ba9a:{} (3)'] = { +exports['Enrollment api key Repository delete allow to delete a enrollmentApiKey - get:enrollment_api_keys (3)'] = { "results": null } diff --git a/x-pack/legacy/plugins/fleet/server/repositories/enrollment_api_keys/default.contract.test.ts b/x-pack/legacy/plugins/fleet/server/repositories/enrollment_api_keys/default.contract.test.ts index d5375e8eac502..349d18b57b10a 100644 --- a/x-pack/legacy/plugins/fleet/server/repositories/enrollment_api_keys/default.contract.test.ts +++ b/x-pack/legacy/plugins/fleet/server/repositories/enrollment_api_keys/default.contract.test.ts @@ -60,7 +60,7 @@ describe('Enrollment api key Repository', () => { soAdapter = new MemorizeSODatabaseAdapter(baseAdapter); const baseEncyrptedSOAdapter = new EncryptedSavedObjects( - servers.kbnServer.plugins.encrypted_saved_objects + servers.kbnServer.newPlatform.start.plugins.encryptedSavedObjects ); encryptedSavedObject = (new MemorizeEncryptedSavedObjects( diff --git a/x-pack/legacy/plugins/fleet/server/repositories/enrollment_api_keys/default.ts b/x-pack/legacy/plugins/fleet/server/repositories/enrollment_api_keys/default.ts index f15ae6c645378..7c429c4e7f6f3 100644 --- a/x-pack/legacy/plugins/fleet/server/repositories/enrollment_api_keys/default.ts +++ b/x-pack/legacy/plugins/fleet/server/repositories/enrollment_api_keys/default.ts @@ -12,7 +12,7 @@ import { EnrollmentApiKeysRepository as EnrollmentApiKeysRepositoryType, SAVED_OBJECT_TYPE, } from './types'; -import { EncryptedSavedObjects } from '../../adapters/encrypted_saved_objects/default'; +import { EncryptedSavedObjects } from '../../adapters/encrypted_saved_objects/adapter_types'; import { FrameworkUser } from '../../adapters/framework/adapter_types'; function getFirstOrNull(list: T[]): T | null { diff --git a/x-pack/legacy/plugins/fleet/server/repositories/enrollment_api_keys/memory.ts b/x-pack/legacy/plugins/fleet/server/repositories/enrollment_api_keys/memory.ts deleted file mode 100644 index 6f0f4ac0e8691..0000000000000 --- a/x-pack/legacy/plugins/fleet/server/repositories/enrollment_api_keys/memory.ts +++ /dev/null @@ -1,99 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License; - * you may not use this file except in compliance with the Elastic License. - */ - -import moment from 'moment'; -import { EnrollmentApiKey, EnrollmentApiKeysRepository } from './types'; -import { FrameworkUser } from '../../adapters/framework/adapter_types'; - -/** - * MemoryAdapter for persisting enrollmentApiKeys, for tests purposes only. - */ -export class MemoryEnrollmentApiKeysRepository implements EnrollmentApiKeysRepository { - public keys: { [k: string]: EnrollmentApiKey } = {}; - private keyId = 1; - public async create( - user: FrameworkUser, - { - apiKey, - apiKeyId, - active, - policyId, - expire_at, - name, - }: { - apiKey: string; - apiKeyId: string; - active: boolean; - policyId?: string; - expire_at?: string; - name?: string; - } - ): Promise { - const id = `enrollment-api-keys-${this.keyId++}`; - this.keys[id] = { - id, - active, - created_at: moment().toISOString(), - api_key: apiKey, - api_key_id: apiKeyId, - expire_at, - policy_id: policyId, - enrollment_rules: [], - name, - }; - - return this.keys[id]; - } - - public async list( - user: FrameworkUser, - options: { - page?: number; - perPage?: number; - kuery?: string; - showInactive?: boolean; - } - ): Promise<{ items: EnrollmentApiKey[]; total: any; page: any; perPage: any }> { - const { page = 1, perPage = 20 } = options; - - const keys = Object.values(this.keys); - const start = (page - 1) * perPage; - const items = keys.slice(start, start + perPage); - const total = items.length; - - return { - items, - total, - page, - perPage, - }; - } - - public async getByApiKeyId( - user: FrameworkUser, - apiKeyId: string - ): Promise { - return Object.values(this.keys).find(t => t.api_key_id === apiKeyId) || null; - } - - public async update( - user: FrameworkUser, - id: string, - newData: Partial - ): Promise { - const key = this.keys[id]; - - Object.assign(key, newData); - } - - public async getById(user: FrameworkUser, id: string) { - return Object.values(this.keys).find(t => t.id === id) || null; - } - - public async delete(user: FrameworkUser, id: string): Promise { - delete this.keys[id]; - } -} diff --git a/x-pack/legacy/plugins/fleet/server/repositories/policies/default.ts b/x-pack/legacy/plugins/fleet/server/repositories/policies/default.ts index 72bcf89454f76..2d0353ab80770 100644 --- a/x-pack/legacy/plugins/fleet/server/repositories/policies/default.ts +++ b/x-pack/legacy/plugins/fleet/server/repositories/policies/default.ts @@ -7,7 +7,7 @@ import { IngestPlugin, PoliciesRepository as PoliciesRepositoryType } from './types'; export class PoliciesRepository implements PoliciesRepositoryType { - constructor(private readonly plugin: IngestPlugin) {} + constructor(private readonly plugin?: IngestPlugin) {} /** * Return a full policy @@ -15,6 +15,10 @@ export class PoliciesRepository implements PoliciesRepositoryType { * @param id */ async getFullPolicy(id: string) { - return await this.plugin.getFull(id); + if (this.plugin) { + return await this.plugin.getFull(id); + } + + return null; } } diff --git a/x-pack/legacy/plugins/fleet/server/repositories/policies/in_memory.ts b/x-pack/legacy/plugins/fleet/server/repositories/policies/in_memory.ts deleted file mode 100644 index 35b163bb3f8ea..0000000000000 --- a/x-pack/legacy/plugins/fleet/server/repositories/policies/in_memory.ts +++ /dev/null @@ -1,18 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License; - * you may not use this file except in compliance with the Elastic License. - */ - -import { PoliciesRepository as PoliciesRepositoryType, FullPolicyFile } from './types'; - -/** - * In memory policy Adapter (for test purpose only!) - */ -export class InMemoryPoliciesRepository implements PoliciesRepositoryType { - public policies: { [k: string]: FullPolicyFile } = {}; - - async getFullPolicy(id: string) { - return this.policies[id]; - } -} diff --git a/x-pack/legacy/plugins/fleet/server/repositories/policies/types.ts b/x-pack/legacy/plugins/fleet/server/repositories/policies/types.ts index a4b746f71ddcd..01a7e3960101f 100644 --- a/x-pack/legacy/plugins/fleet/server/repositories/policies/types.ts +++ b/x-pack/legacy/plugins/fleet/server/repositories/policies/types.ts @@ -13,5 +13,5 @@ export interface IngestPlugin { } export interface PoliciesRepository { - getFullPolicy(id: string): Promise; + getFullPolicy(id: string): Promise; }