| 1 | import { ApiProperty |
| 2 | import { IsOptional, IsString, MaxLength } from 'class-validator'; |
| 3 |
| 4 | import { |
| 5 | MAX_PUBLIC_KEY_LENGTH, |
| 6 | MAX_TITLE_LENGTH, |
| 7 | } from '../../../../resources/ssh-keys/dto/ssh-key.dto.js'; |
| 8 |
| 9 | /** GitHub's add-key body. */ |
| 10 | export class GithubAddKeyDTO { |
| 11 | @ApiPropertyOptional({ maxLength: MAX_TITLE_LENGTH }) |
| 12 | @IsOptional() |
| 13 | @IsString() |
| 14 | @MaxLength(MAX_TITLE_LENGTH) |
| 15 | title?: string; |
| 16 |
| 17 | @ApiProperty({ |
| 18 | description: 'One authorized_keys line.', |
| 19 | maxLength: MAX_PUBLIC_KEY_LENGTH, |
| 20 | }) |
| 21 | @IsString() |
| 22 | @MaxLength(MAX_PUBLIC_KEY_LENGTH) |
| 23 | key: string; |
| 24 | } |