@mongosh/cli-repl 1.3.0 → 1.4.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/AUTHORS +1 -0
- package/lib/arg-parser.d.ts +1 -1
- package/lib/arg-parser.js +3 -2
- package/lib/arg-parser.js.map +1 -1
- package/lib/async-repl.js +5 -5
- package/lib/async-repl.js.map +1 -1
- package/lib/build-info.json +1 -1
- package/lib/cli-repl.d.ts +7 -6
- package/lib/cli-repl.js +38 -43
- package/lib/cli-repl.js.map +1 -1
- package/lib/config-directory.js +1 -1
- package/lib/config-directory.js.map +1 -1
- package/lib/constants.js +13 -13
- package/lib/constants.js.map +1 -1
- package/lib/csfle-library-paths.d.ts +10 -0
- package/lib/csfle-library-paths.js +80 -0
- package/lib/csfle-library-paths.js.map +1 -0
- package/lib/format-output.js +24 -20
- package/lib/format-output.js.map +1 -1
- package/lib/index.d.ts +1 -3
- package/lib/index.js +1 -5
- package/lib/index.js.map +1 -1
- package/lib/mongosh-repl.d.ts +2 -2
- package/lib/mongosh-repl.js +25 -21
- package/lib/mongosh-repl.js.map +1 -1
- package/lib/run.js +23 -16
- package/lib/run.js.map +1 -1
- package/lib/smoke-tests-fle.js +3 -3
- package/lib/smoke-tests.js +5 -5
- package/lib/smoke-tests.js.map +1 -1
- package/lib/tls-certificate-selector.d.ts +5 -0
- package/lib/tls-certificate-selector.js +46 -0
- package/lib/tls-certificate-selector.js.map +1 -0
- package/package.json +35 -20
- package/lib/arg-mapper.d.ts +0 -8
- package/lib/arg-mapper.js +0 -124
- package/lib/arg-mapper.js.map +0 -1
- package/lib/mongocryptd-manager.d.ts +0 -30
- package/lib/mongocryptd-manager.js +0 -230
- package/lib/mongocryptd-manager.js.map +0 -1
package/lib/run.js
CHANGED
|
@@ -5,8 +5,10 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
const index_1 = require("./index");
|
|
7
7
|
const config_directory_1 = require("./config-directory");
|
|
8
|
-
const
|
|
8
|
+
const csfle_library_paths_1 = require("./csfle-library-paths");
|
|
9
|
+
const tls_certificate_selector_1 = require("./tls-certificate-selector");
|
|
9
10
|
const history_1 = require("@mongosh/history");
|
|
11
|
+
const arg_parser_1 = require("@mongosh/arg-parser");
|
|
10
12
|
const module_1 = require("module");
|
|
11
13
|
const readline_1 = __importDefault(require("readline"));
|
|
12
14
|
const askcharacter_1 = __importDefault(require("askcharacter"));
|
|
@@ -20,7 +22,7 @@ const stream_1 = __importDefault(require("stream"));
|
|
|
20
22
|
let repl;
|
|
21
23
|
let isSingleConsoleProcess = false;
|
|
22
24
|
try {
|
|
23
|
-
const options = index_1.parseCliArgs(process.argv);
|
|
25
|
+
const options = (0, index_1.parseCliArgs)(process.argv);
|
|
24
26
|
for (const warning of options._argParseWarnings) {
|
|
25
27
|
console.warn(warning);
|
|
26
28
|
}
|
|
@@ -32,22 +34,23 @@ const stream_1 = __importDefault(require("stream"));
|
|
|
32
34
|
console.log(version);
|
|
33
35
|
}
|
|
34
36
|
else if (options.buildInfo) {
|
|
35
|
-
console.log(JSON.stringify(index_1.buildInfo(), null, ' '));
|
|
37
|
+
console.log(JSON.stringify((0, index_1.buildInfo)(), null, ' '));
|
|
36
38
|
}
|
|
37
39
|
else if (options.smokeTests) {
|
|
38
40
|
const smokeTestServer = process.env.MONGOSH_SMOKE_TEST_SERVER;
|
|
41
|
+
const csfleLibraryOpts = options.csfleLibraryPath ? [
|
|
42
|
+
`--csfleLibraryPath=${options.csfleLibraryPath}`
|
|
43
|
+
] : [];
|
|
39
44
|
if (process.execPath === process.argv[1]) {
|
|
40
|
-
await index_1.runSmokeTests(smokeTestServer, process.execPath);
|
|
45
|
+
await (0, index_1.runSmokeTests)(smokeTestServer, process.execPath, ...csfleLibraryOpts);
|
|
41
46
|
}
|
|
42
47
|
else {
|
|
43
|
-
await index_1.runSmokeTests(smokeTestServer, process.execPath, process.argv[1]);
|
|
48
|
+
await (0, index_1.runSmokeTests)(smokeTestServer, process.execPath, process.argv[1], ...csfleLibraryOpts);
|
|
44
49
|
}
|
|
45
50
|
}
|
|
46
51
|
else {
|
|
47
|
-
let mongocryptdSpawnPaths = [['mongocryptd']];
|
|
48
52
|
if (process.execPath === process.argv[1]) {
|
|
49
53
|
process.removeAllListeners('warning');
|
|
50
|
-
mongocryptdSpawnPaths = await index_1.getMongocryptdPaths();
|
|
51
54
|
}
|
|
52
55
|
if (process.env.CLEAR_SIGINT_LISTENERS) {
|
|
53
56
|
process.removeAllListeners('SIGINT');
|
|
@@ -69,35 +72,39 @@ const stream_1 = __importDefault(require("stream"));
|
|
|
69
72
|
}
|
|
70
73
|
}
|
|
71
74
|
}
|
|
72
|
-
const
|
|
73
|
-
|
|
74
|
-
|
|
75
|
+
const connectionInfo = (0, arg_parser_1.generateConnectionInfoFromCliArgs)(options);
|
|
76
|
+
connectionInfo.driverOptions = {
|
|
77
|
+
...connectionInfo.driverOptions,
|
|
78
|
+
...(0, tls_certificate_selector_1.getTlsCertificateSelector)(options.tlsCertificateSelector),
|
|
79
|
+
driverInfo: { name: 'mongosh', version }
|
|
80
|
+
};
|
|
81
|
+
const title = `mongosh ${(0, history_1.redactURICredentials)(connectionInfo.connectionString)}`;
|
|
75
82
|
process.title = title;
|
|
76
83
|
setTerminalWindowTitle(title);
|
|
77
|
-
const shellHomePaths = config_directory_1.getStoragePaths();
|
|
78
|
-
const globalConfigPaths = config_directory_1.getGlobalConfigPaths();
|
|
84
|
+
const shellHomePaths = (0, config_directory_1.getStoragePaths)();
|
|
85
|
+
const globalConfigPaths = (0, config_directory_1.getGlobalConfigPaths)();
|
|
79
86
|
repl = new index_1.CliRepl({
|
|
80
87
|
shellCliOptions: {
|
|
81
88
|
...options,
|
|
82
89
|
},
|
|
83
|
-
|
|
90
|
+
getCSFLELibraryPaths: csfle_library_paths_1.getCSFLELibraryPaths,
|
|
84
91
|
input: process.stdin,
|
|
85
92
|
output: process.stdout,
|
|
86
93
|
onExit: process.exit,
|
|
87
94
|
shellHomePaths: shellHomePaths,
|
|
88
95
|
globalConfigPaths: globalConfigPaths
|
|
89
96
|
});
|
|
90
|
-
await repl.start(
|
|
97
|
+
await repl.start(connectionInfo.connectionString, connectionInfo.driverOptions);
|
|
91
98
|
}
|
|
92
99
|
}
|
|
93
100
|
catch (e) {
|
|
94
|
-
console.error(`${e.name}: ${e.message}`);
|
|
101
|
+
console.error(`${e === null || e === void 0 ? void 0 : e.name}: ${e === null || e === void 0 ? void 0 : e.message}`);
|
|
95
102
|
if (repl !== undefined) {
|
|
96
103
|
repl.bus.emit('mongosh:error', e, 'startup');
|
|
97
104
|
}
|
|
98
105
|
if (isSingleConsoleProcess) {
|
|
99
106
|
process.stdout.write('Press any key to exit: ');
|
|
100
|
-
await askcharacter_1.default({ input: process.stdin, output: process.stdout });
|
|
107
|
+
await (0, askcharacter_1.default)({ input: process.stdin, output: process.stdout });
|
|
101
108
|
process.stdout.write('\n');
|
|
102
109
|
}
|
|
103
110
|
process.exit(1);
|
package/lib/run.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"run.js","sourceRoot":"","sources":["../src/run.ts"],"names":[],"mappings":";;;;;AAAA,
|
|
1
|
+
{"version":3,"file":"run.js","sourceRoot":"","sources":["../src/run.ts"],"names":[],"mappings":";;;;;AAAA,mCAAiF;AACjF,yDAA2E;AAC3E,+DAA6D;AAC7D,yEAAuE;AACvE,8CAAwD;AACxD,oDAAwE;AACxE,mCAAiC;AACjC,wDAAgC;AAChC,gEAAwC;AACxC,oDAA4B;AAG5B,CAAC,KAAK,IAAG,EAAE;IACT,IAAI,OAAO,CAAC,GAAG,CAAC,uBAAuB,EAAE;QAGvC,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;QACzB,gBAAe,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC;QAClC,OAAO;KACR;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ACH,CAAC,CAAC,EAAE,CAAC;AAQL,SAAS,sBAAsB,CAAC,KAAa;;IAC3C,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,KAAK,EAAE;QACzB,OAAO;KACR;IAGD,MAAM,IAAI,GAAG,MAAA,OAAO,CAAC,GAAG,CAAC,IAAI,mCAAI,EAAE,CAAC;IACpC,IAAI,qBAAqB,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE;QACpC,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,YAAY,KAAK,QAAQ,CAAC,CAAC;KACjD;SAAM,IAAI,SAAS,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE;QAC/B,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,UAAU,KAAK,UAAU,CAAC,CAAC;KACjD;AACH,CAAC;AASD,KAAK,UAAU,GAAG,CAAC,MAAc;IAG/B,MAAM,SAAS,GAAG,OAAO,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,gBAAM,CAAC,WAAW,EAAE,CAAC,CAAC;IAC/D,IAAI;QACF,MAAM,iBAAiB,GAAG,kBAAQ,CAAC,eAAe,CAAC;YACjD,KAAK,EAAE,SAAS;YAChB,MAAM,EAAE,OAAO,CAAC,MAAM;YACtB,MAAM;SACP,CAAC,CAAC;QACH,iBAAiB,CAAC,MAAM,EAAE,CAAC;QAE3B,IAAI,KAAK,EAAE,MAAM,IAAI,IAAI,iBAAiB,EAAE;YAC1C,OAAO,IAAI,CAAC;SACb;QACD,OAAO,EAAE,CAAC;KACX;YAAS;QACR,OAAO,CAAC,KAAK,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC;KACjC;AACH,CAAC"}
|
package/lib/smoke-tests-fle.js
CHANGED
|
@@ -8,9 +8,9 @@ const assert = function(value, message) {
|
|
|
8
8
|
process.exit(1);
|
|
9
9
|
}
|
|
10
10
|
};
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
11
|
+
if (process.platform === 'linux' && process.arch === 's390x') {
|
|
12
|
+
// There is no CSFLE shared library binary for the rhel72 s390x that we test on.
|
|
13
|
+
// We will address this in MONGOSH-862.
|
|
14
14
|
print('Test skipped')
|
|
15
15
|
process.exit(0);
|
|
16
16
|
}
|
package/lib/smoke-tests.js
CHANGED
|
@@ -12,7 +12,7 @@ const smoke_tests_fle_1 = __importDefault(require("./smoke-tests-fle"));
|
|
|
12
12
|
async function runSmokeTests(smokeTestServer, executable, ...args) {
|
|
13
13
|
console.log('MONGOSH_SMOKE_TEST_SERVER set?', !!smokeTestServer);
|
|
14
14
|
if (process.env.IS_CI) {
|
|
15
|
-
assert_1.default(!!smokeTestServer, 'Make sure MONGOSH_SMOKE_TEST_SERVER is set in CI');
|
|
15
|
+
(0, assert_1.default)(!!smokeTestServer, 'Make sure MONGOSH_SMOKE_TEST_SERVER is set in CI');
|
|
16
16
|
}
|
|
17
17
|
for (const { input, output, testArgs } of [{
|
|
18
18
|
input: 'print("He" + "llo" + " Wor" + "ld!")',
|
|
@@ -40,19 +40,19 @@ async function runSmokeTests(smokeTestServer, executable, ...args) {
|
|
|
40
40
|
}
|
|
41
41
|
exports.runSmokeTests = runSmokeTests;
|
|
42
42
|
async function runSmokeTest(executable, args, input, output) {
|
|
43
|
-
const proc = child_process_1.spawn(executable, [...args], {
|
|
43
|
+
const proc = (0, child_process_1.spawn)(executable, [...args], {
|
|
44
44
|
stdio: ['pipe', 'pipe', 'inherit']
|
|
45
45
|
});
|
|
46
46
|
let stdout = '';
|
|
47
47
|
proc.stdout.setEncoding('utf8').on('data', (chunk) => { stdout += chunk; });
|
|
48
48
|
proc.stdin.end(input);
|
|
49
|
-
await events_1.once(proc.stdout, 'end');
|
|
49
|
+
await (0, events_1.once)(proc.stdout, 'end');
|
|
50
50
|
try {
|
|
51
51
|
assert_1.default.match(stdout, output);
|
|
52
|
-
console.error({ status: 'success', input, output, stdout, executable, args: args.map(arg => history_1.redactURICredentials(arg)) });
|
|
52
|
+
console.error({ status: 'success', input, output, stdout, executable, args: args.map(arg => (0, history_1.redactURICredentials)(arg)) });
|
|
53
53
|
}
|
|
54
54
|
catch (err) {
|
|
55
|
-
console.error({ status: 'failure', input, output, stdout, executable, args: args.map(arg => history_1.redactURICredentials(arg)) });
|
|
55
|
+
console.error({ status: 'failure', input, output, stdout, executable, args: args.map(arg => (0, history_1.redactURICredentials)(arg)) });
|
|
56
56
|
throw err;
|
|
57
57
|
}
|
|
58
58
|
}
|
package/lib/smoke-tests.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"smoke-tests.js","sourceRoot":"","sources":["../src/smoke-tests.ts"],"names":[],"mappings":";;;;;;AACA,iDAAsC;AACtC,oDAA4B;AAC5B,mCAA8B;AAC9B,8CAAwD;AACxD,wEAAmD;AAW5C,KAAK,UAAU,aAAa,CAAC,eAAmC,EAAE,UAAkB,EAAE,GAAG,IAAc;IAC5G,OAAO,CAAC,GAAG,CAAC,gCAAgC,EAAE,CAAC,CAAC,eAAe,CAAC,CAAC;IACjE,IAAI,OAAO,CAAC,GAAG,CAAC,KAAK,EAAE;QACrB,gBAAM,
|
|
1
|
+
{"version":3,"file":"smoke-tests.js","sourceRoot":"","sources":["../src/smoke-tests.ts"],"names":[],"mappings":";;;;;;AACA,iDAAsC;AACtC,oDAA4B;AAC5B,mCAA8B;AAC9B,8CAAwD;AACxD,wEAAmD;AAW5C,KAAK,UAAU,aAAa,CAAC,eAAmC,EAAE,UAAkB,EAAE,GAAG,IAAc;IAC5G,OAAO,CAAC,GAAG,CAAC,gCAAgC,EAAE,CAAC,CAAC,eAAe,CAAC,CAAC;IACjE,IAAI,OAAO,CAAC,GAAG,CAAC,KAAK,EAAE;QACrB,IAAA,gBAAM,EAAC,CAAC,CAAC,eAAe,EAAE,kDAAkD,CAAC,CAAC;KAC/E;IAED,KAAK,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAE,IAAI,CAAC;YACzC,KAAK,EAAE,sCAAsC;YAC7C,MAAM,EAAE,cAAc;YACtB,Q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AS,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,UAAU,EAAE,IAAI,EAAE,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE,CAAC,IAAA,8BAAoB,EAAC,GAAG,CAAC,CAAC,EAAE,CAAC,CAAC;KAC3H;IAAC,OAAO,GAAQ,EAAE;QACjB,OAAO,CAAC,KAAK,CAAC,EAAE,MAAM,EAAE,SAAS,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,UAAU,EAAE,IAAI,EAAE,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE,CAAC,IAAA,8BAAoB,EAAC,GAAG,CAAC,CAAC,EAAE,CAAC,CAAC;QAC1H,MAAM,GAAG,CAAC;KACX;AACH,CAAC"}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getTlsCertificateSelector = void 0;
|
|
4
|
+
const errors_1 = require("@mongosh/errors");
|
|
5
|
+
function getTlsCertificateSelector(selector) {
|
|
6
|
+
var _a, _b, _c;
|
|
7
|
+
if (!selector) {
|
|
8
|
+
return;
|
|
9
|
+
}
|
|
10
|
+
const exportCertificateAndPrivateKey = getCertificateExporter();
|
|
11
|
+
if (!exportCertificateAndPrivateKey) {
|
|
12
|
+
throw new errors_1.MongoshUnimplementedError('--tlsCertificateSelector is not supported on this platform');
|
|
13
|
+
}
|
|
14
|
+
const match = selector.match(/^(?<key>\w+)=(?<value>.+)/);
|
|
15
|
+
if (!match || !['subject', 'thumbprint'].includes((_b = (_a = match.groups) === null || _a === void 0 ? void 0 : _a.key) !== null && _b !== void 0 ? _b : '')) {
|
|
16
|
+
throw new errors_1.MongoshInvalidInputError('--tlsCertificateSelector needs to include subject or thumbprint');
|
|
17
|
+
}
|
|
18
|
+
const { key, value } = (_c = match.groups) !== null && _c !== void 0 ? _c : {};
|
|
19
|
+
const search = key === 'subject' ? { subject: value } : { thumbprint: Buffer.from(value, 'hex') };
|
|
20
|
+
try {
|
|
21
|
+
const { passphrase, pfx } = exportCertificateAndPrivateKey(search);
|
|
22
|
+
return { passphrase, pfx };
|
|
23
|
+
}
|
|
24
|
+
catch (err) {
|
|
25
|
+
throw new errors_1.MongoshInvalidInputError(`Could not resolve certificate specification '${selector}': ${err === null || err === void 0 ? void 0 : err.message}`);
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
exports.getTlsCertificateSelector = getTlsCertificateSelector;
|
|
29
|
+
function getCertificateExporter() {
|
|
30
|
+
if (process.env.TEST_OS_EXPORT_CERTIFICATE_AND_KEY_PATH) {
|
|
31
|
+
return require(process.env.TEST_OS_EXPORT_CERTIFICATE_AND_KEY_PATH);
|
|
32
|
+
}
|
|
33
|
+
try {
|
|
34
|
+
switch (process.platform) {
|
|
35
|
+
case 'win32':
|
|
36
|
+
return require('win-export-certificate-and-key');
|
|
37
|
+
case 'darwin':
|
|
38
|
+
return require('macos-export-certificate-and-key');
|
|
39
|
+
default:
|
|
40
|
+
return undefined;
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
catch (_a) { }
|
|
44
|
+
return undefined;
|
|
45
|
+
}
|
|
46
|
+
//# sourceMappingURL=tls-certificate-selector.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tls-certificate-selector.js","sourceRoot":"","sources":["../src/tls-certificate-selector.ts"],"names":[],"mappings":";;;AAAA,4CAAsF;AAGtF,SAAgB,yBAAyB,CACvC,QAA4B;;IAE5B,IAAI,CAAC,QAAQ,EAAE;QACb,OAAO;KACR;IAED,MAAM,8BAA8B,GAAG,sBAAsB,EAAE,CAAC;IAChE,IAAI,CAAC,8BAA8B,EAAE;QACnC,MAAM,IAAI,kCAAyB,CAAC,4DAA4D,CAAC,CAAC;KACnG;IAED,MAAM,KAAK,GAAG,QAAQ,CAAC,KAAK,CAAC,2BAA2B,CAAC,CAAC;IAC1D,IAAI,CAAC,KAAK,IAAI,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1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mongosh/cli-repl",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.4.2",
|
|
4
4
|
"description": "MongoDB Shell CLI REPL Package",
|
|
5
5
|
"homepage": "https://github.com/mongodb-js/mongosh",
|
|
6
6
|
"author": "Compass Team <team-compass@10gen.com>",
|
|
@@ -38,31 +38,44 @@
|
|
|
38
38
|
"engines": {
|
|
39
39
|
"node": ">=14.15.0"
|
|
40
40
|
},
|
|
41
|
+
"mongosh": {
|
|
42
|
+
"ciRequiredOptionalDependencies": {
|
|
43
|
+
"macos-export-certificate-and-key": [
|
|
44
|
+
"darwin"
|
|
45
|
+
],
|
|
46
|
+
"win-export-certificate-and-key": [
|
|
47
|
+
"win32"
|
|
48
|
+
],
|
|
49
|
+
"get-console-process-list": [
|
|
50
|
+
"win32"
|
|
51
|
+
]
|
|
52
|
+
}
|
|
53
|
+
},
|
|
41
54
|
"dependencies": {
|
|
42
|
-
"@mongosh/
|
|
43
|
-
"@mongosh/
|
|
44
|
-
"@mongosh/
|
|
45
|
-
"@mongosh/
|
|
46
|
-
"@mongosh/
|
|
47
|
-
"@mongosh/
|
|
48
|
-
"@mongosh/
|
|
49
|
-
"@mongosh/
|
|
50
|
-
"@mongosh/service-provider-
|
|
51
|
-
"@mongosh/
|
|
52
|
-
"@mongosh/shell-
|
|
53
|
-
"@mongosh/
|
|
54
|
-
"@mongosh/
|
|
55
|
+
"@mongosh/arg-parser": "1.4.2",
|
|
56
|
+
"@mongosh/autocomplete": "1.4.2",
|
|
57
|
+
"@mongosh/editor": "1.4.2",
|
|
58
|
+
"@mongosh/errors": "1.4.2",
|
|
59
|
+
"@mongosh/history": "1.4.2",
|
|
60
|
+
"@mongosh/i18n": "1.4.2",
|
|
61
|
+
"@mongosh/js-multiline-to-singleline": "1.4.2",
|
|
62
|
+
"@mongosh/logging": "1.4.2",
|
|
63
|
+
"@mongosh/service-provider-core": "1.4.2",
|
|
64
|
+
"@mongosh/service-provider-server": "1.4.2",
|
|
65
|
+
"@mongosh/shell-api": "1.4.2",
|
|
66
|
+
"@mongosh/shell-evaluator": "1.4.2",
|
|
67
|
+
"@mongosh/snippet-manager": "1.4.2",
|
|
68
|
+
"@mongosh/types": "1.4.2",
|
|
55
69
|
"analytics-node": "^3.4.0-beta.1",
|
|
56
70
|
"ansi-escape-sequences": "^5.1.2",
|
|
57
71
|
"askcharacter": "^1.0.0",
|
|
58
72
|
"askpassword": "^1.2.4",
|
|
59
73
|
"is-recoverable-error": "^1.0.2",
|
|
60
74
|
"js-yaml": "^4.1.0",
|
|
61
|
-
"
|
|
62
|
-
"mongodb-connection-string-url": "^2.3.2",
|
|
75
|
+
"mongodb-connection-string-url": "^2.5.2",
|
|
63
76
|
"mongodb-log-writer": "^1.1.3",
|
|
64
77
|
"nanobus": "^4.4.0",
|
|
65
|
-
"
|
|
78
|
+
"numeral": "^2.0.6",
|
|
66
79
|
"pretty-repl": "^3.1.1",
|
|
67
80
|
"semver": "^7.1.2",
|
|
68
81
|
"strip-ansi": "^6.0.0",
|
|
@@ -74,18 +87,20 @@
|
|
|
74
87
|
"@types/ansi-escape-sequences": "^4.0.0",
|
|
75
88
|
"@types/chai-as-promised": "^7.1.3",
|
|
76
89
|
"@types/js-yaml": "^4.0.5",
|
|
77
|
-
"@types/lodash.set": "^4.3.6",
|
|
78
90
|
"@types/node": "^14.14.5",
|
|
91
|
+
"@types/numeral": "^2.0.2",
|
|
79
92
|
"@types/text-table": "^0.2.1",
|
|
80
93
|
"@types/yargs-parser": "^15.0.0",
|
|
81
94
|
"chai-as-promised": "^7.1.1",
|
|
82
95
|
"lodash": "^4.17.21",
|
|
83
|
-
"moment": "^2.29.1"
|
|
96
|
+
"moment": "^2.29.1",
|
|
97
|
+
"mongodb-csfle-library-dummy": "^1.0.1"
|
|
84
98
|
},
|
|
85
99
|
"optionalDependencies": {
|
|
86
100
|
"get-console-process-list": "^1.0.4",
|
|
87
101
|
"macos-export-certificate-and-key": "^1.1.1",
|
|
102
|
+
"mongodb-csfle-library-version": "^1.0.2",
|
|
88
103
|
"win-export-certificate-and-key": "^1.1.1"
|
|
89
104
|
},
|
|
90
|
-
"gitHead": "
|
|
105
|
+
"gitHead": "7daf54d237b923567f44725816de7f62f471df11"
|
|
91
106
|
}
|
package/lib/arg-mapper.d.ts
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
/// <reference types="node" />
|
|
2
|
-
import { CliOptions, DevtoolsConnectOptions } from '@mongosh/service-provider-server';
|
|
3
|
-
declare function mapCliToDriver(options: CliOptions): DevtoolsConnectOptions;
|
|
4
|
-
export declare function getTlsCertificateSelector(selector: string | undefined): {
|
|
5
|
-
passphrase: string;
|
|
6
|
-
pfx: Buffer;
|
|
7
|
-
} | undefined;
|
|
8
|
-
export default mapCliToDriver;
|
package/lib/arg-mapper.js
DELETED
|
@@ -1,124 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.getTlsCertificateSelector = void 0;
|
|
7
|
-
const errors_1 = require("@mongosh/errors");
|
|
8
|
-
const lodash_set_1 = __importDefault(require("lodash.set"));
|
|
9
|
-
const MAPPINGS = {
|
|
10
|
-
apiDeprecationErrors: 'serverApi.deprecationErrors',
|
|
11
|
-
apiStrict: 'serverApi.strict',
|
|
12
|
-
apiVersion: 'serverApi.version',
|
|
13
|
-
awsAccessKeyId: 'autoEncryption.kmsProviders.aws.accessKeyId',
|
|
14
|
-
awsSecretAccessKey: 'autoEncryption.kmsProviders.aws.secretAccessKey',
|
|
15
|
-
awsSessionToken: 'autoEncryption.kmsProviders.aws.sessionToken',
|
|
16
|
-
awsIamSessionToken: 'authMechanismProperties.AWS_SESSION_TOKEN',
|
|
17
|
-
gssapiServiceName: 'authMechanismProperties.SERVICE_NAME',
|
|
18
|
-
sspiRealmOverride: 'authMechanismProperties.SERVICE_REALM',
|
|
19
|
-
sspiHostnameCanonicalization: { opt: 'authMechanismProperties.CANONICALIZE_HOST_NAME', fun: mapGSSAPIHostnameCanonicalization },
|
|
20
|
-
authenticationDatabase: 'authSource',
|
|
21
|
-
authenticationMechanism: 'authMechanism',
|
|
22
|
-
keyVaultNamespace: 'autoEncryption.keyVaultNamespace',
|
|
23
|
-
password: 'auth.password',
|
|
24
|
-
quiet: { opt: 'loggerLevel', val: 'error' },
|
|
25
|
-
retryWrites: 'retryWrites',
|
|
26
|
-
tls: 'tls',
|
|
27
|
-
tlsAllowInvalidCertificates: 'tlsAllowInvalidCertificates',
|
|
28
|
-
tlsAllowInvalidHostnames: 'tlsAllowInvalidHostnames',
|
|
29
|
-
tlsCAFile: 'tlsCAFile',
|
|
30
|
-
tlsCRLFile: 'sslCRL',
|
|
31
|
-
tlsCertificateKeyFile: 'tlsCertificateKeyFile',
|
|
32
|
-
tlsCertificateKeyFilePassword: 'tlsCertificateKeyFilePassword',
|
|
33
|
-
tlsUseSystemCA: 'useSystemCA',
|
|
34
|
-
username: 'auth.username',
|
|
35
|
-
verbose: { opt: 'loggerLevel', val: 'debug' }
|
|
36
|
-
};
|
|
37
|
-
function isExistingMappingKey(key, options) {
|
|
38
|
-
return MAPPINGS.hasOwnProperty(key) && options.hasOwnProperty(key);
|
|
39
|
-
}
|
|
40
|
-
function mapCliToDriver(options) {
|
|
41
|
-
const nodeOptions = {};
|
|
42
|
-
for (const cliOption of Object.keys(MAPPINGS)) {
|
|
43
|
-
if (isExistingMappingKey(cliOption, options)) {
|
|
44
|
-
const mapping = MAPPINGS[cliOption];
|
|
45
|
-
if (typeof mapping === 'object') {
|
|
46
|
-
const cliValue = options[cliOption];
|
|
47
|
-
if (cliValue) {
|
|
48
|
-
let newValue;
|
|
49
|
-
if ('val' in mapping) {
|
|
50
|
-
newValue = mapping.val;
|
|
51
|
-
}
|
|
52
|
-
else {
|
|
53
|
-
newValue = mapping.fun(cliValue);
|
|
54
|
-
if (newValue === undefined) {
|
|
55
|
-
continue;
|
|
56
|
-
}
|
|
57
|
-
}
|
|
58
|
-
lodash_set_1.default(nodeOptions, mapping.opt, newValue);
|
|
59
|
-
}
|
|
60
|
-
}
|
|
61
|
-
else {
|
|
62
|
-
lodash_set_1.default(nodeOptions, mapping, options[cliOption]);
|
|
63
|
-
}
|
|
64
|
-
}
|
|
65
|
-
}
|
|
66
|
-
const { version } = require('../package.json');
|
|
67
|
-
return {
|
|
68
|
-
...nodeOptions,
|
|
69
|
-
...getTlsCertificateSelector(options.tlsCertificateSelector),
|
|
70
|
-
driverInfo: { name: 'mongosh', version }
|
|
71
|
-
};
|
|
72
|
-
}
|
|
73
|
-
function getTlsCertificateSelector(selector) {
|
|
74
|
-
var _a, _b, _c;
|
|
75
|
-
if (!selector) {
|
|
76
|
-
return;
|
|
77
|
-
}
|
|
78
|
-
const exportCertificateAndPrivateKey = getCertificateExporter();
|
|
79
|
-
if (!exportCertificateAndPrivateKey) {
|
|
80
|
-
throw new errors_1.MongoshUnimplementedError('--tlsCertificateSelector is not supported on this platform');
|
|
81
|
-
}
|
|
82
|
-
const match = selector.match(/^(?<key>\w+)=(?<value>.+)/);
|
|
83
|
-
if (!match || !['subject', 'thumbprint'].includes((_b = (_a = match.groups) === null || _a === void 0 ? void 0 : _a.key) !== null && _b !== void 0 ? _b : '')) {
|
|
84
|
-
throw new errors_1.MongoshInvalidInputError('--tlsCertificateSelector needs to include subject or thumbprint');
|
|
85
|
-
}
|
|
86
|
-
const { key, value } = (_c = match.groups) !== null && _c !== void 0 ? _c : {};
|
|
87
|
-
const search = key === 'subject' ? { subject: value } : { thumbprint: Buffer.from(value, 'hex') };
|
|
88
|
-
try {
|
|
89
|
-
const { passphrase, pfx } = exportCertificateAndPrivateKey(search);
|
|
90
|
-
return { passphrase, pfx };
|
|
91
|
-
}
|
|
92
|
-
catch (err) {
|
|
93
|
-
throw new errors_1.MongoshInvalidInputError(`Could not resolve certificate specification '${selector}': ${err.message}`);
|
|
94
|
-
}
|
|
95
|
-
}
|
|
96
|
-
exports.getTlsCertificateSelector = getTlsCertificateSelector;
|
|
97
|
-
function getCertificateExporter() {
|
|
98
|
-
if (process.env.TEST_OS_EXPORT_CERTIFICATE_AND_KEY_PATH) {
|
|
99
|
-
return require(process.env.TEST_OS_EXPORT_CERTIFICATE_AND_KEY_PATH);
|
|
100
|
-
}
|
|
101
|
-
try {
|
|
102
|
-
switch (process.platform) {
|
|
103
|
-
case 'win32':
|
|
104
|
-
return require('win-export-certificate-and-key');
|
|
105
|
-
case 'darwin':
|
|
106
|
-
return require('macos-export-certificate-and-key');
|
|
107
|
-
default:
|
|
108
|
-
return undefined;
|
|
109
|
-
}
|
|
110
|
-
}
|
|
111
|
-
catch (_a) { }
|
|
112
|
-
return undefined;
|
|
113
|
-
}
|
|
114
|
-
function mapGSSAPIHostnameCanonicalization(value) {
|
|
115
|
-
if (value === '') {
|
|
116
|
-
return undefined;
|
|
117
|
-
}
|
|
118
|
-
if (value === 'true' || value === 'false') {
|
|
119
|
-
return value === 'true';
|
|
120
|
-
}
|
|
121
|
-
return value;
|
|
122
|
-
}
|
|
123
|
-
exports.default = mapCliToDriver;
|
|
124
|
-
//# sourceMappingURL=arg-mapper.js.map
|
package/lib/arg-mapper.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"arg-mapper.js","sourceRoot":"","sources":["../src/arg-mapper.ts"],"names":[],"mappings":";;;;;;AAAA,4CAAsF;AAEtF,4DAAkC;AAKlC,MAAM,QAAQ,GAAG;IACf,oBAAoB,EAAE,6BAA6B;IACnD,SAAS,EAAE,kBAAkB;IAC7B,UAAU,EAAE,mBAAmB;IAC/B,cAAc,EAAE,6CAA6C;IAC7D,kBAAkB,EAAE,iDAAiD;IACrE,eAAe,EAAE,8CAA8C;IAC/D,kBAAkB,EAAE,2CAA2C;IAC/D,iBAAiB,EAAE,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ChildProcess } from 'child_process';
|
|
3
|
-
import { Readable } from 'stream';
|
|
4
|
-
import type { MongoshBus } from '@mongosh/types';
|
|
5
|
-
import { LogEntry } from './log-entry';
|
|
6
|
-
import { ShellHomeDirectory } from './config-directory';
|
|
7
|
-
export declare function getMongocryptdPaths(): Promise<string[][]>;
|
|
8
|
-
declare type MongocryptdState = {
|
|
9
|
-
uri: string;
|
|
10
|
-
proc: ChildProcess;
|
|
11
|
-
interval: NodeJS.Timeout;
|
|
12
|
-
};
|
|
13
|
-
export declare class MongocryptdManager {
|
|
14
|
-
spawnPaths: string[][];
|
|
15
|
-
bus: MongoshBus;
|
|
16
|
-
path: string;
|
|
17
|
-
state: MongocryptdState | null;
|
|
18
|
-
idleShutdownTimeoutSecs: number;
|
|
19
|
-
constructor(spawnPaths: string[][], shellHomeDirectory: ShellHomeDirectory, bus: MongoshBus);
|
|
20
|
-
start(): Promise<{
|
|
21
|
-
mongocryptdURI: string;
|
|
22
|
-
mongocryptdBypassSpawn: true;
|
|
23
|
-
}>;
|
|
24
|
-
close: () => this;
|
|
25
|
-
createLogEntryIterator(stdout: Readable, pid: number): AsyncIterable<LogEntry>;
|
|
26
|
-
_spawnMongocryptdProcess(spawnPath: string[]): ChildProcess;
|
|
27
|
-
_spawn(): Promise<MongocryptdState>;
|
|
28
|
-
_cleanupOldMongocryptdDirectories(): Promise<void>;
|
|
29
|
-
}
|
|
30
|
-
export {};
|