tweag / webauthn

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

Use Validation applicative for `asfVerify` #89

Closed infinisil closed 2 years ago

infinisil commented 2 years ago

There is effectively no need for asfVerify being the Either Monad. By switching this to Validation we are more explicit about the few early exits, and it allows us to return multiple validation failures

This opportunity is also used to propagate the attestation statement validation errors directly, instead of wrapping them in a SomeException. This allows library users to catch such failures.