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

Function validateUsers

controlplane/validation.go:15–30  ·  view source on GitHub ↗
(users map[string]string)

Source from the content-addressed store, hash-verified

13}
14
15func validateUsers(users map[string]string) error {
16 if len(users) == 0 {
17 return fmt.Errorf("at least one user is required")
18 }
19
20 for username, password := range users {
21 if strings.TrimSpace(username) == "" {
22 return fmt.Errorf("username must not be empty")
23 }
24 if password == "" {
25 return fmt.Errorf("password for user %q must not be empty", username)
26 }
27 }
28
29 return nil
30}
31
32func validateControlPlaneSecurity(cfg ControlPlaneConfig) error {
33 if err := validateTLSFiles(cfg.TLSCertFile, cfg.TLSKeyFile); err != nil {

Callers 2

TestValidateUsersFunction · 0.85

Calls

no outgoing calls

Tested by 1

TestValidateUsersFunction · 0.68