Stability | internal |
---|---|
Safe Haskell | Safe-Inferred |
Language | Haskell2010 |
This module implements decoding/encoding from/to webauthn-json JSON values to the Haskell types defined in Crypto.WebAuthn.Model.Types.
Synopsis
- data PublicKeyCredentialCreationOptions = PublicKeyCredentialCreationOptions {
- rp :: PublicKeyCredentialRpEntity
- user :: PublicKeyCredentialUserEntity
- challenge :: Base64UrlString
- pubKeyCredParams :: [PublicKeyCredentialParameters]
- timeout :: Maybe Word32
- excludeCredentials :: Maybe [PublicKeyCredentialDescriptor]
- authenticatorSelection :: Maybe AuthenticatorSelectionCriteria
- attestation :: Maybe Text
- extensions :: Maybe AuthenticationExtensionsClientInputs
- data PublicKeyCredentialRequestOptions = PublicKeyCredentialRequestOptions {}
- data PublicKeyCredential response = PublicKeyCredential {}
- data AuthenticatorAttestationResponse = AuthenticatorAttestationResponse {}
- data AuthenticatorAssertionResponse = AuthenticatorAssertionResponse {}
- data PublicKeyCredentialRpEntity = PublicKeyCredentialRpEntity {}
- data PublicKeyCredentialUserEntity = PublicKeyCredentialUserEntity {
- id :: Base64UrlString
- displayName :: Text
- name :: Text
- data PublicKeyCredentialParameters = PublicKeyCredentialParameters {}
- newtype AuthenticationExtensionsClientInputs = AuthenticationExtensionsClientInputs {}
- newtype AuthenticationExtensionsClientOutputs = AuthenticationExtensionsClientOutputs {}
- newtype CredentialPropertiesOutput = CredentialPropertiesOutput {}
- type COSEAlgorithmIdentifier = Int32
- data PublicKeyCredentialDescriptor = PublicKeyCredentialDescriptor {
- littype :: Text
- id :: Base64UrlString
- transports :: Maybe [Text]
- data AuthenticatorSelectionCriteria = AuthenticatorSelectionCriteria {}
- newtype Base64UrlString = Base64UrlString {}
- class Encode a where
- class Encode a => Decode m a where
- decode :: MonadError Text m => JSON a -> m a
Top-level types
data PublicKeyCredentialCreationOptions Source #
Instances
data PublicKeyCredentialRequestOptions Source #
Instances
data PublicKeyCredential response Source #
Instances
Nested types
data AuthenticatorAttestationResponse Source #
AuthenticatorAttestationResponse | |
|
Instances
FromJSON AuthenticatorAttestationResponse Source # | |
ToJSON AuthenticatorAttestationResponse Source # | |
Generic AuthenticatorAttestationResponse Source # | |
Show AuthenticatorAttestationResponse Source # | |
Eq AuthenticatorAttestationResponse Source # | |
type Rep AuthenticatorAttestationResponse Source # | |
Defined in Crypto.WebAuthn.Encoding.Internal.WebAuthnJson type Rep AuthenticatorAttestationResponse = D1 ('MetaData "AuthenticatorAttestationResponse" "Crypto.WebAuthn.Encoding.Internal.WebAuthnJson" "webauthn-0.8.0.0-inplace" 'False) (C1 ('MetaCons "AuthenticatorAttestationResponse" 'PrefixI 'True) (S1 ('MetaSel ('Just "clientDataJSON") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Base64UrlString) :*: (S1 ('MetaSel ('Just "attestationObject") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Base64UrlString) :*: S1 ('MetaSel ('Just "transports") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe [Text]))))) |
data AuthenticatorAssertionResponse Source #
Instances
data PublicKeyCredentialRpEntity Source #
Instances
data PublicKeyCredentialUserEntity Source #
Instances
data PublicKeyCredentialParameters Source #
Instances
newtype AuthenticationExtensionsClientInputs Source #
Instances
FromJSON AuthenticationExtensionsClientInputs Source # | |
ToJSON AuthenticationExtensionsClientInputs Source # | |
Generic AuthenticationExtensionsClientInputs Source # | |
Defined in Crypto.WebAuthn.Encoding.Internal.WebAuthnJson type Rep AuthenticationExtensionsClientInputs :: Type -> Type # | |
Show AuthenticationExtensionsClientInputs Source # | |
Eq AuthenticationExtensionsClientInputs Source # | |
type Rep AuthenticationExtensionsClientInputs Source # | |
Defined in Crypto.WebAuthn.Encoding.Internal.WebAuthnJson type Rep AuthenticationExtensionsClientInputs = D1 ('MetaData "AuthenticationExtensionsClientInputs" "Crypto.WebAuthn.Encoding.Internal.WebAuthnJson" "webauthn-0.8.0.0-inplace" 'True) (C1 ('MetaCons "AuthenticationExtensionsClientInputs" 'PrefixI 'True) (S1 ('MetaSel ('Just "credProps") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe Bool)))) |
newtype AuthenticationExtensionsClientOutputs Source #
Instances
FromJSON AuthenticationExtensionsClientOutputs Source # | |
ToJSON AuthenticationExtensionsClientOutputs Source # | |
Generic AuthenticationExtensionsClientOutputs Source # | |
Defined in Crypto.WebAuthn.Encoding.Internal.WebAuthnJson type Rep AuthenticationExtensionsClientOutputs :: Type -> Type # | |
Show AuthenticationExtensionsClientOutputs Source # | |
Eq AuthenticationExtensionsClientOutputs Source # | |
type Rep AuthenticationExtensionsClientOutputs Source # | |
Defined in Crypto.WebAuthn.Encoding.Internal.WebAuthnJson type Rep AuthenticationExtensionsClientOutputs = D1 ('MetaData "AuthenticationExtensionsClientOutputs" "Crypto.WebAuthn.Encoding.Internal.WebAuthnJson" "webauthn-0.8.0.0-inplace" 'True) (C1 ('MetaCons "AuthenticationExtensionsClientOutputs" 'PrefixI 'True) (S1 ('MetaSel ('Just "credProps") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe CredentialPropertiesOutput)))) |
newtype CredentialPropertiesOutput Source #
Instances
FromJSON CredentialPropertiesOutput Source # | |
ToJSON CredentialPropertiesOutput Source # | |
Generic CredentialPropertiesOutput Source # | |
Defined in Crypto.WebAuthn.Encoding.Internal.WebAuthnJson type Rep CredentialPropertiesOutput :: Type -> Type # | |
Show CredentialPropertiesOutput Source # | |
Defined in Crypto.WebAuthn.Encoding.Internal.WebAuthnJson showsPrec :: Int -> CredentialPropertiesOutput -> ShowS # show :: CredentialPropertiesOutput -> String # showList :: [CredentialPropertiesOutput] -> ShowS # | |
Eq CredentialPropertiesOutput Source # | |
type Rep CredentialPropertiesOutput Source # | |
Defined in Crypto.WebAuthn.Encoding.Internal.WebAuthnJson type Rep CredentialPropertiesOutput = D1 ('MetaData "CredentialPropertiesOutput" "Crypto.WebAuthn.Encoding.Internal.WebAuthnJson" "webauthn-0.8.0.0-inplace" 'True) (C1 ('MetaCons "CredentialPropertiesOutput" 'PrefixI 'True) (S1 ('MetaSel ('Just "rk") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe Bool)))) |
data PublicKeyCredentialDescriptor Source #
Instances
data AuthenticatorSelectionCriteria Source #
Instances
newtype Base64UrlString Source #
Instances
FromJSON Base64UrlString Source # | Decodes a base64url encoded JSON string into the bytes it represents |
Defined in Crypto.WebAuthn.Encoding.Internal.WebAuthnJson parseJSON :: Value -> Parser Base64UrlString # parseJSONList :: Value -> Parser [Base64UrlString] # | |
ToJSON Base64UrlString Source # | Encodes bytes using base64url to a JSON string |
Defined in Crypto.WebAuthn.Encoding.Internal.WebAuthnJson toJSON :: Base64UrlString -> Value # toEncoding :: Base64UrlString -> Encoding # toJSONList :: [Base64UrlString] -> Value # toEncodingList :: [Base64UrlString] -> Encoding # | |
Show Base64UrlString Source # | |
Defined in Crypto.WebAuthn.Encoding.Internal.WebAuthnJson showsPrec :: Int -> Base64UrlString -> ShowS # show :: Base64UrlString -> String # showList :: [Base64UrlString] -> ShowS # | |
Eq Base64UrlString Source # | |
Defined in Crypto.WebAuthn.Encoding.Internal.WebAuthnJson (==) :: Base64UrlString -> Base64UrlString -> Bool # (/=) :: Base64UrlString -> Base64UrlString -> Bool # |
Type classes
A type class to indicate that some Haskell type a
can be encoded to a
corresponding JSON-serializable webauthn-json type
using JSON
aencode
Nothing
Instances
class Encode a => Decode m a where Source #
An extension of Encode
to decoding. This typeclass is parametrized by a
Monad
m
since decoding certain structures requires additional
information to succeed, specifically
SupportedAttestationStatementFormats
, which can be provided with a
MonadReader
constraint
Nothing
decode :: MonadError Text m => JSON a -> m a Source #
Decodes a webauthn-json type, potentially throwing a Text
error