Skip to content

Commit 8fb918e

Browse files
feat(options): add tlsCertificateKeyFilePassword flag (#9)
This adds --tlsCertificateKeyFilePassword flag that specifies the password to de-crypt the --tlsCertificateKeyFile
1 parent f8bc023 commit 8fb918e

4 files changed

Lines changed: 21 additions & 1 deletion

File tree

README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@ Options:
6363
validate the certificate presented by the mongod/mongos instance
6464
--tlsCertificateKeyFile <path> Specifies the location of a local .pem file that contains either the
6565
client's TLS/SSL certificate and key
66+
--tlsCertificateKeyFilePassword <password> Specifies the password to de-crypt the tlsCertificateKeyFile
6667
-m --db-map [dump-db-name=target-db-name...] Map the databases in the dump with the target databases. We have our own naming convention for the production databases, but it is up to the customers to name their databases (default: ["google_production=codefresh","chart-manager=charts-manager","kubernetes-monitor=k8s-monitor"])
6768
-h, --help display help for command
6869
```
@@ -108,6 +109,7 @@ Options:
108109
validate the certificate presented by the mongod/mongos instance
109110
--tlsCertificateKeyFile <path> Specifies the location of a local .pem file that contains either the
110111
client's TLS/SSL certificate and key
112+
--tlsCertificateKeyFilePassword <password> Specifies the password to de-crypt the tlsCertificateKeyFile
111113
-h, --help display help for command
112114
```
113115

@@ -140,6 +142,7 @@ Options:
140142
validate the certificate presented by the mongod/mongos instance
141143
--tlsCertificateKeyFile <path> Specifies the location of a local .pem file that contains either the
142144
client's TLS/SSL certificate and key
145+
--tlsCertificateKeyFilePassword <password> Specifies the password to de-crypt the tlsCertificateKeyFile
143146
-f --force Create indexes even on heavily populated collections, which may take a while
144147
-m --db-map [dump-db-name=target-db-name...] Map the databases in the dump with the target databases. We have our own naming convention for the production databases, but it is up to the customers to name their databases (default: ["google_production=codefresh","chart-manager=charts-manager","kubernetes-monitor=k8s-monitor"])
145148
-h, --help display help for command

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "index-alignment",
3-
"version": "0.1.0-2.8",
3+
"version": "0.2.0-2.8",
44
"main": "dist/index.js",
55
"private": true,
66
"type": "module",

src/get-mongo-client.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ export const getMongoClient = (options: Partial<MongoClientOptions> & { uri: str
77
tlsInsecure: options.tlsInsecure,
88
tlsCAFile: options.tlsCAFile,
99
tlsCertificateKeyFile: options.tlsCertificateKeyFile,
10+
tlsCertificateKeyFilePassword: options.tlsCertificateKeyFilePassword,
1011
} satisfies MongoClientOptions;
1112
logger.stderr(`The following options will be used for the MongoDB connection: ${JSON.stringify(clientOptions, null, 2)}`);
1213
return new MongoClient(options.uri, clientOptions);

src/index.ts

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,10 @@ program
2828
'--tlsCertificateKeyFile <path>',
2929
`Specifies the location of a local .pem file that contains either the client's TLS/SSL certificate and key`,
3030
)
31+
.option(
32+
'--tlsCertificateKeyFilePassword <password>',
33+
'Specifies the password to de-crypt the tlsCertificateKeyFile',
34+
)
3135
.action(dumpAllIndexes);
3236

3337
program
@@ -52,6 +56,10 @@ program
5256
'--tlsCertificateKeyFile <path>',
5357
`Specifies the location of a local .pem file that contains either the client's TLS/SSL certificate and key`,
5458
)
59+
.option(
60+
'--tlsCertificateKeyFilePassword <password>',
61+
'Specifies the password to de-crypt the tlsCertificateKeyFile',
62+
)
5563
.action(stats);
5664

5765
program
@@ -77,6 +85,10 @@ program
7785
'--tlsCertificateKeyFile <path>',
7886
`Specifies the location of a local .pem file that contains either the client's TLS/SSL certificate and key`,
7987
)
88+
.option(
89+
'--tlsCertificateKeyFilePassword <password>',
90+
'Specifies the password to de-crypt the tlsCertificateKeyFile',
91+
)
8092
.option(
8193
'-m --db-map [dump-db-name=target-db-name...]',
8294
'Map the databases in the dump with the target databases. We have our own naming convention for the production databases, but it is up to the customers to name their databases',
@@ -107,6 +119,10 @@ program
107119
'--tlsCertificateKeyFile <path>',
108120
`Specifies the location of a local .pem file that contains either the client's TLS/SSL certificate and key`,
109121
)
122+
.option(
123+
'--tlsCertificateKeyFilePassword <password>',
124+
'Specifies the password to de-crypt the tlsCertificateKeyFile',
125+
)
110126
.option('-f --force', 'Create indexes even on heavily populated collections, which may take a while')
111127
.option(
112128
'-m --db-map [dump-db-name=target-db-name...]',

0 commit comments

Comments
 (0)