Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
120 changes: 99 additions & 21 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@
"husky": "^9.0.11",
"mocha": "^10.2.0",
"mongodb": "^6.19.0",
"mongodb-runner": "^5.7.1",
"mongodb-runner": "^6.0.0",
"node-gyp": "^9.0.0 || ^10.2.0",
"nyc": "^15.1.0",
"pkg-up": "^3.1.0",
Expand Down
2 changes: 1 addition & 1 deletion packages/build/src/download-center/constants.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const fallback = require('./fallback.json');
import fallback from './fallback.json';

/**
* The S3 bucket for download center configurations.
Expand Down
1 change: 1 addition & 0 deletions packages/build/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import type { Config, PackageVariant } from './config';
import { updateJsonFeedCTA } from './download-center';
import Ajv from 'ajv';

export { downloadCryptLibrary } from './packaging/download-crypt-library';
export { getArtifactUrl, downloadMongoDb };

const validCommands: (ReleaseCommand | 'trigger-release' | 'update-cta')[] = [
Expand Down
3 changes: 2 additions & 1 deletion packages/build/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
"compilerOptions": {
"outDir": "./lib",
"allowJs": true,
"removeComments": false
"removeComments": false,
"resolveJsonModule": true
},
"include": ["src/**/*"],
"exclude": ["./src/**/*.spec.*"]
Expand Down
10 changes: 10 additions & 0 deletions testing/.eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
const { fixCygwinPath } = require('@mongodb-js/eslint-config-mongosh/utils');

module.exports = {
root: true,
extends: ['@mongodb-js/eslint-config-mongosh'],
parserOptions: {
tsconfigRootDir: fixCygwinPath(__dirname),
project: ['./tsconfig.json'],
},
};
1 change: 1 addition & 0 deletions testing/.prettierrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
"@mongodb-js/prettier-config-devtools"
51 changes: 30 additions & 21 deletions testing/certificates/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ This directory contains all certificates and keys used in testing.
To recreate the certificates follow the steps outlined below.

## Setup CA

1. Create a new key to use for the CA:
```
openssl genrsa -out ca.key 4096
Expand All @@ -13,10 +14,11 @@ To recreate the certificates follow the steps outlined below.
```
openssl req -new -x509 -key ca.key -out ca.crt -days 99999
```
* Organization Name: `MongoDB`
* Organizational Unit Name: `DevTools`
* Common Name: `DevTools CA`
- Organization Name: `MongoDB`
- Organizational Unit Name: `DevTools`
- Common Name: `DevTools CA`
3. To sign and revoke certificates, an openssl config files is required. Create `ca.cnf` with the following content:

```
[ca]
default_ca=CA_default
Expand All @@ -43,12 +45,14 @@ To recreate the certificates follow the steps outlined below.
commonName=supplied
emailAddress=optional
```

4. Ensure the `ca.db` file exists:
```
touch ca.db
```

## Setup Server Certificate

1. Create a new key to use for the server:
```
openssl genrsa -out server.key 4096
Expand All @@ -57,9 +61,9 @@ To recreate the certificates follow the steps outlined below.
```
openssl req -new -key server.key -out server.csr -days 99999
```
* Organization Name: `MongoDB`
* Organizational Unit Name: `DevTools`
* Common Name: `localhost`
- Organization Name: `MongoDB`
- Organizational Unit Name: `DevTools`
- Common Name: `localhost`
3. Sign the CSR to generate server certificate:
```
openssl ca -create_serial -config ca.cnf -in server.csr -out server.pem -days 99999
Expand All @@ -71,6 +75,7 @@ To recreate the certificates follow the steps outlined below.
```

## Setup Server Certificate with invalid hostname

1. Create a new key to use for the server:
```
openssl genrsa -out server-invalidhost.key 4096
Expand All @@ -79,9 +84,9 @@ To recreate the certificates follow the steps outlined below.
```
openssl req -new -key server-invalidhost.key -out server-invalidhost.csr -days 99999
```
* Organization Name: `MongoDB`
* Organizational Unit Name: `DevTools`
* Common Name: `invalidhost`
- Organization Name: `MongoDB`
- Organizational Unit Name: `DevTools`
- Common Name: `invalidhost`
3. Sign the CSR to generate server certificate:
```
openssl ca -create_serial -config ca.cnf -in server-invalidhost.csr -out server-invalidhost.pem -days 99999
Expand All @@ -93,6 +98,7 @@ To recreate the certificates follow the steps outlined below.
```

## Setup "Non-CA" for testing invalid CA cert

1. Create a new key to use for the Non CA:
```
openssl genrsa -out non-ca.key 4096
Expand All @@ -101,11 +107,12 @@ To recreate the certificates follow the steps outlined below.
```
openssl req -new -x509 -key non-ca.key -out non-ca.crt -days 99999
```
* Organization Name: `MongoDB`
* Organizational Unit Name: `DevTools`
* Common Name: `NOT DevTools CA`
- Organization Name: `MongoDB`
- Organizational Unit Name: `DevTools`
- Common Name: `NOT DevTools CA`

## Revoke Server Certificate and generate CRL

1. Revoke the server's certificate:
```
openssl ca -config ca.cnf -revoke server.pem
Expand All @@ -116,6 +123,7 @@ To recreate the certificates follow the steps outlined below.
```

## Create Client Certificate from CA

1. Create a new key to use for the client:
```
openssl genrsa -out client.key 4096
Expand All @@ -124,10 +132,10 @@ To recreate the certificates follow the steps outlined below.
```
openssl req -new -key client.key -out client.csr -days 99999
```
* Organization Name: `MongoDB`
* Organizational Unit Name: `DevTools Testers`
* Common Name: `Wonderwoman`
* E-Mail: `[email protected]`
- Organization Name: `MongoDB`
- Organizational Unit Name: `DevTools Testers`
- Common Name: `Wonderwoman`
- E-Mail: `[email protected]`
3. Sign the CSR to generate server certificate:
```
openssl ca -create_serial -config ca.cnf -in client.csr -out client.pem -days 99999
Expand All @@ -146,9 +154,10 @@ To recreate the certificates follow the steps outlined below.
```
openssl pkcs12 -inkey client.bundle.pem -in client.bundle.pem -export -out client.bundle.pfx
```
* Password: `passw0rd`
- Password: `passw0rd`

## Create Client Certificate not from CA

1. Create a new key to use for the Non CA:
```
openssl genrsa -out invalid-client.key 4096
Expand All @@ -157,10 +166,10 @@ To recreate the certificates follow the steps outlined below.
```
openssl req -new -x509 -key invalid-client.key -out invalid-client.crt -days 99999
```
* Organization Name: `MongoDB`
* Organizational Unit Name: `DevTools Testers`
* Common Name: `Wonderwoman`
* E-Mail: `[email protected]`
- Organization Name: `MongoDB`
- Organizational Unit Name: `DevTools Testers`
- Common Name: `Wonderwoman`
- E-Mail: `[email protected]`
3. Create a bundle with client key and certificate to use for connecting:
```
cat invalid-client.crt invalid-client.key > invalid-client.bundle.pem
Expand Down
Loading