-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Move and clean up webauthn-json serialization modules
- Combines Crypto.WebAuthn.Model.WebIDL.Internal.{Convert,Encoding,Decoding} into a single Crypto.Encoding.Internal.WebAuthnJson - Moves Crypto.WebAuthn.Model.WebIDL to Crypto.Encoding.WebAuthnJson - Removes mentions of WebIDL from the above modules, correcting them to WebAuthnJson, or WJ as a prefix. This renames all the exposed decoding functions, prefixing them with wj - Make wjDecodeCredentialRegistration use allSupportedFormats as the SupportedAttestationStatementFormats argument. wjDecodeCredentialRegistration' has been introduced to allow passing a custom SupportedAttestationStatementFormats. For the future, only the unticked functions are intended to stay backwards compatible - Don't have Decode and DecodeCreated, instead parametrize Decode by m, allowing instances to add additional constraints to it. Oh also just use mtl monad constraints in general over Either for that module
- Loading branch information
Showing
13 changed files
with
781 additions
and
873 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,39 @@ | ||
{-# OPTIONS_GHC -Wno-missing-import-lists #-} | ||
|
||
-- | Stability: experimental | ||
-- This module exposes everything related to encoding\/decoding of WebAuthn | ||
-- values | ||
-- This module ncludes everything needed to encode\/decode WebAuthn types | ||
-- between serializations and Haskell types defined in "Crypto.WebAuthn.Model". | ||
module Crypto.WebAuthn.Encoding | ||
( module Crypto.WebAuthn.Encoding.Binary, | ||
( -- * webauthn-json serialization | ||
|
||
-- This module includes encoding and decoding functions for messages | ||
-- exchanged with the | ||
-- [webauthn-json](https://github.com/github/webauthn-json) JavaScript | ||
-- library. | ||
module Crypto.WebAuthn.Encoding.WebAuthnJson, | ||
|
||
-- * Binary fields | ||
|
||
-- WebAuthn defines several structures that employ a binary serialization, | ||
-- such as | ||
-- [clientDataJSON](https://www.w3.org/TR/webauthn-2/#dom-authenticatorresponse-clientdatajson) | ||
-- or [authenticator | ||
-- data](https://www.w3.org/TR/webauthn-2/#dom-authenticatorassertionresponse-authenticatordata). | ||
-- This module exposes functions for encoding/decoding such fields, using | ||
-- types from "Crypto.WebAuthn.Model". This is useful for defining | ||
-- serializations alternative to the webauthn-json one. | ||
module Crypto.WebAuthn.Encoding.Binary, | ||
|
||
-- * Enum strings | ||
|
||
-- WebAuthn also defines several enumerations, which can be translated | ||
-- to\/from their respective Haskell types in "Crypto.WebAuthn.Model" using | ||
-- this module. This is useful for defining serializations alternative to | ||
-- the webauthn-json one. | ||
module Crypto.WebAuthn.Encoding.Strings, | ||
) | ||
where | ||
|
||
import Crypto.WebAuthn.Encoding.Binary | ||
import Crypto.WebAuthn.Encoding.Strings | ||
import Crypto.WebAuthn.Encoding.WebAuthnJson |
Oops, something went wrong.