add model validation for authentication handshake

This commit is contained in:
Claus-Peter Huebner 2023-10-24 23:33:30 +02:00
parent 7faec3f691
commit f965e6c450
4 changed files with 9 additions and 2 deletions

View File

@ -1,10 +1,13 @@
import { IsString } from 'class-validator'
import { ArgsType, Field } from 'type-graphql'
@ArgsType()
export class OpenConnectionArgs {
@Field(() => String)
@IsString()
publicKey: string
@Field(() => String)
@IsString()
url: string
}

View File

@ -1,10 +1,13 @@
import { IsString, IsUUID } from 'class-validator'
import { Field, InputType } from 'type-graphql'
@InputType()
export class AuthenticationArgs {
@Field(() => String)
@IsString()
oneTimeCode: string
@Field(() => String)
@IsUUID('4')
uuid: string
}

View File

@ -1,10 +1,13 @@
import { IsString } from 'class-validator'
import { Field, InputType } from 'type-graphql'
@InputType()
export class OpenConnectionArgs {
@Field(() => String)
@IsString()
publicKey: string
@Field(() => String)
@IsString()
url: string
}

View File

@ -11,7 +11,6 @@ const schema = async (): Promise<GraphQLSchema> => {
resolvers: [getApiResolvers()],
// authChecker: isAuthorized,
scalarsMap: [{ type: Decimal, scalar: DecimalScalar }],
/*
validate: {
validationError: { target: false },
skipMissingProperties: true,
@ -20,7 +19,6 @@ const schema = async (): Promise<GraphQLSchema> => {
forbidUnknownValues: true,
stopAtFirstError: true,
},
*/
})
}