@zz1996/dbhub-dameng 1.2.5-dameng.621 → 1.2.5-dameng.624

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.
@@ -45,6 +45,7 @@ function parseConnectionInfoFromDSN(dsn) {
45
45
  return null;
46
46
  }
47
47
  }
48
+ var REDACTED_DSN = "<redacted DSN>";
48
49
  function obfuscateDSNPassword(dsn) {
49
50
  if (!dsn) {
50
51
  return dsn;
@@ -55,6 +56,9 @@ function obfuscateDSNPassword(dsn) {
55
56
  return dsn;
56
57
  }
57
58
  const url = new SafeURL(dsn);
59
+ if (url.port && !/^\d+$/.test(url.port)) {
60
+ return REDACTED_DSN;
61
+ }
58
62
  if (!url.password) {
59
63
  return dsn;
60
64
  }
@@ -79,7 +83,7 @@ function obfuscateDSNPassword(dsn) {
79
83
  }
80
84
  return result;
81
85
  } catch {
82
- return dsn;
86
+ return REDACTED_DSN;
83
87
  }
84
88
  }
85
89
  function getDatabaseTypeFromDSN(dsn) {
@@ -4,7 +4,7 @@ import {
4
4
  } from "./chunk-FU2ZJE4E.js";
5
5
  import {
6
6
  obfuscateDSNPassword
7
- } from "./chunk-3RJRH3CN.js";
7
+ } from "./chunk-JDFXWHHT.js";
8
8
 
9
9
  // src/connectors/mysql-family-health-check.ts
