import { ApiProperty } from '@nestjs/swagger'; import { ArrayMaxSize, IsArray, IsString, Validate } from 'class-validator'; import { MAX_ALLOWED_IPS } from '../ip-allowlist'; import { AllowedIpConstraint } from './allowed-ips.validator'; export class UpdateApiKeyDto { @ApiProperty({ description: 'Erlaubte Absender (IP oder CIDR); leere Liste = von überall nutzbar', type: [String], }) @IsArray() @ArrayMaxSize(MAX_ALLOWED_IPS) @IsString({ each: true }) @Validate(AllowedIpConstraint, { each: true }) allowedIps!: string[]; }