mirror of
https://github.com/Syngnat/GoNavi.git
synced 2026-06-07 06:59:32 +08:00
🐛 fix(connection): 收敛数据库连接参数白名单
- MySQL 兼容 JDBC 参数映射并丢弃 allowPublicKeyRetrieval 等无效参数 - 为 PostgreSQL 系、SQL Server、Oracle、达梦、TDengine 接入驱动参数白名单 - 补充连接参数归一化、别名映射和未知参数过滤回归测试
This commit is contained in:
@@ -71,7 +71,7 @@ func (k *KingbaseDB) getDSN(config connection.ConnectionConfig) string {
|
||||
params.Set("dbname", config.Database)
|
||||
params.Set("sslmode", resolvePostgresSSLMode(config))
|
||||
params.Set("connect_timeout", strconv.Itoa(getConnectTimeoutSeconds(config)))
|
||||
mergeConnectionParamsFromConfig(params, config, "kingbase")
|
||||
mergeConnectionParamsFromConfigWithAllowlist(params, config, kingbaseConnectionParamNames, "kingbase")
|
||||
|
||||
preferred := []string{"host", "port", "user", "password", "dbname", "sslmode", "connect_timeout"}
|
||||
seen := make(map[string]struct{}, len(params))
|
||||
|
||||
Reference in New Issue
Block a user