Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
dagnelies committed Apr 7, 2023
1 parent 989001b commit 4a7f3d7
Show file tree
Hide file tree
Showing 12 changed files with 873 additions and 4,208 deletions.
2 changes: 1 addition & 1 deletion dist/webauthn.min.js.map

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
export default {
preset: 'ts-jest',
testEnvironment: 'node', // 'jsdom', //'node',
moduleDirectories: ["node_modules", "src"],
resolver: "jest-ts-webcompat-resolver"
/*
globals: {
crypto,
Expand Down
5,040 changes: 851 additions & 4,189 deletions package-lock.json

Large diffs are not rendered by default.

4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@passwordless-id/webauthn",
"version": "1.2.0",
"version": "1.2.1",
"description": "A small wrapper around the webauthn protocol to make one's life easier.",
"type": "module",
"main": "dist/esm/index.js",
Expand Down Expand Up @@ -28,11 +28,13 @@
},
"homepage": "https://webauthn.passwordless.id",
"devDependencies": {
"@babel/preset-typescript": "^7.21.4",
"@types/jest": "^29.2.3",
"esbuild": "^0.15.8",
"http-server": "^14.1.1",
"jest": "^29.3.1",
"jest-environment-jsdom": "^29.3.1",
"jest-ts-webcompat-resolver": "^1.0.0",
"ts-jest": "^29.0.3",
"typescript": "^4.8.3"
}
Expand Down
4 changes: 2 additions & 2 deletions src/authenticators.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import authenticatorMetadata from './authenticatorMetadata' //assert {type: 'json'}
import * as utils from './utils'
import authenticatorMetadata from './authenticatorMetadata.js' //assert {type: 'json'}
import * as utils from './utils.js'


export function parseAuthBuffer(authData :ArrayBuffer) {
Expand Down
4 changes: 2 additions & 2 deletions src/client.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import * as utils from './utils'
import { AuthenticateOptions, AuthenticationEncoded, AuthType, NamedAlgo, NumAlgo, RegisterOptions, RegistrationEncoded } from './types'
import * as utils from './utils.js'
import { AuthenticateOptions, AuthenticationEncoded, AuthType, NamedAlgo, NumAlgo, RegisterOptions, RegistrationEncoded } from './types.js'

/**
* Returns whether passwordless authentication is available on this browser/platform or not.
Expand Down
8 changes: 4 additions & 4 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ export * from './parsers'
export * from './validation'
*/

export * as client from './client';
export * as server from './server';
export * as parsers from './parsers';
export * as utils from './utils';
export * as client from './client.js';
export * as server from './server.js';
export * as parsers from './parsers.js';
export * as utils from './utils.js';


2 changes: 1 addition & 1 deletion src/parsers.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {parsers} from './index'
import {parsers} from './index.js'

test('Test parseRegistration', async () => {
const res = parsers.parseRegistration({
Expand Down
4 changes: 2 additions & 2 deletions src/parsers.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import * as authenticators from './authenticators'
import * as utils from './utils'
import * as authenticators from './authenticators.js'
import * as utils from './utils.js'
import { AuthenticatorInfo, ClientInfo, RegistrationEncoded, RegistrationParsed, AuthenticationEncoded, AuthenticationParsed } from './types'

const utf8Decoder = new TextDecoder('utf-8')
Expand Down
3 changes: 1 addition & 2 deletions src/server.test.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import * as server from './server'
import { client } from './index'
import * as server from './server.js'

test('Test RS256 signatures', async () => {
const res = await server.verifySignature({
Expand Down
6 changes: 3 additions & 3 deletions src/server.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { parseAuthentication, parseRegistration } from "./parsers";
import { AuthenticationEncoded, AuthenticationParsed, CredentialKey, NamedAlgo, RegistrationEncoded, RegistrationParsed } from "./types";
import * as utils from './utils'
import { parseAuthentication, parseRegistration } from "./parsers.js";
import { AuthenticationEncoded, AuthenticationParsed, CredentialKey, NamedAlgo, RegistrationEncoded, RegistrationParsed } from "./types.js";
import * as utils from './utils.js'


async function isValid(validator :any, value :any) :Promise<boolean> {
Expand Down
2 changes: 1 addition & 1 deletion src/utils.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { randomChallenge } from "./utils";
import { randomChallenge } from "./utils.js";


console.log('Node version: ', process.version);
Expand Down

0 comments on commit 4a7f3d7

Please sign in to comment.