Skip to content

Commit

Permalink
fix(devtools-connect): bump mongodb to latest and fix OIDC option c…
Browse files Browse the repository at this point in the history
…heck MONGOSH-1831 (#407)
  • Loading branch information
addaleax authored Jul 11, 2024
1 parent e1c598a commit 96f1173
Show file tree
Hide file tree
Showing 5 changed files with 31 additions and 30 deletions.
42 changes: 21 additions & 21 deletions package-lock.json

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

4 changes: 2 additions & 2 deletions packages/devtools-connect/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
},
"peerDependencies": {
"@mongodb-js/oidc-plugin": "^1.0.0",
"mongodb": "^5.8.1 || ^6.0.0",
"mongodb": "^6.8.0",
"mongodb-log-writer": "^1.4.2"
},
"devDependencies": {
Expand All @@ -75,7 +75,7 @@
"eslint-plugin-promise": "^6.1.1",
"gen-esm-wrapper": "^1.1.0",
"mocha": "^8.4.0",
"mongodb": "^5.8.1 || ^6.0.0",
"mongodb": "^6.8.0",
"mongodb-log-writer": "^1.4.2",
"nyc": "^15.1.0",
"os-dns-native": "^1.2.0",
Expand Down
8 changes: 4 additions & 4 deletions packages/devtools-connect/src/connect.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -429,20 +429,20 @@ describe('devtools connect', function () {
).to.equal(true);
});

it('returns false if the PROVIDER_NAME JS option is set', function () {
it('returns false if the ENVIRONMENT JS option is set', function () {
expect(
isHumanOidcFlow('mongodb://example/?authMechanism=MONGODB-OIDC', {
authMechanismProperties: {
PROVIDER_NAME: 'aws',
ENVIRONMENT: 'azure',
},
})
).to.equal(false);
});

it('returns false if the PROVIDER_NAME url option is set', function () {
it('returns false if the ENVIRONMENT url option is set', function () {
expect(
isHumanOidcFlow(
'mongodb://example/?authMechanism=MONGODB-OIDC&authMechanismProperties=PROVIDER_NAME:aws',
'mongodb://example/?authMechanism=MONGODB-OIDC&authMechanismProperties=ENVIRONMENT:azure',
{}
)
).to.equal(false);
Expand Down
5 changes: 3 additions & 2 deletions packages/devtools-connect/src/connect.ts
Original file line number Diff line number Diff line change
Expand Up @@ -471,7 +471,8 @@ export function isHumanOidcFlow(
if (
(clientOptions.authMechanism &&
clientOptions.authMechanism !== 'MONGODB-OIDC') ||
clientOptions.authMechanismProperties?.PROVIDER_NAME
clientOptions.authMechanismProperties?.ENVIRONMENT ||
clientOptions.authMechanismProperties?.OIDC_CALLBACK
) {
return false;
}
Expand All @@ -487,7 +488,7 @@ export function isHumanOidcFlow(
return (
authMechanism === 'MONGODB-OIDC' &&
!new CommaAndColonSeparatedRecord(sp.get('authMechanismProperties')).get(
'PROVIDER_NAME'
'ENVIRONMENT'
)
);
}
Expand Down
2 changes: 1 addition & 1 deletion packages/mongodb-runner/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@
"dependencies": {
"@mongodb-js/mongodb-downloader": "^0.3.2",
"debug": "^4.3.4",
"mongodb": "^6.3.0",
"mongodb": "^6.8.0",
"@mongodb-js/saslprep": "^1.1.7",
"mongodb-connection-string-url": "^3.0.0",
"yargs": "^17.7.2"
Expand Down

0 comments on commit 96f1173

Please sign in to comment.