From 774626e5e176c51ee2dea3d2a9036eba4676098c Mon Sep 17 00:00:00 2001 From: Anna Henningsen Date: Fri, 12 Aug 2022 19:00:32 +0200 Subject: [PATCH 1/2] fix(compass): include node-forge in unpacked node_modules COMPASS-5802 Since it is a dependency of win-export-certificate-and-key, node-forge should also be unpacked, like its dependent. This adds an e2e test for verifying that the shell works when connecting to Atlas using tlsUseSystemCA (since that is an environment which always uses TLS and should always match the system CA suite). --- .../tests/connection.test.ts | 27 +++++++++++++++++++ packages/compass/package.json | 1 + 2 files changed, 28 insertions(+) diff --git a/packages/compass-e2e-tests/tests/connection.test.ts b/packages/compass-e2e-tests/tests/connection.test.ts index fccab62dc67..49a1d9d8aab 100644 --- a/packages/compass-e2e-tests/tests/connection.test.ts +++ b/packages/compass-e2e-tests/tests/connection.test.ts @@ -429,6 +429,33 @@ describe('Connection screen', function () { expect(result).to.have.property('ok', 1); }); + it('can connect to an Atlas with tlsUseSystemCA', async function () { + if (!hasAtlasEnvironmentVariables()) { + return this.skip(); + } + + const username = process.env.E2E_TESTS_ATLAS_USERNAME ?? ''; + const password = process.env.E2E_TESTS_ATLAS_PASSWORD ?? ''; + const host = process.env.E2E_TESTS_ATLAS_HOST ?? ''; + + await browser.connectWithConnectionForm({ + scheme: 'MONGODB_SRV', + authMethod: 'DEFAULT', + defaultUsername: username, + defaultPassword: password, + hosts: [host], + sslConnection: 'ON', + useSystemCA: true + }); + // NB: The fact that we can use the shell is a regression test for COMPASS-5802. + const result = await browser.shellEval( + 'db.runCommand({ connectionStatus: 1 })', + true + ); + await new Promise(resolve => setTimeout(resolve, 10000)); + expect(result).to.have.property('ok', 1); + }); + it('can connect to Atlas Serverless', async function () { if (!hasAtlasEnvironmentVariables()) { return this.skip(); diff --git a/packages/compass/package.json b/packages/compass/package.json index e0785b7f95d..06718fdbcf4 100644 --- a/packages/compass/package.json +++ b/packages/compass/package.json @@ -110,6 +110,7 @@ "**/win-export-certificate-and-key/**", "**/macos-export-certificate-and-key/**", "**/system-ca/**", + "**/node-forge/**", "**/mongo_crypt_v1.*" ] }, From 027f06a3c600452c14786f6d02511b8cbde9bd89 Mon Sep 17 00:00:00 2001 From: Anna Henningsen Date: Mon, 22 Aug 2022 11:44:59 +0200 Subject: [PATCH 2/2] fixup: reformat --- packages/compass-e2e-tests/tests/connection.test.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/compass-e2e-tests/tests/connection.test.ts b/packages/compass-e2e-tests/tests/connection.test.ts index 49a1d9d8aab..5043629c81e 100644 --- a/packages/compass-e2e-tests/tests/connection.test.ts +++ b/packages/compass-e2e-tests/tests/connection.test.ts @@ -445,14 +445,14 @@ describe('Connection screen', function () { defaultPassword: password, hosts: [host], sslConnection: 'ON', - useSystemCA: true + useSystemCA: true, }); // NB: The fact that we can use the shell is a regression test for COMPASS-5802. const result = await browser.shellEval( 'db.runCommand({ connectionStatus: 1 })', true ); - await new Promise(resolve => setTimeout(resolve, 10000)); + await new Promise((resolve) => setTimeout(resolve, 10000)); expect(result).to.have.property('ok', 1); });