File tree Expand file tree Collapse file tree 3 files changed +15
-10
lines changed
Expand file tree Collapse file tree 3 files changed +15
-10
lines changed Original file line number Diff line number Diff line change @@ -64,6 +64,7 @@ export default defineConfig([
6464 "eslint.config.js" ,
6565 "vitest.config.ts" ,
6666 "src/types/*.d.ts" ,
67+ "tests/integration/fixtures/" ,
6768 ] ) ,
6869 eslintPluginPrettierRecommended ,
6970] ) ;
Original file line number Diff line number Diff line change @@ -115,6 +115,9 @@ export class ConnectionManager extends EventEmitter<ConnectionManagerEvents> {
115115 connectionInfo . driverOptions . oidc . notifyDeviceFlow ??= this . onOidcNotifyDeviceFlow . bind ( this ) ;
116116 }
117117
118+ connectionInfo . driverOptions . proxy ??= { useEnvironmentVariableProxies : true } ;
119+ connectionInfo . driverOptions . applyProxyToOIDC ??= true ;
120+
118121 serviceProvider = await NodeDriverServiceProvider . connect (
119122 connectionInfo . connectionString ,
120123 {
@@ -203,9 +206,9 @@ export class ConnectionManager extends EventEmitter<ConnectionManagerEvents> {
203206 return newState ;
204207 }
205208
206- private onOidcAuthFailed ( error : unknown ) : void {
209+ private async onOidcAuthFailed ( error : unknown ) : Promise < void > {
207210 if ( this . state . tag === "connecting" && this . state . connectionStringAuthType ?. startsWith ( "oidc" ) ) {
208- this . disconnect ( ) ;
211+ await this . disconnect ( ) ;
209212 this . changeState ( "connection-errored" , { tag : "errored" , errorReason : String ( error ) } ) ;
210213 }
211214 }
Original file line number Diff line number Diff line change @@ -69,10 +69,14 @@ export abstract class MongoDBToolBase extends ToolBase {
6969
7070 const connectToolsNames = connectTools ?. map ( ( t ) => `"${ t . name } "` ) . join ( ", " ) ;
7171 const connectionStatus = this . session . connectionManager . currentConnectionState ;
72- const additionalPromptForOidc =
73- connectionStatus . tag === "connecting" && connectionStatus . oidcConnectionType === "oidc-device-flow"
74- ? `The user needs to finish their OIDC connection by opening '${ connectionStatus . oidcLoginUrl } ' in the browser and use the following user code: '${ connectionStatus . oidcUserCode } '`
75- : "" ;
72+ const additionalPromptForOidc : { type : "text" ; text : string } [ ] = [ ] ;
73+
74+ if ( connectionStatus . tag === "connecting" && connectionStatus . oidcConnectionType === "oidc-device-flow" ) {
75+ additionalPromptForOidc . push ( {
76+ type : "text" ,
77+ text : `The user needs to finish their OIDC connection by opening '${ connectionStatus . oidcLoginUrl } ' in the browser and use the following user code: '${ connectionStatus . oidcUserCode } '` ,
78+ } ) ;
79+ }
7680
7781 switch ( error . code ) {
7882 case ErrorCodes . NotConnectedToMongoDB :
@@ -82,10 +86,7 @@ export abstract class MongoDBToolBase extends ToolBase {
8286 type : "text" ,
8387 text : "You need to connect to a MongoDB instance before you can access its data." ,
8488 } ,
85- {
86- type : "text" ,
87- text : additionalPromptForOidc ,
88- } ,
89+ ...additionalPromptForOidc ,
8990 {
9091 type : "text" ,
9192 text : connectToolsNames
You can’t perform that action at this time.
0 commit comments