tweag / webauthn

A library for parsing and validating webauthn/fido2 credentials
Apache License 2.0
34 stars 11 forks source link

Improve string handling #139

Open infinisil opened 2 years ago

infinisil commented 2 years ago

Special string handling

Currently all strings of the library are represented with Text, but that doesn't take into account that some fields of the WebAuthn spec have additional requirements for such values, specifically

DOMString vs USVString

There's also the problem regarding DOMString and USVString, both of which are currently represented as Text:

This means that Haskell's Text is really USVString, however USVString is only used for the rpId field and extension inputs, everything else uses DOMString. This might be tricky to solve, because the aeson library uses Text underneath for strings.