dbgate-api 5.2.7 → 5.2.8
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
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dbgate-api",
|
|
3
3
|
"main": "src/index.js",
|
|
4
|
-
"version": "5.2.
|
|
4
|
+
"version": "5.2.8",
|
|
5
5
|
"homepage": "https://dbgate.org/",
|
|
6
6
|
"repository": {
|
|
7
7
|
"type": "git",
|
|
@@ -27,9 +27,9 @@
|
|
|
27
27
|
"cors": "^2.8.5",
|
|
28
28
|
"cross-env": "^6.0.3",
|
|
29
29
|
"dbgate-query-splitter": "^4.9.3",
|
|
30
|
-
"dbgate-sqltree": "^5.2.
|
|
31
|
-
"dbgate-tools": "^5.2.
|
|
32
|
-
"dbgate-datalib": "^5.2.
|
|
30
|
+
"dbgate-sqltree": "^5.2.8",
|
|
31
|
+
"dbgate-tools": "^5.2.8",
|
|
32
|
+
"dbgate-datalib": "^5.2.8",
|
|
33
33
|
"debug": "^4.3.4",
|
|
34
34
|
"diff": "^5.0.0",
|
|
35
35
|
"diff2html": "^3.4.13",
|
|
@@ -74,17 +74,17 @@
|
|
|
74
74
|
"devDependencies": {
|
|
75
75
|
"@types/fs-extra": "^9.0.11",
|
|
76
76
|
"@types/lodash": "^4.14.149",
|
|
77
|
-
"dbgate-types": "^5.2.
|
|
77
|
+
"dbgate-types": "^5.2.8",
|
|
78
78
|
"env-cmd": "^10.1.0",
|
|
79
79
|
"node-loader": "^1.0.2",
|
|
80
80
|
"nodemon": "^2.0.2",
|
|
81
81
|
"typescript": "^4.4.3",
|
|
82
|
-
"webpack": "^
|
|
83
|
-
"webpack-cli": "^
|
|
82
|
+
"webpack": "^5.91.0",
|
|
83
|
+
"webpack-cli": "^5.1.4"
|
|
84
84
|
},
|
|
85
85
|
"optionalDependencies": {
|
|
86
|
-
"better-sqlite3": "
|
|
87
|
-
"msnodesqlv8": "^2.
|
|
86
|
+
"better-sqlite3": "9.6.0",
|
|
87
|
+
"msnodesqlv8": "^4.2.1",
|
|
88
88
|
"oracledb": "^5.5.0"
|
|
89
89
|
}
|
|
90
90
|
}
|
package/src/controllers/auth.js
CHANGED
|
@@ -137,7 +137,7 @@ module.exports = {
|
|
|
137
137
|
return { error: 'Logins not configured' };
|
|
138
138
|
}
|
|
139
139
|
const foundLogin = logins.find(x => x.login == login);
|
|
140
|
-
if (foundLogin && foundLogin.password == password) {
|
|
140
|
+
if (foundLogin && foundLogin.password && foundLogin.password == password) {
|
|
141
141
|
return {
|
|
142
142
|
accessToken: jwt.sign({ login }, tokenSecret, { expiresIn: getTokenLifetime() }),
|
|
143
143
|
};
|
|
@@ -88,6 +88,7 @@ function getPortalCollections() {
|
|
|
88
88
|
sslCertFilePassword: process.env[`SSL_CERT_FILE_PASSWORD_${id}`],
|
|
89
89
|
sslKeyFile: process.env[`SSL_KEY_FILE_${id}`],
|
|
90
90
|
sslRejectUnauthorized: process.env[`SSL_REJECT_UNAUTHORIZED_${id}`],
|
|
91
|
+
trustServerCertificate: process.env[`SSL_TRUST_CERTIFICATE_${id}`],
|
|
91
92
|
}));
|
|
92
93
|
|
|
93
94
|
logger.info({ connections: connections.map(pickSafeConnectionInfo) }, 'Using connections from ENV variables');
|
package/src/currentVersion.js
CHANGED
package/src/main.js
CHANGED
|
@@ -48,7 +48,7 @@ function start() {
|
|
|
48
48
|
if (logins && process.env.BASIC_AUTH) {
|
|
49
49
|
app.use(
|
|
50
50
|
basicAuth({
|
|
51
|
-
users: _.fromPairs(logins.map(x => [x.login, x.password])),
|
|
51
|
+
users: _.fromPairs(logins.filter(x => x.password).map(x => [x.login, x.password])),
|
|
52
52
|
challenge: true,
|
|
53
53
|
realm: 'DbGate Web App',
|
|
54
54
|
})
|
|
@@ -39,7 +39,7 @@ function getLogins() {
|
|
|
39
39
|
permissions: process.env.PERMISSIONS,
|
|
40
40
|
});
|
|
41
41
|
}
|
|
42
|
-
if (process.env.LOGINS) {
|
|
42
|
+
if (process.env.LOGINS || process.env.OAUTH_PERMISSIONS) {
|
|
43
43
|
const logins = _.compact(process.env.LOGINS.split(',').map(x => x.trim()));
|
|
44
44
|
for (const login of logins) {
|
|
45
45
|
const password = process.env[`LOGIN_PASSWORD_${login}`];
|
|
@@ -51,6 +51,13 @@ function getLogins() {
|
|
|
51
51
|
permissions,
|
|
52
52
|
});
|
|
53
53
|
}
|
|
54
|
+
if (process.env.OAUTH_PERMISSIONS) {
|
|
55
|
+
res.push({
|
|
56
|
+
login,
|
|
57
|
+
password: null,
|
|
58
|
+
permissions,
|
|
59
|
+
})
|
|
60
|
+
}
|
|
54
61
|
}
|
|
55
62
|
}
|
|
56
63
|
|