From 604295549840dd2f4fbe2f91f4ac74d529cc5ca2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=A7=9A=E7=AB=A0=E6=B5=A9?= Date: Wed, 4 Nov 2026 09:52:00 +0800 Subject: [PATCH] =?UTF-8?q?fix(objectgateway):=20=E5=85=A5=E5=8F=A3?= =?UTF-8?q?=E6=B5=8B=E8=AF=95=E5=A4=B9=E5=85=B7=E6=94=B9=E7=94=A8=E6=97=A0?= =?UTF-8?q?=E5=8F=A3=E4=BB=A4=20PG=20URL?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 现象:CI run 347 / job 362 在 security-secrets 失败,指向 cmd/object-gateway/main_test.go:30 的 pg-url 类别。 根因:该 DSN 只用于 127.0.0.1:1 故意不可达连接,验证启动能越过 配置阶段到达 journal/后端准入,本身不需要任何口令,却写成了带口令形式。 取舍:直接换成合法无口令 URL,不拆秘密字符串隐藏检测、不改扫描器/基线/ 必需项范围。产品代码与测试行为不变。 证据:check_secrets.py 由 exit 1(指向该行)转为 exit 0;go test ./cmd/object-gateway 通过;umask 022 下 make verify 16 项本地必需全 success。 --- cmd/object-gateway/main_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmd/object-gateway/main_test.go b/cmd/object-gateway/main_test.go index d2f7adf..b0e8f61 100644 --- a/cmd/object-gateway/main_test.go +++ b/cmd/object-gateway/main_test.go @@ -27,7 +27,7 @@ func startErrorMessage(t *testing.T, extra ...string) (string, int) { "PATH=" + os.Getenv("PATH"), "HOME=" + os.Getenv("HOME"), "OBJECT_GATEWAY_LISTEN=127.0.0.1:0", - "OBJECT_GATEWAY_DATABASE_URL=postgres://gateway:gateway@127.0.0.1:1/gateway?sslmode=disable&connect_timeout=2", + "OBJECT_GATEWAY_DATABASE_URL=postgres://gateway@127.0.0.1:1/gateway?sslmode=disable&connect_timeout=2", "OBJECT_GATEWAY_PROVIDER=minio", "OBJECT_GATEWAY_ENDPOINT=http://127.0.0.1:19100", "OBJECT_GATEWAY_BUCKET=maintenance-fixture-bucket",