Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(devtools-connect): bump mongodb to latest and fix OIDC option check MONGOSH-1831 #407

Merged
merged 2 commits into from
Jul 11, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
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',
kmruiz marked this conversation as resolved.
Show resolved Hide resolved
},
})
).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
Loading