{-# LANGUAGE DataKinds #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE GADTs #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE StandaloneDeriving #-}
{-# LANGUAGE TypeFamilies #-}
module Crypto.WebAuthn.Model.Types
(
CredentialType (..),
AuthenticatorTransport (..),
AuthenticatorAttachment (..),
ResidentKeyRequirement (..),
UserVerificationRequirement (..),
AttestationConveyancePreference (..),
AttestationChain (..),
AttestationKind (..),
AttestationType (..),
VerifiableAttestationType (..),
RpId (..),
RelyingPartyName (..),
UserHandle (..),
generateUserHandle,
UserAccountDisplayName (..),
UserAccountName (..),
CredentialId (..),
generateCredentialId,
Challenge (..),
generateChallenge,
Timeout (..),
AssertionSignature (..),
RpIdHash (..),
ClientDataHash (..),
Origin (..),
SignatureCounter (..),
PublicKeyBytes (..),
AuthenticationExtensionsClientInputs (..),
CredentialPropertiesOutput (..),
AuthenticationExtensionsClientOutputs (..),
AuthenticatorExtensionOutputs (..),
CredentialRpEntity (..),
CredentialUserEntity (..),
CredentialParameters (..),
CredentialDescriptor (..),
AuthenticatorSelectionCriteria (..),
AuthenticatorDataFlags (..),
CollectedClientData (..),
AttestedCredentialData (..),
AuthenticatorData (..),
AttestationObject (..),
AuthenticatorResponse (..),
SomeAttestationType (..),
AttestationStatementFormat (..),
SomeAttestationStatementFormat (..),
SupportedAttestationStatementFormats,
singletonAttestationStatementFormat,
lookupAttestationStatementFormat,
RawField (..),
CredentialOptions (..),
Credential (..),
)
where
import qualified Codec.CBOR.Term as CBOR
import Control.Exception (Exception)
import Crypto.Hash (Digest)
import Crypto.Hash.Algorithms (SHA256)
import Crypto.Random (MonadRandom, getRandomBytes)
import qualified Crypto.WebAuthn.Cose.PublicKeyWithSignAlg as Cose
import qualified Crypto.WebAuthn.Cose.SignAlg as Cose
import Crypto.WebAuthn.Internal.ToJSONOrphans (PrettyHexByteString (PrettyHexByteString))
import Crypto.WebAuthn.Model.Identifier (AAGUID)
import Crypto.WebAuthn.Model.Kinds
( AttestationKind (Unverifiable, Verifiable),
CeremonyKind (Authentication, Registration),
ProtocolKind (Fido2, FidoU2F),
)
import Data.Aeson (ToJSON, Value (Null, String), object, (.=))
import Data.Aeson.Types (toJSON)
import qualified Data.ByteString as BS
import Data.HashMap.Strict (HashMap, (!?))
import qualified Data.HashMap.Strict as HashMap
import qualified Data.Hourglass as HG
import Data.Kind (Type)
import Data.List.NonEmpty (NonEmpty)
import Data.Singletons (SingI, sing)
import Data.String (IsString)
import Data.Text (Text)
import Data.Validation (Validation)
import Data.Word (Word32)
import qualified Data.X509 as X509
import qualified Data.X509.CertificateStore as X509
import GHC.Generics (Generic)
import Type.Reflection (Typeable, eqTypeRep, typeOf, type (:~~:) (HRefl))
data RawField (raw :: Bool) where
NoRaw :: RawField 'False
WithRaw :: {RawField 'True -> ByteString
unRaw :: BS.ByteString} -> RawField 'True
deriving instance Eq (RawField raw)
deriving instance Show (RawField raw)
instance ToJSON (RawField raw) where
toJSON :: RawField raw -> Value
toJSON RawField raw
NoRaw = Value
"<none>"
toJSON (WithRaw ByteString
bytes) = PrettyHexByteString -> Value
forall a. ToJSON a => a -> Value
toJSON (PrettyHexByteString -> Value) -> PrettyHexByteString -> Value
forall a b. (a -> b) -> a -> b
$ ByteString -> PrettyHexByteString
PrettyHexByteString ByteString
bytes
data CredentialType = CredentialTypePublicKey
deriving (CredentialType -> CredentialType -> Bool
(CredentialType -> CredentialType -> Bool)
-> (CredentialType -> CredentialType -> Bool) -> Eq CredentialType
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: CredentialType -> CredentialType -> Bool
== :: CredentialType -> CredentialType -> Bool
$c/= :: CredentialType -> CredentialType -> Bool
/= :: CredentialType -> CredentialType -> Bool
Eq, Int -> CredentialType -> ShowS
[CredentialType] -> ShowS
CredentialType -> String
(Int -> CredentialType -> ShowS)
-> (CredentialType -> String)
-> ([CredentialType] -> ShowS)
-> Show CredentialType
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> CredentialType -> ShowS
showsPrec :: Int -> CredentialType -> ShowS
$cshow :: CredentialType -> String
show :: CredentialType -> String
$cshowList :: [CredentialType] -> ShowS
showList :: [CredentialType] -> ShowS
Show, CredentialType
CredentialType -> CredentialType -> Bounded CredentialType
forall a. a -> a -> Bounded a
$cminBound :: CredentialType
minBound :: CredentialType
$cmaxBound :: CredentialType
maxBound :: CredentialType
Bounded, Int -> CredentialType
CredentialType -> Int
CredentialType -> [CredentialType]
CredentialType -> CredentialType
CredentialType -> CredentialType -> [CredentialType]
CredentialType
-> CredentialType -> CredentialType -> [CredentialType]
(CredentialType -> CredentialType)
-> (CredentialType -> CredentialType)
-> (Int -> CredentialType)
-> (CredentialType -> Int)
-> (CredentialType -> [CredentialType])
-> (CredentialType -> CredentialType -> [CredentialType])
-> (CredentialType -> CredentialType -> [CredentialType])
-> (CredentialType
-> CredentialType -> CredentialType -> [CredentialType])
-> Enum CredentialType
forall a.
(a -> a)
-> (a -> a)
-> (Int -> a)
-> (a -> Int)
-> (a -> [a])
-> (a -> a -> [a])
-> (a -> a -> [a])
-> (a -> a -> a -> [a])
-> Enum a
$csucc :: CredentialType -> CredentialType
succ :: CredentialType -> CredentialType
$cpred :: CredentialType -> CredentialType
pred :: CredentialType -> CredentialType
$ctoEnum :: Int -> CredentialType
toEnum :: Int -> CredentialType
$cfromEnum :: CredentialType -> Int
fromEnum :: CredentialType -> Int
$cenumFrom :: CredentialType -> [CredentialType]
enumFrom :: CredentialType -> [CredentialType]
$cenumFromThen :: CredentialType -> CredentialType -> [CredentialType]
enumFromThen :: CredentialType -> CredentialType -> [CredentialType]
$cenumFromTo :: CredentialType -> CredentialType -> [CredentialType]
enumFromTo :: CredentialType -> CredentialType -> [CredentialType]
$cenumFromThenTo :: CredentialType
-> CredentialType -> CredentialType -> [CredentialType]
enumFromThenTo :: CredentialType
-> CredentialType -> CredentialType -> [CredentialType]
Enum, Eq CredentialType
Eq CredentialType
-> (CredentialType -> CredentialType -> Ordering)
-> (CredentialType -> CredentialType -> Bool)
-> (CredentialType -> CredentialType -> Bool)
-> (CredentialType -> CredentialType -> Bool)
-> (CredentialType -> CredentialType -> Bool)
-> (CredentialType -> CredentialType -> CredentialType)
-> (CredentialType -> CredentialType -> CredentialType)
-> Ord CredentialType
CredentialType -> CredentialType -> Bool
CredentialType -> CredentialType -> Ordering
CredentialType -> CredentialType -> CredentialType
forall a.
Eq a
-> (a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
$ccompare :: CredentialType -> CredentialType -> Ordering
compare :: CredentialType -> CredentialType -> Ordering
$c< :: CredentialType -> CredentialType -> Bool
< :: CredentialType -> CredentialType -> Bool
$c<= :: CredentialType -> CredentialType -> Bool
<= :: CredentialType -> CredentialType -> Bool
$c> :: CredentialType -> CredentialType -> Bool
> :: CredentialType -> CredentialType -> Bool
$c>= :: CredentialType -> CredentialType -> Bool
>= :: CredentialType -> CredentialType -> Bool
$cmax :: CredentialType -> CredentialType -> CredentialType
max :: CredentialType -> CredentialType -> CredentialType
$cmin :: CredentialType -> CredentialType -> CredentialType
min :: CredentialType -> CredentialType -> CredentialType
Ord, (forall x. CredentialType -> Rep CredentialType x)
-> (forall x. Rep CredentialType x -> CredentialType)
-> Generic CredentialType
forall x. Rep CredentialType x -> CredentialType
forall x. CredentialType -> Rep CredentialType x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cfrom :: forall x. CredentialType -> Rep CredentialType x
from :: forall x. CredentialType -> Rep CredentialType x
$cto :: forall x. Rep CredentialType x -> CredentialType
to :: forall x. Rep CredentialType x -> CredentialType
Generic)
instance ToJSON CredentialType where
toJSON :: CredentialType -> Value
toJSON CredentialType
CredentialTypePublicKey = Value
"CredentialTypePublicKey"
data AuthenticatorTransport
=
AuthenticatorTransportUSB
|
AuthenticatorTransportNFC
|
AuthenticatorTransportBLE
|
AuthenticatorTransportInternal
|
AuthenticatorTransportUnknown Text
deriving (AuthenticatorTransport -> AuthenticatorTransport -> Bool
(AuthenticatorTransport -> AuthenticatorTransport -> Bool)
-> (AuthenticatorTransport -> AuthenticatorTransport -> Bool)
-> Eq AuthenticatorTransport
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: AuthenticatorTransport -> AuthenticatorTransport -> Bool
== :: AuthenticatorTransport -> AuthenticatorTransport -> Bool
$c/= :: AuthenticatorTransport -> AuthenticatorTransport -> Bool
/= :: AuthenticatorTransport -> AuthenticatorTransport -> Bool
Eq, Int -> AuthenticatorTransport -> ShowS
[AuthenticatorTransport] -> ShowS
AuthenticatorTransport -> String
(Int -> AuthenticatorTransport -> ShowS)
-> (AuthenticatorTransport -> String)
-> ([AuthenticatorTransport] -> ShowS)
-> Show AuthenticatorTransport
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> AuthenticatorTransport -> ShowS
showsPrec :: Int -> AuthenticatorTransport -> ShowS
$cshow :: AuthenticatorTransport -> String
show :: AuthenticatorTransport -> String
$cshowList :: [AuthenticatorTransport] -> ShowS
showList :: [AuthenticatorTransport] -> ShowS
Show, Eq AuthenticatorTransport
Eq AuthenticatorTransport
-> (AuthenticatorTransport -> AuthenticatorTransport -> Ordering)
-> (AuthenticatorTransport -> AuthenticatorTransport -> Bool)
-> (AuthenticatorTransport -> AuthenticatorTransport -> Bool)
-> (AuthenticatorTransport -> AuthenticatorTransport -> Bool)
-> (AuthenticatorTransport -> AuthenticatorTransport -> Bool)
-> (AuthenticatorTransport
-> AuthenticatorTransport -> AuthenticatorTransport)
-> (AuthenticatorTransport
-> AuthenticatorTransport -> AuthenticatorTransport)
-> Ord AuthenticatorTransport
AuthenticatorTransport -> AuthenticatorTransport -> Bool
AuthenticatorTransport -> AuthenticatorTransport -> Ordering
AuthenticatorTransport
-> AuthenticatorTransport -> AuthenticatorTransport
forall a.
Eq a
-> (a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
$ccompare :: AuthenticatorTransport -> AuthenticatorTransport -> Ordering
compare :: AuthenticatorTransport -> AuthenticatorTransport -> Ordering
$c< :: AuthenticatorTransport -> AuthenticatorTransport -> Bool
< :: AuthenticatorTransport -> AuthenticatorTransport -> Bool
$c<= :: AuthenticatorTransport -> AuthenticatorTransport -> Bool
<= :: AuthenticatorTransport -> AuthenticatorTransport -> Bool
$c> :: AuthenticatorTransport -> AuthenticatorTransport -> Bool
> :: AuthenticatorTransport -> AuthenticatorTransport -> Bool
$c>= :: AuthenticatorTransport -> AuthenticatorTransport -> Bool
>= :: AuthenticatorTransport -> AuthenticatorTransport -> Bool
$cmax :: AuthenticatorTransport
-> AuthenticatorTransport -> AuthenticatorTransport
max :: AuthenticatorTransport
-> AuthenticatorTransport -> AuthenticatorTransport
$cmin :: AuthenticatorTransport
-> AuthenticatorTransport -> AuthenticatorTransport
min :: AuthenticatorTransport
-> AuthenticatorTransport -> AuthenticatorTransport
Ord, (forall x. AuthenticatorTransport -> Rep AuthenticatorTransport x)
-> (forall x.
Rep AuthenticatorTransport x -> AuthenticatorTransport)
-> Generic AuthenticatorTransport
forall x. Rep AuthenticatorTransport x -> AuthenticatorTransport
forall x. AuthenticatorTransport -> Rep AuthenticatorTransport x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cfrom :: forall x. AuthenticatorTransport -> Rep AuthenticatorTransport x
from :: forall x. AuthenticatorTransport -> Rep AuthenticatorTransport x
$cto :: forall x. Rep AuthenticatorTransport x -> AuthenticatorTransport
to :: forall x. Rep AuthenticatorTransport x -> AuthenticatorTransport
Generic)
deriving instance ToJSON AuthenticatorTransport
data AuthenticatorAttachment
=
AuthenticatorAttachmentPlatform
|
AuthenticatorAttachmentCrossPlatform
deriving (AuthenticatorAttachment -> AuthenticatorAttachment -> Bool
(AuthenticatorAttachment -> AuthenticatorAttachment -> Bool)
-> (AuthenticatorAttachment -> AuthenticatorAttachment -> Bool)
-> Eq AuthenticatorAttachment
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: AuthenticatorAttachment -> AuthenticatorAttachment -> Bool
== :: AuthenticatorAttachment -> AuthenticatorAttachment -> Bool
$c/= :: AuthenticatorAttachment -> AuthenticatorAttachment -> Bool
/= :: AuthenticatorAttachment -> AuthenticatorAttachment -> Bool
Eq, Int -> AuthenticatorAttachment -> ShowS
[AuthenticatorAttachment] -> ShowS
AuthenticatorAttachment -> String
(Int -> AuthenticatorAttachment -> ShowS)
-> (AuthenticatorAttachment -> String)
-> ([AuthenticatorAttachment] -> ShowS)
-> Show AuthenticatorAttachment
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> AuthenticatorAttachment -> ShowS
showsPrec :: Int -> AuthenticatorAttachment -> ShowS
$cshow :: AuthenticatorAttachment -> String
show :: AuthenticatorAttachment -> String
$cshowList :: [AuthenticatorAttachment] -> ShowS
showList :: [AuthenticatorAttachment] -> ShowS
Show, AuthenticatorAttachment
AuthenticatorAttachment
-> AuthenticatorAttachment -> Bounded AuthenticatorAttachment
forall a. a -> a -> Bounded a
$cminBound :: AuthenticatorAttachment
minBound :: AuthenticatorAttachment
$cmaxBound :: AuthenticatorAttachment
maxBound :: AuthenticatorAttachment
Bounded, Int -> AuthenticatorAttachment
AuthenticatorAttachment -> Int
AuthenticatorAttachment -> [AuthenticatorAttachment]
AuthenticatorAttachment -> AuthenticatorAttachment
AuthenticatorAttachment
-> AuthenticatorAttachment -> [AuthenticatorAttachment]
AuthenticatorAttachment
-> AuthenticatorAttachment
-> AuthenticatorAttachment
-> [AuthenticatorAttachment]
(AuthenticatorAttachment -> AuthenticatorAttachment)
-> (AuthenticatorAttachment -> AuthenticatorAttachment)
-> (Int -> AuthenticatorAttachment)
-> (AuthenticatorAttachment -> Int)
-> (AuthenticatorAttachment -> [AuthenticatorAttachment])
-> (AuthenticatorAttachment
-> AuthenticatorAttachment -> [AuthenticatorAttachment])
-> (AuthenticatorAttachment
-> AuthenticatorAttachment -> [AuthenticatorAttachment])
-> (AuthenticatorAttachment
-> AuthenticatorAttachment
-> AuthenticatorAttachment
-> [AuthenticatorAttachment])
-> Enum AuthenticatorAttachment
forall a.
(a -> a)
-> (a -> a)
-> (Int -> a)
-> (a -> Int)
-> (a -> [a])
-> (a -> a -> [a])
-> (a -> a -> [a])
-> (a -> a -> a -> [a])
-> Enum a
$csucc :: AuthenticatorAttachment -> AuthenticatorAttachment
succ :: AuthenticatorAttachment -> AuthenticatorAttachment
$cpred :: AuthenticatorAttachment -> AuthenticatorAttachment
pred :: AuthenticatorAttachment -> AuthenticatorAttachment
$ctoEnum :: Int -> AuthenticatorAttachment
toEnum :: Int -> AuthenticatorAttachment
$cfromEnum :: AuthenticatorAttachment -> Int
fromEnum :: AuthenticatorAttachment -> Int
$cenumFrom :: AuthenticatorAttachment -> [AuthenticatorAttachment]
enumFrom :: AuthenticatorAttachment -> [AuthenticatorAttachment]
$cenumFromThen :: AuthenticatorAttachment
-> AuthenticatorAttachment -> [AuthenticatorAttachment]
enumFromThen :: AuthenticatorAttachment
-> AuthenticatorAttachment -> [AuthenticatorAttachment]
$cenumFromTo :: AuthenticatorAttachment
-> AuthenticatorAttachment -> [AuthenticatorAttachment]
enumFromTo :: AuthenticatorAttachment
-> AuthenticatorAttachment -> [AuthenticatorAttachment]
$cenumFromThenTo :: AuthenticatorAttachment
-> AuthenticatorAttachment
-> AuthenticatorAttachment
-> [AuthenticatorAttachment]
enumFromThenTo :: AuthenticatorAttachment
-> AuthenticatorAttachment
-> AuthenticatorAttachment
-> [AuthenticatorAttachment]
Enum, Eq AuthenticatorAttachment
Eq AuthenticatorAttachment
-> (AuthenticatorAttachment -> AuthenticatorAttachment -> Ordering)
-> (AuthenticatorAttachment -> AuthenticatorAttachment -> Bool)
-> (AuthenticatorAttachment -> AuthenticatorAttachment -> Bool)
-> (AuthenticatorAttachment -> AuthenticatorAttachment -> Bool)
-> (AuthenticatorAttachment -> AuthenticatorAttachment -> Bool)
-> (AuthenticatorAttachment
-> AuthenticatorAttachment -> AuthenticatorAttachment)
-> (AuthenticatorAttachment
-> AuthenticatorAttachment -> AuthenticatorAttachment)
-> Ord AuthenticatorAttachment
AuthenticatorAttachment -> AuthenticatorAttachment -> Bool
AuthenticatorAttachment -> AuthenticatorAttachment -> Ordering
AuthenticatorAttachment
-> AuthenticatorAttachment -> AuthenticatorAttachment
forall a.
Eq a
-> (a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
$ccompare :: AuthenticatorAttachment -> AuthenticatorAttachment -> Ordering
compare :: AuthenticatorAttachment -> AuthenticatorAttachment -> Ordering
$c< :: AuthenticatorAttachment -> AuthenticatorAttachment -> Bool
< :: AuthenticatorAttachment -> AuthenticatorAttachment -> Bool
$c<= :: AuthenticatorAttachment -> AuthenticatorAttachment -> Bool
<= :: AuthenticatorAttachment -> AuthenticatorAttachment -> Bool
$c> :: AuthenticatorAttachment -> AuthenticatorAttachment -> Bool
> :: AuthenticatorAttachment -> AuthenticatorAttachment -> Bool
$c>= :: AuthenticatorAttachment -> AuthenticatorAttachment -> Bool
>= :: AuthenticatorAttachment -> AuthenticatorAttachment -> Bool
$cmax :: AuthenticatorAttachment
-> AuthenticatorAttachment -> AuthenticatorAttachment
max :: AuthenticatorAttachment
-> AuthenticatorAttachment -> AuthenticatorAttachment
$cmin :: AuthenticatorAttachment
-> AuthenticatorAttachment -> AuthenticatorAttachment
min :: AuthenticatorAttachment
-> AuthenticatorAttachment -> AuthenticatorAttachment
Ord, (forall x.
AuthenticatorAttachment -> Rep AuthenticatorAttachment x)
-> (forall x.
Rep AuthenticatorAttachment x -> AuthenticatorAttachment)
-> Generic AuthenticatorAttachment
forall x. Rep AuthenticatorAttachment x -> AuthenticatorAttachment
forall x. AuthenticatorAttachment -> Rep AuthenticatorAttachment x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cfrom :: forall x. AuthenticatorAttachment -> Rep AuthenticatorAttachment x
from :: forall x. AuthenticatorAttachment -> Rep AuthenticatorAttachment x
$cto :: forall x. Rep AuthenticatorAttachment x -> AuthenticatorAttachment
to :: forall x. Rep AuthenticatorAttachment x -> AuthenticatorAttachment
Generic)
deriving instance ToJSON AuthenticatorAttachment
data ResidentKeyRequirement
=
ResidentKeyRequirementDiscouraged
|
ResidentKeyRequirementPreferred
|
ResidentKeyRequirementRequired
deriving (ResidentKeyRequirement -> ResidentKeyRequirement -> Bool
(ResidentKeyRequirement -> ResidentKeyRequirement -> Bool)
-> (ResidentKeyRequirement -> ResidentKeyRequirement -> Bool)
-> Eq ResidentKeyRequirement
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: ResidentKeyRequirement -> ResidentKeyRequirement -> Bool
== :: ResidentKeyRequirement -> ResidentKeyRequirement -> Bool
$c/= :: ResidentKeyRequirement -> ResidentKeyRequirement -> Bool
/= :: ResidentKeyRequirement -> ResidentKeyRequirement -> Bool
Eq, Int -> ResidentKeyRequirement -> ShowS
[ResidentKeyRequirement] -> ShowS
ResidentKeyRequirement -> String
(Int -> ResidentKeyRequirement -> ShowS)
-> (ResidentKeyRequirement -> String)
-> ([ResidentKeyRequirement] -> ShowS)
-> Show ResidentKeyRequirement
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> ResidentKeyRequirement -> ShowS
showsPrec :: Int -> ResidentKeyRequirement -> ShowS
$cshow :: ResidentKeyRequirement -> String
show :: ResidentKeyRequirement -> String
$cshowList :: [ResidentKeyRequirement] -> ShowS
showList :: [ResidentKeyRequirement] -> ShowS
Show, ResidentKeyRequirement
ResidentKeyRequirement
-> ResidentKeyRequirement -> Bounded ResidentKeyRequirement
forall a. a -> a -> Bounded a
$cminBound :: ResidentKeyRequirement
minBound :: ResidentKeyRequirement
$cmaxBound :: ResidentKeyRequirement
maxBound :: ResidentKeyRequirement
Bounded, Int -> ResidentKeyRequirement
ResidentKeyRequirement -> Int
ResidentKeyRequirement -> [ResidentKeyRequirement]
ResidentKeyRequirement -> ResidentKeyRequirement
ResidentKeyRequirement
-> ResidentKeyRequirement -> [ResidentKeyRequirement]
ResidentKeyRequirement
-> ResidentKeyRequirement
-> ResidentKeyRequirement
-> [ResidentKeyRequirement]
(ResidentKeyRequirement -> ResidentKeyRequirement)
-> (ResidentKeyRequirement -> ResidentKeyRequirement)
-> (Int -> ResidentKeyRequirement)
-> (ResidentKeyRequirement -> Int)
-> (ResidentKeyRequirement -> [ResidentKeyRequirement])
-> (ResidentKeyRequirement
-> ResidentKeyRequirement -> [ResidentKeyRequirement])
-> (ResidentKeyRequirement
-> ResidentKeyRequirement -> [ResidentKeyRequirement])
-> (ResidentKeyRequirement
-> ResidentKeyRequirement
-> ResidentKeyRequirement
-> [ResidentKeyRequirement])
-> Enum ResidentKeyRequirement
forall a.
(a -> a)
-> (a -> a)
-> (Int -> a)
-> (a -> Int)
-> (a -> [a])
-> (a -> a -> [a])
-> (a -> a -> [a])
-> (a -> a -> a -> [a])
-> Enum a
$csucc :: ResidentKeyRequirement -> ResidentKeyRequirement
succ :: ResidentKeyRequirement -> ResidentKeyRequirement
$cpred :: ResidentKeyRequirement -> ResidentKeyRequirement
pred :: ResidentKeyRequirement -> ResidentKeyRequirement
$ctoEnum :: Int -> ResidentKeyRequirement
toEnum :: Int -> ResidentKeyRequirement
$cfromEnum :: ResidentKeyRequirement -> Int
fromEnum :: ResidentKeyRequirement -> Int
$cenumFrom :: ResidentKeyRequirement -> [ResidentKeyRequirement]
enumFrom :: ResidentKeyRequirement -> [ResidentKeyRequirement]
$cenumFromThen :: ResidentKeyRequirement
-> ResidentKeyRequirement -> [ResidentKeyRequirement]
enumFromThen :: ResidentKeyRequirement
-> ResidentKeyRequirement -> [ResidentKeyRequirement]
$cenumFromTo :: ResidentKeyRequirement
-> ResidentKeyRequirement -> [ResidentKeyRequirement]
enumFromTo :: ResidentKeyRequirement
-> ResidentKeyRequirement -> [ResidentKeyRequirement]
$cenumFromThenTo :: ResidentKeyRequirement
-> ResidentKeyRequirement
-> ResidentKeyRequirement
-> [ResidentKeyRequirement]
enumFromThenTo :: ResidentKeyRequirement
-> ResidentKeyRequirement
-> ResidentKeyRequirement
-> [ResidentKeyRequirement]
Enum, Eq ResidentKeyRequirement
Eq ResidentKeyRequirement
-> (ResidentKeyRequirement -> ResidentKeyRequirement -> Ordering)
-> (ResidentKeyRequirement -> ResidentKeyRequirement -> Bool)
-> (ResidentKeyRequirement -> ResidentKeyRequirement -> Bool)
-> (ResidentKeyRequirement -> ResidentKeyRequirement -> Bool)
-> (ResidentKeyRequirement -> ResidentKeyRequirement -> Bool)
-> (ResidentKeyRequirement
-> ResidentKeyRequirement -> ResidentKeyRequirement)
-> (ResidentKeyRequirement
-> ResidentKeyRequirement -> ResidentKeyRequirement)
-> Ord ResidentKeyRequirement
ResidentKeyRequirement -> ResidentKeyRequirement -> Bool
ResidentKeyRequirement -> ResidentKeyRequirement -> Ordering
ResidentKeyRequirement
-> ResidentKeyRequirement -> ResidentKeyRequirement
forall a.
Eq a
-> (a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
$ccompare :: ResidentKeyRequirement -> ResidentKeyRequirement -> Ordering
compare :: ResidentKeyRequirement -> ResidentKeyRequirement -> Ordering
$c< :: ResidentKeyRequirement -> ResidentKeyRequirement -> Bool
< :: ResidentKeyRequirement -> ResidentKeyRequirement -> Bool
$c<= :: ResidentKeyRequirement -> ResidentKeyRequirement -> Bool
<= :: ResidentKeyRequirement -> ResidentKeyRequirement -> Bool
$c> :: ResidentKeyRequirement -> ResidentKeyRequirement -> Bool
> :: ResidentKeyRequirement -> ResidentKeyRequirement -> Bool
$c>= :: ResidentKeyRequirement -> ResidentKeyRequirement -> Bool
>= :: ResidentKeyRequirement -> ResidentKeyRequirement -> Bool
$cmax :: ResidentKeyRequirement
-> ResidentKeyRequirement -> ResidentKeyRequirement
max :: ResidentKeyRequirement
-> ResidentKeyRequirement -> ResidentKeyRequirement
$cmin :: ResidentKeyRequirement
-> ResidentKeyRequirement -> ResidentKeyRequirement
min :: ResidentKeyRequirement
-> ResidentKeyRequirement -> ResidentKeyRequirement
Ord, (forall x. ResidentKeyRequirement -> Rep ResidentKeyRequirement x)
-> (forall x.
Rep ResidentKeyRequirement x -> ResidentKeyRequirement)
-> Generic ResidentKeyRequirement
forall x. Rep ResidentKeyRequirement x -> ResidentKeyRequirement
forall x. ResidentKeyRequirement -> Rep ResidentKeyRequirement x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cfrom :: forall x. ResidentKeyRequirement -> Rep ResidentKeyRequirement x
from :: forall x. ResidentKeyRequirement -> Rep ResidentKeyRequirement x
$cto :: forall x. Rep ResidentKeyRequirement x -> ResidentKeyRequirement
to :: forall x. Rep ResidentKeyRequirement x -> ResidentKeyRequirement
Generic)
deriving instance ToJSON ResidentKeyRequirement
data UserVerificationRequirement
=
UserVerificationRequirementRequired
|
UserVerificationRequirementPreferred
|
UserVerificationRequirementDiscouraged
deriving (UserVerificationRequirement -> UserVerificationRequirement -> Bool
(UserVerificationRequirement
-> UserVerificationRequirement -> Bool)
-> (UserVerificationRequirement
-> UserVerificationRequirement -> Bool)
-> Eq UserVerificationRequirement
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: UserVerificationRequirement -> UserVerificationRequirement -> Bool
== :: UserVerificationRequirement -> UserVerificationRequirement -> Bool
$c/= :: UserVerificationRequirement -> UserVerificationRequirement -> Bool
/= :: UserVerificationRequirement -> UserVerificationRequirement -> Bool
Eq, Int -> UserVerificationRequirement -> ShowS
[UserVerificationRequirement] -> ShowS
UserVerificationRequirement -> String
(Int -> UserVerificationRequirement -> ShowS)
-> (UserVerificationRequirement -> String)
-> ([UserVerificationRequirement] -> ShowS)
-> Show UserVerificationRequirement
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> UserVerificationRequirement -> ShowS
showsPrec :: Int -> UserVerificationRequirement -> ShowS
$cshow :: UserVerificationRequirement -> String
show :: UserVerificationRequirement -> String
$cshowList :: [UserVerificationRequirement] -> ShowS
showList :: [UserVerificationRequirement] -> ShowS
Show, UserVerificationRequirement
UserVerificationRequirement
-> UserVerificationRequirement
-> Bounded UserVerificationRequirement
forall a. a -> a -> Bounded a
$cminBound :: UserVerificationRequirement
minBound :: UserVerificationRequirement
$cmaxBound :: UserVerificationRequirement
maxBound :: UserVerificationRequirement
Bounded, Int -> UserVerificationRequirement
UserVerificationRequirement -> Int
UserVerificationRequirement -> [UserVerificationRequirement]
UserVerificationRequirement -> UserVerificationRequirement
UserVerificationRequirement
-> UserVerificationRequirement -> [UserVerificationRequirement]
UserVerificationRequirement
-> UserVerificationRequirement
-> UserVerificationRequirement
-> [UserVerificationRequirement]
(UserVerificationRequirement -> UserVerificationRequirement)
-> (UserVerificationRequirement -> UserVerificationRequirement)
-> (Int -> UserVerificationRequirement)
-> (UserVerificationRequirement -> Int)
-> (UserVerificationRequirement -> [UserVerificationRequirement])
-> (UserVerificationRequirement
-> UserVerificationRequirement -> [UserVerificationRequirement])
-> (UserVerificationRequirement
-> UserVerificationRequirement -> [UserVerificationRequirement])
-> (UserVerificationRequirement
-> UserVerificationRequirement
-> UserVerificationRequirement
-> [UserVerificationRequirement])
-> Enum UserVerificationRequirement
forall a.
(a -> a)
-> (a -> a)
-> (Int -> a)
-> (a -> Int)
-> (a -> [a])
-> (a -> a -> [a])
-> (a -> a -> [a])
-> (a -> a -> a -> [a])
-> Enum a
$csucc :: UserVerificationRequirement -> UserVerificationRequirement
succ :: UserVerificationRequirement -> UserVerificationRequirement
$cpred :: UserVerificationRequirement -> UserVerificationRequirement
pred :: UserVerificationRequirement -> UserVerificationRequirement
$ctoEnum :: Int -> UserVerificationRequirement
toEnum :: Int -> UserVerificationRequirement
$cfromEnum :: UserVerificationRequirement -> Int
fromEnum :: UserVerificationRequirement -> Int
$cenumFrom :: UserVerificationRequirement -> [UserVerificationRequirement]
enumFrom :: UserVerificationRequirement -> [UserVerificationRequirement]
$cenumFromThen :: UserVerificationRequirement
-> UserVerificationRequirement -> [UserVerificationRequirement]
enumFromThen :: UserVerificationRequirement
-> UserVerificationRequirement -> [UserVerificationRequirement]
$cenumFromTo :: UserVerificationRequirement
-> UserVerificationRequirement -> [UserVerificationRequirement]
enumFromTo :: UserVerificationRequirement
-> UserVerificationRequirement -> [UserVerificationRequirement]
$cenumFromThenTo :: UserVerificationRequirement
-> UserVerificationRequirement
-> UserVerificationRequirement
-> [UserVerificationRequirement]
enumFromThenTo :: UserVerificationRequirement
-> UserVerificationRequirement
-> UserVerificationRequirement
-> [UserVerificationRequirement]
Enum, Eq UserVerificationRequirement
Eq UserVerificationRequirement
-> (UserVerificationRequirement
-> UserVerificationRequirement -> Ordering)
-> (UserVerificationRequirement
-> UserVerificationRequirement -> Bool)
-> (UserVerificationRequirement
-> UserVerificationRequirement -> Bool)
-> (UserVerificationRequirement
-> UserVerificationRequirement -> Bool)
-> (UserVerificationRequirement
-> UserVerificationRequirement -> Bool)
-> (UserVerificationRequirement
-> UserVerificationRequirement -> UserVerificationRequirement)
-> (UserVerificationRequirement
-> UserVerificationRequirement -> UserVerificationRequirement)
-> Ord UserVerificationRequirement
UserVerificationRequirement -> UserVerificationRequirement -> Bool
UserVerificationRequirement
-> UserVerificationRequirement -> Ordering
UserVerificationRequirement
-> UserVerificationRequirement -> UserVerificationRequirement
forall a.
Eq a
-> (a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
$ccompare :: UserVerificationRequirement
-> UserVerificationRequirement -> Ordering
compare :: UserVerificationRequirement
-> UserVerificationRequirement -> Ordering
$c< :: UserVerificationRequirement -> UserVerificationRequirement -> Bool
< :: UserVerificationRequirement -> UserVerificationRequirement -> Bool
$c<= :: UserVerificationRequirement -> UserVerificationRequirement -> Bool
<= :: UserVerificationRequirement -> UserVerificationRequirement -> Bool
$c> :: UserVerificationRequirement -> UserVerificationRequirement -> Bool
> :: UserVerificationRequirement -> UserVerificationRequirement -> Bool
$c>= :: UserVerificationRequirement -> UserVerificationRequirement -> Bool
>= :: UserVerificationRequirement -> UserVerificationRequirement -> Bool
$cmax :: UserVerificationRequirement
-> UserVerificationRequirement -> UserVerificationRequirement
max :: UserVerificationRequirement
-> UserVerificationRequirement -> UserVerificationRequirement
$cmin :: UserVerificationRequirement
-> UserVerificationRequirement -> UserVerificationRequirement
min :: UserVerificationRequirement
-> UserVerificationRequirement -> UserVerificationRequirement
Ord, (forall x.
UserVerificationRequirement -> Rep UserVerificationRequirement x)
-> (forall x.
Rep UserVerificationRequirement x -> UserVerificationRequirement)
-> Generic UserVerificationRequirement
forall x.
Rep UserVerificationRequirement x -> UserVerificationRequirement
forall x.
UserVerificationRequirement -> Rep UserVerificationRequirement x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cfrom :: forall x.
UserVerificationRequirement -> Rep UserVerificationRequirement x
from :: forall x.
UserVerificationRequirement -> Rep UserVerificationRequirement x
$cto :: forall x.
Rep UserVerificationRequirement x -> UserVerificationRequirement
to :: forall x.
Rep UserVerificationRequirement x -> UserVerificationRequirement
Generic)
deriving instance ToJSON UserVerificationRequirement
data AttestationConveyancePreference
=
AttestationConveyancePreferenceNone
|
AttestationConveyancePreferenceIndirect
|
AttestationConveyancePreferenceDirect
|
AttestationConveyancePreferenceEnterprise
deriving (AttestationConveyancePreference
-> AttestationConveyancePreference -> Bool
(AttestationConveyancePreference
-> AttestationConveyancePreference -> Bool)
-> (AttestationConveyancePreference
-> AttestationConveyancePreference -> Bool)
-> Eq AttestationConveyancePreference
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: AttestationConveyancePreference
-> AttestationConveyancePreference -> Bool
== :: AttestationConveyancePreference
-> AttestationConveyancePreference -> Bool
$c/= :: AttestationConveyancePreference
-> AttestationConveyancePreference -> Bool
/= :: AttestationConveyancePreference
-> AttestationConveyancePreference -> Bool
Eq, Int -> AttestationConveyancePreference -> ShowS
[AttestationConveyancePreference] -> ShowS
AttestationConveyancePreference -> String
(Int -> AttestationConveyancePreference -> ShowS)
-> (AttestationConveyancePreference -> String)
-> ([AttestationConveyancePreference] -> ShowS)
-> Show AttestationConveyancePreference
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> AttestationConveyancePreference -> ShowS
showsPrec :: Int -> AttestationConveyancePreference -> ShowS
$cshow :: AttestationConveyancePreference -> String
show :: AttestationConveyancePreference -> String
$cshowList :: [AttestationConveyancePreference] -> ShowS
showList :: [AttestationConveyancePreference] -> ShowS
Show, AttestationConveyancePreference
AttestationConveyancePreference
-> AttestationConveyancePreference
-> Bounded AttestationConveyancePreference
forall a. a -> a -> Bounded a
$cminBound :: AttestationConveyancePreference
minBound :: AttestationConveyancePreference
$cmaxBound :: AttestationConveyancePreference
maxBound :: AttestationConveyancePreference
Bounded, Int -> AttestationConveyancePreference
AttestationConveyancePreference -> Int
AttestationConveyancePreference
-> [AttestationConveyancePreference]
AttestationConveyancePreference -> AttestationConveyancePreference
AttestationConveyancePreference
-> AttestationConveyancePreference
-> [AttestationConveyancePreference]
AttestationConveyancePreference
-> AttestationConveyancePreference
-> AttestationConveyancePreference
-> [AttestationConveyancePreference]
(AttestationConveyancePreference
-> AttestationConveyancePreference)
-> (AttestationConveyancePreference
-> AttestationConveyancePreference)
-> (Int -> AttestationConveyancePreference)
-> (AttestationConveyancePreference -> Int)
-> (AttestationConveyancePreference
-> [AttestationConveyancePreference])
-> (AttestationConveyancePreference
-> AttestationConveyancePreference
-> [AttestationConveyancePreference])
-> (AttestationConveyancePreference
-> AttestationConveyancePreference
-> [AttestationConveyancePreference])
-> (AttestationConveyancePreference
-> AttestationConveyancePreference
-> AttestationConveyancePreference
-> [AttestationConveyancePreference])
-> Enum AttestationConveyancePreference
forall a.
(a -> a)
-> (a -> a)
-> (Int -> a)
-> (a -> Int)
-> (a -> [a])
-> (a -> a -> [a])
-> (a -> a -> [a])
-> (a -> a -> a -> [a])
-> Enum a
$csucc :: AttestationConveyancePreference -> AttestationConveyancePreference
succ :: AttestationConveyancePreference -> AttestationConveyancePreference
$cpred :: AttestationConveyancePreference -> AttestationConveyancePreference
pred :: AttestationConveyancePreference -> AttestationConveyancePreference
$ctoEnum :: Int -> AttestationConveyancePreference
toEnum :: Int -> AttestationConveyancePreference
$cfromEnum :: AttestationConveyancePreference -> Int
fromEnum :: AttestationConveyancePreference -> Int
$cenumFrom :: AttestationConveyancePreference
-> [AttestationConveyancePreference]
enumFrom :: AttestationConveyancePreference
-> [AttestationConveyancePreference]
$cenumFromThen :: AttestationConveyancePreference
-> AttestationConveyancePreference
-> [AttestationConveyancePreference]
enumFromThen :: AttestationConveyancePreference
-> AttestationConveyancePreference
-> [AttestationConveyancePreference]
$cenumFromTo :: AttestationConveyancePreference
-> AttestationConveyancePreference
-> [AttestationConveyancePreference]
enumFromTo :: AttestationConveyancePreference
-> AttestationConveyancePreference
-> [AttestationConveyancePreference]
$cenumFromThenTo :: AttestationConveyancePreference
-> AttestationConveyancePreference
-> AttestationConveyancePreference
-> [AttestationConveyancePreference]
enumFromThenTo :: AttestationConveyancePreference
-> AttestationConveyancePreference
-> AttestationConveyancePreference
-> [AttestationConveyancePreference]
Enum, Eq AttestationConveyancePreference
Eq AttestationConveyancePreference
-> (AttestationConveyancePreference
-> AttestationConveyancePreference -> Ordering)
-> (AttestationConveyancePreference
-> AttestationConveyancePreference -> Bool)
-> (AttestationConveyancePreference
-> AttestationConveyancePreference -> Bool)
-> (AttestationConveyancePreference
-> AttestationConveyancePreference -> Bool)
-> (AttestationConveyancePreference
-> AttestationConveyancePreference -> Bool)
-> (AttestationConveyancePreference
-> AttestationConveyancePreference
-> AttestationConveyancePreference)
-> (AttestationConveyancePreference
-> AttestationConveyancePreference
-> AttestationConveyancePreference)
-> Ord AttestationConveyancePreference
AttestationConveyancePreference
-> AttestationConveyancePreference -> Bool
AttestationConveyancePreference
-> AttestationConveyancePreference -> Ordering
AttestationConveyancePreference
-> AttestationConveyancePreference
-> AttestationConveyancePreference
forall a.
Eq a
-> (a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
$ccompare :: AttestationConveyancePreference
-> AttestationConveyancePreference -> Ordering
compare :: AttestationConveyancePreference
-> AttestationConveyancePreference -> Ordering
$c< :: AttestationConveyancePreference
-> AttestationConveyancePreference -> Bool
< :: AttestationConveyancePreference
-> AttestationConveyancePreference -> Bool
$c<= :: AttestationConveyancePreference
-> AttestationConveyancePreference -> Bool
<= :: AttestationConveyancePreference
-> AttestationConveyancePreference -> Bool
$c> :: AttestationConveyancePreference
-> AttestationConveyancePreference -> Bool
> :: AttestationConveyancePreference
-> AttestationConveyancePreference -> Bool
$c>= :: AttestationConveyancePreference
-> AttestationConveyancePreference -> Bool
>= :: AttestationConveyancePreference
-> AttestationConveyancePreference -> Bool
$cmax :: AttestationConveyancePreference
-> AttestationConveyancePreference
-> AttestationConveyancePreference
max :: AttestationConveyancePreference
-> AttestationConveyancePreference
-> AttestationConveyancePreference
$cmin :: AttestationConveyancePreference
-> AttestationConveyancePreference
-> AttestationConveyancePreference
min :: AttestationConveyancePreference
-> AttestationConveyancePreference
-> AttestationConveyancePreference
Ord, (forall x.
AttestationConveyancePreference
-> Rep AttestationConveyancePreference x)
-> (forall x.
Rep AttestationConveyancePreference x
-> AttestationConveyancePreference)
-> Generic AttestationConveyancePreference
forall x.
Rep AttestationConveyancePreference x
-> AttestationConveyancePreference
forall x.
AttestationConveyancePreference
-> Rep AttestationConveyancePreference x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cfrom :: forall x.
AttestationConveyancePreference
-> Rep AttestationConveyancePreference x
from :: forall x.
AttestationConveyancePreference
-> Rep AttestationConveyancePreference x
$cto :: forall x.
Rep AttestationConveyancePreference x
-> AttestationConveyancePreference
to :: forall x.
Rep AttestationConveyancePreference x
-> AttestationConveyancePreference
Generic)
deriving instance ToJSON AttestationConveyancePreference
data AttestationChain (p :: ProtocolKind) where
Fido2Chain :: NonEmpty X509.SignedCertificate -> AttestationChain 'Fido2
FidoU2FCert :: X509.SignedCertificate -> AttestationChain 'FidoU2F
deriving instance Eq (AttestationChain p)
deriving instance Show (AttestationChain p)
instance ToJSON (AttestationChain p) where
toJSON :: AttestationChain p -> Value
toJSON (Fido2Chain NonEmpty SignedCertificate
chain) = NonEmpty SignedCertificate -> Value
forall a. ToJSON a => a -> Value
toJSON NonEmpty SignedCertificate
chain
toJSON (FidoU2FCert SignedCertificate
cert) = [SignedCertificate] -> Value
forall a. ToJSON a => a -> Value
toJSON [SignedCertificate
cert]
data VerifiableAttestationType
=
VerifiableAttestationTypeUncertain
|
VerifiableAttestationTypeBasic
|
VerifiableAttestationTypeAttCA
|
VerifiableAttestationTypeAnonCA
deriving (VerifiableAttestationType -> VerifiableAttestationType -> Bool
(VerifiableAttestationType -> VerifiableAttestationType -> Bool)
-> (VerifiableAttestationType -> VerifiableAttestationType -> Bool)
-> Eq VerifiableAttestationType
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: VerifiableAttestationType -> VerifiableAttestationType -> Bool
== :: VerifiableAttestationType -> VerifiableAttestationType -> Bool
$c/= :: VerifiableAttestationType -> VerifiableAttestationType -> Bool
/= :: VerifiableAttestationType -> VerifiableAttestationType -> Bool
Eq, Int -> VerifiableAttestationType -> ShowS
[VerifiableAttestationType] -> ShowS
VerifiableAttestationType -> String
(Int -> VerifiableAttestationType -> ShowS)
-> (VerifiableAttestationType -> String)
-> ([VerifiableAttestationType] -> ShowS)
-> Show VerifiableAttestationType
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> VerifiableAttestationType -> ShowS
showsPrec :: Int -> VerifiableAttestationType -> ShowS
$cshow :: VerifiableAttestationType -> String
show :: VerifiableAttestationType -> String
$cshowList :: [VerifiableAttestationType] -> ShowS
showList :: [VerifiableAttestationType] -> ShowS
Show, VerifiableAttestationType
VerifiableAttestationType
-> VerifiableAttestationType -> Bounded VerifiableAttestationType
forall a. a -> a -> Bounded a
$cminBound :: VerifiableAttestationType
minBound :: VerifiableAttestationType
$cmaxBound :: VerifiableAttestationType
maxBound :: VerifiableAttestationType
Bounded, Int -> VerifiableAttestationType
VerifiableAttestationType -> Int
VerifiableAttestationType -> [VerifiableAttestationType]
VerifiableAttestationType -> VerifiableAttestationType
VerifiableAttestationType
-> VerifiableAttestationType -> [VerifiableAttestationType]
VerifiableAttestationType
-> VerifiableAttestationType
-> VerifiableAttestationType
-> [VerifiableAttestationType]
(VerifiableAttestationType -> VerifiableAttestationType)
-> (VerifiableAttestationType -> VerifiableAttestationType)
-> (Int -> VerifiableAttestationType)
-> (VerifiableAttestationType -> Int)
-> (VerifiableAttestationType -> [VerifiableAttestationType])
-> (VerifiableAttestationType
-> VerifiableAttestationType -> [VerifiableAttestationType])
-> (VerifiableAttestationType
-> VerifiableAttestationType -> [VerifiableAttestationType])
-> (VerifiableAttestationType
-> VerifiableAttestationType
-> VerifiableAttestationType
-> [VerifiableAttestationType])
-> Enum VerifiableAttestationType
forall a.
(a -> a)
-> (a -> a)
-> (Int -> a)
-> (a -> Int)
-> (a -> [a])
-> (a -> a -> [a])
-> (a -> a -> [a])
-> (a -> a -> a -> [a])
-> Enum a
$csucc :: VerifiableAttestationType -> VerifiableAttestationType
succ :: VerifiableAttestationType -> VerifiableAttestationType
$cpred :: VerifiableAttestationType -> VerifiableAttestationType
pred :: VerifiableAttestationType -> VerifiableAttestationType
$ctoEnum :: Int -> VerifiableAttestationType
toEnum :: Int -> VerifiableAttestationType
$cfromEnum :: VerifiableAttestationType -> Int
fromEnum :: VerifiableAttestationType -> Int
$cenumFrom :: VerifiableAttestationType -> [VerifiableAttestationType]
enumFrom :: VerifiableAttestationType -> [VerifiableAttestationType]
$cenumFromThen :: VerifiableAttestationType
-> VerifiableAttestationType -> [VerifiableAttestationType]
enumFromThen :: VerifiableAttestationType
-> VerifiableAttestationType -> [VerifiableAttestationType]
$cenumFromTo :: VerifiableAttestationType
-> VerifiableAttestationType -> [VerifiableAttestationType]
enumFromTo :: VerifiableAttestationType
-> VerifiableAttestationType -> [VerifiableAttestationType]
$cenumFromThenTo :: VerifiableAttestationType
-> VerifiableAttestationType
-> VerifiableAttestationType
-> [VerifiableAttestationType]
enumFromThenTo :: VerifiableAttestationType
-> VerifiableAttestationType
-> VerifiableAttestationType
-> [VerifiableAttestationType]
Enum, Eq VerifiableAttestationType
Eq VerifiableAttestationType
-> (VerifiableAttestationType
-> VerifiableAttestationType -> Ordering)
-> (VerifiableAttestationType -> VerifiableAttestationType -> Bool)
-> (VerifiableAttestationType -> VerifiableAttestationType -> Bool)
-> (VerifiableAttestationType -> VerifiableAttestationType -> Bool)
-> (VerifiableAttestationType -> VerifiableAttestationType -> Bool)
-> (VerifiableAttestationType
-> VerifiableAttestationType -> VerifiableAttestationType)
-> (VerifiableAttestationType
-> VerifiableAttestationType -> VerifiableAttestationType)
-> Ord VerifiableAttestationType
VerifiableAttestationType -> VerifiableAttestationType -> Bool
VerifiableAttestationType -> VerifiableAttestationType -> Ordering
VerifiableAttestationType
-> VerifiableAttestationType -> VerifiableAttestationType
forall a.
Eq a
-> (a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
$ccompare :: VerifiableAttestationType -> VerifiableAttestationType -> Ordering
compare :: VerifiableAttestationType -> VerifiableAttestationType -> Ordering
$c< :: VerifiableAttestationType -> VerifiableAttestationType -> Bool
< :: VerifiableAttestationType -> VerifiableAttestationType -> Bool
$c<= :: VerifiableAttestationType -> VerifiableAttestationType -> Bool
<= :: VerifiableAttestationType -> VerifiableAttestationType -> Bool
$c> :: VerifiableAttestationType -> VerifiableAttestationType -> Bool
> :: VerifiableAttestationType -> VerifiableAttestationType -> Bool
$c>= :: VerifiableAttestationType -> VerifiableAttestationType -> Bool
>= :: VerifiableAttestationType -> VerifiableAttestationType -> Bool
$cmax :: VerifiableAttestationType
-> VerifiableAttestationType -> VerifiableAttestationType
max :: VerifiableAttestationType
-> VerifiableAttestationType -> VerifiableAttestationType
$cmin :: VerifiableAttestationType
-> VerifiableAttestationType -> VerifiableAttestationType
min :: VerifiableAttestationType
-> VerifiableAttestationType -> VerifiableAttestationType
Ord, (forall x.
VerifiableAttestationType -> Rep VerifiableAttestationType x)
-> (forall x.
Rep VerifiableAttestationType x -> VerifiableAttestationType)
-> Generic VerifiableAttestationType
forall x.
Rep VerifiableAttestationType x -> VerifiableAttestationType
forall x.
VerifiableAttestationType -> Rep VerifiableAttestationType x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cfrom :: forall x.
VerifiableAttestationType -> Rep VerifiableAttestationType x
from :: forall x.
VerifiableAttestationType -> Rep VerifiableAttestationType x
$cto :: forall x.
Rep VerifiableAttestationType x -> VerifiableAttestationType
to :: forall x.
Rep VerifiableAttestationType x -> VerifiableAttestationType
Generic)
deriving instance ToJSON VerifiableAttestationType
data AttestationType (k :: AttestationKind) where
AttestationTypeNone :: AttestationType 'Unverifiable
AttestationTypeSelf :: AttestationType 'Unverifiable
AttestationTypeVerifiable ::
{
forall (p :: ProtocolKind).
AttestationType ('Verifiable p) -> VerifiableAttestationType
atvType :: VerifiableAttestationType,
forall (p :: ProtocolKind).
AttestationType ('Verifiable p) -> AttestationChain p
atvChain :: AttestationChain p
} ->
AttestationType ('Verifiable p)
deriving instance Eq (AttestationType k)
deriving instance Show (AttestationType k)
instance ToJSON (AttestationType k) where
toJSON :: AttestationType k -> Value
toJSON AttestationType k
AttestationTypeNone =
[Pair] -> Value
object
[ Key
"tag" Key -> Value -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
.= Text -> Value
String Text
"AttestationTypeNone"
]
toJSON AttestationType k
AttestationTypeSelf =
[Pair] -> Value
object
[ Key
"tag" Key -> Value -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
.= Text -> Value
String Text
"AttestationTypeSelf"
]
toJSON AttestationTypeVerifiable {VerifiableAttestationType
AttestationChain p
atvType :: forall (p :: ProtocolKind).
AttestationType ('Verifiable p) -> VerifiableAttestationType
atvChain :: forall (p :: ProtocolKind).
AttestationType ('Verifiable p) -> AttestationChain p
atvType :: VerifiableAttestationType
atvChain :: AttestationChain p
..} =
[Pair] -> Value
object
[ Key
"tag" Key -> Value -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
.= Text -> Value
String Text
"AttestationTypeVerifiable",
Key
"atvType" Key -> VerifiableAttestationType -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
.= VerifiableAttestationType
atvType,
Key
"atvChain" Key -> AttestationChain p -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
.= AttestationChain p
atvChain
]
newtype RpId = RpId {RpId -> Text
unRpId :: Text}
deriving (RpId -> RpId -> Bool
(RpId -> RpId -> Bool) -> (RpId -> RpId -> Bool) -> Eq RpId
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: RpId -> RpId -> Bool
== :: RpId -> RpId -> Bool
$c/= :: RpId -> RpId -> Bool
/= :: RpId -> RpId -> Bool
Eq, Int -> RpId -> ShowS
[RpId] -> ShowS
RpId -> String
(Int -> RpId -> ShowS)
-> (RpId -> String) -> ([RpId] -> ShowS) -> Show RpId
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> RpId -> ShowS
showsPrec :: Int -> RpId -> ShowS
$cshow :: RpId -> String
show :: RpId -> String
$cshowList :: [RpId] -> ShowS
showList :: [RpId] -> ShowS
Show, Eq RpId
Eq RpId
-> (RpId -> RpId -> Ordering)
-> (RpId -> RpId -> Bool)
-> (RpId -> RpId -> Bool)
-> (RpId -> RpId -> Bool)
-> (RpId -> RpId -> Bool)
-> (RpId -> RpId -> RpId)
-> (RpId -> RpId -> RpId)
-> Ord RpId
RpId -> RpId -> Bool
RpId -> RpId -> Ordering
RpId -> RpId -> RpId
forall a.
Eq a
-> (a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
$ccompare :: RpId -> RpId -> Ordering
compare :: RpId -> RpId -> Ordering
$c< :: RpId -> RpId -> Bool
< :: RpId -> RpId -> Bool
$c<= :: RpId -> RpId -> Bool
<= :: RpId -> RpId -> Bool
$c> :: RpId -> RpId -> Bool
> :: RpId -> RpId -> Bool
$c>= :: RpId -> RpId -> Bool
>= :: RpId -> RpId -> Bool
$cmax :: RpId -> RpId -> RpId
max :: RpId -> RpId -> RpId
$cmin :: RpId -> RpId -> RpId
min :: RpId -> RpId -> RpId
Ord)
deriving newtype (String -> RpId
(String -> RpId) -> IsString RpId
forall a. (String -> a) -> IsString a
$cfromString :: String -> RpId
fromString :: String -> RpId
IsString)
deriving newtype instance ToJSON RpId
newtype RelyingPartyName = RelyingPartyName {RelyingPartyName -> Text
unRelyingPartyName :: Text}
deriving (RelyingPartyName -> RelyingPartyName -> Bool
(RelyingPartyName -> RelyingPartyName -> Bool)
-> (RelyingPartyName -> RelyingPartyName -> Bool)
-> Eq RelyingPartyName
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: RelyingPartyName -> RelyingPartyName -> Bool
== :: RelyingPartyName -> RelyingPartyName -> Bool
$c/= :: RelyingPartyName -> RelyingPartyName -> Bool
/= :: RelyingPartyName -> RelyingPartyName -> Bool
Eq, Int -> RelyingPartyName -> ShowS
[RelyingPartyName] -> ShowS
RelyingPartyName -> String
(Int -> RelyingPartyName -> ShowS)
-> (RelyingPartyName -> String)
-> ([RelyingPartyName] -> ShowS)
-> Show RelyingPartyName
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> RelyingPartyName -> ShowS
showsPrec :: Int -> RelyingPartyName -> ShowS
$cshow :: RelyingPartyName -> String
show :: RelyingPartyName -> String
$cshowList :: [RelyingPartyName] -> ShowS
showList :: [RelyingPartyName] -> ShowS
Show)
deriving newtype (String -> RelyingPartyName
(String -> RelyingPartyName) -> IsString RelyingPartyName
forall a. (String -> a) -> IsString a
$cfromString :: String -> RelyingPartyName
fromString :: String -> RelyingPartyName
IsString)
deriving newtype instance ToJSON RelyingPartyName
newtype UserHandle = UserHandle {UserHandle -> ByteString
unUserHandle :: BS.ByteString}
deriving (UserHandle -> UserHandle -> Bool
(UserHandle -> UserHandle -> Bool)
-> (UserHandle -> UserHandle -> Bool) -> Eq UserHandle
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: UserHandle -> UserHandle -> Bool
== :: UserHandle -> UserHandle -> Bool
$c/= :: UserHandle -> UserHandle -> Bool
/= :: UserHandle -> UserHandle -> Bool
Eq, Int -> UserHandle -> ShowS
[UserHandle] -> ShowS
UserHandle -> String
(Int -> UserHandle -> ShowS)
-> (UserHandle -> String)
-> ([UserHandle] -> ShowS)
-> Show UserHandle
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> UserHandle -> ShowS
showsPrec :: Int -> UserHandle -> ShowS
$cshow :: UserHandle -> String
show :: UserHandle -> String
$cshowList :: [UserHandle] -> ShowS
showList :: [UserHandle] -> ShowS
Show, Eq UserHandle
Eq UserHandle
-> (UserHandle -> UserHandle -> Ordering)
-> (UserHandle -> UserHandle -> Bool)
-> (UserHandle -> UserHandle -> Bool)
-> (UserHandle -> UserHandle -> Bool)
-> (UserHandle -> UserHandle -> Bool)
-> (UserHandle -> UserHandle -> UserHandle)
-> (UserHandle -> UserHandle -> UserHandle)
-> Ord UserHandle
UserHandle -> UserHandle -> Bool
UserHandle -> UserHandle -> Ordering
UserHandle -> UserHandle -> UserHandle
forall a.
Eq a
-> (a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
$ccompare :: UserHandle -> UserHandle -> Ordering
compare :: UserHandle -> UserHandle -> Ordering
$c< :: UserHandle -> UserHandle -> Bool
< :: UserHandle -> UserHandle -> Bool
$c<= :: UserHandle -> UserHandle -> Bool
<= :: UserHandle -> UserHandle -> Bool
$c> :: UserHandle -> UserHandle -> Bool
> :: UserHandle -> UserHandle -> Bool
$c>= :: UserHandle -> UserHandle -> Bool
>= :: UserHandle -> UserHandle -> Bool
$cmax :: UserHandle -> UserHandle -> UserHandle
max :: UserHandle -> UserHandle -> UserHandle
$cmin :: UserHandle -> UserHandle -> UserHandle
min :: UserHandle -> UserHandle -> UserHandle
Ord)
deriving via PrettyHexByteString instance ToJSON UserHandle
generateUserHandle :: (MonadRandom m) => m UserHandle
generateUserHandle :: forall (m :: * -> *). MonadRandom m => m UserHandle
generateUserHandle = ByteString -> UserHandle
UserHandle (ByteString -> UserHandle) -> m ByteString -> m UserHandle
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> Int -> m ByteString
forall byteArray. ByteArray byteArray => Int -> m byteArray
forall (m :: * -> *) byteArray.
(MonadRandom m, ByteArray byteArray) =>
Int -> m byteArray
getRandomBytes Int
16
newtype UserAccountDisplayName = UserAccountDisplayName {UserAccountDisplayName -> Text
unUserAccountDisplayName :: Text}
deriving (UserAccountDisplayName -> UserAccountDisplayName -> Bool
(UserAccountDisplayName -> UserAccountDisplayName -> Bool)
-> (UserAccountDisplayName -> UserAccountDisplayName -> Bool)
-> Eq UserAccountDisplayName
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: UserAccountDisplayName -> UserAccountDisplayName -> Bool
== :: UserAccountDisplayName -> UserAccountDisplayName -> Bool
$c/= :: UserAccountDisplayName -> UserAccountDisplayName -> Bool
/= :: UserAccountDisplayName -> UserAccountDisplayName -> Bool
Eq, Int -> UserAccountDisplayName -> ShowS
[UserAccountDisplayName] -> ShowS
UserAccountDisplayName -> String
(Int -> UserAccountDisplayName -> ShowS)
-> (UserAccountDisplayName -> String)
-> ([UserAccountDisplayName] -> ShowS)
-> Show UserAccountDisplayName
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> UserAccountDisplayName -> ShowS
showsPrec :: Int -> UserAccountDisplayName -> ShowS
$cshow :: UserAccountDisplayName -> String
show :: UserAccountDisplayName -> String
$cshowList :: [UserAccountDisplayName] -> ShowS
showList :: [UserAccountDisplayName] -> ShowS
Show)
deriving newtype (String -> UserAccountDisplayName
(String -> UserAccountDisplayName)
-> IsString UserAccountDisplayName
forall a. (String -> a) -> IsString a
$cfromString :: String -> UserAccountDisplayName
fromString :: String -> UserAccountDisplayName
IsString)
deriving newtype instance ToJSON UserAccountDisplayName
newtype UserAccountName = UserAccountName {UserAccountName -> Text
unUserAccountName :: Text}
deriving (UserAccountName -> UserAccountName -> Bool
(UserAccountName -> UserAccountName -> Bool)
-> (UserAccountName -> UserAccountName -> Bool)
-> Eq UserAccountName
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: UserAccountName -> UserAccountName -> Bool
== :: UserAccountName -> UserAccountName -> Bool
$c/= :: UserAccountName -> UserAccountName -> Bool
/= :: UserAccountName -> UserAccountName -> Bool
Eq, Int -> UserAccountName -> ShowS
[UserAccountName] -> ShowS
UserAccountName -> String
(Int -> UserAccountName -> ShowS)
-> (UserAccountName -> String)
-> ([UserAccountName] -> ShowS)
-> Show UserAccountName
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> UserAccountName -> ShowS
showsPrec :: Int -> UserAccountName -> ShowS
$cshow :: UserAccountName -> String
show :: UserAccountName -> String
$cshowList :: [UserAccountName] -> ShowS
showList :: [UserAccountName] -> ShowS
Show)
deriving newtype (String -> UserAccountName
(String -> UserAccountName) -> IsString UserAccountName
forall a. (String -> a) -> IsString a
$cfromString :: String -> UserAccountName
fromString :: String -> UserAccountName
IsString)
deriving newtype instance ToJSON UserAccountName
newtype CredentialId = CredentialId {CredentialId -> ByteString
unCredentialId :: BS.ByteString}
deriving (CredentialId -> CredentialId -> Bool
(CredentialId -> CredentialId -> Bool)
-> (CredentialId -> CredentialId -> Bool) -> Eq CredentialId
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: CredentialId -> CredentialId -> Bool
== :: CredentialId -> CredentialId -> Bool
$c/= :: CredentialId -> CredentialId -> Bool
/= :: CredentialId -> CredentialId -> Bool
Eq, Int -> CredentialId -> ShowS
[CredentialId] -> ShowS
CredentialId -> String
(Int -> CredentialId -> ShowS)
-> (CredentialId -> String)
-> ([CredentialId] -> ShowS)
-> Show CredentialId
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> CredentialId -> ShowS
showsPrec :: Int -> CredentialId -> ShowS
$cshow :: CredentialId -> String
show :: CredentialId -> String
$cshowList :: [CredentialId] -> ShowS
showList :: [CredentialId] -> ShowS
Show, Eq CredentialId
Eq CredentialId
-> (CredentialId -> CredentialId -> Ordering)
-> (CredentialId -> CredentialId -> Bool)
-> (CredentialId -> CredentialId -> Bool)
-> (CredentialId -> CredentialId -> Bool)
-> (CredentialId -> CredentialId -> Bool)
-> (CredentialId -> CredentialId -> CredentialId)
-> (CredentialId -> CredentialId -> CredentialId)
-> Ord CredentialId
CredentialId -> CredentialId -> Bool
CredentialId -> CredentialId -> Ordering
CredentialId -> CredentialId -> CredentialId
forall a.
Eq a
-> (a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
$ccompare :: CredentialId -> CredentialId -> Ordering
compare :: CredentialId -> CredentialId -> Ordering
$c< :: CredentialId -> CredentialId -> Bool
< :: CredentialId -> CredentialId -> Bool
$c<= :: CredentialId -> CredentialId -> Bool
<= :: CredentialId -> CredentialId -> Bool
$c> :: CredentialId -> CredentialId -> Bool
> :: CredentialId -> CredentialId -> Bool
$c>= :: CredentialId -> CredentialId -> Bool
>= :: CredentialId -> CredentialId -> Bool
$cmax :: CredentialId -> CredentialId -> CredentialId
max :: CredentialId -> CredentialId -> CredentialId
$cmin :: CredentialId -> CredentialId -> CredentialId
min :: CredentialId -> CredentialId -> CredentialId
Ord)
deriving via PrettyHexByteString instance ToJSON CredentialId
generateCredentialId :: (MonadRandom m) => m CredentialId
generateCredentialId :: forall (m :: * -> *). MonadRandom m => m CredentialId
generateCredentialId = ByteString -> CredentialId
CredentialId (ByteString -> CredentialId) -> m ByteString -> m CredentialId
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> Int -> m ByteString
forall byteArray. ByteArray byteArray => Int -> m byteArray
forall (m :: * -> *) byteArray.
(MonadRandom m, ByteArray byteArray) =>
Int -> m byteArray
getRandomBytes Int
16
newtype Challenge = Challenge {Challenge -> ByteString
unChallenge :: BS.ByteString}
deriving (Challenge -> Challenge -> Bool
(Challenge -> Challenge -> Bool)
-> (Challenge -> Challenge -> Bool) -> Eq Challenge
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: Challenge -> Challenge -> Bool
== :: Challenge -> Challenge -> Bool
$c/= :: Challenge -> Challenge -> Bool
/= :: Challenge -> Challenge -> Bool
Eq, Int -> Challenge -> ShowS
[Challenge] -> ShowS
Challenge -> String
(Int -> Challenge -> ShowS)
-> (Challenge -> String)
-> ([Challenge] -> ShowS)
-> Show Challenge
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> Challenge -> ShowS
showsPrec :: Int -> Challenge -> ShowS
$cshow :: Challenge -> String
show :: Challenge -> String
$cshowList :: [Challenge] -> ShowS
showList :: [Challenge] -> ShowS
Show, Eq Challenge
Eq Challenge
-> (Challenge -> Challenge -> Ordering)
-> (Challenge -> Challenge -> Bool)
-> (Challenge -> Challenge -> Bool)
-> (Challenge -> Challenge -> Bool)
-> (Challenge -> Challenge -> Bool)
-> (Challenge -> Challenge -> Challenge)
-> (Challenge -> Challenge -> Challenge)
-> Ord Challenge
Challenge -> Challenge -> Bool
Challenge -> Challenge -> Ordering
Challenge -> Challenge -> Challenge
forall a.
Eq a
-> (a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
$ccompare :: Challenge -> Challenge -> Ordering
compare :: Challenge -> Challenge -> Ordering
$c< :: Challenge -> Challenge -> Bool
< :: Challenge -> Challenge -> Bool
$c<= :: Challenge -> Challenge -> Bool
<= :: Challenge -> Challenge -> Bool
$c> :: Challenge -> Challenge -> Bool
> :: Challenge -> Challenge -> Bool
$c>= :: Challenge -> Challenge -> Bool
>= :: Challenge -> Challenge -> Bool
$cmax :: Challenge -> Challenge -> Challenge
max :: Challenge -> Challenge -> Challenge
$cmin :: Challenge -> Challenge -> Challenge
min :: Challenge -> Challenge -> Challenge
Ord)
deriving via PrettyHexByteString instance ToJSON Challenge
generateChallenge :: (MonadRandom m) => m Challenge
generateChallenge :: forall (m :: * -> *). MonadRandom m => m Challenge
generateChallenge = ByteString -> Challenge
Challenge (ByteString -> Challenge) -> m ByteString -> m Challenge
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> Int -> m ByteString
forall byteArray. ByteArray byteArray => Int -> m byteArray
forall (m :: * -> *) byteArray.
(MonadRandom m, ByteArray byteArray) =>
Int -> m byteArray
getRandomBytes Int
16
newtype Timeout = Timeout {Timeout -> Word32
unTimeout :: Word32}
deriving (Timeout -> Timeout -> Bool
(Timeout -> Timeout -> Bool)
-> (Timeout -> Timeout -> Bool) -> Eq Timeout
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: Timeout -> Timeout -> Bool
== :: Timeout -> Timeout -> Bool
$c/= :: Timeout -> Timeout -> Bool
/= :: Timeout -> Timeout -> Bool
Eq, Int -> Timeout -> ShowS
[Timeout] -> ShowS
Timeout -> String
(Int -> Timeout -> ShowS)
-> (Timeout -> String) -> ([Timeout] -> ShowS) -> Show Timeout
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> Timeout -> ShowS
showsPrec :: Int -> Timeout -> ShowS
$cshow :: Timeout -> String
show :: Timeout -> String
$cshowList :: [Timeout] -> ShowS
showList :: [Timeout] -> ShowS
Show)
deriving newtype instance ToJSON Timeout
newtype AssertionSignature = AssertionSignature {AssertionSignature -> ByteString
unAssertionSignature :: BS.ByteString}
deriving (AssertionSignature -> AssertionSignature -> Bool
(AssertionSignature -> AssertionSignature -> Bool)
-> (AssertionSignature -> AssertionSignature -> Bool)
-> Eq AssertionSignature
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: AssertionSignature -> AssertionSignature -> Bool
== :: AssertionSignature -> AssertionSignature -> Bool
$c/= :: AssertionSignature -> AssertionSignature -> Bool
/= :: AssertionSignature -> AssertionSignature -> Bool
Eq, Int -> AssertionSignature -> ShowS
[AssertionSignature] -> ShowS
AssertionSignature -> String
(Int -> AssertionSignature -> ShowS)
-> (AssertionSignature -> String)
-> ([AssertionSignature] -> ShowS)
-> Show AssertionSignature
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> AssertionSignature -> ShowS
showsPrec :: Int -> AssertionSignature -> ShowS
$cshow :: AssertionSignature -> String
show :: AssertionSignature -> String
$cshowList :: [AssertionSignature] -> ShowS
showList :: [AssertionSignature] -> ShowS
Show)
deriving via PrettyHexByteString instance ToJSON AssertionSignature
newtype RpIdHash = RpIdHash {RpIdHash -> Digest SHA256
unRpIdHash :: Digest SHA256}
deriving (RpIdHash -> RpIdHash -> Bool
(RpIdHash -> RpIdHash -> Bool)
-> (RpIdHash -> RpIdHash -> Bool) -> Eq RpIdHash
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: RpIdHash -> RpIdHash -> Bool
== :: RpIdHash -> RpIdHash -> Bool
$c/= :: RpIdHash -> RpIdHash -> Bool
/= :: RpIdHash -> RpIdHash -> Bool
Eq, Int -> RpIdHash -> ShowS
[RpIdHash] -> ShowS
RpIdHash -> String
(Int -> RpIdHash -> ShowS)
-> (RpIdHash -> String) -> ([RpIdHash] -> ShowS) -> Show RpIdHash
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> RpIdHash -> ShowS
showsPrec :: Int -> RpIdHash -> ShowS
$cshow :: RpIdHash -> String
show :: RpIdHash -> String
$cshowList :: [RpIdHash] -> ShowS
showList :: [RpIdHash] -> ShowS
Show)
deriving newtype instance ToJSON RpIdHash
newtype ClientDataHash = ClientDataHash {ClientDataHash -> Digest SHA256
unClientDataHash :: Digest SHA256}
deriving (ClientDataHash -> ClientDataHash -> Bool
(ClientDataHash -> ClientDataHash -> Bool)
-> (ClientDataHash -> ClientDataHash -> Bool) -> Eq ClientDataHash
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: ClientDataHash -> ClientDataHash -> Bool
== :: ClientDataHash -> ClientDataHash -> Bool
$c/= :: ClientDataHash -> ClientDataHash -> Bool
/= :: ClientDataHash -> ClientDataHash -> Bool
Eq, Int -> ClientDataHash -> ShowS
[ClientDataHash] -> ShowS
ClientDataHash -> String
(Int -> ClientDataHash -> ShowS)
-> (ClientDataHash -> String)
-> ([ClientDataHash] -> ShowS)
-> Show ClientDataHash
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> ClientDataHash -> ShowS
showsPrec :: Int -> ClientDataHash -> ShowS
$cshow :: ClientDataHash -> String
show :: ClientDataHash -> String
$cshowList :: [ClientDataHash] -> ShowS
showList :: [ClientDataHash] -> ShowS
Show)
deriving newtype instance ToJSON ClientDataHash
newtype Origin = Origin {Origin -> Text
unOrigin :: Text}
deriving (Origin -> Origin -> Bool
(Origin -> Origin -> Bool)
-> (Origin -> Origin -> Bool) -> Eq Origin
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: Origin -> Origin -> Bool
== :: Origin -> Origin -> Bool
$c/= :: Origin -> Origin -> Bool
/= :: Origin -> Origin -> Bool
Eq, Int -> Origin -> ShowS
[Origin] -> ShowS
Origin -> String
(Int -> Origin -> ShowS)
-> (Origin -> String) -> ([Origin] -> ShowS) -> Show Origin
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> Origin -> ShowS
showsPrec :: Int -> Origin -> ShowS
$cshow :: Origin -> String
show :: Origin -> String
$cshowList :: [Origin] -> ShowS
showList :: [Origin] -> ShowS
Show)
deriving newtype (String -> Origin
(String -> Origin) -> IsString Origin
forall a. (String -> a) -> IsString a
$cfromString :: String -> Origin
fromString :: String -> Origin
IsString)
deriving newtype instance ToJSON Origin
newtype SignatureCounter = SignatureCounter {SignatureCounter -> Word32
unSignatureCounter :: Word32}
deriving (SignatureCounter -> SignatureCounter -> Bool
(SignatureCounter -> SignatureCounter -> Bool)
-> (SignatureCounter -> SignatureCounter -> Bool)
-> Eq SignatureCounter
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: SignatureCounter -> SignatureCounter -> Bool
== :: SignatureCounter -> SignatureCounter -> Bool
$c/= :: SignatureCounter -> SignatureCounter -> Bool
/= :: SignatureCounter -> SignatureCounter -> Bool
Eq, Int -> SignatureCounter -> ShowS
[SignatureCounter] -> ShowS
SignatureCounter -> String
(Int -> SignatureCounter -> ShowS)
-> (SignatureCounter -> String)
-> ([SignatureCounter] -> ShowS)
-> Show SignatureCounter
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> SignatureCounter -> ShowS
showsPrec :: Int -> SignatureCounter -> ShowS
$cshow :: SignatureCounter -> String
show :: SignatureCounter -> String
$cshowList :: [SignatureCounter] -> ShowS
showList :: [SignatureCounter] -> ShowS
Show)
deriving newtype (Integer -> SignatureCounter
SignatureCounter -> SignatureCounter
SignatureCounter -> SignatureCounter -> SignatureCounter
(SignatureCounter -> SignatureCounter -> SignatureCounter)
-> (SignatureCounter -> SignatureCounter -> SignatureCounter)
-> (SignatureCounter -> SignatureCounter -> SignatureCounter)
-> (SignatureCounter -> SignatureCounter)
-> (SignatureCounter -> SignatureCounter)
-> (SignatureCounter -> SignatureCounter)
-> (Integer -> SignatureCounter)
-> Num SignatureCounter
forall a.
(a -> a -> a)
-> (a -> a -> a)
-> (a -> a -> a)
-> (a -> a)
-> (a -> a)
-> (a -> a)
-> (Integer -> a)
-> Num a
$c+ :: SignatureCounter -> SignatureCounter -> SignatureCounter
+ :: SignatureCounter -> SignatureCounter -> SignatureCounter
$c- :: SignatureCounter -> SignatureCounter -> SignatureCounter
- :: SignatureCounter -> SignatureCounter -> SignatureCounter
$c* :: SignatureCounter -> SignatureCounter -> SignatureCounter
* :: SignatureCounter -> SignatureCounter -> SignatureCounter
$cnegate :: SignatureCounter -> SignatureCounter
negate :: SignatureCounter -> SignatureCounter
$cabs :: SignatureCounter -> SignatureCounter
abs :: SignatureCounter -> SignatureCounter
$csignum :: SignatureCounter -> SignatureCounter
signum :: SignatureCounter -> SignatureCounter
$cfromInteger :: Integer -> SignatureCounter
fromInteger :: Integer -> SignatureCounter
Num, Eq SignatureCounter
Eq SignatureCounter
-> (SignatureCounter -> SignatureCounter -> Ordering)
-> (SignatureCounter -> SignatureCounter -> Bool)
-> (SignatureCounter -> SignatureCounter -> Bool)
-> (SignatureCounter -> SignatureCounter -> Bool)
-> (SignatureCounter -> SignatureCounter -> Bool)
-> (SignatureCounter -> SignatureCounter -> SignatureCounter)
-> (SignatureCounter -> SignatureCounter -> SignatureCounter)
-> Ord SignatureCounter
SignatureCounter -> SignatureCounter -> Bool
SignatureCounter -> SignatureCounter -> Ordering
SignatureCounter -> SignatureCounter -> SignatureCounter
forall a.
Eq a
-> (a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
$ccompare :: SignatureCounter -> SignatureCounter -> Ordering
compare :: SignatureCounter -> SignatureCounter -> Ordering
$c< :: SignatureCounter -> SignatureCounter -> Bool
< :: SignatureCounter -> SignatureCounter -> Bool
$c<= :: SignatureCounter -> SignatureCounter -> Bool
<= :: SignatureCounter -> SignatureCounter -> Bool
$c> :: SignatureCounter -> SignatureCounter -> Bool
> :: SignatureCounter -> SignatureCounter -> Bool
$c>= :: SignatureCounter -> SignatureCounter -> Bool
>= :: SignatureCounter -> SignatureCounter -> Bool
$cmax :: SignatureCounter -> SignatureCounter -> SignatureCounter
max :: SignatureCounter -> SignatureCounter -> SignatureCounter
$cmin :: SignatureCounter -> SignatureCounter -> SignatureCounter
min :: SignatureCounter -> SignatureCounter -> SignatureCounter
Ord)
deriving newtype instance ToJSON SignatureCounter
newtype PublicKeyBytes = PublicKeyBytes {PublicKeyBytes -> ByteString
unPublicKeyBytes :: BS.ByteString}
deriving (PublicKeyBytes -> PublicKeyBytes -> Bool
(PublicKeyBytes -> PublicKeyBytes -> Bool)
-> (PublicKeyBytes -> PublicKeyBytes -> Bool) -> Eq PublicKeyBytes
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: PublicKeyBytes -> PublicKeyBytes -> Bool
== :: PublicKeyBytes -> PublicKeyBytes -> Bool
$c/= :: PublicKeyBytes -> PublicKeyBytes -> Bool
/= :: PublicKeyBytes -> PublicKeyBytes -> Bool
Eq, Int -> PublicKeyBytes -> ShowS
[PublicKeyBytes] -> ShowS
PublicKeyBytes -> String
(Int -> PublicKeyBytes -> ShowS)
-> (PublicKeyBytes -> String)
-> ([PublicKeyBytes] -> ShowS)
-> Show PublicKeyBytes
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> PublicKeyBytes -> ShowS
showsPrec :: Int -> PublicKeyBytes -> ShowS
$cshow :: PublicKeyBytes -> String
show :: PublicKeyBytes -> String
$cshowList :: [PublicKeyBytes] -> ShowS
showList :: [PublicKeyBytes] -> ShowS
Show)
deriving via PrettyHexByteString instance ToJSON PublicKeyBytes
newtype AuthenticationExtensionsClientInputs = AuthenticationExtensionsClientInputs
{
AuthenticationExtensionsClientInputs -> Maybe Bool
aeciCredProps :: Maybe Bool
}
deriving (AuthenticationExtensionsClientInputs
-> AuthenticationExtensionsClientInputs -> Bool
(AuthenticationExtensionsClientInputs
-> AuthenticationExtensionsClientInputs -> Bool)
-> (AuthenticationExtensionsClientInputs
-> AuthenticationExtensionsClientInputs -> Bool)
-> Eq AuthenticationExtensionsClientInputs
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: AuthenticationExtensionsClientInputs
-> AuthenticationExtensionsClientInputs -> Bool
== :: AuthenticationExtensionsClientInputs
-> AuthenticationExtensionsClientInputs -> Bool
$c/= :: AuthenticationExtensionsClientInputs
-> AuthenticationExtensionsClientInputs -> Bool
/= :: AuthenticationExtensionsClientInputs
-> AuthenticationExtensionsClientInputs -> Bool
Eq, Int -> AuthenticationExtensionsClientInputs -> ShowS
[AuthenticationExtensionsClientInputs] -> ShowS
AuthenticationExtensionsClientInputs -> String
(Int -> AuthenticationExtensionsClientInputs -> ShowS)
-> (AuthenticationExtensionsClientInputs -> String)
-> ([AuthenticationExtensionsClientInputs] -> ShowS)
-> Show AuthenticationExtensionsClientInputs
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> AuthenticationExtensionsClientInputs -> ShowS
showsPrec :: Int -> AuthenticationExtensionsClientInputs -> ShowS
$cshow :: AuthenticationExtensionsClientInputs -> String
show :: AuthenticationExtensionsClientInputs -> String
$cshowList :: [AuthenticationExtensionsClientInputs] -> ShowS
showList :: [AuthenticationExtensionsClientInputs] -> ShowS
Show)
deriving newtype ([AuthenticationExtensionsClientInputs] -> Value
[AuthenticationExtensionsClientInputs] -> Encoding
AuthenticationExtensionsClientInputs -> Value
AuthenticationExtensionsClientInputs -> Encoding
(AuthenticationExtensionsClientInputs -> Value)
-> (AuthenticationExtensionsClientInputs -> Encoding)
-> ([AuthenticationExtensionsClientInputs] -> Value)
-> ([AuthenticationExtensionsClientInputs] -> Encoding)
-> ToJSON AuthenticationExtensionsClientInputs
forall a.
(a -> Value)
-> (a -> Encoding)
-> ([a] -> Value)
-> ([a] -> Encoding)
-> ToJSON a
$ctoJSON :: AuthenticationExtensionsClientInputs -> Value
toJSON :: AuthenticationExtensionsClientInputs -> Value
$ctoEncoding :: AuthenticationExtensionsClientInputs -> Encoding
toEncoding :: AuthenticationExtensionsClientInputs -> Encoding
$ctoJSONList :: [AuthenticationExtensionsClientInputs] -> Value
toJSONList :: [AuthenticationExtensionsClientInputs] -> Value
$ctoEncodingList :: [AuthenticationExtensionsClientInputs] -> Encoding
toEncodingList :: [AuthenticationExtensionsClientInputs] -> Encoding
ToJSON)
newtype CredentialPropertiesOutput = CredentialPropertiesOutput
{
CredentialPropertiesOutput -> Maybe Bool
cpoRk :: Maybe Bool
}
deriving (CredentialPropertiesOutput -> CredentialPropertiesOutput -> Bool
(CredentialPropertiesOutput -> CredentialPropertiesOutput -> Bool)
-> (CredentialPropertiesOutput
-> CredentialPropertiesOutput -> Bool)
-> Eq CredentialPropertiesOutput
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: CredentialPropertiesOutput -> CredentialPropertiesOutput -> Bool
== :: CredentialPropertiesOutput -> CredentialPropertiesOutput -> Bool
$c/= :: CredentialPropertiesOutput -> CredentialPropertiesOutput -> Bool
/= :: CredentialPropertiesOutput -> CredentialPropertiesOutput -> Bool
Eq, Int -> CredentialPropertiesOutput -> ShowS
[CredentialPropertiesOutput] -> ShowS
CredentialPropertiesOutput -> String
(Int -> CredentialPropertiesOutput -> ShowS)
-> (CredentialPropertiesOutput -> String)
-> ([CredentialPropertiesOutput] -> ShowS)
-> Show CredentialPropertiesOutput
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> CredentialPropertiesOutput -> ShowS
showsPrec :: Int -> CredentialPropertiesOutput -> ShowS
$cshow :: CredentialPropertiesOutput -> String
show :: CredentialPropertiesOutput -> String
$cshowList :: [CredentialPropertiesOutput] -> ShowS
showList :: [CredentialPropertiesOutput] -> ShowS
Show)
deriving newtype ([CredentialPropertiesOutput] -> Value
[CredentialPropertiesOutput] -> Encoding
CredentialPropertiesOutput -> Value
CredentialPropertiesOutput -> Encoding
(CredentialPropertiesOutput -> Value)
-> (CredentialPropertiesOutput -> Encoding)
-> ([CredentialPropertiesOutput] -> Value)
-> ([CredentialPropertiesOutput] -> Encoding)
-> ToJSON CredentialPropertiesOutput
forall a.
(a -> Value)
-> (a -> Encoding)
-> ([a] -> Value)
-> ([a] -> Encoding)
-> ToJSON a
$ctoJSON :: CredentialPropertiesOutput -> Value
toJSON :: CredentialPropertiesOutput -> Value
$ctoEncoding :: CredentialPropertiesOutput -> Encoding
toEncoding :: CredentialPropertiesOutput -> Encoding
$ctoJSONList :: [CredentialPropertiesOutput] -> Value
toJSONList :: [CredentialPropertiesOutput] -> Value
$ctoEncodingList :: [CredentialPropertiesOutput] -> Encoding
toEncodingList :: [CredentialPropertiesOutput] -> Encoding
ToJSON)
newtype AuthenticationExtensionsClientOutputs = AuthenticationExtensionsClientOutputs
{
AuthenticationExtensionsClientOutputs
-> Maybe CredentialPropertiesOutput
aecoCredProps :: Maybe CredentialPropertiesOutput
}
deriving (AuthenticationExtensionsClientOutputs
-> AuthenticationExtensionsClientOutputs -> Bool
(AuthenticationExtensionsClientOutputs
-> AuthenticationExtensionsClientOutputs -> Bool)
-> (AuthenticationExtensionsClientOutputs
-> AuthenticationExtensionsClientOutputs -> Bool)
-> Eq AuthenticationExtensionsClientOutputs
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: AuthenticationExtensionsClientOutputs
-> AuthenticationExtensionsClientOutputs -> Bool
== :: AuthenticationExtensionsClientOutputs
-> AuthenticationExtensionsClientOutputs -> Bool
$c/= :: AuthenticationExtensionsClientOutputs
-> AuthenticationExtensionsClientOutputs -> Bool
/= :: AuthenticationExtensionsClientOutputs
-> AuthenticationExtensionsClientOutputs -> Bool
Eq, Int -> AuthenticationExtensionsClientOutputs -> ShowS
[AuthenticationExtensionsClientOutputs] -> ShowS
AuthenticationExtensionsClientOutputs -> String
(Int -> AuthenticationExtensionsClientOutputs -> ShowS)
-> (AuthenticationExtensionsClientOutputs -> String)
-> ([AuthenticationExtensionsClientOutputs] -> ShowS)
-> Show AuthenticationExtensionsClientOutputs
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> AuthenticationExtensionsClientOutputs -> ShowS
showsPrec :: Int -> AuthenticationExtensionsClientOutputs -> ShowS
$cshow :: AuthenticationExtensionsClientOutputs -> String
show :: AuthenticationExtensionsClientOutputs -> String
$cshowList :: [AuthenticationExtensionsClientOutputs] -> ShowS
showList :: [AuthenticationExtensionsClientOutputs] -> ShowS
Show)
deriving newtype ([AuthenticationExtensionsClientOutputs] -> Value
[AuthenticationExtensionsClientOutputs] -> Encoding
AuthenticationExtensionsClientOutputs -> Value
AuthenticationExtensionsClientOutputs -> Encoding
(AuthenticationExtensionsClientOutputs -> Value)
-> (AuthenticationExtensionsClientOutputs -> Encoding)
-> ([AuthenticationExtensionsClientOutputs] -> Value)
-> ([AuthenticationExtensionsClientOutputs] -> Encoding)
-> ToJSON AuthenticationExtensionsClientOutputs
forall a.
(a -> Value)
-> (a -> Encoding)
-> ([a] -> Value)
-> ([a] -> Encoding)
-> ToJSON a
$ctoJSON :: AuthenticationExtensionsClientOutputs -> Value
toJSON :: AuthenticationExtensionsClientOutputs -> Value
$ctoEncoding :: AuthenticationExtensionsClientOutputs -> Encoding
toEncoding :: AuthenticationExtensionsClientOutputs -> Encoding
$ctoJSONList :: [AuthenticationExtensionsClientOutputs] -> Value
toJSONList :: [AuthenticationExtensionsClientOutputs] -> Value
$ctoEncodingList :: [AuthenticationExtensionsClientOutputs] -> Encoding
toEncodingList :: [AuthenticationExtensionsClientOutputs] -> Encoding
ToJSON)
data AuthenticatorExtensionOutputs = AuthenticatorExtensionOutputs
{
}
deriving (AuthenticatorExtensionOutputs
-> AuthenticatorExtensionOutputs -> Bool
(AuthenticatorExtensionOutputs
-> AuthenticatorExtensionOutputs -> Bool)
-> (AuthenticatorExtensionOutputs
-> AuthenticatorExtensionOutputs -> Bool)
-> Eq AuthenticatorExtensionOutputs
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: AuthenticatorExtensionOutputs
-> AuthenticatorExtensionOutputs -> Bool
== :: AuthenticatorExtensionOutputs
-> AuthenticatorExtensionOutputs -> Bool
$c/= :: AuthenticatorExtensionOutputs
-> AuthenticatorExtensionOutputs -> Bool
/= :: AuthenticatorExtensionOutputs
-> AuthenticatorExtensionOutputs -> Bool
Eq, Int -> AuthenticatorExtensionOutputs -> ShowS
[AuthenticatorExtensionOutputs] -> ShowS
AuthenticatorExtensionOutputs -> String
(Int -> AuthenticatorExtensionOutputs -> ShowS)
-> (AuthenticatorExtensionOutputs -> String)
-> ([AuthenticatorExtensionOutputs] -> ShowS)
-> Show AuthenticatorExtensionOutputs
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> AuthenticatorExtensionOutputs -> ShowS
showsPrec :: Int -> AuthenticatorExtensionOutputs -> ShowS
$cshow :: AuthenticatorExtensionOutputs -> String
show :: AuthenticatorExtensionOutputs -> String
$cshowList :: [AuthenticatorExtensionOutputs] -> ShowS
showList :: [AuthenticatorExtensionOutputs] -> ShowS
Show)
instance ToJSON AuthenticatorExtensionOutputs where
toJSON :: AuthenticatorExtensionOutputs -> Value
toJSON AuthenticatorExtensionOutputs
_ = [Pair] -> Value
object []
data CredentialRpEntity = CredentialRpEntity
{
CredentialRpEntity -> Maybe RpId
creId :: Maybe RpId,
CredentialRpEntity -> RelyingPartyName
creName :: RelyingPartyName
}
deriving (CredentialRpEntity -> CredentialRpEntity -> Bool
(CredentialRpEntity -> CredentialRpEntity -> Bool)
-> (CredentialRpEntity -> CredentialRpEntity -> Bool)
-> Eq CredentialRpEntity
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: CredentialRpEntity -> CredentialRpEntity -> Bool
== :: CredentialRpEntity -> CredentialRpEntity -> Bool
$c/= :: CredentialRpEntity -> CredentialRpEntity -> Bool
/= :: CredentialRpEntity -> CredentialRpEntity -> Bool
Eq, Int -> CredentialRpEntity -> ShowS
[CredentialRpEntity] -> ShowS
CredentialRpEntity -> String
(Int -> CredentialRpEntity -> ShowS)
-> (CredentialRpEntity -> String)
-> ([CredentialRpEntity] -> ShowS)
-> Show CredentialRpEntity
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> CredentialRpEntity -> ShowS
showsPrec :: Int -> CredentialRpEntity -> ShowS
$cshow :: CredentialRpEntity -> String
show :: CredentialRpEntity -> String
$cshowList :: [CredentialRpEntity] -> ShowS
showList :: [CredentialRpEntity] -> ShowS
Show, (forall x. CredentialRpEntity -> Rep CredentialRpEntity x)
-> (forall x. Rep CredentialRpEntity x -> CredentialRpEntity)
-> Generic CredentialRpEntity
forall x. Rep CredentialRpEntity x -> CredentialRpEntity
forall x. CredentialRpEntity -> Rep CredentialRpEntity x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cfrom :: forall x. CredentialRpEntity -> Rep CredentialRpEntity x
from :: forall x. CredentialRpEntity -> Rep CredentialRpEntity x
$cto :: forall x. Rep CredentialRpEntity x -> CredentialRpEntity
to :: forall x. Rep CredentialRpEntity x -> CredentialRpEntity
Generic)
deriving instance ToJSON CredentialRpEntity
data CredentialUserEntity = CredentialUserEntity
{
CredentialUserEntity -> UserHandle
cueId :: UserHandle,
CredentialUserEntity -> UserAccountDisplayName
cueDisplayName :: UserAccountDisplayName,
CredentialUserEntity -> UserAccountName
cueName :: UserAccountName
}
deriving (CredentialUserEntity -> CredentialUserEntity -> Bool
(CredentialUserEntity -> CredentialUserEntity -> Bool)
-> (CredentialUserEntity -> CredentialUserEntity -> Bool)
-> Eq CredentialUserEntity
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: CredentialUserEntity -> CredentialUserEntity -> Bool
== :: CredentialUserEntity -> CredentialUserEntity -> Bool
$c/= :: CredentialUserEntity -> CredentialUserEntity -> Bool
/= :: CredentialUserEntity -> CredentialUserEntity -> Bool
Eq, Int -> CredentialUserEntity -> ShowS
[CredentialUserEntity] -> ShowS
CredentialUserEntity -> String
(Int -> CredentialUserEntity -> ShowS)
-> (CredentialUserEntity -> String)
-> ([CredentialUserEntity] -> ShowS)
-> Show CredentialUserEntity
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> CredentialUserEntity -> ShowS
showsPrec :: Int -> CredentialUserEntity -> ShowS
$cshow :: CredentialUserEntity -> String
show :: CredentialUserEntity -> String
$cshowList :: [CredentialUserEntity] -> ShowS
showList :: [CredentialUserEntity] -> ShowS
Show, (forall x. CredentialUserEntity -> Rep CredentialUserEntity x)
-> (forall x. Rep CredentialUserEntity x -> CredentialUserEntity)
-> Generic CredentialUserEntity
forall x. Rep CredentialUserEntity x -> CredentialUserEntity
forall x. CredentialUserEntity -> Rep CredentialUserEntity x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cfrom :: forall x. CredentialUserEntity -> Rep CredentialUserEntity x
from :: forall x. CredentialUserEntity -> Rep CredentialUserEntity x
$cto :: forall x. Rep CredentialUserEntity x -> CredentialUserEntity
to :: forall x. Rep CredentialUserEntity x -> CredentialUserEntity
Generic)
deriving instance ToJSON CredentialUserEntity
data CredentialParameters = CredentialParameters
{
CredentialParameters -> CredentialType
cpTyp :: CredentialType,
CredentialParameters -> CoseSignAlg
cpAlg :: Cose.CoseSignAlg
}
deriving (CredentialParameters -> CredentialParameters -> Bool
(CredentialParameters -> CredentialParameters -> Bool)
-> (CredentialParameters -> CredentialParameters -> Bool)
-> Eq CredentialParameters
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: CredentialParameters -> CredentialParameters -> Bool
== :: CredentialParameters -> CredentialParameters -> Bool
$c/= :: CredentialParameters -> CredentialParameters -> Bool
/= :: CredentialParameters -> CredentialParameters -> Bool
Eq, Int -> CredentialParameters -> ShowS
[CredentialParameters] -> ShowS
CredentialParameters -> String
(Int -> CredentialParameters -> ShowS)
-> (CredentialParameters -> String)
-> ([CredentialParameters] -> ShowS)
-> Show CredentialParameters
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> CredentialParameters -> ShowS
showsPrec :: Int -> CredentialParameters -> ShowS
$cshow :: CredentialParameters -> String
show :: CredentialParameters -> String
$cshowList :: [CredentialParameters] -> ShowS
showList :: [CredentialParameters] -> ShowS
Show, (forall x. CredentialParameters -> Rep CredentialParameters x)
-> (forall x. Rep CredentialParameters x -> CredentialParameters)
-> Generic CredentialParameters
forall x. Rep CredentialParameters x -> CredentialParameters
forall x. CredentialParameters -> Rep CredentialParameters x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cfrom :: forall x. CredentialParameters -> Rep CredentialParameters x
from :: forall x. CredentialParameters -> Rep CredentialParameters x
$cto :: forall x. Rep CredentialParameters x -> CredentialParameters
to :: forall x. Rep CredentialParameters x -> CredentialParameters
Generic)
deriving instance ToJSON CredentialParameters
data CredentialDescriptor = CredentialDescriptor
{
CredentialDescriptor -> CredentialType
cdTyp :: CredentialType,
CredentialDescriptor -> CredentialId
cdId :: CredentialId,
CredentialDescriptor -> Maybe [AuthenticatorTransport]
cdTransports :: Maybe [AuthenticatorTransport]
}
deriving (CredentialDescriptor -> CredentialDescriptor -> Bool
(CredentialDescriptor -> CredentialDescriptor -> Bool)
-> (CredentialDescriptor -> CredentialDescriptor -> Bool)
-> Eq CredentialDescriptor
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: CredentialDescriptor -> CredentialDescriptor -> Bool
== :: CredentialDescriptor -> CredentialDescriptor -> Bool
$c/= :: CredentialDescriptor -> CredentialDescriptor -> Bool
/= :: CredentialDescriptor -> CredentialDescriptor -> Bool
Eq, Int -> CredentialDescriptor -> ShowS
[CredentialDescriptor] -> ShowS
CredentialDescriptor -> String
(Int -> CredentialDescriptor -> ShowS)
-> (CredentialDescriptor -> String)
-> ([CredentialDescriptor] -> ShowS)
-> Show CredentialDescriptor
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> CredentialDescriptor -> ShowS
showsPrec :: Int -> CredentialDescriptor -> ShowS
$cshow :: CredentialDescriptor -> String
show :: CredentialDescriptor -> String
$cshowList :: [CredentialDescriptor] -> ShowS
showList :: [CredentialDescriptor] -> ShowS
Show, (forall x. CredentialDescriptor -> Rep CredentialDescriptor x)
-> (forall x. Rep CredentialDescriptor x -> CredentialDescriptor)
-> Generic CredentialDescriptor
forall x. Rep CredentialDescriptor x -> CredentialDescriptor
forall x. CredentialDescriptor -> Rep CredentialDescriptor x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cfrom :: forall x. CredentialDescriptor -> Rep CredentialDescriptor x
from :: forall x. CredentialDescriptor -> Rep CredentialDescriptor x
$cto :: forall x. Rep CredentialDescriptor x -> CredentialDescriptor
to :: forall x. Rep CredentialDescriptor x -> CredentialDescriptor
Generic)
deriving instance ToJSON CredentialDescriptor
data AuthenticatorSelectionCriteria = AuthenticatorSelectionCriteria
{
AuthenticatorSelectionCriteria -> Maybe AuthenticatorAttachment
ascAuthenticatorAttachment :: Maybe AuthenticatorAttachment,
AuthenticatorSelectionCriteria -> ResidentKeyRequirement
ascResidentKey :: ResidentKeyRequirement,
AuthenticatorSelectionCriteria -> UserVerificationRequirement
ascUserVerification :: UserVerificationRequirement
}
deriving (AuthenticatorSelectionCriteria
-> AuthenticatorSelectionCriteria -> Bool
(AuthenticatorSelectionCriteria
-> AuthenticatorSelectionCriteria -> Bool)
-> (AuthenticatorSelectionCriteria
-> AuthenticatorSelectionCriteria -> Bool)
-> Eq AuthenticatorSelectionCriteria
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: AuthenticatorSelectionCriteria
-> AuthenticatorSelectionCriteria -> Bool
== :: AuthenticatorSelectionCriteria
-> AuthenticatorSelectionCriteria -> Bool
$c/= :: AuthenticatorSelectionCriteria
-> AuthenticatorSelectionCriteria -> Bool
/= :: AuthenticatorSelectionCriteria
-> AuthenticatorSelectionCriteria -> Bool
Eq, Int -> AuthenticatorSelectionCriteria -> ShowS
[AuthenticatorSelectionCriteria] -> ShowS
AuthenticatorSelectionCriteria -> String
(Int -> AuthenticatorSelectionCriteria -> ShowS)
-> (AuthenticatorSelectionCriteria -> String)
-> ([AuthenticatorSelectionCriteria] -> ShowS)
-> Show AuthenticatorSelectionCriteria
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> AuthenticatorSelectionCriteria -> ShowS
showsPrec :: Int -> AuthenticatorSelectionCriteria -> ShowS
$cshow :: AuthenticatorSelectionCriteria -> String
show :: AuthenticatorSelectionCriteria -> String
$cshowList :: [AuthenticatorSelectionCriteria] -> ShowS
showList :: [AuthenticatorSelectionCriteria] -> ShowS
Show, (forall x.
AuthenticatorSelectionCriteria
-> Rep AuthenticatorSelectionCriteria x)
-> (forall x.
Rep AuthenticatorSelectionCriteria x
-> AuthenticatorSelectionCriteria)
-> Generic AuthenticatorSelectionCriteria
forall x.
Rep AuthenticatorSelectionCriteria x
-> AuthenticatorSelectionCriteria
forall x.
AuthenticatorSelectionCriteria
-> Rep AuthenticatorSelectionCriteria x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cfrom :: forall x.
AuthenticatorSelectionCriteria
-> Rep AuthenticatorSelectionCriteria x
from :: forall x.
AuthenticatorSelectionCriteria
-> Rep AuthenticatorSelectionCriteria x
$cto :: forall x.
Rep AuthenticatorSelectionCriteria x
-> AuthenticatorSelectionCriteria
to :: forall x.
Rep AuthenticatorSelectionCriteria x
-> AuthenticatorSelectionCriteria
Generic)
deriving instance ToJSON AuthenticatorSelectionCriteria
data AuthenticatorDataFlags = AuthenticatorDataFlags
{
AuthenticatorDataFlags -> Bool
adfUserPresent :: Bool,
AuthenticatorDataFlags -> Bool
adfUserVerified :: Bool
}
deriving (AuthenticatorDataFlags -> AuthenticatorDataFlags -> Bool
(AuthenticatorDataFlags -> AuthenticatorDataFlags -> Bool)
-> (AuthenticatorDataFlags -> AuthenticatorDataFlags -> Bool)
-> Eq AuthenticatorDataFlags
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: AuthenticatorDataFlags -> AuthenticatorDataFlags -> Bool
== :: AuthenticatorDataFlags -> AuthenticatorDataFlags -> Bool
$c/= :: AuthenticatorDataFlags -> AuthenticatorDataFlags -> Bool
/= :: AuthenticatorDataFlags -> AuthenticatorDataFlags -> Bool
Eq, Int -> AuthenticatorDataFlags -> ShowS
[AuthenticatorDataFlags] -> ShowS
AuthenticatorDataFlags -> String
(Int -> AuthenticatorDataFlags -> ShowS)
-> (AuthenticatorDataFlags -> String)
-> ([AuthenticatorDataFlags] -> ShowS)
-> Show AuthenticatorDataFlags
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> AuthenticatorDataFlags -> ShowS
showsPrec :: Int -> AuthenticatorDataFlags -> ShowS
$cshow :: AuthenticatorDataFlags -> String
show :: AuthenticatorDataFlags -> String
$cshowList :: [AuthenticatorDataFlags] -> ShowS
showList :: [AuthenticatorDataFlags] -> ShowS
Show, (forall x. AuthenticatorDataFlags -> Rep AuthenticatorDataFlags x)
-> (forall x.
Rep AuthenticatorDataFlags x -> AuthenticatorDataFlags)
-> Generic AuthenticatorDataFlags
forall x. Rep AuthenticatorDataFlags x -> AuthenticatorDataFlags
forall x. AuthenticatorDataFlags -> Rep AuthenticatorDataFlags x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cfrom :: forall x. AuthenticatorDataFlags -> Rep AuthenticatorDataFlags x
from :: forall x. AuthenticatorDataFlags -> Rep AuthenticatorDataFlags x
$cto :: forall x. Rep AuthenticatorDataFlags x -> AuthenticatorDataFlags
to :: forall x. Rep AuthenticatorDataFlags x -> AuthenticatorDataFlags
Generic)
deriving instance ToJSON AuthenticatorDataFlags
data CredentialOptions (c :: CeremonyKind) where
CredentialOptionsRegistration ::
{
CredentialOptions 'Registration -> CredentialRpEntity
corRp :: CredentialRpEntity,
CredentialOptions 'Registration -> CredentialUserEntity
corUser :: CredentialUserEntity,
CredentialOptions 'Registration -> Challenge
corChallenge :: Challenge,
CredentialOptions 'Registration -> [CredentialParameters]
corPubKeyCredParams :: [CredentialParameters],
CredentialOptions 'Registration -> Maybe Timeout
corTimeout :: Maybe Timeout,
CredentialOptions 'Registration -> [CredentialDescriptor]
corExcludeCredentials :: [CredentialDescriptor],
CredentialOptions 'Registration
-> Maybe AuthenticatorSelectionCriteria
corAuthenticatorSelection :: Maybe AuthenticatorSelectionCriteria,
CredentialOptions 'Registration -> AttestationConveyancePreference
corAttestation :: AttestationConveyancePreference,
CredentialOptions 'Registration
-> Maybe AuthenticationExtensionsClientInputs
corExtensions :: Maybe AuthenticationExtensionsClientInputs
} ->
CredentialOptions 'Registration
CredentialOptionsAuthentication ::
{
CredentialOptions 'Authentication -> Challenge
coaChallenge :: Challenge,
CredentialOptions 'Authentication -> Maybe Timeout
coaTimeout :: Maybe Timeout,
CredentialOptions 'Authentication -> Maybe RpId
coaRpId :: Maybe RpId,
CredentialOptions 'Authentication -> [CredentialDescriptor]
coaAllowCredentials :: [CredentialDescriptor],
CredentialOptions 'Authentication -> UserVerificationRequirement
coaUserVerification :: UserVerificationRequirement,
CredentialOptions 'Authentication
-> Maybe AuthenticationExtensionsClientInputs
coaExtensions :: Maybe AuthenticationExtensionsClientInputs
} ->
CredentialOptions 'Authentication
deriving instance Eq (CredentialOptions c)
deriving instance Show (CredentialOptions c)
instance ToJSON (CredentialOptions c) where
toJSON :: CredentialOptions c -> Value
toJSON CredentialOptionsRegistration {[CredentialDescriptor]
[CredentialParameters]
Maybe AuthenticatorSelectionCriteria
Maybe AuthenticationExtensionsClientInputs
Maybe Timeout
CredentialUserEntity
CredentialRpEntity
Challenge
AttestationConveyancePreference
corChallenge :: CredentialOptions 'Registration -> Challenge
corAuthenticatorSelection :: CredentialOptions 'Registration
-> Maybe AuthenticatorSelectionCriteria
corPubKeyCredParams :: CredentialOptions 'Registration -> [CredentialParameters]
corUser :: CredentialOptions 'Registration -> CredentialUserEntity
corRp :: CredentialOptions 'Registration -> CredentialRpEntity
corTimeout :: CredentialOptions 'Registration -> Maybe Timeout
corExcludeCredentials :: CredentialOptions 'Registration -> [CredentialDescriptor]
corAttestation :: CredentialOptions 'Registration -> AttestationConveyancePreference
corExtensions :: CredentialOptions 'Registration
-> Maybe AuthenticationExtensionsClientInputs
corRp :: CredentialRpEntity
corUser :: CredentialUserEntity
corChallenge :: Challenge
corPubKeyCredParams :: [CredentialParameters]
corTimeout :: Maybe Timeout
corExcludeCredentials :: [CredentialDescriptor]
corAuthenticatorSelection :: Maybe AuthenticatorSelectionCriteria
corAttestation :: AttestationConveyancePreference
corExtensions :: Maybe AuthenticationExtensionsClientInputs
..} =
[Pair] -> Value
object
[ Key
"tag" Key -> Value -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
.= Text -> Value
String Text
"CredentialOptionsRegistration",
Key
"corRp" Key -> CredentialRpEntity -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
.= CredentialRpEntity
corRp,
Key
"corUser" Key -> CredentialUserEntity -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
.= CredentialUserEntity
corUser,
Key
"corChallenge" Key -> Challenge -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
.= Challenge
corChallenge,
Key
"corPubKeyCredParams" Key -> [CredentialParameters] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
.= [CredentialParameters]
corPubKeyCredParams,
Key
"corTimeout" Key -> Maybe Timeout -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
.= Maybe Timeout
corTimeout,
Key
"corExcludeCredentials" Key -> [CredentialDescriptor] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
.= [CredentialDescriptor]
corExcludeCredentials,
Key
"corAuthenticatorSelection" Key -> Maybe AuthenticatorSelectionCriteria -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
.= Maybe AuthenticatorSelectionCriteria
corAuthenticatorSelection,
Key
"corAttestation" Key -> AttestationConveyancePreference -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
.= AttestationConveyancePreference
corAttestation,
Key
"corExtensions" Key -> Maybe AuthenticationExtensionsClientInputs -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
.= Maybe AuthenticationExtensionsClientInputs
corExtensions
]
toJSON CredentialOptionsAuthentication {[CredentialDescriptor]
Maybe AuthenticationExtensionsClientInputs
Maybe Timeout
Maybe RpId
Challenge
UserVerificationRequirement
coaUserVerification :: CredentialOptions 'Authentication -> UserVerificationRequirement
coaChallenge :: CredentialOptions 'Authentication -> Challenge
coaAllowCredentials :: CredentialOptions 'Authentication -> [CredentialDescriptor]
coaTimeout :: CredentialOptions 'Authentication -> Maybe Timeout
coaRpId :: CredentialOptions 'Authentication -> Maybe RpId
coaExtensions :: CredentialOptions 'Authentication
-> Maybe AuthenticationExtensionsClientInputs
coaChallenge :: Challenge
coaTimeout :: Maybe Timeout
coaRpId :: Maybe RpId
coaAllowCredentials :: [CredentialDescriptor]
coaUserVerification :: UserVerificationRequirement
coaExtensions :: Maybe AuthenticationExtensionsClientInputs
..} =
[Pair] -> Value
object
[ Key
"tag" Key -> Value -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
.= Text -> Value
String Text
"CredentialOptionsAuthentication",
Key
"coaChallenge" Key -> Challenge -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
.= Challenge
coaChallenge,
Key
"coaTimeout" Key -> Maybe Timeout -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
.= Maybe Timeout
coaTimeout,
Key
"coaRpId" Key -> Maybe RpId -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
.= Maybe RpId
coaRpId,
Key
"coaAllowCredentials" Key -> [CredentialDescriptor] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
.= [CredentialDescriptor]
coaAllowCredentials,
Key
"coaUserVerification" Key -> UserVerificationRequirement -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
.= UserVerificationRequirement
coaUserVerification,
Key
"coaExtensions" Key -> Maybe AuthenticationExtensionsClientInputs -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
.= Maybe AuthenticationExtensionsClientInputs
coaExtensions
]
data CollectedClientData (c :: CeremonyKind) raw = CollectedClientData
{
forall (c :: CeremonyKind) (raw :: Bool).
CollectedClientData c raw -> Challenge
ccdChallenge :: Challenge,
forall (c :: CeremonyKind) (raw :: Bool).
CollectedClientData c raw -> Origin
ccdOrigin :: Origin,
forall (c :: CeremonyKind) (raw :: Bool).
CollectedClientData c raw -> Maybe Bool
ccdCrossOrigin :: Maybe Bool,
forall (c :: CeremonyKind) (raw :: Bool).
CollectedClientData c raw -> RawField raw
ccdRawData :: RawField raw
}
deriving (CollectedClientData c raw -> CollectedClientData c raw -> Bool
(CollectedClientData c raw -> CollectedClientData c raw -> Bool)
-> (CollectedClientData c raw -> CollectedClientData c raw -> Bool)
-> Eq (CollectedClientData c raw)
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
forall (c :: CeremonyKind) (raw :: Bool).
CollectedClientData c raw -> CollectedClientData c raw -> Bool
$c== :: forall (c :: CeremonyKind) (raw :: Bool).
CollectedClientData c raw -> CollectedClientData c raw -> Bool
== :: CollectedClientData c raw -> CollectedClientData c raw -> Bool
$c/= :: forall (c :: CeremonyKind) (raw :: Bool).
CollectedClientData c raw -> CollectedClientData c raw -> Bool
/= :: CollectedClientData c raw -> CollectedClientData c raw -> Bool
Eq, Int -> CollectedClientData c raw -> ShowS
[CollectedClientData c raw] -> ShowS
CollectedClientData c raw -> String
(Int -> CollectedClientData c raw -> ShowS)
-> (CollectedClientData c raw -> String)
-> ([CollectedClientData c raw] -> ShowS)
-> Show (CollectedClientData c raw)
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
forall (c :: CeremonyKind) (raw :: Bool).
Int -> CollectedClientData c raw -> ShowS
forall (c :: CeremonyKind) (raw :: Bool).
[CollectedClientData c raw] -> ShowS
forall (c :: CeremonyKind) (raw :: Bool).
CollectedClientData c raw -> String
$cshowsPrec :: forall (c :: CeremonyKind) (raw :: Bool).
Int -> CollectedClientData c raw -> ShowS
showsPrec :: Int -> CollectedClientData c raw -> ShowS
$cshow :: forall (c :: CeremonyKind) (raw :: Bool).
CollectedClientData c raw -> String
show :: CollectedClientData c raw -> String
$cshowList :: forall (c :: CeremonyKind) (raw :: Bool).
[CollectedClientData c raw] -> ShowS
showList :: [CollectedClientData c raw] -> ShowS
Show)
instance (SingI c) => ToJSON (CollectedClientData (c :: CeremonyKind) raw) where
toJSON :: CollectedClientData c raw -> Value
toJSON CollectedClientData {Maybe Bool
Origin
Challenge
RawField raw
ccdRawData :: forall (c :: CeremonyKind) (raw :: Bool).
CollectedClientData c raw -> RawField raw
ccdChallenge :: forall (c :: CeremonyKind) (raw :: Bool).
CollectedClientData c raw -> Challenge
ccdOrigin :: forall (c :: CeremonyKind) (raw :: Bool).
CollectedClientData c raw -> Origin
ccdCrossOrigin :: forall (c :: CeremonyKind) (raw :: Bool).
CollectedClientData c raw -> Maybe Bool
ccdChallenge :: Challenge
ccdOrigin :: Origin
ccdCrossOrigin :: Maybe Bool
ccdRawData :: RawField raw
..} =
[Pair] -> Value
object
[ Key
"webauthnKind" Key -> SCeremonyKind c -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
.= forall {k} (a :: k). SingI a => Sing a
forall (a :: CeremonyKind). SingI a => Sing a
sing @c,
Key
"ccdChallenge" Key -> Challenge -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
.= Challenge
ccdChallenge,
Key
"ccdOrigin" Key -> Origin -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
.= Origin
ccdOrigin,
Key
"ccdCrossOrigin" Key -> Maybe Bool -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
.= Maybe Bool
ccdCrossOrigin,
Key
"ccdRawData" Key -> RawField raw -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
.= RawField raw
ccdRawData
]
data AttestedCredentialData (c :: CeremonyKind) raw where
AttestedCredentialData ::
{
forall (raw :: Bool).
AttestedCredentialData 'Registration raw -> AAGUID
acdAaguid :: AAGUID,
forall (raw :: Bool).
AttestedCredentialData 'Registration raw -> CredentialId
acdCredentialId :: CredentialId,
forall (raw :: Bool).
AttestedCredentialData 'Registration raw -> CosePublicKey
acdCredentialPublicKey :: Cose.CosePublicKey,
forall (raw :: Bool).
AttestedCredentialData 'Registration raw -> RawField raw
acdCredentialPublicKeyBytes :: RawField raw
} ->
AttestedCredentialData 'Registration raw
NoAttestedCredentialData ::
AttestedCredentialData 'Authentication raw
deriving instance Eq (AttestedCredentialData c raw)
deriving instance Show (AttestedCredentialData c raw)
instance ToJSON (AttestedCredentialData c raw) where
toJSON :: AttestedCredentialData c raw -> Value
toJSON AttestedCredentialData {CosePublicKey
AAGUID
CredentialId
RawField raw
acdAaguid :: forall (raw :: Bool).
AttestedCredentialData 'Registration raw -> AAGUID
acdCredentialId :: forall (raw :: Bool).
AttestedCredentialData 'Registration raw -> CredentialId
acdCredentialPublicKey :: forall (raw :: Bool).
AttestedCredentialData 'Registration raw -> CosePublicKey
acdCredentialPublicKeyBytes :: forall (raw :: Bool).
AttestedCredentialData 'Registration raw -> RawField raw
acdAaguid :: AAGUID
acdCredentialId :: CredentialId
acdCredentialPublicKey :: CosePublicKey
acdCredentialPublicKeyBytes :: RawField raw
..} =
[Pair] -> Value
object
[ Key
"acdAaguid" Key -> AAGUID -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
.= AAGUID
acdAaguid,
Key
"acdCredentialId" Key -> CredentialId -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
.= CredentialId
acdCredentialId,
Key
"acdCredentialPublicKey" Key -> CosePublicKey -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
.= CosePublicKey
acdCredentialPublicKey,
Key
"acdCredentialPublicKeyBytes" Key -> RawField raw -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
.= RawField raw
acdCredentialPublicKeyBytes
]
toJSON NoAttestedCredentialData {} = Value
Null
data AuthenticatorData (c :: CeremonyKind) raw = AuthenticatorData
{
forall (c :: CeremonyKind) (raw :: Bool).
AuthenticatorData c raw -> RpIdHash
adRpIdHash :: RpIdHash,
forall (c :: CeremonyKind) (raw :: Bool).
AuthenticatorData c raw -> AuthenticatorDataFlags
adFlags :: AuthenticatorDataFlags,
forall (c :: CeremonyKind) (raw :: Bool).
AuthenticatorData c raw -> SignatureCounter
adSignCount :: SignatureCounter,
forall (c :: CeremonyKind) (raw :: Bool).
AuthenticatorData c raw -> AttestedCredentialData c raw
adAttestedCredentialData :: AttestedCredentialData c raw,
forall (c :: CeremonyKind) (raw :: Bool).
AuthenticatorData c raw -> Maybe AuthenticatorExtensionOutputs
adExtensions :: Maybe AuthenticatorExtensionOutputs,
forall (c :: CeremonyKind) (raw :: Bool).
AuthenticatorData c raw -> RawField raw
adRawData :: RawField raw
}
deriving (AuthenticatorData c raw -> AuthenticatorData c raw -> Bool
(AuthenticatorData c raw -> AuthenticatorData c raw -> Bool)
-> (AuthenticatorData c raw -> AuthenticatorData c raw -> Bool)
-> Eq (AuthenticatorData c raw)
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
forall (c :: CeremonyKind) (raw :: Bool).
AuthenticatorData c raw -> AuthenticatorData c raw -> Bool
$c== :: forall (c :: CeremonyKind) (raw :: Bool).
AuthenticatorData c raw -> AuthenticatorData c raw -> Bool
== :: AuthenticatorData c raw -> AuthenticatorData c raw -> Bool
$c/= :: forall (c :: CeremonyKind) (raw :: Bool).
AuthenticatorData c raw -> AuthenticatorData c raw -> Bool
/= :: AuthenticatorData c raw -> AuthenticatorData c raw -> Bool
Eq, Int -> AuthenticatorData c raw -> ShowS
[AuthenticatorData c raw] -> ShowS
AuthenticatorData c raw -> String
(Int -> AuthenticatorData c raw -> ShowS)
-> (AuthenticatorData c raw -> String)
-> ([AuthenticatorData c raw] -> ShowS)
-> Show (AuthenticatorData c raw)
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
forall (c :: CeremonyKind) (raw :: Bool).
Int -> AuthenticatorData c raw -> ShowS
forall (c :: CeremonyKind) (raw :: Bool).
[AuthenticatorData c raw] -> ShowS
forall (c :: CeremonyKind) (raw :: Bool).
AuthenticatorData c raw -> String
$cshowsPrec :: forall (c :: CeremonyKind) (raw :: Bool).
Int -> AuthenticatorData c raw -> ShowS
showsPrec :: Int -> AuthenticatorData c raw -> ShowS
$cshow :: forall (c :: CeremonyKind) (raw :: Bool).
AuthenticatorData c raw -> String
show :: AuthenticatorData c raw -> String
$cshowList :: forall (c :: CeremonyKind) (raw :: Bool).
[AuthenticatorData c raw] -> ShowS
showList :: [AuthenticatorData c raw] -> ShowS
Show, (forall x.
AuthenticatorData c raw -> Rep (AuthenticatorData c raw) x)
-> (forall x.
Rep (AuthenticatorData c raw) x -> AuthenticatorData c raw)
-> Generic (AuthenticatorData c raw)
forall x.
Rep (AuthenticatorData c raw) x -> AuthenticatorData c raw
forall x.
AuthenticatorData c raw -> Rep (AuthenticatorData c raw) x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
forall (c :: CeremonyKind) (raw :: Bool) x.
Rep (AuthenticatorData c raw) x -> AuthenticatorData c raw
forall (c :: CeremonyKind) (raw :: Bool) x.
AuthenticatorData c raw -> Rep (AuthenticatorData c raw) x
$cfrom :: forall (c :: CeremonyKind) (raw :: Bool) x.
AuthenticatorData c raw -> Rep (AuthenticatorData c raw) x
from :: forall x.
AuthenticatorData c raw -> Rep (AuthenticatorData c raw) x
$cto :: forall (c :: CeremonyKind) (raw :: Bool) x.
Rep (AuthenticatorData c raw) x -> AuthenticatorData c raw
to :: forall x.
Rep (AuthenticatorData c raw) x -> AuthenticatorData c raw
Generic)
deriving instance ToJSON (AuthenticatorData c raw)
data SomeAttestationType = forall k. SomeAttestationType (AttestationType k)
class
( Eq (AttStmt a),
Show (AttStmt a),
ToJSON (AttStmt a),
Typeable a,
Show a,
Exception (AttStmtVerificationError a)
) =>
AttestationStatementFormat a
where
type AttStmt a :: Type
asfIdentifier :: a -> Text
type AttStmtVerificationError a :: Type
asfVerify ::
a ->
HG.DateTime ->
AttStmt a ->
AuthenticatorData 'Registration 'True ->
ClientDataHash ->
Validation (NonEmpty (AttStmtVerificationError a)) SomeAttestationType
asfTrustAnchors ::
a ->
VerifiableAttestationType ->
X509.CertificateStore
asfDecode ::
a ->
HashMap Text CBOR.Term ->
Either Text (AttStmt a)
asfEncode ::
a ->
AttStmt a ->
CBOR.Term
data SomeAttestationStatementFormat
= forall a.
(AttestationStatementFormat a) =>
SomeAttestationStatementFormat a
newtype SupportedAttestationStatementFormats
=
SupportedAttestationStatementFormats (HashMap Text SomeAttestationStatementFormat)
deriving newtype (NonEmpty SupportedAttestationStatementFormats
-> SupportedAttestationStatementFormats
SupportedAttestationStatementFormats
-> SupportedAttestationStatementFormats
-> SupportedAttestationStatementFormats
(SupportedAttestationStatementFormats
-> SupportedAttestationStatementFormats
-> SupportedAttestationStatementFormats)
-> (NonEmpty SupportedAttestationStatementFormats
-> SupportedAttestationStatementFormats)
-> (forall b.
Integral b =>
b
-> SupportedAttestationStatementFormats
-> SupportedAttestationStatementFormats)
-> Semigroup SupportedAttestationStatementFormats
forall b.
Integral b =>
b
-> SupportedAttestationStatementFormats
-> SupportedAttestationStatementFormats
forall a.
(a -> a -> a)
-> (NonEmpty a -> a)
-> (forall b. Integral b => b -> a -> a)
-> Semigroup a
$c<> :: SupportedAttestationStatementFormats
-> SupportedAttestationStatementFormats
-> SupportedAttestationStatementFormats
<> :: SupportedAttestationStatementFormats
-> SupportedAttestationStatementFormats
-> SupportedAttestationStatementFormats
$csconcat :: NonEmpty SupportedAttestationStatementFormats
-> SupportedAttestationStatementFormats
sconcat :: NonEmpty SupportedAttestationStatementFormats
-> SupportedAttestationStatementFormats
$cstimes :: forall b.
Integral b =>
b
-> SupportedAttestationStatementFormats
-> SupportedAttestationStatementFormats
stimes :: forall b.
Integral b =>
b
-> SupportedAttestationStatementFormats
-> SupportedAttestationStatementFormats
Semigroup, Semigroup SupportedAttestationStatementFormats
SupportedAttestationStatementFormats
Semigroup SupportedAttestationStatementFormats
-> SupportedAttestationStatementFormats
-> (SupportedAttestationStatementFormats
-> SupportedAttestationStatementFormats
-> SupportedAttestationStatementFormats)
-> ([SupportedAttestationStatementFormats]
-> SupportedAttestationStatementFormats)
-> Monoid SupportedAttestationStatementFormats
[SupportedAttestationStatementFormats]
-> SupportedAttestationStatementFormats
SupportedAttestationStatementFormats
-> SupportedAttestationStatementFormats
-> SupportedAttestationStatementFormats
forall a.
Semigroup a -> a -> (a -> a -> a) -> ([a] -> a) -> Monoid a
$cmempty :: SupportedAttestationStatementFormats
mempty :: SupportedAttestationStatementFormats
$cmappend :: SupportedAttestationStatementFormats
-> SupportedAttestationStatementFormats
-> SupportedAttestationStatementFormats
mappend :: SupportedAttestationStatementFormats
-> SupportedAttestationStatementFormats
-> SupportedAttestationStatementFormats
$cmconcat :: [SupportedAttestationStatementFormats]
-> SupportedAttestationStatementFormats
mconcat :: [SupportedAttestationStatementFormats]
-> SupportedAttestationStatementFormats
Monoid)
singletonAttestationStatementFormat :: SomeAttestationStatementFormat -> SupportedAttestationStatementFormats
singletonAttestationStatementFormat :: SomeAttestationStatementFormat
-> SupportedAttestationStatementFormats
singletonAttestationStatementFormat someFormat :: SomeAttestationStatementFormat
someFormat@(SomeAttestationStatementFormat a
format) =
HashMap Text SomeAttestationStatementFormat
-> SupportedAttestationStatementFormats
SupportedAttestationStatementFormats (HashMap Text SomeAttestationStatementFormat
-> SupportedAttestationStatementFormats)
-> HashMap Text SomeAttestationStatementFormat
-> SupportedAttestationStatementFormats
forall a b. (a -> b) -> a -> b
$ Text
-> SomeAttestationStatementFormat
-> HashMap Text SomeAttestationStatementFormat
forall k v. Hashable k => k -> v -> HashMap k v
HashMap.singleton (a -> Text
forall a. AttestationStatementFormat a => a -> Text
asfIdentifier a
format) SomeAttestationStatementFormat
someFormat
lookupAttestationStatementFormat ::
Text ->
SupportedAttestationStatementFormats ->
Maybe SomeAttestationStatementFormat
lookupAttestationStatementFormat :: Text
-> SupportedAttestationStatementFormats
-> Maybe SomeAttestationStatementFormat
lookupAttestationStatementFormat Text
id (SupportedAttestationStatementFormats HashMap Text SomeAttestationStatementFormat
sasf) = HashMap Text SomeAttestationStatementFormat
sasf HashMap Text SomeAttestationStatementFormat
-> Text -> Maybe SomeAttestationStatementFormat
forall k v. (Eq k, Hashable k) => HashMap k v -> k -> Maybe v
!? Text
id
data AttestationObject raw = forall a.
(AttestationStatementFormat a) =>
AttestationObject
{
forall (raw :: Bool).
AttestationObject raw -> AuthenticatorData 'Registration raw
aoAuthData :: AuthenticatorData 'Registration raw,
()
aoFmt :: a,
()
aoAttStmt :: AttStmt a
}
instance Eq (AttestationObject raw) where
AttestationObject {aoAuthData :: forall (raw :: Bool).
AttestationObject raw -> AuthenticatorData 'Registration raw
aoAuthData = AuthenticatorData 'Registration raw
lAuthData, aoFmt :: ()
aoFmt = a
lFmt, aoAttStmt :: ()
aoAttStmt = AttStmt a
lAttStmt}
== :: AttestationObject raw -> AttestationObject raw -> Bool
== AttestationObject {aoAuthData :: forall (raw :: Bool).
AttestationObject raw -> AuthenticatorData 'Registration raw
aoAuthData = AuthenticatorData 'Registration raw
rAuthData, aoFmt :: ()
aoFmt = a
rFmt, aoAttStmt :: ()
aoAttStmt = AttStmt a
rAttStmt} =
AuthenticatorData 'Registration raw
lAuthData AuthenticatorData 'Registration raw
-> AuthenticatorData 'Registration raw -> Bool
forall a. Eq a => a -> a -> Bool
== AuthenticatorData 'Registration raw
rAuthData
Bool -> Bool -> Bool
&& case TypeRep a -> TypeRep a -> Maybe (a :~~: a)
forall k1 k2 (a :: k1) (b :: k2).
TypeRep a -> TypeRep b -> Maybe (a :~~: b)
eqTypeRep (a -> TypeRep a
forall a. Typeable a => a -> TypeRep a
typeOf a
lFmt) (a -> TypeRep a
forall a. Typeable a => a -> TypeRep a
typeOf a
rFmt) of
Just a :~~: a
HRefl -> AttStmt a
lAttStmt AttStmt a -> AttStmt a -> Bool
forall a. Eq a => a -> a -> Bool
== AttStmt a
AttStmt a
rAttStmt
Maybe (a :~~: a)
Nothing -> Bool
False
deriving instance Show (AttestationObject raw)
instance ToJSON (AttestationObject raw) where
toJSON :: AttestationObject raw -> Value
toJSON AttestationObject {a
AttStmt a
AuthenticatorData 'Registration raw
aoAttStmt :: ()
aoAuthData :: forall (raw :: Bool).
AttestationObject raw -> AuthenticatorData 'Registration raw
aoFmt :: ()
aoAuthData :: AuthenticatorData 'Registration raw
aoFmt :: a
aoAttStmt :: AttStmt a
..} =
[Pair] -> Value
object
[ Key
"aoAuthData" Key -> AuthenticatorData 'Registration raw -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
.= AuthenticatorData 'Registration raw
aoAuthData,
Key
"aoFmt" Key -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
.= a -> Text
forall a. AttestationStatementFormat a => a -> Text
asfIdentifier a
aoFmt,
Key
"aoAttStmt" Key -> AttStmt a -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
.= AttStmt a
aoAttStmt
]
data AuthenticatorResponse (c :: CeremonyKind) raw where
AuthenticatorResponseRegistration ::
{
forall (raw :: Bool).
AuthenticatorResponse 'Registration raw
-> CollectedClientData 'Registration raw
arrClientData :: CollectedClientData 'Registration raw,
forall (raw :: Bool).
AuthenticatorResponse 'Registration raw -> AttestationObject raw
arrAttestationObject :: AttestationObject raw,
forall (raw :: Bool).
AuthenticatorResponse 'Registration raw -> [AuthenticatorTransport]
arrTransports :: [AuthenticatorTransport]
} ->
AuthenticatorResponse 'Registration raw
AuthenticatorResponseAuthentication ::
{
forall (raw :: Bool).
AuthenticatorResponse 'Authentication raw
-> CollectedClientData 'Authentication raw
araClientData :: CollectedClientData 'Authentication raw,
forall (raw :: Bool).
AuthenticatorResponse 'Authentication raw
-> AuthenticatorData 'Authentication raw
araAuthenticatorData :: AuthenticatorData 'Authentication raw,
forall (raw :: Bool).
AuthenticatorResponse 'Authentication raw -> AssertionSignature
araSignature :: AssertionSignature,
forall (raw :: Bool).
AuthenticatorResponse 'Authentication raw -> Maybe UserHandle
araUserHandle :: Maybe UserHandle
} ->
AuthenticatorResponse 'Authentication raw
deriving instance Eq (AuthenticatorResponse c raw)
deriving instance Show (AuthenticatorResponse c raw)
instance ToJSON (AuthenticatorResponse c raw) where
toJSON :: AuthenticatorResponse c raw -> Value
toJSON AuthenticatorResponseRegistration {[AuthenticatorTransport]
AttestationObject raw
CollectedClientData 'Registration raw
arrClientData :: forall (raw :: Bool).
AuthenticatorResponse 'Registration raw
-> CollectedClientData 'Registration raw
arrAttestationObject :: forall (raw :: Bool).
AuthenticatorResponse 'Registration raw -> AttestationObject raw
arrTransports :: forall (raw :: Bool).
AuthenticatorResponse 'Registration raw -> [AuthenticatorTransport]
arrClientData :: CollectedClientData 'Registration raw
arrAttestationObject :: AttestationObject raw
arrTransports :: [AuthenticatorTransport]
..} =
[Pair] -> Value
object
[ Key
"arrClientData" Key -> CollectedClientData 'Registration raw -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
.= CollectedClientData 'Registration raw
arrClientData,
Key
"arrAttestationObject" Key -> AttestationObject raw -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
.= AttestationObject raw
arrAttestationObject
]
toJSON AuthenticatorResponseAuthentication {Maybe UserHandle
AuthenticatorData 'Authentication raw
CollectedClientData 'Authentication raw
AssertionSignature
araSignature :: forall (raw :: Bool).
AuthenticatorResponse 'Authentication raw -> AssertionSignature
araClientData :: forall (raw :: Bool).
AuthenticatorResponse 'Authentication raw
-> CollectedClientData 'Authentication raw
araAuthenticatorData :: forall (raw :: Bool).
AuthenticatorResponse 'Authentication raw
-> AuthenticatorData 'Authentication raw
araUserHandle :: forall (raw :: Bool).
AuthenticatorResponse 'Authentication raw -> Maybe UserHandle
araClientData :: CollectedClientData 'Authentication raw
araAuthenticatorData :: AuthenticatorData 'Authentication raw
araSignature :: AssertionSignature
araUserHandle :: Maybe UserHandle
..} =
[Pair] -> Value
object
[ Key
"araClientData" Key -> CollectedClientData 'Authentication raw -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
.= CollectedClientData 'Authentication raw
araClientData,
Key
"araAuthenticatorData" Key -> AuthenticatorData 'Authentication raw -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
.= AuthenticatorData 'Authentication raw
araAuthenticatorData,
Key
"araSignature" Key -> AssertionSignature -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
.= AssertionSignature
araSignature,
Key
"araUserHandle" Key -> Maybe UserHandle -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
.= Maybe UserHandle
araUserHandle
]
data Credential (c :: CeremonyKind) raw = Credential
{
forall (c :: CeremonyKind) (raw :: Bool).
Credential c raw -> CredentialId
cIdentifier :: CredentialId,
forall (c :: CeremonyKind) (raw :: Bool).
Credential c raw -> AuthenticatorResponse c raw
cResponse :: AuthenticatorResponse c raw,
forall (c :: CeremonyKind) (raw :: Bool).
Credential c raw -> AuthenticationExtensionsClientOutputs
cClientExtensionResults :: AuthenticationExtensionsClientOutputs
}
deriving (Credential c raw -> Credential c raw -> Bool
(Credential c raw -> Credential c raw -> Bool)
-> (Credential c raw -> Credential c raw -> Bool)
-> Eq (Credential c raw)
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
forall (c :: CeremonyKind) (raw :: Bool).
Credential c raw -> Credential c raw -> Bool
$c== :: forall (c :: CeremonyKind) (raw :: Bool).
Credential c raw -> Credential c raw -> Bool
== :: Credential c raw -> Credential c raw -> Bool
$c/= :: forall (c :: CeremonyKind) (raw :: Bool).
Credential c raw -> Credential c raw -> Bool
/= :: Credential c raw -> Credential c raw -> Bool
Eq, Int -> Credential c raw -> ShowS
[Credential c raw] -> ShowS
Credential c raw -> String
(Int -> Credential c raw -> ShowS)
-> (Credential c raw -> String)
-> ([Credential c raw] -> ShowS)
-> Show (Credential c raw)
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
forall (c :: CeremonyKind) (raw :: Bool).
Int -> Credential c raw -> ShowS
forall (c :: CeremonyKind) (raw :: Bool).
[Credential c raw] -> ShowS
forall (c :: CeremonyKind) (raw :: Bool).
Credential c raw -> String
$cshowsPrec :: forall (c :: CeremonyKind) (raw :: Bool).
Int -> Credential c raw -> ShowS
showsPrec :: Int -> Credential c raw -> ShowS
$cshow :: forall (c :: CeremonyKind) (raw :: Bool).
Credential c raw -> String
show :: Credential c raw -> String
$cshowList :: forall (c :: CeremonyKind) (raw :: Bool).
[Credential c raw] -> ShowS
showList :: [Credential c raw] -> ShowS
Show, (forall x. Credential c raw -> Rep (Credential c raw) x)
-> (forall x. Rep (Credential c raw) x -> Credential c raw)
-> Generic (Credential c raw)
forall x. Rep (Credential c raw) x -> Credential c raw
forall x. Credential c raw -> Rep (Credential c raw) x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
forall (c :: CeremonyKind) (raw :: Bool) x.
Rep (Credential c raw) x -> Credential c raw
forall (c :: CeremonyKind) (raw :: Bool) x.
Credential c raw -> Rep (Credential c raw) x
$cfrom :: forall (c :: CeremonyKind) (raw :: Bool) x.
Credential c raw -> Rep (Credential c raw) x
from :: forall x. Credential c raw -> Rep (Credential c raw) x
$cto :: forall (c :: CeremonyKind) (raw :: Bool) x.
Rep (Credential c raw) x -> Credential c raw
to :: forall x. Rep (Credential c raw) x -> Credential c raw
Generic)
deriving instance ToJSON (Credential c raw)