| Safe Haskell | Safe-Inferred |
|---|---|
| Language | Haskell2010 |
Crypto.Paseto.Token.Claim
Description
PASETO token claim.
Synopsis
- newtype Issuer = Issuer {}
- newtype Subject = Subject {}
- newtype Audience = Audience {
- unAudience :: Text
- newtype Expiration = Expiration {}
- renderExpiration :: Expiration -> Text
- newtype NotBefore = NotBefore {}
- renderNotBefore :: NotBefore -> Text
- newtype IssuedAt = IssuedAt {}
- renderIssuedAt :: IssuedAt -> Text
- newtype TokenIdentifier = TokenIdentifier {}
- data ClaimKey where
- pattern IssuerClaimKey :: ClaimKey
- pattern SubjectClaimKey :: ClaimKey
- pattern AudienceClaimKey :: ClaimKey
- pattern ExpirationClaimKey :: ClaimKey
- pattern NotBeforeClaimKey :: ClaimKey
- pattern IssuedAtClaimKey :: ClaimKey
- pattern TokenIdentifierClaimKey :: ClaimKey
- pattern CustomClaimKey :: UnregisteredClaimKey -> ClaimKey
- renderClaimKey :: ClaimKey -> Text
- parseClaimKey :: Text -> ClaimKey
- registeredClaimKeys :: Set ClaimKey
- data UnregisteredClaimKey
- mkUnregisteredClaimKey :: Text -> Maybe UnregisteredClaimKey
- renderUnregisteredClaimKey :: UnregisteredClaimKey -> Text
- data Claim
- claimKey :: Claim -> ClaimKey
- claimToPair :: Claim -> Pair
- claimFromJson :: Key -> Value -> Parser Claim
Claim value types
Issuer of a token.
Subject of a token.
Recipient for which a token is intended.
Constructors
| Audience | |
Fields
| |
newtype Expiration Source #
Time after which a token expires.
Constructors
| Expiration | |
Fields | |
Instances
| FromJSON Expiration Source # | |
Defined in Crypto.Paseto.Token.Claim | |
| ToJSON Expiration Source # | |
Defined in Crypto.Paseto.Token.Claim Methods toJSON :: Expiration -> Value # toEncoding :: Expiration -> Encoding # toJSONList :: [Expiration] -> Value # toEncodingList :: [Expiration] -> Encoding # omitField :: Expiration -> Bool # | |
| Show Expiration Source # | |
Defined in Crypto.Paseto.Token.Claim Methods showsPrec :: Int -> Expiration -> ShowS # show :: Expiration -> String # showList :: [Expiration] -> ShowS # | |
| Eq Expiration Source # | |
Defined in Crypto.Paseto.Token.Claim | |
renderExpiration :: Expiration -> Text Source #
Render an Expiration as Text.
Time from which a token should be considered valid.
Constructors
| NotBefore | |
Fields | |
Time at which a token was issued.
Constructors
| IssuedAt | |
Fields | |
newtype TokenIdentifier Source #
Token identifier.
Constructors
| TokenIdentifier | |
Fields | |
Instances
| FromJSON TokenIdentifier Source # | |
Defined in Crypto.Paseto.Token.Claim Methods parseJSON :: Value -> Parser TokenIdentifier # parseJSONList :: Value -> Parser [TokenIdentifier] # | |
| ToJSON TokenIdentifier Source # | |
Defined in Crypto.Paseto.Token.Claim Methods toJSON :: TokenIdentifier -> Value # toEncoding :: TokenIdentifier -> Encoding # toJSONList :: [TokenIdentifier] -> Value # toEncodingList :: [TokenIdentifier] -> Encoding # omitField :: TokenIdentifier -> Bool # | |
| Show TokenIdentifier Source # | |
Defined in Crypto.Paseto.Token.Claim Methods showsPrec :: Int -> TokenIdentifier -> ShowS # show :: TokenIdentifier -> String # showList :: [TokenIdentifier] -> ShowS # | |
| Eq TokenIdentifier Source # | |
Defined in Crypto.Paseto.Token.Claim Methods (==) :: TokenIdentifier -> TokenIdentifier -> Bool # (/=) :: TokenIdentifier -> TokenIdentifier -> Bool # | |
Claim key
Token claim key.
Bundled Patterns
| pattern IssuerClaimKey :: ClaimKey | |
| pattern SubjectClaimKey :: ClaimKey | |
| pattern AudienceClaimKey :: ClaimKey | |
| pattern ExpirationClaimKey :: ClaimKey | |
| pattern NotBeforeClaimKey :: ClaimKey | |
| pattern IssuedAtClaimKey :: ClaimKey | |
| pattern TokenIdentifierClaimKey :: ClaimKey | |
| pattern CustomClaimKey :: UnregisteredClaimKey -> ClaimKey |
registeredClaimKeys :: Set ClaimKey Source #
Registered claims as defined by the PASETO specification.
Unregistered claim key
data UnregisteredClaimKey Source #
Unregistered claim key.
Instances
| Show UnregisteredClaimKey Source # | |
Defined in Crypto.Paseto.Token.Claim Methods showsPrec :: Int -> UnregisteredClaimKey -> ShowS # show :: UnregisteredClaimKey -> String # showList :: [UnregisteredClaimKey] -> ShowS # | |
| Eq UnregisteredClaimKey Source # | |
Defined in Crypto.Paseto.Token.Claim Methods (==) :: UnregisteredClaimKey -> UnregisteredClaimKey -> Bool # (/=) :: UnregisteredClaimKey -> UnregisteredClaimKey -> Bool # | |
mkUnregisteredClaimKey :: Text -> Maybe UnregisteredClaimKey Source #
Construct an unregistered claim key.
If the provided Text key matches that of a registered claim
(registeredClaimKeys), this function will return Nothing.
renderUnregisteredClaimKey :: UnregisteredClaimKey -> Text Source #
Render an UnregisteredClaimKey as Text.
Claim
Token claim.
Constructors
| IssuerClaim !Issuer | |
| SubjectClaim !Subject | |
| AudienceClaim !Audience | |
| ExpirationClaim !Expiration | |
| NotBeforeClaim !NotBefore | |
| IssuedAtClaim !IssuedAt | |
| TokenIdentifierClaim !TokenIdentifier | |
| CustomClaim | |
Fields
| |
claimToPair :: Claim -> Pair Source #