Skip to content

Commit

Permalink
Remove extra validation line
Browse files Browse the repository at this point in the history
  • Loading branch information
jjacobson93 committed Jul 19, 2023
1 parent 5958ae0 commit 536e6f3
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions agent/hcp/bootstrap/bootstrap.go
Original file line number Diff line number Diff line change
Expand Up @@ -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")
}
Expand Down

0 comments on commit 536e6f3

Please sign in to comment.