Skip to content

Commit 12a547b

Browse files
addaleaxAnemy
andauthored
feat(data-service): share OIDC state with embedded mongosh COMPASS-6802 (#4419)
This commit is sufficient to make OIDC connectivity work when using the connection string to set OIDC as the auth mechanism. Co-authored-by: Rhys <[email protected]>
1 parent 3fbf917 commit 12a547b

File tree

11 files changed

+410
-49
lines changed

11 files changed

+410
-49
lines changed

configs/webpack-config-compass/.depcheckrc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,3 +16,5 @@ ignores:
1616
- 'babel-plugin-istanbul'
1717
# recursive
1818
- 'mongodb-compass'
19+
# used as a resolve alias
20+
- 'jose'

configs/webpack-config-compass/src/index.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,11 @@ const sharedResolveOptions = (
6767
// Additionally `ampersand-sync` brings into the bundle a number of other dependencies
6868
// that are outdated and having known vulnerabilities.
6969
'ampersand-sync': false,
70+
// `jose` provides a browser export that uses webcrypto APIs and returns
71+
// webcrypto objects to represent keys, but openid-client requires
72+
// KeyObject instances from the Node.js crypto API (https://tinyurl.com/2rrtu2hy).
73+
// Manually resolve `jose` to use the Node.js export here.
74+
jose: require.resolve('jose'),
7075
},
7176
};
7277
};

package-lock.json

Lines changed: 91 additions & 17 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
#!/usr/bin/env node
2+
/* eslint-disable */
3+
'use strict';
4+
const fetch = require('node-fetch');
5+
6+
// fetch() an URL and ignore the response body
7+
(async function () {
8+
(await fetch(process.argv[2])).body?.resume();
9+
})().catch((err) => {
10+
process.nextTick(() => {
11+
throw err;
12+
});
13+
});

packages/compass-e2e-tests/package.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,11 @@
3131
"@mongodb-js/eslint-config-compass": "^1.0.5",
3232
"@mongodb-js/prettier-config-compass": "^1.0.0",
3333
"@mongodb-js/tsconfig-compass": "^1.0.2",
34+
"@mongodb-js/oidc-mock-provider": "^0.3.0",
3435
"@types/chai-as-promised": "^7.1.4",
3536
"@types/cross-spawn": "^6.0.2",
3637
"@types/puppeteer": "^5.4.4",
38+
"@types/tar": "^6.1.5",
3739
"@wdio/types": "^7.16.13",
3840
"bson": "^5.2.0",
3941
"chai": "^4.3.4",
@@ -53,13 +55,16 @@
5355
"mocha": "^10.2.0",
5456
"mongodb": "^5.5.0",
5557
"mongodb-connection-string-url": "^2.6.0",
58+
"mongodb-download-url": "^1.3.0",
5659
"mongodb-log-writer": "^1.2.0",
60+
"node-fetch": "^2.6.1",
5761
"nyc": "^15.1.0",
5862
"prettier": "^2.7.1",
5963
"ps-list": "^8.1.0",
6064
"puppeteer": "^15.4.0",
6165
"resolve-mongodb-srv": "^1.1.2",
6266
"semver": "^7.5.0",
67+
"tar": "^6.1.15",
6368
"ts-node": "^10.9.1",
6469
"webdriverio": "^7.16.13",
6570
"xvfb-maybe": "^0.2.1"

0 commit comments

Comments
 (0)