Skip to content

Commit b07a006

Browse files
committed
add typescript
1 parent e62018d commit b07a006

25 files changed

+834
-344
lines changed

.gitignore

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -184,4 +184,6 @@ $RECYCLE.BIN/
184184

185185
# End of https://www.toptal.com/developers/gitignore/api/osx,windows,vscode,webstorm,linux
186186

187-
node_modules
187+
node_modules
188+
189+
lib

docker/community/config.js

Lines changed: 0 additions & 16 deletions
This file was deleted.

docker/community/config.ts

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
const path = require("path");
2+
3+
export default {
4+
dockerCompose: {
5+
projectName: path.basename(__dirname),
6+
yamlPath: path.resolve(__dirname, "docker-compose.yaml"),
7+
},
8+
waitOn: ["tcp:27020"],
9+
connections: {
10+
community: {
11+
connectionString: "mongodb://localhost:27020/test",
12+
},
13+
},
14+
};

docker/enterprise/config.js

Lines changed: 0 additions & 16 deletions
This file was deleted.

docker/enterprise/config.ts

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
const path = require("path");
2+
3+
export default {
4+
dockerCompose: {
5+
projectName: path.basename(__dirname),
6+
yamlPath: path.resolve(__dirname, "docker-compose.yaml"),
7+
},
8+
waitOn: ["tcp:27021"],
9+
connections: {
10+
enterprise: {
11+
connectionString: "mongodb://localhost:27021/test",
12+
},
13+
},
14+
};

docker/kerberos/config.js

Lines changed: 0 additions & 62 deletions
This file was deleted.

docker/kerberos/config.ts

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
const path = require("path");
2+
const execa = require("execa");
3+
4+
const { default: ConnectionString } = require("mongodb-connection-string-url");
5+
6+
const principal = "mongodb.user";
7+
const simple = new ConnectionString(
8+
"mongodb://mongodb-kerberos-1.example.com:29017"
9+
);
10+
simple.username = principal;
11+
simple.searchParams.set("authMechanism", "GSSAPI");
12+
13+
const alternate = new ConnectionString(
14+
"mongodb://mongodb-kerberos-2.example.com:29018"
15+
);
16+
alternate.username = principal;
17+
alternate.searchParams.set("authMechanism", "GSSAPI");
18+
alternate.searchParams.set("authMechanismProperties", "SERVICE_NAME:alternate");
19+
20+
const crossRealm = new ConnectionString(
21+
"mongodb://mongodb-kerberos-3.examplecrossrealm.com:29019"
22+
);
23+
crossRealm.username = principal;
24+
crossRealm.searchParams.set("authMechanism", "GSSAPI");
25+
26+
export default {
27+
dockerCompose: {
28+
projectName: path.basename(__dirname),
29+
yamlPath: path.resolve(__dirname, "docker-compose.yaml"),
30+
},
31+
waitOn: ["tcp:29017", "tcp:29018", "tcp:29019"],
32+
hosts: [
33+
"mongodb-kerberos-1.example.com",
34+
"mongodb-kerberos-2.example.com",
35+
"mongodb-kerberos-3.examplecrossrealm.com",
36+
],
37+
setup: async () => {
38+
try {
39+
// hemdal
40+
await execa("kinit", ["--password-file=STDIN", principal], {
41+
input: "password",
42+
});
43+
} catch (e) {
44+
// mit
45+
await execa("kinit", [principal], { input: "password" });
46+
}
47+
},
48+
teardown: async () => {
49+
try {
50+
await execa("kdestroy", ["-p", principal]);
51+
} catch (e) {
52+
//
53+
}
54+
},
55+
connections: {
56+
default: {
57+
connectionString: simple.href,
58+
},
59+
alternate: {
60+
connectionString: alternate.href,
61+
},
62+
crossRealm: {
63+
connectionString: crossRealm.href,
64+
},
65+
},
66+
};

docker/ldap/config.js

Lines changed: 0 additions & 24 deletions
This file was deleted.

docker/ldap/config.ts

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
const path = require("path");
2+
3+
const { default: ConnectionString } = require("mongodb-connection-string-url");
4+
5+
const connectionString = new ConnectionString("mongodb://localhost:30017");
6+
connectionString.username = "writer";
7+
connectionString.password = "Password1!";
8+
connectionString.searchParams.set("authMechanism", "PLAIN");
9+
10+
export default {
11+
dockerCompose: {
12+
projectName: path.basename(__dirname),
13+
yamlPath: path.resolve(__dirname, "docker-compose.yaml"),
14+
},
15+
waitOn: ["tcp:30017"],
16+
connections: {
17+
default: {
18+
connectionString: connectionString.href,
19+
},
20+
},
21+
};

docker/replica-set/config.js

Lines changed: 0 additions & 31 deletions
This file was deleted.

0 commit comments

Comments
 (0)