@mongodb-js/devtools-connect
Advanced tools
Comparing version 2.6.3 to 3.0.1
@@ -152,4 +152,2 @@ "use strict"; | ||
async handleRpc(content) { | ||
const oidcCallbacks = this.state.oidcPlugin.mongoClientOptions.authMechanismProperties; | ||
let oidcMethod; | ||
switch (content.method) { | ||
@@ -159,11 +157,8 @@ case 'oidc:_abort': | ||
return {}; | ||
case 'oidc:REQUEST_TOKEN_CALLBACK': | ||
oidcMethod = 'REQUEST_TOKEN_CALLBACK'; | ||
case 'oidc:REFRESH_TOKEN_CALLBACK': { | ||
oidcMethod ?? (oidcMethod = 'REFRESH_TOKEN_CALLBACK'); | ||
case 'oidc:OIDC_HUMAN_CALLBACK': { | ||
const abortController = new AbortController(); | ||
this.abortContexts.set(content.timeoutContextId, abortController); | ||
try { | ||
const result = await oidcCallbacks[oidcMethod](content.info, { | ||
...content.context, | ||
const result = await this.state.oidcPlugin.mongoClientOptions.authMechanismProperties.OIDC_HUMAN_CALLBACK({ | ||
...content.callbackParams, | ||
timeoutContext: abortController.signal, | ||
@@ -196,4 +191,3 @@ }); | ||
authMechanismProperties: { | ||
REQUEST_TOKEN_CALLBACK: this._oidcCallback.bind(this, 'oidc:REQUEST_TOKEN_CALLBACK'), | ||
REFRESH_TOKEN_CALLBACK: this._oidcCallback.bind(this, 'oidc:REFRESH_TOKEN_CALLBACK'), | ||
OIDC_HUMAN_CALLBACK: this._oidcCallback.bind(this, 'oidc:OIDC_HUMAN_CALLBACK'), | ||
}, | ||
@@ -203,5 +197,5 @@ }, | ||
} | ||
async _oidcCallback(method, info, _context) { | ||
async _oidcCallback(method, params) { | ||
const timeoutContextId = (await (0, util_1.promisify)(crypto_1.default.randomBytes)(16)).toString('base64'); | ||
const { timeoutContext, ...context } = _context; | ||
const { timeoutContext, ...callbackParams } = params; | ||
const abort = async () => { | ||
@@ -218,4 +212,3 @@ await this.makeRpcCall({ | ||
timeoutContextId, | ||
context, | ||
info, | ||
callbackParams, | ||
}); | ||
@@ -222,0 +215,0 @@ return result; |
{ | ||
"name": "@mongodb-js/devtools-connect", | ||
"version": "2.6.3", | ||
"version": "3.0.1", | ||
"description": "A connection establishment utility for MongoDB developer tools", | ||
@@ -57,3 +57,3 @@ "homepage": "https://github.com/mongodb-js/devtools-shared/tree/main/packages/devtools-connect", | ||
"peerDependencies": { | ||
"@mongodb-js/oidc-plugin": "^0.4.0", | ||
"@mongodb-js/oidc-plugin": "^1.0.0", | ||
"mongodb": "^5.8.1 || ^6.0.0", | ||
@@ -63,3 +63,3 @@ "mongodb-log-writer": "^1.4.2" | ||
"devDependencies": { | ||
"@mongodb-js/oidc-plugin": "^0.4.0", | ||
"@mongodb-js/oidc-plugin": "^1.0.0", | ||
"@mongodb-js/saslprep": "^1.1.7", | ||
@@ -96,3 +96,3 @@ "@types/lodash.merge": "^4.6.7", | ||
}, | ||
"gitHead": "bb641986d3447110afcbc109d4cea262e17faa3c" | ||
"gitHead": "04bfb43bbdc573285cfab4098aaf1604cd056b83" | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
80689
887