|
| 1 | +import { ApiProperty } from '@nestjs/swagger'; |
| 2 | +import { IsNumber, IsBoolean } from 'class-validator'; |
| 3 | + |
| 4 | +export class PasswordPoliciesDto { |
| 5 | + @IsNumber() |
| 6 | + @ApiProperty({ example: '8', description: 'Password minimal Length', type: Number }) |
| 7 | + public len: Number; |
| 8 | + |
| 9 | + @IsNumber() |
| 10 | + @ApiProperty({ example: '1', description: 'Minimal amount of letters in uppercase', type: Number }) |
| 11 | + public hasUpperCase: Number; |
| 12 | + |
| 13 | + @IsNumber() |
| 14 | + @ApiProperty({ example: '1', description: 'Minimal amount of letters in lowercase', type: Number }) |
| 15 | + public hasLowerCase: Number; |
| 16 | + |
| 17 | + @IsNumber() |
| 18 | + @ApiProperty({ example: '1', description: 'Minimal amount of numbers', type: Number }) |
| 19 | + public hasNumbers: Number; |
| 20 | + |
| 21 | + @IsNumber() |
| 22 | + @ApiProperty({ example: '1', description: 'Minimal amount of special characters', type: Number }) |
| 23 | + public hasSpecialChars: Number; |
| 24 | + |
| 25 | + @IsNumber() |
| 26 | + @ApiProperty({ example: '30', description: 'Minimal complexity (entropy), Below this number the password wont be accepted', type: Number }) |
| 27 | + public minComplexity: Number; |
| 28 | + |
| 29 | + @IsNumber() |
| 30 | + @ApiProperty({ example: '70', description: 'Good complexity (entropy), Upper this number the password is considered good', type: Number }) |
| 31 | + public goodComplexity: Number; |
| 32 | + |
| 33 | + @IsBoolean() |
| 34 | + @ApiProperty({ example: true, description: 'Teh password will be checked on Pwned', type: Boolean }) |
| 35 | + public checkPwned: Boolean; |
| 36 | + |
| 37 | + @IsNumber() |
| 38 | + @ApiProperty({ example: '10', description: 'after X bad logins the user will be banned for bannedTime', type: Number }) |
| 39 | + public maxRetry: Number; |
| 40 | + |
| 41 | + @IsNumber() |
| 42 | + @ApiProperty({ example: '3600', description: 'in Seconds', type: Number }) |
| 43 | + public bannedTime: Number; |
| 44 | +} |
0 commit comments