fix(auth): upgrade simplewebauthn types

This commit is contained in:
Karol Sójko
2023-01-23 11:28:36 +01:00
parent 1d316e17cb
commit 52ce5f3a2f
12 changed files with 36 additions and 36 deletions
@@ -49,7 +49,7 @@ describe('VerifyAuthenticatorAuthenticationResponse', () => {
const result = await useCase.execute({
userUuid: 'invalid',
authenticationCredential: {
authenticatorResponse: {
authenticatorAttachment: 'platform',
clientExtensionResults: {},
id: 'id',
@@ -77,7 +77,7 @@ describe('VerifyAuthenticatorAuthenticationResponse', () => {
const result = await useCase.execute({
userUuid: '00000000-0000-0000-0000-000000000000',
authenticationCredential: {
authenticatorResponse: {
authenticatorAttachment: 'platform',
clientExtensionResults: {},
id: 'id',
@@ -105,7 +105,7 @@ describe('VerifyAuthenticatorAuthenticationResponse', () => {
const result = await useCase.execute({
userUuid: '00000000-0000-0000-0000-000000000000',
authenticationCredential: {
authenticatorResponse: {
authenticatorAttachment: 'platform',
clientExtensionResults: {},
id: 'id',
@@ -134,7 +134,7 @@ describe('VerifyAuthenticatorAuthenticationResponse', () => {
const result = await useCase.execute({
userUuid: '00000000-0000-0000-0000-000000000000',
authenticationCredential: {
authenticatorResponse: {
authenticatorAttachment: 'platform',
clientExtensionResults: {},
id: 'id',
@@ -167,7 +167,7 @@ describe('VerifyAuthenticatorAuthenticationResponse', () => {
const result = await useCase.execute({
userUuid: '00000000-0000-0000-0000-000000000000',
authenticationCredential: {
authenticatorResponse: {
authenticatorAttachment: 'platform',
clientExtensionResults: {},
id: 'id',
@@ -203,7 +203,7 @@ describe('VerifyAuthenticatorAuthenticationResponse', () => {
const result = await useCase.execute({
userUuid: '00000000-0000-0000-0000-000000000000',
authenticationCredential: {
authenticatorResponse: {
authenticatorAttachment: 'platform',
clientExtensionResults: {},
id: 'id',
@@ -27,18 +27,18 @@ export class VerifyAuthenticatorAuthenticationResponse implements UseCaseInterfa
const authenticator = await this.authenticatorRepository.findByUserUuidAndCredentialId(
userUuid,
Buffer.from(dto.authenticationCredential.id as string),
Buffer.from(dto.authenticatorResponse.id as string),
)
if (!authenticator) {
return Result.fail(
`Could not verify authenticator authentication response: authenticator ${dto.authenticationCredential.id} not found`,
`Could not verify authenticator authentication response: authenticator ${dto.authenticatorResponse.id} not found`,
)
}
let verification: VerifiedAuthenticationResponse
try {
verification = await verifyAuthenticationResponse({
credential: dto.authenticationCredential,
response: dto.authenticatorResponse,
expectedChallenge: authenticatorChallenge.props.challenge.toString(),
expectedOrigin: `https://${this.relyingPartyId}`,
expectedRPID: this.relyingPartyId,
@@ -1,4 +1,4 @@
export interface VerifyAuthenticatorAuthenticationResponseDTO {
userUuid: string
authenticationCredential: Record<string, unknown>
authenticatorResponse: Record<string, unknown>
}