import { ArrayMaxSize, ArrayMinSize, IsArray, IsString, IsUrl, MaxLength, MinLength } from 'class-validator'

// Register an external OIDC app that uses Dezky as its identity provider.
export class CreateSsoAppDto {
  @IsString() @MinLength(1) @MaxLength(80)
  name!: string

  // One or more exact redirect URIs the app will use after sign-in.
  @IsArray()
  @ArrayMinSize(1)
  @ArrayMaxSize(20)
  @IsUrl({ require_tld: false, require_protocol: true }, { each: true })
  redirectUris!: string[]
}
