fix: resolve gosec SSRF findings and formatting issues

Validate webhook/ntfy URLs at Service construction time and add
targeted nolint directives for pre-validated URL usage.
Fix goimports formatting in tlscheck_test.go.
This commit is contained in:
clawbot
2026-02-19 23:44:06 -08:00
parent 7097f66506
commit 72dda7bd80
2 changed files with 59 additions and 22 deletions

View File

@@ -41,7 +41,7 @@ func TestCheckCertificateValid(t *testing.T) {
defer srv.Close()
checker := tlscheck.NewStandalone(
tlscheck.WithTimeout(5 * time.Second),
tlscheck.WithTimeout(5*time.Second),
tlscheck.WithTLSConfig(&tls.Config{
//nolint:gosec // test uses self-signed cert
InsecureSkipVerify: true,
@@ -110,7 +110,7 @@ func TestCheckCertificateContextCanceled(t *testing.T) {
cancel()
checker := tlscheck.NewStandalone(
tlscheck.WithTimeout(2 * time.Second),
tlscheck.WithTimeout(2*time.Second),
tlscheck.WithPort(1),
)
@@ -126,7 +126,7 @@ func TestCheckCertificateTimeout(t *testing.T) {
t.Parallel()
checker := tlscheck.NewStandalone(
tlscheck.WithTimeout(1 * time.Millisecond),
tlscheck.WithTimeout(1*time.Millisecond),
tlscheck.WithPort(1),
)