mirror of
https://github.com/DeNNiiInc/dbgate.git
synced 2026-05-02 06:43:59 +00:00
azure aith wip
This commit is contained in:
@@ -389,7 +389,7 @@ module.exports = {
|
|||||||
const { conid } = req.query;
|
const { conid } = req.query;
|
||||||
const connection = await this.getCore({ conid });
|
const connection = await this.getCore({ conid });
|
||||||
const driver = requireEngineDriver(connection);
|
const driver = requireEngineDriver(connection);
|
||||||
const authUrl = driver.getRedirectAuthUrl(connection);
|
const authUrl = await driver.getRedirectAuthUrl(connection);
|
||||||
res.redirect(authUrl);
|
res.redirect(authUrl);
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -56,7 +56,10 @@ module.exports = {
|
|||||||
if (connection.passwordMode == 'askPassword' || connection.passwordMode == 'askUser') {
|
if (connection.passwordMode == 'askPassword' || connection.passwordMode == 'askUser') {
|
||||||
throw new MissingCredentialsError({ conid, passwordMode: connection.passwordMode });
|
throw new MissingCredentialsError({ conid, passwordMode: connection.passwordMode });
|
||||||
}
|
}
|
||||||
const subprocess = fork(
|
if (connection.useRedirectDbLogin) {
|
||||||
|
throw new MissingCredentialsError({ conid, redirectToDbLogin: true });
|
||||||
|
}
|
||||||
|
const subprocess = fork(
|
||||||
global['API_PACKAGE'] || process.argv[1],
|
global['API_PACKAGE'] || process.argv[1],
|
||||||
[
|
[
|
||||||
'--is-forked-api',
|
'--is-forked-api',
|
||||||
|
|||||||
@@ -67,7 +67,7 @@ module.exports = function useController(app, electron, route, controller) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (raw) {
|
if (raw) {
|
||||||
router[method](routeAction, controller[key]);
|
router[method](routeAction, (req, res) => controller[key](req, res));
|
||||||
} else {
|
} else {
|
||||||
router[method](routeAction, async (req, res) => {
|
router[method](routeAction, async (req, res) => {
|
||||||
// if (controller._init && !controller._init_called) {
|
// if (controller._init && !controller._init_called) {
|
||||||
|
|||||||
@@ -181,6 +181,11 @@
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
export function changeConnectionBeforeSave(connection) {
|
||||||
|
if (driver?.beforeConnectionSave) return driver.beforeConnectionSave(connection);
|
||||||
|
return connection;
|
||||||
|
}
|
||||||
|
|
||||||
$: isConnected = $openedConnections.includes($values._id) || $openedSingleDatabaseConnections.includes($values._id);
|
$: isConnected = $openedConnections.includes($values._id) || $openedSingleDatabaseConnections.includes($values._id);
|
||||||
|
|
||||||
// $: console.log('CONN VALUES', $values);
|
// $: console.log('CONN VALUES', $values);
|
||||||
|
|||||||
@@ -65,7 +65,7 @@ function processApiResponse(route, args, resp) {
|
|||||||
|
|
||||||
if (resp?.missingCredentials) {
|
if (resp?.missingCredentials) {
|
||||||
if (resp.detail.redirectToDbLogin) {
|
if (resp.detail.redirectToDbLogin) {
|
||||||
openWebLink('connections/dblogin');
|
openWebLink(`connections/dblogin?conid=${resp.detail.conid}`);
|
||||||
} else if (!isDatabaseLoginVisible()) {
|
} else if (!isDatabaseLoginVisible()) {
|
||||||
showModal(DatabaseLoginModal, resp.detail);
|
showModal(DatabaseLoginModal, resp.detail);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ const AsyncLock = require('async-lock');
|
|||||||
const nativeDriver = require('./nativeDriver');
|
const nativeDriver = require('./nativeDriver');
|
||||||
const lock = new AsyncLock();
|
const lock = new AsyncLock();
|
||||||
const { tediousConnect, tediousQueryCore, tediousReadQuery, tediousStream } = require('./tediousDriver');
|
const { tediousConnect, tediousQueryCore, tediousReadQuery, tediousStream } = require('./tediousDriver');
|
||||||
const { getAzureAuthTypes } = require('./azureAuth');
|
const { getAzureAuthTypes, azureGetRedirectAuthUrl } = require('./azureAuth');
|
||||||
const { nativeConnect, nativeQueryCore, nativeReadQuery, nativeStream } = nativeDriver;
|
const { nativeConnect, nativeQueryCore, nativeReadQuery, nativeStream } = nativeDriver;
|
||||||
|
|
||||||
let requireMsnodesqlv8;
|
let requireMsnodesqlv8;
|
||||||
|
|||||||
Reference in New Issue
Block a user