mirror of
https://github.com/hedgedoc/hedgedoc.git
synced 2024-12-23 08:54:26 +00:00
a5d8c9cc33
Signed-off-by: David Mehren <git@herrmehren.de>
45 lines
881 B
TypeScript
45 lines
881 B
TypeScript
/*
|
|
* SPDX-FileCopyrightText: 2022 The HedgeDoc developers (see AUTHORS file)
|
|
*
|
|
* SPDX-License-Identifier: AGPL-3.0-only
|
|
*/
|
|
import { Type } from 'class-transformer';
|
|
import { IsDate, IsNumber, IsOptional, IsString } from 'class-validator';
|
|
|
|
import { BaseDto } from '../utils/base.dto.';
|
|
import { TimestampMillis } from '../utils/timestamp';
|
|
|
|
export class AuthTokenDto extends BaseDto {
|
|
@IsString()
|
|
label: string;
|
|
|
|
@IsString()
|
|
keyId: string;
|
|
|
|
@IsDate()
|
|
@Type(() => Date)
|
|
createdAt: Date;
|
|
|
|
@IsDate()
|
|
@Type(() => Date)
|
|
validUntil: Date;
|
|
|
|
@IsDate()
|
|
@Type(() => Date)
|
|
@IsOptional()
|
|
lastUsedAt: Date | null;
|
|
}
|
|
|
|
export class AuthTokenWithSecretDto extends AuthTokenDto {
|
|
@IsString()
|
|
secret: string;
|
|
}
|
|
|
|
export class AuthTokenCreateDto extends BaseDto {
|
|
@IsString()
|
|
label: string;
|
|
|
|
@IsNumber()
|
|
@Type(() => Number)
|
|
validUntil: TimestampMillis;
|
|
}
|