[core] API - limited characters in the session name

fix #1163
This commit is contained in:
devlikepro committed 2025-08-05 15:53:42 +07:00
1 parent eb8e3a0fd1
commit a043a46457
1 file changed
+5
+5
View File
@@ -7,6 +7,7 @@ import {
IsBoolean,
IsOptional,
IsString,
Matches,
MaxLength,
ValidateNested,
} from 'class-validator';
@@ -179,6 +180,10 @@ export class SessionCreateRequest {
@IsString()
@IsOptional()
@MaxLength(DB_NAME_LIMIT - DB_NAME_MAX_PREFIX_LEN)
@Matches(/^[a-zA-Z0-9_-]*$/, {
message:
'Session name can only contain alphanumeric characters, hyphens, and underscores (a-z, A-Z, 0-9, -, _) or be empty',
})
name: string | undefined;
@ValidateNested()