10
10
  async function getMySQLFamilyHealthCheck(query) {
@@ -4,8 +4,9 @@ import {
4
4
  import {
5
5
  getDatabaseTypeFromDSN,
6
6
  getDefaultPortForType,
7
+ obfuscateDSNPassword,
7
8
  parseConnectionInfoFromDSN
8
- } from "./chunk-3RJRH3CN.js";
9
+ } from "./chunk-JDFXWHHT.js";
9
10
  import {
10
11
  ConnectorRegistry,
11
12
  SafeURL,
@@ -826,15 +827,7 @@ function splitTokenList(value) {
826
827
  return value.split(",").map((t) => t.trim()).filter((t) => t.length > 0);
827
828
  }
828
829
  function redactDSN(dsn) {
829
- try {
830
- const url = new URL(dsn);
831
- if (url.password) {
832
- url.password = "*******";
833
- }
834
- return url.toString();
835
- } catch (error) {
836
- return dsn.replace(/\/\/([^:]+):([^@]+)@/, "//$1:***@");
837
- }
830
+ return obfuscateDSNPassword(dsn);
838
831
  }
839
832
  function resolveId() {
840
833
  const args = parseCommandLineArgs();
@@ -981,7 +974,7 @@ async function resolveSourceConfigs() {
981
974
  dsnUrl = new SafeURL(dsnResult.dsn);
982
975
  } catch (error) {
983
976
  throw new Error(
984
- `Invalid DSN format: ${dsnResult.dsn}. Expected format: protocol://[user[:password]@]host[:port]/database`
977
+ `Invalid DSN format: ${redactDSN(dsnResult.dsn)}. Expected format: protocol://[user[:password]@]host[:port]/database`
985
978
  );
986
979
  }
987
980
  const protocol = dsnUrl.protocol.replace(":", "");
package/dist/index.js CHANGED
@@ -18,7 +18,7 @@ import {
18
18
  resolveSourceConfigs,
19
19
  resolveTomlConfigPath,
20
20
  resolveTransport
21
- } from "./chunk-HGU7ILEZ.js";
21
+ } from "./chunk-RRLCKPSL.js";
22
22
  import {
23
23
  loadConnectors
24
24
  } from "./chunk-WVVMH6FJ.js";
@@ -29,7 +29,7 @@ import {
29
29
  getDatabaseTypeFromDSN,
30
30
  getDefaultPortForType,
31
31
  parseConnectionInfoFromDSN
32
- } from "./chunk-3RJRH3CN.js";
32
+ } from "./chunk-JDFXWHHT.js";
33
33
  import {
34
34
  allowedKeywords,
35
35
  getFirstKeyword,
@@ -1915,7 +1915,7 @@ See documentation for more details on configuring database connections.
1915
1915
  const sources = sourceConfigsData.sources;
1916
1916
  console.error(`Configuration source: ${sourceConfigsData.source}`);
1917
1917
  await connectorManager.connectWithSources(sources);
1918
- const { initializeToolRegistry: initializeToolRegistry2 } = await import("./registry-WVSFVS35.js");
1918
+ const { initializeToolRegistry: initializeToolRegistry2 } = await import("./registry-U6JUB444.js");
1919
1919
  initializeToolRegistry2({
1920
1920
  sources: sourceConfigsData.sources,
1921
1921
  tools: sourceConfigsData.tools
@@ -2070,12 +2070,12 @@ See documentation for more details on configuring database connections.
2070
2070
 
2071
2071
  // src/index.ts
2072
2072
  var connectorModules = [
2073
- { load: () => import("./postgres-C24SBQ4I.js"), name: "PostgreSQL", driver: "pg" },
2074
- { load: () => import("./sqlserver-KZPPK67Q.js"), name: "SQL Server", driver: "mssql" },
2073
+ { load: () => import("./postgres-UAK5DSEM.js"), name: "PostgreSQL", driver: "pg" },
2074
+ { load: () => import("./sqlserver-LNPATTNS.js"), name: "SQL Server", driver: "mssql" },
2075
2075
  { load: () => import("./dameng-NKF7NZKE.js"), name: "Dameng", driver: "dmdb" },
2076
- { load: () => import("./sqlite-7BNGDMBZ.js"), name: "SQLite", driver: "node:sqlite" },
2077
- { load: () => import("./mysql-TESH7KKV.js"), name: "MySQL", driver: "mysql2" },
2078
- { load: () => import("./mariadb-MMC6WMEG.js"), name: "MariaDB", driver: "mariadb" }
2076
+ { load: () => import("./sqlite-J42ZHIO4.js"), name: "SQLite", driver: "node:sqlite" },
2077
+ { load: () => import("./mysql-GHTT5NG3.js"), name: "MySQL", driver: "mysql2" },
2078
+ { load: () => import("./mariadb-Y6H4TOLN.js"), name: "MariaDB", driver: "mariadb" }
2079
2079
  ];
2080
2080
  loadConnectors(connectorModules).then(() => main()).catch((error) => {
2081
2081
  console.error("Fatal error:", error);
@@ -5,14 +5,14 @@ import {
5
5
  parseQueryResultSets,
6
6
  requireDatabaseInDSN,
7
7
  withReadOnlyTransaction
8
- } from "./chunk-4276LPPU.js";
8
+ } from "./chunk-KYBFNQQ4.js";
9
9
  import "./chunk-FU2ZJE4E.js";
10
10
  import {
11
11
  quoteIdentifier
12
12
  } from "./chunk-JFWX35TB.js";
13
13
  import {
14
14
  obfuscateDSNPassword
15
- } from "./chunk-3RJRH3CN.js";
15
+ } from "./chunk-JDFXWHHT.js";
16
16
  import {
17
17
  SQLRowLimiter,
18
18
  closeQuietly
@@ -6,14 +6,14 @@ import {
6
6
  parseQueryResultSets,
7
7
  requireDatabaseInDSN,
8
8
  withReadOnlyTransaction
9
- } from "./chunk-4276LPPU.js";
9
+ } from "./chunk-KYBFNQQ4.js";
10
10
  import "./chunk-FU2ZJE4E.js";
11
11
  import {
12
12
  quoteIdentifier
13
13
  } from "./chunk-JFWX35TB.js";
14
14
  import {
15
15
  obfuscateDSNPassword
16
- } from "./chunk-3RJRH3CN.js";
16
+ } from "./chunk-JDFXWHHT.js";
17
17
  import {
18
18
  SQLRowLimiter,
19
19
  closeQuietly
@@ -6,7 +6,7 @@ import {
6
6
  } from "./chunk-JFWX35TB.js";
7
7
  import {
8
8
  obfuscateDSNPassword
9
- } from "./chunk-3RJRH3CN.js";
9
+ } from "./chunk-JDFXWHHT.js";
10
10
  import {
11
11
  SQLRowLimiter,
12
12
  closeQuietly
@@ -2,9 +2,9 @@ import {
2
2
  ToolRegistry,
3
3
  getToolRegistry,
4
4
  initializeToolRegistry
5
- } from "./chunk-HGU7ILEZ.js";
5
+ } from "./chunk-RRLCKPSL.js";
6
6
  import "./chunk-WVVMH6FJ.js";
7
- import "./chunk-3RJRH3CN.js";
7
+ import "./chunk-JDFXWHHT.js";
8
8
  import "./chunk-2JL4KCP5.js";
9
9
  export {
10
10
  ToolRegistry,
@@ -3,7 +3,7 @@ import {
3
3
  } from "./chunk-JFWX35TB.js";
4
4
  import {
5
5
  obfuscateDSNPassword
6
- } from "./chunk-3RJRH3CN.js";
6
+ } from "./chunk-JDFXWHHT.js";
7
7
  import {
8
8
  SQLRowLimiter,
9
9
  closeQuietly
@@ -7,7 +7,7 @@ import {
7
7
  } from "./chunk-FU2ZJE4E.js";
8
8
  import {
9
9
  obfuscateDSNPassword
10
- } from "./chunk-3RJRH3CN.js";
10
+ } from "./chunk-JDFXWHHT.js";
11
11
  import {
12
12
  SQLRowLimiter,
13
13
  closeQuietly
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zz1996/dbhub-dameng",
3
- "version": "1.2.5-dameng.621",
3
+ "version": "1.2.5-dameng.624",
4
4
  "mcpName": "io.github.zuozh11/dbhub-dameng",
5
5
  "description": "DBHub with a minimal Dameng/DM8 connector",
6
6
  "repository": {