fix: allow UTF-8 (Cyrillic) secret names in validator
This commit is contained in:
1 parent
07272804e4
commit
0ae4416b0b
1 file changed
+3
-2
@@ -8,7 +8,7 @@ import (
|
||||
|
||||
const SecretNameMaxLength = 255
|
||||
|
||||
var SecretNamePattern = regexp.MustCompile(`^[a-zA-Z0-9]([a-zA-Z0-9 _\-\./]*[a-zA-Z0-9])?$`)
|
||||
var SecretNamePattern = regexp.MustCompile(`^[\p{L}0-9]([\p{L}0-9 _\-\\./]*[\p{L}0-9])?$`)
|
||||
|
||||
func IsValidSecretName(name string) bool {
|
||||
if len(name) == 0 || len(name) > SecretNameMaxLength {
|
||||
@@ -19,8 +19,9 @@ func IsValidSecretName(name string) bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// Allow UTF-8 (incl. Cyrillic) secret names; only reject control chars.
|
||||
for _, ch := range name {
|
||||
if ch < 32 || ch > 126 {
|
||||
if ch < 32 || ch == 127 {
|
||||
return false
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user