Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat/isomorphic #299

Merged
merged 122 commits into from
Dec 11, 2022
Merged

feat/isomorphic #299

merged 122 commits into from
Dec 11, 2022

Conversation

MasterKale
Copy link
Owner

@MasterKale MasterKale commented Nov 11, 2022

This PR refactors SimpleWebAuthn to work in more runtimes than just Node. This is generally achieved by refactoring away references to Node-specific data classes, like Buffer, and referencing Web APIs in a way that should support use of @simplewebauthn/server in more non-Node runtimes than before.

Non-isomorphic third-party dependencies have also been replaced, with efforts taken to prevent breaking changes to external API inputs and outputs.

Noteworthy changes:

Registration

  • The following values returned from verifyRegistrationResponse() are now a Uint8Array instead of a Buffer
    • aaguid
    • authData
    • clientDataHash
    • credentialID
    • credentialPublicKey
    • rpIdHash

Authentication

  • The following values returned from verifyAuthenticationResponse() are now a Uint8Array instead of a Buffer
    • credentialID

Helpers (@simplewebauthn/server/helpers)

  • There are several new helpers for working with WebAuthn-related data types that should work in all runtimes:
    • isoCBOR for working with CBOR-encoded values
    • isoCrypto for leveraging the WebCrypto API when working with various WebAuthn/FIDO2 data structures
    • isoBase64URL for encoding and decoding values into base64url (with optional base64 support)
    • isoUint8Array for working with Uint8Arrays
    • cose for working with COSE-related methods and types
  • The isBase64URLString() helper is now isoBase64URL.isBase64url()
  • The decodeCborFirst() helper is now isoCBOR.decodeFirst()
  • The convertPublicKeyToPEM() helper has been removed

@MasterKale MasterKale marked this pull request as ready for review December 2, 2022 05:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
package:server @simplewebauthn/server
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant