dbgate-api-premium 7.2.0 → 7.2.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +6 -6
- package/src/auth/authProvider.js +3 -0
- package/src/auth/storageAuthProvider.js +37 -0
- package/src/controllers/auth.js +80 -2
- package/src/controllers/config.js +29 -3
- package/src/controllers/connections.js +10 -3
- package/src/controllers/databaseConnections.js +18 -2
- package/src/controllers/mcpAdmin.js +156 -0
- package/src/controllers/storage.js +72 -17
- package/src/controllers/storageDb.js +6 -0
- package/src/currentVersion.js +2 -2
- package/src/main.js +15 -0
- package/src/mcp.js +1719 -0
- package/src/proc/databaseConnectionProcess.js +50 -3
- package/src/proc/sessionProcess.js +20 -3
- package/src/shell/copyStream.js +2 -1
- package/src/storageModel.js +4 -0
- package/src/utility/envtools.js +5 -0
- package/src/utility/healthStatus.js +3 -1
- package/src/utility/loginchecker.js +7 -0
- package/src/utility/mcpAuth.js +137 -0
- package/src/utility/queryResultMetadata.js +268 -5
- package/src/utility/storageReplicatorItems.js +12 -0
package/src/main.js
CHANGED
|
@@ -31,6 +31,8 @@ const scheduler = require('./controllers/scheduler');
|
|
|
31
31
|
const queryHistory = require('./controllers/queryHistory');
|
|
32
32
|
const cloud = require('./controllers/cloud');
|
|
33
33
|
const teamFiles = require('./controllers/teamFiles');
|
|
34
|
+
const mcpAdmin = require('./controllers/mcpAdmin');
|
|
35
|
+
const mcp = require('./mcp');
|
|
34
36
|
|
|
35
37
|
const onFinished = require('on-finished');
|
|
36
38
|
const processArgs = require('./utility/processArgs');
|
|
@@ -94,6 +96,7 @@ function start() {
|
|
|
94
96
|
// console.log('process.argv', process.argv);
|
|
95
97
|
|
|
96
98
|
const app = express();
|
|
99
|
+
app.set('trust proxy', 'loopback, linklocal, uniquelocal');
|
|
97
100
|
|
|
98
101
|
const server = http.createServer(app);
|
|
99
102
|
|
|
@@ -175,6 +178,17 @@ function start() {
|
|
|
175
178
|
});
|
|
176
179
|
|
|
177
180
|
app.use(bodyParser.json({ limit: '50mb' }));
|
|
181
|
+
app.use(bodyParser.urlencoded({ extended: false }));
|
|
182
|
+
|
|
183
|
+
app.get(getExpressPath('/.well-known/oauth-protected-resource'), mcp.handleOAuthProtectedResourceMetadata);
|
|
184
|
+
app.get(getExpressPath('/.well-known/oauth-protected-resource/mcp'), mcp.handleOAuthProtectedResourceMetadata);
|
|
185
|
+
app.get(getExpressPath('/.well-known/oauth-authorization-server'), mcp.handleOAuthAuthorizationServerMetadata);
|
|
186
|
+
app.get(getExpressPath('/.well-known/openid-configuration'), mcp.handleOAuthAuthorizationServerMetadata);
|
|
187
|
+
app.get(getExpressPath('/authorize'), mcp.handleOAuthAuthorize);
|
|
188
|
+
app.post(getExpressPath('/token'), mcp.handleOAuthToken);
|
|
189
|
+
app.get(getExpressPath('/mcp/oauth/authorize'), mcp.handleOAuthAuthorize);
|
|
190
|
+
app.post(getExpressPath('/mcp/oauth/token'), mcp.handleOAuthToken);
|
|
191
|
+
app.post(getExpressPath('/mcp'), mcp.handleMcpRequest);
|
|
178
192
|
|
|
179
193
|
app.use(
|
|
180
194
|
getExpressPath('/uploads'),
|
|
@@ -269,6 +283,7 @@ function useAllControllers(app, electron) {
|
|
|
269
283
|
useController(app, electron, '/cloud', cloud);
|
|
270
284
|
useController(app, electron, '/team-files', teamFiles);
|
|
271
285
|
useController(app, electron, '/rest-connections', restConnections);
|
|
286
|
+
useController(app, electron, '/mcp-admin', mcpAdmin);
|
|
272
287
|
}
|
|
273
288
|
|
|
274
289
|
function setElectronSender(electronSender) {
|