diff options
-rw-r--r-- | .eslintignore | 1 | ||||
-rw-r--r-- | .prettierignore | 1 | ||||
-rw-r--r-- | example/public/login/index.html | 2 | ||||
-rw-r--r-- | example/public/register/index.html | 2 | ||||
-rw-r--r-- | example/public/styles.css | 2 | ||||
-rw-r--r-- | package.json | 14 | ||||
-rw-r--r-- | packages/browser/src/helpers/bufferToBase64URLString.ts | 5 | ||||
-rw-r--r-- | packages/server/package.json | 2 | ||||
-rw-r--r-- | packages/server/src/assertion/verifyAssertionResponse.ts | 4 | ||||
-rw-r--r-- | packages/server/src/helpers/decodeAttestationObject.ts | 5 | ||||
-rw-r--r-- | packages/server/src/index.ts | 12 | ||||
-rw-r--r-- | packages/server/tsconfig.json | 7 |
12 files changed, 27 insertions, 30 deletions
diff --git a/.eslintignore b/.eslintignore index 3927d49..8adba0d 100644 --- a/.eslintignore +++ b/.eslintignore @@ -4,3 +4,4 @@ coverage/ *.test.ts *.config.js setupTests.ts +tsconfig.json diff --git a/.prettierignore b/.prettierignore index ebe37e7..21ec09b 100644 --- a/.prettierignore +++ b/.prettierignore @@ -2,3 +2,4 @@ node_modules/ dist/ coverage/ *.md +tsconfig.json diff --git a/example/public/login/index.html b/example/public/login/index.html index ddcb0c0..413911d 100644 --- a/example/public/login/index.html +++ b/example/public/login/index.html @@ -28,7 +28,7 @@ // Hide the Begin button if the browser is incapable of using WebAuthn if (!supportsWebauthn()) { elemBegin.style.display = 'none'; - elemError.innerText = 'It seems this browser doesn\'t support WebAuthn...'; + elemError.innerText = "It seems this browser doesn't support WebAuthn..."; } elemBegin.addEventListener('click', async () => { diff --git a/example/public/register/index.html b/example/public/register/index.html index ede622a..ee16e2b 100644 --- a/example/public/register/index.html +++ b/example/public/register/index.html @@ -28,7 +28,7 @@ // Hide the Begin button if the browser is incapable of using WebAuthn if (!supportsWebauthn()) { elemBegin.style.display = 'none'; - elemError.innerText = 'It seems this browser doesn\'t support WebAuthn...'; + elemError.innerText = "It seems this browser doesn't support WebAuthn..."; } elemBegin.addEventListener('click', async () => { diff --git a/example/public/styles.css b/example/public/styles.css index 6669463..b67b3c2 100644 --- a/example/public/styles.css +++ b/example/public/styles.css @@ -50,7 +50,7 @@ button:hover { } /* Desktop Styles */ -@media(min-width: 75rem) { +@media (min-width: 75rem) { * { font-size: 24px; } diff --git a/package.json b/package.json index f1b578f..cf2066e 100644 --- a/package.json +++ b/package.json @@ -14,30 +14,26 @@ "dev:browser": "lerna exec npm run test:watch --scope=@simplewebauthn/browser" }, "devDependencies": { - "@simplewebauthn/typescript-types": "^0.10.0", "@types/express": "^4.17.9", "@types/jest": "^25.2.3", "@types/node-fetch": "^2.5.7", - "@typescript-eslint/eslint-plugin": "^3.10.1", - "@typescript-eslint/parser": "^3.10.1", - "eslint": "^7.8.1", + "@typescript-eslint/eslint-plugin": "^4.17.0", + "@typescript-eslint/parser": "^4.17.0", + "eslint": "^7.21.0", "husky": "^4.3.0", "jest": "^26.6.3", "jest-environment-jsdom": "^26.3.0", "lerna": "^3.22.1", "lint-staged": "^10.3.0", - "prettier": "^2.1.1", + "prettier": "^2.2.1", "rimraf": "^3.0.2", "semver": "^7.3.2", "ts-jest": "^26.4.4", "ts-morph": "^9.0.0", "ts-node": "^8.10.2", - "ttypescript": "^1.5.12", "typedoc": "^0.20.20", - "typescript": "^4.0.5", - "typescript-transform-paths": "^1.1.15" + "typescript": "^4.0.5" }, - "dependencies": {}, "husky": { "hooks": { "pre-commit": "lint-staged" diff --git a/packages/browser/src/helpers/bufferToBase64URLString.ts b/packages/browser/src/helpers/bufferToBase64URLString.ts index 954f4b0..c13420c 100644 --- a/packages/browser/src/helpers/bufferToBase64URLString.ts +++ b/packages/browser/src/helpers/bufferToBase64URLString.ts @@ -14,8 +14,5 @@ export default function bufferToBase64URLString(buffer: ArrayBuffer): string { const base64String = btoa(str); - return base64String - .replace(/\+/g, '-') - .replace(/\//g, '_') - .replace(/=/g, ''); + return base64String.replace(/\+/g, '-').replace(/\//g, '_').replace(/=/g, ''); } diff --git a/packages/server/package.json b/packages/server/package.json index d193b77..73d83b0 100644 --- a/packages/server/package.json +++ b/packages/server/package.json @@ -19,7 +19,7 @@ "node": ">=10.0.0" }, "scripts": { - "build": "rimraf dist && ttsc", + "build": "rimraf dist && tsc", "test": "jest", "test:watch": "jest --watch", "test:coverage": "npm test -- --coverage", diff --git a/packages/server/src/assertion/verifyAssertionResponse.ts b/packages/server/src/assertion/verifyAssertionResponse.ts index 7136510..2203360 100644 --- a/packages/server/src/assertion/verifyAssertionResponse.ts +++ b/packages/server/src/assertion/verifyAssertionResponse.ts @@ -36,7 +36,9 @@ export type VerifyAssertionResponseOpts = { * `generateAssertionOptions()`. Activates FIDO-specific user presence and verification checks. * Omitting this value defaults verification to a WebAuthn-specific user presence requirement. */ -export default function verifyAssertionResponse(options: VerifyAssertionResponseOpts): VerifiedAssertion { +export default function verifyAssertionResponse( + options: VerifyAssertionResponseOpts, +): VerifiedAssertion { const { credential, expectedChallenge, diff --git a/packages/server/src/helpers/decodeAttestationObject.ts b/packages/server/src/helpers/decodeAttestationObject.ts index 362e8a0..8b69c90 100644 --- a/packages/server/src/helpers/decodeAttestationObject.ts +++ b/packages/server/src/helpers/decodeAttestationObject.ts @@ -1,10 +1,9 @@ -import base64url from 'base64url'; import cbor from 'cbor'; /** - * Convert an AttestationObject from base64url string to a proper object + * Convert an AttestationObject buffer to a proper object * - * @param base64AttestationObject Base64URL-encoded Attestation Object + * @param base64AttestationObject Attestation Object buffer */ export default function decodeAttestationObject(attestationObject: Buffer): AttestationObject { const toCBOR: AttestationObject = cbor.decodeAllSync(attestationObject)[0]; diff --git a/packages/server/src/index.ts b/packages/server/src/index.ts index defed10..1a24c63 100644 --- a/packages/server/src/index.ts +++ b/packages/server/src/index.ts @@ -18,8 +18,14 @@ export { import type { GenerateAttestationOptionsOpts } from './attestation/generateAttestationOptions'; import type { GenerateAssertionOptionsOpts } from './assertion/generateAssertionOptions'; -import type { VerifiedAttestation, VerifyAttestationResponseOpts } from './attestation/verifyAttestationResponse'; -import type { VerifiedAssertion, VerifyAssertionResponseOpts } from './assertion/verifyAssertionResponse'; +import type { + VerifiedAttestation, + VerifyAttestationResponseOpts, +} from './attestation/verifyAttestationResponse'; +import type { + VerifiedAssertion, + VerifyAssertionResponseOpts, +} from './assertion/verifyAssertionResponse'; export type { GenerateAttestationOptionsOpts, @@ -28,4 +34,4 @@ export type { VerifyAssertionResponseOpts, VerifiedAttestation, VerifiedAssertion, -} +}; diff --git a/packages/server/tsconfig.json b/packages/server/tsconfig.json index 3f7b415..a76d838 100644 --- a/packages/server/tsconfig.json +++ b/packages/server/tsconfig.json @@ -11,11 +11,6 @@ "./node_modules/@types", "../../node_modules/@types" ], - "experimentalDecorators": true, - "plugins": [ - // These replace the path helpers above with relative paths at build time - { "transform": "typescript-transform-paths" }, - { "transform": "typescript-transform-paths", "afterDeclarations": true } - ] + "experimentalDecorators": true } } |