Skip to content

Commit

Permalink
feat(data-service): share OIDC state with embedded mongosh COMPASS-6802
Browse files Browse the repository at this point in the history
… (#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]>
  • Loading branch information
addaleax and Anemy authored May 25, 2023
1 parent 3fbf917 commit 12a547b
Show file tree
Hide file tree
Showing 11 changed files with 410 additions and 49 deletions.
2 changes: 2 additions & 0 deletions configs/webpack-config-compass/.depcheckrc
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,5 @@ ignores:
- 'babel-plugin-istanbul'
# recursive
- 'mongodb-compass'
# used as a resolve alias
- 'jose'
5 changes: 5 additions & 0 deletions configs/webpack-config-compass/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,11 @@ const sharedResolveOptions = (
// Additionally `ampersand-sync` brings into the bundle a number of other dependencies
// that are outdated and having known vulnerabilities.
'ampersand-sync': false,
// `jose` provides a browser export that uses webcrypto APIs and returns
// webcrypto objects to represent keys, but openid-client requires
// KeyObject instances from the Node.js crypto API (https://tinyurl.com/2rrtu2hy).
// Manually resolve `jose` to use the Node.js export here.
jose: require.resolve('jose'),
},
};
};
Expand Down
108 changes: 91 additions & 17 deletions package-lock.json

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

13 changes: 13 additions & 0 deletions packages/compass-e2e-tests/fixtures/curl.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#!/usr/bin/env node
/* eslint-disable */
'use strict';
const fetch = require('node-fetch');

// fetch() an URL and ignore the response body
(async function () {
(await fetch(process.argv[2])).body?.resume();
})().catch((err) => {
process.nextTick(() => {
throw err;
});
});
5 changes: 5 additions & 0 deletions packages/compass-e2e-tests/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,11 @@
"@mongodb-js/eslint-config-compass": "^1.0.5",
"@mongodb-js/prettier-config-compass": "^1.0.0",
"@mongodb-js/tsconfig-compass": "^1.0.2",
"@mongodb-js/oidc-mock-provider": "^0.3.0",
"@types/chai-as-promised": "^7.1.4",
"@types/cross-spawn": "^6.0.2",
"@types/puppeteer": "^5.4.4",
"@types/tar": "^6.1.5",
"@wdio/types": "^7.16.13",
"bson": "^5.2.0",
"chai": "^4.3.4",
Expand All @@ -53,13 +55,16 @@
"mocha": "^10.2.0",
"mongodb": "^5.5.0",
"mongodb-connection-string-url": "^2.6.0",
"mongodb-download-url": "^1.3.0",
"mongodb-log-writer": "^1.2.0",
"node-fetch": "^2.6.1",
"nyc": "^15.1.0",
"prettier": "^2.7.1",
"ps-list": "^8.1.0",
"puppeteer": "^15.4.0",
"resolve-mongodb-srv": "^1.1.2",
"semver": "^7.5.0",
"tar": "^6.1.15",
"ts-node": "^10.9.1",
"webdriverio": "^7.16.13",
"xvfb-maybe": "^0.2.1"
Expand Down
Loading

0 comments on commit 12a547b

Please sign in to comment.