This commit is contained in:
Stephan D
2026-03-10 12:31:09 +01:00
parent d87e709f43
commit e77d1ab793
287 changed files with 2089 additions and 1550 deletions

View File

@@ -11,6 +11,7 @@ func TestBuildSafePublishableNATSURL(t *testing.T) {
t.Run("redacts single URL credentials", func(t *testing.T) {
t.Parallel()
//nolint:gosec // Test fixture includes credentials to verify redaction logic.
raw := "nats://alice:supersecret@localhost:4222"
sanitized := buildSafePublishableNATSURL(raw)
@@ -25,6 +26,7 @@ func TestBuildSafePublishableNATSURL(t *testing.T) {
t.Run("redacts credentials in gateway URL format", func(t *testing.T) {
t.Parallel()
//nolint:gosec // Test fixture includes credentials to verify redaction logic.
raw := "nats://dev_nats:nats_password_123@dev-nats:4222"
sanitized := buildSafePublishableNATSURL(raw)
@@ -49,6 +51,7 @@ func TestBuildSafePublishableNATSURL(t *testing.T) {
t.Run("redacts each URL in server list", func(t *testing.T) {
t.Parallel()
//nolint:gosec // Test fixture includes credentials to verify redaction logic.
raw := " nats://alice:one@localhost:4222, nats://bob:two@localhost:4223 "
sanitized := buildSafePublishableNATSURL(raw)
@@ -73,6 +76,7 @@ func TestBuildSafePublishableNATSURL(t *testing.T) {
t.Run("redacts malformed URL credentials via fallback", func(t *testing.T) {
t.Parallel()
//nolint:gosec // Test fixture includes credentials to verify redaction logic.
raw := "nats://alice:pa%ss@localhost:4222"
sanitized := buildSafePublishableNATSURL(raw)