| Stability | experimental |
|---|---|
| Safe Haskell | Safe-Inferred |
| Language | Haskell2010 |
Crypto.WebAuthn.Encoding.Strings
Description
This module provides functions for encoding and decoding WebAuthn enum types between their Haskell types defined in Crypto.WebAuthn.Model.Types and their string forms.
Synopsis
- encodeCredentialType :: CredentialType -> Text
- decodeCredentialType :: Text -> Either Text CredentialType
- encodeUserVerificationRequirement :: UserVerificationRequirement -> Text
- decodeUserVerificationRequirement :: Text -> Either Text UserVerificationRequirement
- encodeAuthenticatorAttachment :: AuthenticatorAttachment -> Text
- decodeAuthenticatorAttachment :: Text -> Either Text AuthenticatorAttachment
- encodeResidentKeyRequirement :: ResidentKeyRequirement -> Text
- decodeResidentKeyRequirement :: Text -> Either Text ResidentKeyRequirement
- encodeAttestationConveyancePreference :: AttestationConveyancePreference -> Text
- decodeAttestationConveyancePreference :: Text -> Either Text AttestationConveyancePreference
- encodeAuthenticatorTransport :: AuthenticatorTransport -> Text
- decodeAuthenticatorTransport :: Text -> AuthenticatorTransport
Documentation
encodeCredentialType :: CredentialType -> Text Source #
(spec) Encodes a CredentialType to a string.
decodeCredentialType :: Text -> Either Text CredentialType Source #
(spec) Decodes a string into a CredentialType, returning Left when the string
isn't known to be an enum value.
encodeUserVerificationRequirement :: UserVerificationRequirement -> Text Source #
(spec) Encodes a UserVerificationRequirement to a string.
decodeUserVerificationRequirement :: Text -> Either Text UserVerificationRequirement Source #
(spec) Decodes a string into a UserVerificationRequirement, returning Left when
the string isn't known to be an enum value.
encodeAuthenticatorAttachment :: AuthenticatorAttachment -> Text Source #
(spec) Encodes a AuthenticatorAttachment to a string.
decodeAuthenticatorAttachment :: Text -> Either Text AuthenticatorAttachment Source #
(spec) Decodes a string into a AuthenticatorAttachment, returning Left when
the string isn't known to be an enum value.
encodeResidentKeyRequirement :: ResidentKeyRequirement -> Text Source #
(spec) Encodes a ResidentKeyRequirement to a string.
decodeResidentKeyRequirement :: Text -> Either Text ResidentKeyRequirement Source #
(spec) Decodes a string into a ResidentKeyRequirement, returning Left when
the string isn't known to be an enum value.
encodeAttestationConveyancePreference :: AttestationConveyancePreference -> Text Source #
(spec) Encodes a AttestationConveyancePreference to a string.
decodeAttestationConveyancePreference :: Text -> Either Text AttestationConveyancePreference Source #
(spec) Decodes a string into a AttestationConveyancePreference, returning Left when
the string isn't known to be an enum value.
encodeAuthenticatorTransport :: AuthenticatorTransport -> Text Source #
(spec) Encodes a AuthenticatorTransport to a string.
decodeAuthenticatorTransport :: Text -> AuthenticatorTransport Source #
(spec) Decodes a string into a AuthenticatorTransport, returning
AuthenticatorTransportUnknown when the string isn't known to be an enum
value. This is required so that relying parties can still store unknown
values, see
transports
and the clarification to that section
here