Files
MeshPort/engines/singbox/bridge/diagnostics_test.go
T
shenandshen c7cc2aa865 Fix VPN internet connectivity and simplify client setup
Initialize Android physical interfaces and preserve macOS scoped routes. Add redacted diagnostics, default DNS, ordered auto-save, simplified controls, scanner rotation settings, and native regression coverage. Restore vendored build sources and document validation and stability checks.
2026-10-12 06:51:25 -07:00

24 lines
791 B
Go

package bridge
import (
"errors"
"strings"
"testing"
)
func TestStartupDiagnosticsDoNotExposeUpstreamCredentials(t *testing.T) {
for _, message := range []string{
"unknown option password=test-secret https://example.test/sub?token=test-token",
"rule-set download https://user:test-secret@example.test/sub?token=test-token",
"unclassified failure with test-secret and test-token",
} {
result := startupFailure("initialize_engine", errors.New(message)).Error()
if strings.Contains(result, "test-secret") || strings.Contains(result, "test-token") || strings.Contains(result, "example.test") {
t.Fatalf("diagnostic exposed upstream contents: %s", result)
}
if !strings.Contains(result, "stage=initialize_engine") {
t.Fatal("diagnostic omitted failing stage")
}
}
}