fix(security): trusted-proxy-scoped login rate limit

This commit is contained in:
2026-09-07 12:44:47 +08:00
parent f7c27272ba
commit 6adbab44c3
5 changed files with 71 additions and 21 deletions
+2 -1
View File
@@ -18,7 +18,8 @@ import (
)
func testCfg() *config.Config {
return &config.Config{Addr: ":8080", JWTSecret: []byte("s3cret"), ScanInterval: time.Minute, UploadMaxMB: 200}
return &config.Config{Addr: ":8080", JWTSecret: []byte("s3cret"), ScanInterval: time.Minute, UploadMaxMB: 200,
TrustedProxies: []string{"172.16.0.0/12"}} // 与 prod 默认一致: 只有 compose 网段内代理才可信
}
func TestHealthz(t *testing.T) {