MCPcopy Create free account
hub / github.com/PostHog/duckgres / TestValidateControlPlaneSecurity

Function TestValidateControlPlaneSecurity

controlplane/validation_test.go:79–100  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

77}
78
79func TestValidateControlPlaneSecurity(t *testing.T) {
80 baseCfg := ControlPlaneConfig{}
81 baseCfg.TLSCertFile = "cert.pem"
82 baseCfg.TLSKeyFile = "key.pem"
83 baseCfg.Users = map[string]string{"postgres": "postgres"}
84
85 if err := validateControlPlaneSecurity(baseCfg); err != nil {
86 t.Fatalf("expected valid control-plane security config, got: %v", err)
87 }
88
89 noTLS := baseCfg
90 noTLS.TLSCertFile = ""
91 if err := validateControlPlaneSecurity(noTLS); err == nil {
92 t.Fatalf("expected error for missing TLS cert")
93 }
94
95 noUsers := baseCfg
96 noUsers.Users = map[string]string{}
97 if err := validateControlPlaneSecurity(noUsers); err == nil {
98 t.Fatalf("expected error for missing users")
99 }
100}
101
102func TestValidateWorkerBackendConfig(t *testing.T) {
103 tests := []struct {

Callers

nothing calls this directly

Calls 1

Tested by

no test coverage detected