Fix secret name validation not checking for beginning of string

This commit is contained in:
2023-02-24 22:29:21 -07:00
parent 77a8d0840a
commit 77a5514578
+1 -1
View File
@@ -449,7 +449,7 @@ func (db *Database) CreateSecret(name string, secret string) (Secret, error) {
return s, fmt.Errorf("secret name must be 256 characters or less")
}
validName := regexp.MustCompile(`^[A-Z0-9_]+$`)
validName := regexp.MustCompile(`[A-Z0-9_]+$`)
if !validName.MatchString(name) {
return s, fmt.Errorf("secren name must be made up of only uppercase letters, numbers, and underscores")
}