mirror of
https://github.com/diegosouzapw/OmniRoute.git
synced 2026-08-01 21:02:12 +03:00
fix: allow Unicode letters in API key name validation (#1996)
Integrated into release/v3.8.0
This commit is contained in:
committed by
GitHub
parent
40cc0d116a
commit
4cd7ee1134
@@ -42,8 +42,8 @@ function validateKeyName(
|
||||
if (name.length > MAX_KEY_NAME_LENGTH) {
|
||||
return { valid: false, error: t("keyNameTooLong", { max: MAX_KEY_NAME_LENGTH }) };
|
||||
}
|
||||
// Only allow alphanumeric, spaces, hyphens, underscores
|
||||
if (!/^[a-zA-Z0-9_\-\s]+$/.test(name)) {
|
||||
// Allow Unicode letters (accented chars), numbers, spaces, hyphens, underscores
|
||||
if (!/^[\p{L}\p{N}_\-\s]+$/u.test(name)) {
|
||||
return {
|
||||
valid: false,
|
||||
error: t("keyNameInvalid"),
|
||||
|
||||
@@ -977,7 +977,7 @@
|
||||
"tipSeparate": "Create separate keys for different clients or environments",
|
||||
"tipRestrict": "Restrict keys to specific models for better security and cost control",
|
||||
"keyName": "Key Name",
|
||||
"keyNamePlaceholder": "e.g., Production Key, Development Key",
|
||||
"keyNamePlaceholder": "e.g. Production Key",
|
||||
"keyNameDesc": "Choose a descriptive name to identify this key's purpose",
|
||||
"keyCreated": "API Key Created",
|
||||
"keyCreatedSuccess": "Key created successfully!",
|
||||
|
||||
@@ -875,7 +875,7 @@
|
||||
"tipSeparate": "Crie chaves separadas para diferentes clientes ou ambientes",
|
||||
"tipRestrict": "Restrinja chaves a modelos específicos para maior segurança e controle de custos",
|
||||
"keyName": "Nome da Chave",
|
||||
"keyNamePlaceholder": "ex: Chave de Produção, Chave de Desenvolvimento",
|
||||
"keyNamePlaceholder": "ex: Chave de Produção",
|
||||
"keyNameDesc": "Escolha um nome descritivo para identificar o propósito desta chave",
|
||||
"keyCreated": "Chave de API Criada",
|
||||
"keyCreatedSuccess": "Chave criada com sucesso!",
|
||||
|
||||
Reference in New Issue
Block a user