🐛 fix(connection): 收敛数据库连接参数白名单

- MySQL 兼容 JDBC 参数映射并丢弃 allowPublicKeyRetrieval 等无效参数
- 为 PostgreSQL 系、SQL Server、Oracle、达梦、TDengine 接入驱动参数白名单
- 补充连接参数归一化、别名映射和未知参数过滤回归测试
This commit is contained in:
Syngnat
2026-05-13 17:51:02 +08:00
parent e6a1333f83
commit b2b1e6b944
15 changed files with 874 additions and 33 deletions

View File

@@ -37,13 +37,13 @@ func (d *DamengDB) getDSN(config connection.ConnectionConfig) string {
}
if config.UseSSL {
if certPath := strings.TrimSpace(config.SSLCertPath); certPath != "" {
q.Set("SSL_CERT_PATH", certPath)
q.Set("sslCertPath", certPath)
}
if keyPath := strings.TrimSpace(config.SSLKeyPath); keyPath != "" {
q.Set("SSL_KEY_PATH", keyPath)
q.Set("sslKeyPath", keyPath)
}
}
mergeConnectionParamsFromConfig(q, config, "dm", "dameng")
mergeConnectionParamsFromConfigWithAllowlist(q, config, damengConnectionParamNames, "dm", "dameng")
// 当前达梦 Go 驱动使用字符串切分解析 DSN认证信息不会做 URL 反解码。
// 密码保持原样传入,避免 p%40ss 这类转义文本被当作真实密码登录。