diff --git a/package-lock.json b/package-lock.json index 6664f8fd17..16023e07b9 100644 --- a/package-lock.json +++ b/package-lock.json @@ -59,7 +59,7 @@ "glob": "^10.3.12", "husky": "^9.0.11", "mocha": "^10.2.0", - "mongodb": "^6.18.0", + "mongodb": "^6.19.0", "mongodb-runner": "^5.7.1", "node-gyp": "^9.0.0 || ^10.2.0", "nyc": "^15.1.0", @@ -6501,12 +6501,12 @@ "license": "Apache-2.0" }, "node_modules/@mongodb-js/devtools-connect": { - "version": "3.9.3", - "resolved": "https://registry.npmjs.org/@mongodb-js/devtools-connect/-/devtools-connect-3.9.3.tgz", - "integrity": "sha512-qlvjgzZeIJQgF+C2D+T5zOfsat62vp/hgoib+gJrU5JcThN8Hbq9ZQaE9f5/mUg3DKW1R9VvdrzcCn2NEZRvKA==", + "version": "3.9.4", + "resolved": "https://registry.npmjs.org/@mongodb-js/devtools-connect/-/devtools-connect-3.9.4.tgz", + "integrity": "sha512-L/DyeoVUejkFqP9HOxJ9PgClkNL+z1We1eAzAvdseRtm0T4B7UJvBg2Fn4D84cC9mbQVuxkSRThTQnQkKW0jOA==", "license": "Apache-2.0", "dependencies": { - "@mongodb-js/devtools-proxy-support": "^0.5.2", + "@mongodb-js/devtools-proxy-support": "^0.5.3", "@mongodb-js/oidc-http-server-pages": "1.1.6", "lodash.merge": "^4.6.2", "mongodb-connection-string-url": "^3.0.0", @@ -6525,9 +6525,9 @@ } }, "node_modules/@mongodb-js/devtools-proxy-support": { - "version": "0.5.2", - "resolved": "https://registry.npmjs.org/@mongodb-js/devtools-proxy-support/-/devtools-proxy-support-0.5.2.tgz", - "integrity": "sha512-3zp/5Ui8ci8EK2pNZ+YKc73L8bPCIP0tkJNMCpsM3P9/I9L9woTpJtGGlS3GtwL1caOypeKc6pibDqQzkjQFCA==", + "version": "0.5.3", + "resolved": "https://registry.npmjs.org/@mongodb-js/devtools-proxy-support/-/devtools-proxy-support-0.5.3.tgz", + "integrity": "sha512-m5LzS86xh7iOuHA88ibbJvBkPZ6Qm/0B4N90s7epNEOvtMo0Jr8dYNxnLYobahFkvzbHp+oPRrCsztAKs0TZYQ==", "license": "Apache-2.0", "dependencies": { "@mongodb-js/socksv5": "^0.0.10", @@ -6570,9 +6570,9 @@ } }, "node_modules/@mongodb-js/devtools-proxy-support/node_modules/lru-cache": { - "version": "11.1.0", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-11.1.0.tgz", - "integrity": "sha512-QIXZUBJUx+2zHUdQujWejBkcD9+cs94tLn0+YL8UrCh+D5sCXZ4c7LaEH48pNwRY3MLDgqUFyhlCyjJPf1WP0A==", + "version": "11.2.1", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-11.2.1.tgz", + "integrity": "sha512-r8LA6i4LP4EeWOhqBaZZjDWwehd1xUJPCJd9Sv300H0ZmcUER4+JPh7bqqZeqs1o5pgtgvXm+d9UGrB5zZGDiQ==", "license": "ISC", "engines": { "node": "20 || >=22" @@ -34919,7 +34919,7 @@ "mongodb-connection-string-url": "^3.0.1" }, "devDependencies": { - "@mongodb-js/devtools-connect": "^3.9.3", + "@mongodb-js/devtools-connect": "^3.9.4", "@mongodb-js/eslint-config-mongosh": "^1.0.0", "@mongodb-js/prettier-config-devtools": "^1.0.1", "@mongodb-js/tsconfig-mongosh": "^1.0.0", @@ -35580,7 +35580,7 @@ "version": "2.5.7", "license": "Apache-2.0", "dependencies": { - "@mongodb-js/devtools-proxy-support": "^0.5.2", + "@mongodb-js/devtools-proxy-support": "^0.5.3", "@mongosh/arg-parser": "^3.16.0", "@mongosh/autocomplete": "^3.20.0", "@mongosh/editor": "^3.20.0", @@ -35918,7 +35918,7 @@ "license": "Apache-2.0", "dependencies": { "@mongodb-js/device-id": "^0.2.1", - "@mongodb-js/devtools-connect": "^3.9.3", + "@mongodb-js/devtools-connect": "^3.9.4", "@mongosh/errors": "2.4.4", "@mongosh/history": "2.4.8", "@mongosh/types": "^3.12.0", @@ -36127,7 +36127,7 @@ "version": "3.14.0", "license": "Apache-2.0", "dependencies": { - "@mongodb-js/devtools-connect": "^3.9.3", + "@mongodb-js/devtools-connect": "^3.9.4", "@mongodb-js/oidc-plugin": "^2.0.3", "@mongosh/errors": "2.4.4", "@mongosh/service-provider-core": "3.3.7", @@ -36221,7 +36221,7 @@ "version": "3.20.0", "license": "Apache-2.0", "dependencies": { - "@mongodb-js/devtools-proxy-support": "^0.5.2", + "@mongodb-js/devtools-proxy-support": "^0.5.3", "@mongosh/errors": "2.4.4", "@mongosh/shell-api": "^3.20.0", "@mongosh/types": "^3.12.0", @@ -36261,7 +36261,7 @@ "version": "3.12.0", "license": "Apache-2.0", "dependencies": { - "@mongodb-js/devtools-connect": "^3.9.3" + "@mongodb-js/devtools-connect": "^3.9.4" }, "devDependencies": { "@mongodb-js/eslint-config-mongosh": "^1.0.0", diff --git a/packages/arg-parser/package.json b/packages/arg-parser/package.json index 42d2e56da4..2d55d187b8 100644 --- a/packages/arg-parser/package.json +++ b/packages/arg-parser/package.json @@ -40,7 +40,7 @@ "mongodb-connection-string-url": "^3.0.1" }, "devDependencies": { - "@mongodb-js/devtools-connect": "^3.9.3", + "@mongodb-js/devtools-connect": "^3.9.4", "@mongodb-js/eslint-config-mongosh": "^1.0.0", "@mongodb-js/prettier-config-devtools": "^1.0.1", "@mongodb-js/tsconfig-mongosh": "^1.0.0", diff --git a/packages/cli-repl/package.json b/packages/cli-repl/package.json index 3eb0209318..8b086c404f 100644 --- a/packages/cli-repl/package.json +++ b/packages/cli-repl/package.json @@ -62,7 +62,7 @@ } }, "dependencies": { - "@mongodb-js/devtools-proxy-support": "^0.5.2", + "@mongodb-js/devtools-proxy-support": "^0.5.3", "@mongosh/arg-parser": "^3.16.0", "@mongosh/autocomplete": "^3.20.0", "@mongosh/editor": "^3.20.0", diff --git a/packages/e2e-tests/test/e2e-oidc.spec.ts b/packages/e2e-tests/test/e2e-oidc.spec.ts index b274acef89..2c3554628c 100644 --- a/packages/e2e-tests/test/e2e-oidc.spec.ts +++ b/packages/e2e-tests/test/e2e-oidc.spec.ts @@ -10,7 +10,7 @@ import type { TestShell } from './test-shell'; import path from 'path'; import { expect } from 'chai'; import { createServer as createHTTPSServer } from 'https'; -import { getCertPath, useTmpdir } from './repl-helpers'; +import { getCertPath, readReplLogFile, useTmpdir } from './repl-helpers'; import { baseOidcServerConfig, commonOidcServerArgs, @@ -530,6 +530,34 @@ describe('OIDC auth e2e', function () { shell.assertContainsOutput(/"refreshToken": "(?!debugid:)/); }); + it('logs OIDC HTTP calls', async function () { + shell = this.startTestShell({ + args: [ + await testServer.connectionString(), + '--authenticationMechanism=MONGODB-OIDC', + '--oidcRedirectUri=http://localhost:0/', + `--browser=${fetchBrowserFixture}`, + '--eval=log.getPath()', + '--quiet', + '--json', + ], + env: { + ...process.env, + HOME: tmpdir.path, + LOCALAPPDATA: tmpdir.path, + APPDATA: tmpdir.path, + }, + }); + await shell.waitForSuccessfulExit(); + const logs = await readReplLogFile(JSON.parse(shell.output)); + const inbound = logs.find((e) => e.id === 1_002_000_024); + const outbound = logs.find((e) => e.id === 1_002_000_023); + expect(inbound?.attr.url).to.be.a('string'); + expect(inbound?.s).to.equal('D1'); + expect(outbound?.attr.url).to.be.a('string'); + expect(outbound?.s).to.equal('D1'); + }); + it('can successfully authenticate using workload OIDC', async function () { // Get a token from the OIDC server, store it to disk, then pass that to mongosh const tokenFile = path.join(tmpdir.path, 'token'); diff --git a/packages/logging/package.json b/packages/logging/package.json index b111e73961..255cd5aecd 100644 --- a/packages/logging/package.json +++ b/packages/logging/package.json @@ -18,7 +18,7 @@ }, "dependencies": { "@mongodb-js/device-id": "^0.2.1", - "@mongodb-js/devtools-connect": "^3.9.3", + "@mongodb-js/devtools-connect": "^3.9.4", "@mongosh/errors": "2.4.4", "@mongosh/history": "2.4.8", "@mongosh/types": "^3.12.0", diff --git a/packages/logging/src/logging-and-telemetry.ts b/packages/logging/src/logging-and-telemetry.ts index 28e3398462..02119802b6 100644 --- a/packages/logging/src/logging-and-telemetry.ts +++ b/packages/logging/src/logging-and-telemetry.ts @@ -913,6 +913,9 @@ export class LoggingAndTelemetry implements MongoshLoggingAndTelemetry { hookLogger( this.bus, { + debug: (...args: Parameters) => { + return this.log.debug(...args); + }, info: (...args: Parameters) => { return this.log.info(...args); }, diff --git a/packages/service-provider-node-driver/package.json b/packages/service-provider-node-driver/package.json index a1a31407b2..614cab3419 100644 --- a/packages/service-provider-node-driver/package.json +++ b/packages/service-provider-node-driver/package.json @@ -47,7 +47,7 @@ } }, "dependencies": { - "@mongodb-js/devtools-connect": "^3.9.3", + "@mongodb-js/devtools-connect": "^3.9.4", "@mongodb-js/oidc-plugin": "^2.0.3", "@mongosh/errors": "2.4.4", "@mongosh/service-provider-core": "3.3.7", diff --git a/packages/snippet-manager/package.json b/packages/snippet-manager/package.json index ae49946fe6..59b8209287 100644 --- a/packages/snippet-manager/package.json +++ b/packages/snippet-manager/package.json @@ -35,7 +35,7 @@ "unitTestsOnly": true }, "dependencies": { - "@mongodb-js/devtools-proxy-support": "^0.5.2", + "@mongodb-js/devtools-proxy-support": "^0.5.3", "@mongosh/errors": "2.4.4", "@mongosh/shell-api": "^3.20.0", "@mongosh/types": "^3.12.0", diff --git a/packages/types/package.json b/packages/types/package.json index 1979bf7a8b..2224c930f2 100644 --- a/packages/types/package.json +++ b/packages/types/package.json @@ -38,7 +38,7 @@ "unitTestsOnly": true }, "dependencies": { - "@mongodb-js/devtools-connect": "^3.9.3" + "@mongodb-js/devtools-connect": "^3.9.4" }, "devDependencies": { "@mongodb-js/eslint-config-mongosh": "^1.0.0",