From 688bde306ed62dc873ffd5f022d702fb0365f333 Mon Sep 17 00:00:00 2001 From: Rex White Date: Thu, 1 Feb 2024 18:06:09 -0500 Subject: [PATCH] Revert connection_status code changes --- .../__snapshots__/fifi.integration.js.snap | 76 +++++++++---------- src/remediations/fifi.integration.js | 4 +- src/remediations/routes.js | 2 +- 3 files changed, 41 insertions(+), 41 deletions(-) diff --git a/src/remediations/__snapshots__/fifi.integration.js.snap b/src/remediations/__snapshots__/fifi.integration.js.snap index da9ef7b5..7097188b 100644 --- a/src/remediations/__snapshots__/fifi.integration.js.snap +++ b/src/remediations/__snapshots__/fifi.integration.js.snap @@ -93,42 +93,42 @@ exports[`FiFi connection status get connection status with false smartManagement { \\"endpoint_id\\": null, \\"executor_id\\": \\"01bf542e-6092-485c-ba04-c656d77f988a\\", - \\"executor_type\\": \\"RHC-satellite\\", + \\"executor_type\\": \\"satellite\\", \\"executor_name\\": \\"Satellite 01bf542e-6092-485c-ba04-c656d77f988a Org 2\\", \\"system_count\\": 1, - \\"connection_status\\": \\"connected\\" + \\"connection_status\\": \\"no_smart_management\\" }, { \\"endpoint_id\\": null, \\"executor_id\\": \\"409dd231-6297-43a6-a726-5ce56923d624\\", - \\"executor_type\\": \\"RHC-satellite\\", + \\"executor_type\\": \\"satellite\\", \\"executor_name\\": \\"Satellite 409dd231-6297-43a6-a726-5ce56923d624 Org 2\\", \\"system_count\\": 1, - \\"connection_status\\": \\"disconnected\\" + \\"connection_status\\": \\"no_smart_management\\" }, { \\"endpoint_id\\": null, \\"executor_id\\": \\"63142926-46a5-498b-9614-01f2f66fd40b\\", - \\"executor_type\\": \\"RHC-satellite\\", + \\"executor_type\\": \\"satellite\\", \\"executor_name\\": \\"Satellite 63142926-46a5-498b-9614-01f2f66fd40b Org 2\\", \\"system_count\\": 5, - \\"connection_status\\": \\"connected\\" + \\"connection_status\\": \\"no_smart_management\\" }, { \\"endpoint_id\\": null, \\"executor_id\\": \\"722ec903-f4b5-4b1f-9c2f-23fc7b0ba390\\", - \\"executor_type\\": \\"RHC-satellite\\", + \\"executor_type\\": \\"satellite\\", \\"executor_name\\": \\"Satellite 722ec903-f4b5-4b1f-9c2f-23fc7b0ba390 Org 2\\", \\"system_count\\": 3, - \\"connection_status\\": \\"connected\\" + \\"connection_status\\": \\"no_smart_management\\" }, { \\"endpoint_id\\": null, \\"executor_id\\": \\"72f44b25-64a7-4ee7-a94e-3beed9393972\\", - \\"executor_type\\": \\"RHC-satellite\\", + \\"executor_type\\": \\"satellite\\", \\"executor_name\\": \\"Satellite 72f44b25-64a7-4ee7-a94e-3beed9393972 Org 2\\", \\"system_count\\": 3, - \\"connection_status\\": \\"connected\\" + \\"connection_status\\": \\"no_smart_management\\" }, { \\"endpoint_id\\": null, @@ -151,16 +151,16 @@ exports[`FiFi connection status get connection status with false smartManagement \\"executor_id\\": null, \\"executor_type\\": \\"RHC\\", \\"executor_name\\": null, - \\"system_count\\": 3, + \\"system_count\\": 1, \\"connection_status\\": \\"connected\\" }, { \\"endpoint_id\\": null, \\"executor_id\\": null, - \\"executor_type\\": \\"None\\", + \\"executor_type\\": \\"RHC\\", \\"executor_name\\": null, - \\"system_count\\": 1, - \\"connection_status\\": \\"connected\\" + \\"system_count\\": 2, + \\"connection_status\\": \\"no_smart_management\\" } ] }" @@ -259,41 +259,41 @@ exports[`FiFi connection status obtains connection status 1`] = ` { \\"endpoint_id\\": null, \\"executor_id\\": \\"01bf542e-6092-485c-ba04-c656d77f988a\\", - \\"executor_type\\": \\"RHC-satellite\\", + \\"executor_type\\": \\"satellite\\", \\"executor_name\\": \\"Satellite 01bf542e-6092-485c-ba04-c656d77f988a Org 2\\", \\"system_count\\": 1, + \\"connection_status\\": \\"no_source\\" + }, + { + \\"endpoint_id\\": \\"805\\", + \\"executor_id\\": \\"722ec903-f4b5-4b1f-9c2f-23fc7b0ba390\\", + \\"executor_type\\": \\"satellite\\", + \\"executor_name\\": \\"Satellite 1 (connected)\\", + \\"system_count\\": 3, \\"connection_status\\": \\"connected\\" }, { - \\"endpoint_id\\": null, + \\"endpoint_id\\": \\"806\\", \\"executor_id\\": \\"409dd231-6297-43a6-a726-5ce56923d624\\", - \\"executor_type\\": \\"RHC-satellite\\", - \\"executor_name\\": \\"Satellite 409dd231-6297-43a6-a726-5ce56923d624 Org 2\\", + \\"executor_type\\": \\"satellite\\", + \\"executor_name\\": \\"Satellite 2 (disconnected)\\", \\"system_count\\": 1, \\"connection_status\\": \\"disconnected\\" }, { \\"endpoint_id\\": null, - \\"executor_id\\": \\"63142926-46a5-498b-9614-01f2f66fd40b\\", - \\"executor_type\\": \\"RHC-satellite\\", - \\"executor_name\\": \\"Satellite 63142926-46a5-498b-9614-01f2f66fd40b Org 2\\", - \\"system_count\\": 5, - \\"connection_status\\": \\"connected\\" - }, - { - \\"endpoint_id\\": null, - \\"executor_id\\": \\"722ec903-f4b5-4b1f-9c2f-23fc7b0ba390\\", - \\"executor_type\\": \\"RHC-satellite\\", - \\"executor_name\\": \\"Satellite 722ec903-f4b5-4b1f-9c2f-23fc7b0ba390 Org 2\\", + \\"executor_id\\": \\"72f44b25-64a7-4ee7-a94e-3beed9393972\\", + \\"executor_type\\": \\"satellite\\", + \\"executor_name\\": \\"Satellite 3 (no receptor configured)\\", \\"system_count\\": 3, - \\"connection_status\\": \\"connected\\" + \\"connection_status\\": \\"no_receptor\\" }, { - \\"endpoint_id\\": null, - \\"executor_id\\": \\"72f44b25-64a7-4ee7-a94e-3beed9393972\\", - \\"executor_type\\": \\"RHC-satellite\\", - \\"executor_name\\": \\"Satellite 72f44b25-64a7-4ee7-a94e-3beed9393972 Org 2\\", - \\"system_count\\": 3, + \\"endpoint_id\\": \\"808\\", + \\"executor_id\\": \\"63142926-46a5-498b-9614-01f2f66fd40b\\", + \\"executor_type\\": \\"satellite\\", + \\"executor_name\\": \\"Satellite 4 (connected)\\", + \\"system_count\\": 5, \\"connection_status\\": \\"connected\\" }, { @@ -317,16 +317,16 @@ exports[`FiFi connection status obtains connection status 1`] = ` \\"executor_id\\": null, \\"executor_type\\": \\"RHC\\", \\"executor_name\\": null, - \\"system_count\\": 3, + \\"system_count\\": 2, \\"connection_status\\": \\"connected\\" }, { \\"endpoint_id\\": null, \\"executor_id\\": null, - \\"executor_type\\": \\"None\\", + \\"executor_type\\": \\"RHC\\", \\"executor_name\\": null, \\"system_count\\": 1, - \\"connection_status\\": \\"connected\\" + \\"connection_status\\": \\"no_rhc\\" } ] }" diff --git a/src/remediations/fifi.integration.js b/src/remediations/fifi.integration.js index e2b83700..a38b239b 100644 --- a/src/remediations/fifi.integration.js +++ b/src/remediations/fifi.integration.js @@ -157,14 +157,14 @@ describe('FiFi', function () { .set(auth.fifi) .expect(200); - headers.etag.should.equal('"b3f-ap0xZBE6LAEw4CWgNSPJ+fei+6I"'); + headers.etag.should.equal('"14d3-oEuP8tEpA8HcXXDPWOOrISoZRR4"'); }); test('304s on ETag match', async () => { await request .get('/v1/remediations/0ecb5db7-2f1a-441b-8220-e5ce45066f50/connection_status?pretty') .set(auth.fifi) - .set('if-none-match', '"b3f-ap0xZBE6LAEw4CWgNSPJ+fei+6I"') + .set('if-none-match', '"14d3-oEuP8tEpA8HcXXDPWOOrISoZRR4"') .expect(304); }); }); diff --git a/src/remediations/routes.js b/src/remediations/routes.js index 62d8dcfa..b2a6b99b 100644 --- a/src/remediations/routes.js +++ b/src/remediations/routes.js @@ -43,7 +43,7 @@ module.exports = function (router) { .get(openapi('checkExecutable'), rbacRead, fifi.checkExecutable); router.route('/remediations/:id/connection_status') - .get(trace, openapi('getRemediationConnectionStatus'), rbacExecute, fifi2.connection_status); + .get(trace, openapi('getRemediationConnectionStatus'), rbacExecute, fifi.connection_status); router.route('/remediations/:id/playbook_runs') .get(openapi('listPlaybookRuns'), rbacRead, fifi.listPlaybookRuns)