diff --git a/agent/hcp/bootstrap/bootstrap.go b/agent/hcp/bootstrap/bootstrap.go index 29080d4b4643..320b36107313 100644 --- a/agent/hcp/bootstrap/bootstrap.go +++ b/agent/hcp/bootstrap/bootstrap.go @@ -354,12 +354,9 @@ func persistTLSCerts(dir string, serverCert, serverKey string, caCerts []string) return nil } -// Basic validation to ensure a UUID was loaded. +// Basic validation to ensure a UUID was loaded and assumes the token is non-empty func validateManagementToken(token string) error { - if token == "" { - return errors.New("missing HCP management token") - } - + // note: we assume that the token is not an empty string if _, err := uuid.ParseUUID(token); err != nil { return errors.New("management token is not a valid UUID") }