From c9dfa8325d67d3c74c7b4b607f162c93eb48eb14 Mon Sep 17 00:00:00 2001 From: Matthew Miller Date: Wed, 27 Jul 2022 22:08:41 -0700 Subject: Export named base64URLStringToBuffer --- packages/browser/src/helpers/base64URLStringToBuffer.ts | 2 +- packages/browser/src/helpers/toPublicKeyCredentialDescriptor.ts | 2 +- packages/browser/src/methods/startAuthentication.ts | 2 +- packages/browser/src/methods/startRegistration.ts | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) (limited to 'packages/browser/src') diff --git a/packages/browser/src/helpers/base64URLStringToBuffer.ts b/packages/browser/src/helpers/base64URLStringToBuffer.ts index baa258f..f30b3d5 100644 --- a/packages/browser/src/helpers/base64URLStringToBuffer.ts +++ b/packages/browser/src/helpers/base64URLStringToBuffer.ts @@ -5,7 +5,7 @@ * * Helper method to compliment `bufferToBase64URLString` */ -export default function base64URLStringToBuffer(base64URLString: string): ArrayBuffer { +export function base64URLStringToBuffer(base64URLString: string): ArrayBuffer { // Convert from Base64URL to Base64 const base64 = base64URLString.replace(/-/g, '+').replace(/_/g, '/'); /** diff --git a/packages/browser/src/helpers/toPublicKeyCredentialDescriptor.ts b/packages/browser/src/helpers/toPublicKeyCredentialDescriptor.ts index 82b6ac1..16451ba 100644 --- a/packages/browser/src/helpers/toPublicKeyCredentialDescriptor.ts +++ b/packages/browser/src/helpers/toPublicKeyCredentialDescriptor.ts @@ -1,6 +1,6 @@ import type { PublicKeyCredentialDescriptorJSON } from '@simplewebauthn/typescript-types'; -import base64URLStringToBuffer from './base64URLStringToBuffer'; +import { base64URLStringToBuffer } from './base64URLStringToBuffer'; export default function toPublicKeyCredentialDescriptor( descriptor: PublicKeyCredentialDescriptorJSON, diff --git a/packages/browser/src/methods/startAuthentication.ts b/packages/browser/src/methods/startAuthentication.ts index e99629c..b8a5d7a 100644 --- a/packages/browser/src/methods/startAuthentication.ts +++ b/packages/browser/src/methods/startAuthentication.ts @@ -5,7 +5,7 @@ import { } from '@simplewebauthn/typescript-types'; import bufferToBase64URLString from '../helpers/bufferToBase64URLString'; -import base64URLStringToBuffer from '../helpers/base64URLStringToBuffer'; +import { base64URLStringToBuffer } from '../helpers/base64URLStringToBuffer'; import bufferToUTF8String from '../helpers/bufferToUTF8String'; import { browserSupportsWebauthn } from '../helpers/browserSupportsWebauthn'; import { browserSupportsWebAuthnAutofill } from '../helpers/browserSupportsWebAuthnAutofill'; diff --git a/packages/browser/src/methods/startRegistration.ts b/packages/browser/src/methods/startRegistration.ts index c9749b1..753bd30 100644 --- a/packages/browser/src/methods/startRegistration.ts +++ b/packages/browser/src/methods/startRegistration.ts @@ -6,7 +6,7 @@ import { import utf8StringToBuffer from '../helpers/utf8StringToBuffer'; import bufferToBase64URLString from '../helpers/bufferToBase64URLString'; -import base64URLStringToBuffer from '../helpers/base64URLStringToBuffer'; +import { base64URLStringToBuffer } from '../helpers/base64URLStringToBuffer'; import { browserSupportsWebauthn } from '../helpers/browserSupportsWebauthn'; import toPublicKeyCredentialDescriptor from '../helpers/toPublicKeyCredentialDescriptor'; import { identifyRegistrationError } from '../helpers/identifyRegistrationError'; -- cgit v1.2.3 From 0021fbd36a7f4a13ca98bf5077e61b9852c8d0c4 Mon Sep 17 00:00:00 2001 From: Matthew Miller Date: Wed, 27 Jul 2022 22:09:00 -0700 Subject: Export named bufferToBase64URLString --- packages/browser/src/helpers/bufferToBase64URLString.ts | 2 +- packages/browser/src/methods/startAuthentication.ts | 2 +- packages/browser/src/methods/startRegistration.ts | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) (limited to 'packages/browser/src') diff --git a/packages/browser/src/helpers/bufferToBase64URLString.ts b/packages/browser/src/helpers/bufferToBase64URLString.ts index c13420c..6a40cbb 100644 --- a/packages/browser/src/helpers/bufferToBase64URLString.ts +++ b/packages/browser/src/helpers/bufferToBase64URLString.ts @@ -4,7 +4,7 @@ * * Helper method to compliment `base64URLStringToBuffer` */ -export default function bufferToBase64URLString(buffer: ArrayBuffer): string { +export function bufferToBase64URLString(buffer: ArrayBuffer): string { const bytes = new Uint8Array(buffer); let str = ''; diff --git a/packages/browser/src/methods/startAuthentication.ts b/packages/browser/src/methods/startAuthentication.ts index b8a5d7a..b3eaa80 100644 --- a/packages/browser/src/methods/startAuthentication.ts +++ b/packages/browser/src/methods/startAuthentication.ts @@ -4,7 +4,7 @@ import { AuthenticationCredentialJSON, } from '@simplewebauthn/typescript-types'; -import bufferToBase64URLString from '../helpers/bufferToBase64URLString'; +import { bufferToBase64URLString } from '../helpers/bufferToBase64URLString'; import { base64URLStringToBuffer } from '../helpers/base64URLStringToBuffer'; import bufferToUTF8String from '../helpers/bufferToUTF8String'; import { browserSupportsWebauthn } from '../helpers/browserSupportsWebauthn'; diff --git a/packages/browser/src/methods/startRegistration.ts b/packages/browser/src/methods/startRegistration.ts index 753bd30..499978d 100644 --- a/packages/browser/src/methods/startRegistration.ts +++ b/packages/browser/src/methods/startRegistration.ts @@ -5,7 +5,7 @@ import { } from '@simplewebauthn/typescript-types'; import utf8StringToBuffer from '../helpers/utf8StringToBuffer'; -import bufferToBase64URLString from '../helpers/bufferToBase64URLString'; +import { bufferToBase64URLString } from '../helpers/bufferToBase64URLString'; import { base64URLStringToBuffer } from '../helpers/base64URLStringToBuffer'; import { browserSupportsWebauthn } from '../helpers/browserSupportsWebauthn'; import toPublicKeyCredentialDescriptor from '../helpers/toPublicKeyCredentialDescriptor'; -- cgit v1.2.3 From 1eee174514378d3fdf3e5f3c073efaf2e688dd04 Mon Sep 17 00:00:00 2001 From: Matthew Miller Date: Wed, 27 Jul 2022 22:09:28 -0700 Subject: Export named bufferToUTF8String() --- packages/browser/src/helpers/bufferToUTF8String.ts | 2 +- packages/browser/src/methods/startAuthentication.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'packages/browser/src') diff --git a/packages/browser/src/helpers/bufferToUTF8String.ts b/packages/browser/src/helpers/bufferToUTF8String.ts index a4b97c9..0da3246 100644 --- a/packages/browser/src/helpers/bufferToUTF8String.ts +++ b/packages/browser/src/helpers/bufferToUTF8String.ts @@ -2,6 +2,6 @@ * A helper method to convert an arbitrary ArrayBuffer, returned from an authenticator, to a UTF-8 * string. */ -export default function bufferToUTF8String(value: ArrayBuffer): string { +export function bufferToUTF8String(value: ArrayBuffer): string { return new TextDecoder('utf-8').decode(value); } diff --git a/packages/browser/src/methods/startAuthentication.ts b/packages/browser/src/methods/startAuthentication.ts index b3eaa80..bc00f55 100644 --- a/packages/browser/src/methods/startAuthentication.ts +++ b/packages/browser/src/methods/startAuthentication.ts @@ -6,7 +6,7 @@ import { import { bufferToBase64URLString } from '../helpers/bufferToBase64URLString'; import { base64URLStringToBuffer } from '../helpers/base64URLStringToBuffer'; -import bufferToUTF8String from '../helpers/bufferToUTF8String'; +import { bufferToUTF8String } from '../helpers/bufferToUTF8String'; import { browserSupportsWebauthn } from '../helpers/browserSupportsWebauthn'; import { browserSupportsWebAuthnAutofill } from '../helpers/browserSupportsWebAuthnAutofill'; import toPublicKeyCredentialDescriptor from '../helpers/toPublicKeyCredentialDescriptor'; -- cgit v1.2.3 From e92a262817422404fe60476b8cb39e03a909baa5 Mon Sep 17 00:00:00 2001 From: Matthew Miller Date: Wed, 27 Jul 2022 22:09:50 -0700 Subject: Export named toPublicKeyCredentialDescriptor() --- packages/browser/src/helpers/toPublicKeyCredentialDescriptor.ts | 2 +- packages/browser/src/methods/startAuthentication.ts | 2 +- packages/browser/src/methods/startRegistration.ts | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) (limited to 'packages/browser/src') diff --git a/packages/browser/src/helpers/toPublicKeyCredentialDescriptor.ts b/packages/browser/src/helpers/toPublicKeyCredentialDescriptor.ts index 16451ba..d4d8103 100644 --- a/packages/browser/src/helpers/toPublicKeyCredentialDescriptor.ts +++ b/packages/browser/src/helpers/toPublicKeyCredentialDescriptor.ts @@ -2,7 +2,7 @@ import type { PublicKeyCredentialDescriptorJSON } from '@simplewebauthn/typescri import { base64URLStringToBuffer } from './base64URLStringToBuffer'; -export default function toPublicKeyCredentialDescriptor( +export function toPublicKeyCredentialDescriptor( descriptor: PublicKeyCredentialDescriptorJSON, ): PublicKeyCredentialDescriptor { const { id } = descriptor; diff --git a/packages/browser/src/methods/startAuthentication.ts b/packages/browser/src/methods/startAuthentication.ts index bc00f55..6bc36d7 100644 --- a/packages/browser/src/methods/startAuthentication.ts +++ b/packages/browser/src/methods/startAuthentication.ts @@ -9,7 +9,7 @@ import { base64URLStringToBuffer } from '../helpers/base64URLStringToBuffer'; import { bufferToUTF8String } from '../helpers/bufferToUTF8String'; import { browserSupportsWebauthn } from '../helpers/browserSupportsWebauthn'; import { browserSupportsWebAuthnAutofill } from '../helpers/browserSupportsWebAuthnAutofill'; -import toPublicKeyCredentialDescriptor from '../helpers/toPublicKeyCredentialDescriptor'; +import { toPublicKeyCredentialDescriptor } from '../helpers/toPublicKeyCredentialDescriptor'; import { identifyAuthenticationError } from '../helpers/identifyAuthenticationError'; import { webauthnAbortService } from '../helpers/webAuthnAbortService'; diff --git a/packages/browser/src/methods/startRegistration.ts b/packages/browser/src/methods/startRegistration.ts index 499978d..9b34cfc 100644 --- a/packages/browser/src/methods/startRegistration.ts +++ b/packages/browser/src/methods/startRegistration.ts @@ -8,7 +8,7 @@ import utf8StringToBuffer from '../helpers/utf8StringToBuffer'; import { bufferToBase64URLString } from '../helpers/bufferToBase64URLString'; import { base64URLStringToBuffer } from '../helpers/base64URLStringToBuffer'; import { browserSupportsWebauthn } from '../helpers/browserSupportsWebauthn'; -import toPublicKeyCredentialDescriptor from '../helpers/toPublicKeyCredentialDescriptor'; +import { toPublicKeyCredentialDescriptor } from '../helpers/toPublicKeyCredentialDescriptor'; import { identifyRegistrationError } from '../helpers/identifyRegistrationError'; import { webauthnAbortService } from '../helpers/webAuthnAbortService'; -- cgit v1.2.3 From a0468e98a2be9860e303eeb752bf065b1580fe47 Mon Sep 17 00:00:00 2001 From: Matthew Miller Date: Wed, 27 Jul 2022 22:10:27 -0700 Subject: Export named utf8StringToBuffer() --- packages/browser/src/helpers/utf8StringToBuffer.ts | 2 +- packages/browser/src/methods/startRegistration.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'packages/browser/src') diff --git a/packages/browser/src/helpers/utf8StringToBuffer.ts b/packages/browser/src/helpers/utf8StringToBuffer.ts index 32cb717..b15e5fe 100644 --- a/packages/browser/src/helpers/utf8StringToBuffer.ts +++ b/packages/browser/src/helpers/utf8StringToBuffer.ts @@ -2,6 +2,6 @@ * A helper method to convert an arbitrary string sent from the server to an ArrayBuffer the * authenticator will expect. */ -export default function utf8StringToBuffer(value: string): ArrayBuffer { +export function utf8StringToBuffer(value: string): ArrayBuffer { return new TextEncoder().encode(value); } diff --git a/packages/browser/src/methods/startRegistration.ts b/packages/browser/src/methods/startRegistration.ts index 9b34cfc..f809405 100644 --- a/packages/browser/src/methods/startRegistration.ts +++ b/packages/browser/src/methods/startRegistration.ts @@ -4,7 +4,7 @@ import { RegistrationCredentialJSON, } from '@simplewebauthn/typescript-types'; -import utf8StringToBuffer from '../helpers/utf8StringToBuffer'; +import { utf8StringToBuffer } from '../helpers/utf8StringToBuffer'; import { bufferToBase64URLString } from '../helpers/bufferToBase64URLString'; import { base64URLStringToBuffer } from '../helpers/base64URLStringToBuffer'; import { browserSupportsWebauthn } from '../helpers/browserSupportsWebauthn'; -- cgit v1.2.3 From 4bcbdca46dfa066e78d7e4654feda7366e29ce73 Mon Sep 17 00:00:00 2001 From: Matthew Miller Date: Thu, 28 Jul 2022 09:26:19 -0700 Subject: Update some test imports --- packages/browser/src/methods/startAuthentication.test.ts | 4 ++-- packages/browser/src/methods/startRegistration.test.ts | 4 ++-- .../server/src/authentication/generateAuthenticationOptions.test.ts | 2 +- .../server/src/authentication/verifyAuthenticationResponse.test.ts | 4 ++-- packages/server/src/helpers/convertAAGUIDToString.test.ts | 2 +- packages/server/src/helpers/convertCOSEtoPKCS.test.ts | 2 +- packages/server/src/helpers/convertCertBufferToPEM.test.ts | 2 +- packages/server/src/helpers/convertPublicKeyToPEM.test.ts | 2 +- packages/server/src/helpers/decodeAttestationObject.test.ts | 2 +- packages/server/src/helpers/decodeClientDataJSON.test.ts | 2 +- packages/server/src/helpers/generateChallenge.test.ts | 2 +- packages/server/src/helpers/isBase64URLString.test.ts | 2 +- packages/server/src/helpers/parseAuthenticatorData.test.ts | 2 +- packages/server/src/helpers/toHash.test.ts | 2 +- packages/server/src/metadata/verifyAttestationWithMetadata.test.ts | 2 +- .../server/src/registration/generateRegistrationOptions.test.ts | 2 +- packages/server/src/registration/verifyRegistrationResponse.test.ts | 6 +++--- 17 files changed, 22 insertions(+), 22 deletions(-) (limited to 'packages/browser/src') diff --git a/packages/browser/src/methods/startAuthentication.test.ts b/packages/browser/src/methods/startAuthentication.test.ts index b246cb0..e6ac9c7 100644 --- a/packages/browser/src/methods/startAuthentication.test.ts +++ b/packages/browser/src/methods/startAuthentication.test.ts @@ -7,8 +7,8 @@ import { import { browserSupportsWebauthn } from '../helpers/browserSupportsWebauthn'; import { browserSupportsWebAuthnAutofill } from '../helpers/browserSupportsWebAuthnAutofill'; -import utf8StringToBuffer from '../helpers/utf8StringToBuffer'; -import bufferToBase64URLString from '../helpers/bufferToBase64URLString'; +import { utf8StringToBuffer } from '../helpers/utf8StringToBuffer'; +import { bufferToBase64URLString } from '../helpers/bufferToBase64URLString'; import { WebAuthnError } from '../helpers/structs'; import { generateCustomError } from '../helpers/__jest__/generateCustomError'; import { webauthnAbortService } from '../helpers/webAuthnAbortService'; diff --git a/packages/browser/src/methods/startRegistration.test.ts b/packages/browser/src/methods/startRegistration.test.ts index ddc2d6a..1ca9e62 100644 --- a/packages/browser/src/methods/startRegistration.test.ts +++ b/packages/browser/src/methods/startRegistration.test.ts @@ -6,11 +6,11 @@ import { } from '@simplewebauthn/typescript-types'; import { generateCustomError } from '../helpers/__jest__/generateCustomError'; import { browserSupportsWebauthn } from '../helpers/browserSupportsWebauthn'; -import bufferToBase64URLString from '../helpers/bufferToBase64URLString'; +import { bufferToBase64URLString } from '../helpers/bufferToBase64URLString'; import { WebAuthnError } from '../helpers/structs'; import { webauthnAbortService } from '../helpers/webAuthnAbortService'; -import utf8StringToBuffer from '../helpers/utf8StringToBuffer'; +import { utf8StringToBuffer } from '../helpers/utf8StringToBuffer'; import { startRegistration } from './startRegistration'; diff --git a/packages/server/src/authentication/generateAuthenticationOptions.test.ts b/packages/server/src/authentication/generateAuthenticationOptions.test.ts index 3f11437..78c6473 100644 --- a/packages/server/src/authentication/generateAuthenticationOptions.test.ts +++ b/packages/server/src/authentication/generateAuthenticationOptions.test.ts @@ -1,6 +1,6 @@ jest.mock('../helpers/generateChallenge'); -import generateAuthenticationOptions from './generateAuthenticationOptions'; +import { generateAuthenticationOptions } from './generateAuthenticationOptions'; test('should generate credential request options suitable for sending via JSON', () => { const challenge = 'totallyrandomvalue'; diff --git a/packages/server/src/authentication/verifyAuthenticationResponse.test.ts b/packages/server/src/authentication/verifyAuthenticationResponse.test.ts index dbaa946..4202155 100644 --- a/packages/server/src/authentication/verifyAuthenticationResponse.test.ts +++ b/packages/server/src/authentication/verifyAuthenticationResponse.test.ts @@ -1,9 +1,9 @@ import base64url from 'base64url'; -import verifyAuthenticationResponse from './verifyAuthenticationResponse'; +import { verifyAuthenticationResponse } from './verifyAuthenticationResponse'; import * as decodeClientDataJSON from '../helpers/decodeClientDataJSON'; import * as parseAuthenticatorData from '../helpers/parseAuthenticatorData'; -import toHash from '../helpers/toHash'; +import { toHash } from '../helpers/toHash'; import { AuthenticatorDevice, AuthenticationCredentialJSON, diff --git a/packages/server/src/helpers/convertAAGUIDToString.test.ts b/packages/server/src/helpers/convertAAGUIDToString.test.ts index acef3b9..8c149c4 100644 --- a/packages/server/src/helpers/convertAAGUIDToString.test.ts +++ b/packages/server/src/helpers/convertAAGUIDToString.test.ts @@ -1,4 +1,4 @@ -import convertAAGUIDToString from './convertAAGUIDToString'; +import { convertAAGUIDToString } from './convertAAGUIDToString'; test('should convert buffer to UUID string', () => { const uuid = convertAAGUIDToString(Buffer.from('adce000235bcc60a648b0b25f1f05503', 'hex')); diff --git a/packages/server/src/helpers/convertCOSEtoPKCS.test.ts b/packages/server/src/helpers/convertCOSEtoPKCS.test.ts index f25ac49..fd9cf47 100644 --- a/packages/server/src/helpers/convertCOSEtoPKCS.test.ts +++ b/packages/server/src/helpers/convertCOSEtoPKCS.test.ts @@ -1,6 +1,6 @@ import * as decodeCbor from './decodeCbor'; -import convertCOSEtoPKCS, { COSEKEYS } from './convertCOSEtoPKCS'; +import { convertCOSEtoPKCS, COSEKEYS } from './convertCOSEtoPKCS'; test('should throw an error curve if, somehow, curve coordinate x is missing', () => { const mockCOSEKey = new Map(); diff --git a/packages/server/src/helpers/convertCertBufferToPEM.test.ts b/packages/server/src/helpers/convertCertBufferToPEM.test.ts index 9f99128..5960c25 100644 --- a/packages/server/src/helpers/convertCertBufferToPEM.test.ts +++ b/packages/server/src/helpers/convertCertBufferToPEM.test.ts @@ -1,4 +1,4 @@ -import convertCertBufferToPEM from "./convertCertBufferToPEM"; +import { convertCertBufferToPEM } from "./convertCertBufferToPEM"; test('should return pem when input is base64URLString', () => { const input = "Y2VydEJ1ZmZlclN0cmluZyBjZXJ0QnVmZmVyU3RyaW5nIGNlcnRCdWZmZXJTdHJpbmcgY2VydEJ1ZmZlclN0cmluZyBjZXJ0QnVmZmVyU3RyaW5nIGNlcnRCdWZmZXJTdHJpbmcgY2VydEJ1ZmZlclN0cmluZw"; diff --git a/packages/server/src/helpers/convertPublicKeyToPEM.test.ts b/packages/server/src/helpers/convertPublicKeyToPEM.test.ts index 1e8edd2..2c2655f 100644 --- a/packages/server/src/helpers/convertPublicKeyToPEM.test.ts +++ b/packages/server/src/helpers/convertPublicKeyToPEM.test.ts @@ -1,7 +1,7 @@ import base64url from "base64url"; import cbor from "cbor"; import { COSEKEYS } from "./convertCOSEtoPKCS"; -import convertPublicKeyToPEM from "./convertPublicKeyToPEM"; +import { convertPublicKeyToPEM } from "./convertPublicKeyToPEM"; test('should return pem when input is base64URLString', () => { const mockCOSEKey = new Map(); diff --git a/packages/server/src/helpers/decodeAttestationObject.test.ts b/packages/server/src/helpers/decodeAttestationObject.test.ts index 6ba29e9..1ba6bd0 100644 --- a/packages/server/src/helpers/decodeAttestationObject.test.ts +++ b/packages/server/src/helpers/decodeAttestationObject.test.ts @@ -1,4 +1,4 @@ -import decodeAttestationObject from './decodeAttestationObject'; +import { decodeAttestationObject } from './decodeAttestationObject'; test('should decode base64url-encoded indirect attestationObject', () => { const decoded = decodeAttestationObject( diff --git a/packages/server/src/helpers/decodeClientDataJSON.test.ts b/packages/server/src/helpers/decodeClientDataJSON.test.ts index b51f7ce..c72cb88 100644 --- a/packages/server/src/helpers/decodeClientDataJSON.test.ts +++ b/packages/server/src/helpers/decodeClientDataJSON.test.ts @@ -1,4 +1,4 @@ -import decodeClientDataJSON from './decodeClientDataJSON'; +import { decodeClientDataJSON } from './decodeClientDataJSON'; test('should convert base64url-encoded attestation clientDataJSON to JSON', () => { expect( diff --git a/packages/server/src/helpers/generateChallenge.test.ts b/packages/server/src/helpers/generateChallenge.test.ts index 065ad7f..b1f2fd0 100644 --- a/packages/server/src/helpers/generateChallenge.test.ts +++ b/packages/server/src/helpers/generateChallenge.test.ts @@ -1,4 +1,4 @@ -import generateChallenge from './generateChallenge'; +import { generateChallenge } from './generateChallenge'; test('should return a buffer of at least 32 bytes', () => { const challenge = generateChallenge(); diff --git a/packages/server/src/helpers/isBase64URLString.test.ts b/packages/server/src/helpers/isBase64URLString.test.ts index f91aeb1..545ff93 100644 --- a/packages/server/src/helpers/isBase64URLString.test.ts +++ b/packages/server/src/helpers/isBase64URLString.test.ts @@ -1,4 +1,4 @@ -import isBase64URLString from './isBase64URLString'; +import { isBase64URLString } from './isBase64URLString'; test('should return true when input is base64URLString', () => { const actual = isBase64URLString("U2ltcGxlV2ViQXV0aG4") diff --git a/packages/server/src/helpers/parseAuthenticatorData.test.ts b/packages/server/src/helpers/parseAuthenticatorData.test.ts index e199898..a706718 100644 --- a/packages/server/src/helpers/parseAuthenticatorData.test.ts +++ b/packages/server/src/helpers/parseAuthenticatorData.test.ts @@ -1,6 +1,6 @@ import cbor from 'cbor'; -import parseAuthenticatorData from './parseAuthenticatorData'; +import { parseAuthenticatorData } from './parseAuthenticatorData'; // Grabbed this from a Conformance test, contains attestation data const authDataWithAT = Buffer.from( diff --git a/packages/server/src/helpers/toHash.test.ts b/packages/server/src/helpers/toHash.test.ts index 4f012e5..86c9142 100644 --- a/packages/server/src/helpers/toHash.test.ts +++ b/packages/server/src/helpers/toHash.test.ts @@ -1,4 +1,4 @@ -import toHash from './toHash'; +import { toHash } from './toHash'; test('should return a buffer of at 32 bytes for input string', () => { const hash = toHash("string"); diff --git a/packages/server/src/metadata/verifyAttestationWithMetadata.test.ts b/packages/server/src/metadata/verifyAttestationWithMetadata.test.ts index f938951..57f8aa7 100644 --- a/packages/server/src/metadata/verifyAttestationWithMetadata.test.ts +++ b/packages/server/src/metadata/verifyAttestationWithMetadata.test.ts @@ -1,6 +1,6 @@ import base64url from 'base64url'; -import verifyAttestationWithMetadata from './verifyAttestationWithMetadata'; +import { verifyAttestationWithMetadata } from './verifyAttestationWithMetadata'; import { MetadataStatement } from '../metadata/mdsTypes'; test('should verify attestation with metadata (android-safetynet)', async () => { diff --git a/packages/server/src/registration/generateRegistrationOptions.test.ts b/packages/server/src/registration/generateRegistrationOptions.test.ts index 19fa0a6..db4e11e 100644 --- a/packages/server/src/registration/generateRegistrationOptions.test.ts +++ b/packages/server/src/registration/generateRegistrationOptions.test.ts @@ -1,6 +1,6 @@ jest.mock('../helpers/generateChallenge'); -import generateRegistrationOptions from './generateRegistrationOptions'; +import { generateRegistrationOptions } from './generateRegistrationOptions'; test('should generate credential request options suitable for sending via JSON', () => { const rpName = 'SimpleWebAuthn'; diff --git a/packages/server/src/registration/verifyRegistrationResponse.test.ts b/packages/server/src/registration/verifyRegistrationResponse.test.ts index d4c4f20..1b170ef 100644 --- a/packages/server/src/registration/verifyRegistrationResponse.test.ts +++ b/packages/server/src/registration/verifyRegistrationResponse.test.ts @@ -1,16 +1,16 @@ import base64url from 'base64url'; -import verifyRegistrationResponse from './verifyRegistrationResponse'; +import { verifyRegistrationResponse } from './verifyRegistrationResponse'; import * as decodeAttestationObject from '../helpers/decodeAttestationObject'; import * as decodeClientDataJSON from '../helpers/decodeClientDataJSON'; import * as parseAuthenticatorData from '../helpers/parseAuthenticatorData'; import * as decodeCredentialPublicKey from '../helpers/decodeCredentialPublicKey'; -import SettingsService from '../services/settingsService'; +import { SettingsService } from '../services/settingsService'; import * as verifyFIDOU2F from './verifications/verifyFIDOU2F'; -import toHash from '../helpers/toHash'; +import { toHash } from '../helpers/toHash'; import { RegistrationCredentialJSON } from '@simplewebauthn/typescript-types'; /** -- cgit v1.2.3