paseto-0.1.1.1: Platform-Agnostic Security Tokens
Safe HaskellSafe-Inferred
LanguageHaskell2010

Crypto.Paseto.Token.Claims

Description

Collection of PASETO token claims.

It is recommended to import this module qualified since it contains functions which may conflict with those in Prelude and other container implementations such as Data.Map.

For example:

import Crypto.Paseto.Token.Claims (Claims)
import qualified Crypto.Paseto.Token.Claims as Claims
Synopsis

Claims type

data Claims Source #

Collection of Claims.

Instances

Instances details
FromJSON Claims Source # 
Instance details

Defined in Crypto.Paseto.Token.Claims

ToJSON Claims Source # 
Instance details

Defined in Crypto.Paseto.Token.Claims

Monoid Claims Source # 
Instance details

Defined in Crypto.Paseto.Token.Claims

Semigroup Claims Source # 
Instance details

Defined in Crypto.Paseto.Token.Claims

Show Claims Source # 
Instance details

Defined in Crypto.Paseto.Token.Claims

Eq Claims Source # 
Instance details

Defined in Crypto.Paseto.Token.Claims

Methods

(==) :: Claims -> Claims -> Bool #

(/=) :: Claims -> Claims -> Bool #

Construction

empty :: Claims Source #

Empty collection of claims.

singleton :: Claim -> Claims Source #

Construct a collection of claims with a single element.

Insertion

insert :: Claim -> Claims -> Claims Source #

Insert a Claim into a collection of Claims.

Note that if a claim with the same key is already present, it is replaced with the provided claim.

Deletion

delete :: ClaimKey -> Claims -> Claims Source #

Delete a claim from the collection.

Query

lookupIssuer :: Claims -> Maybe Issuer Source #

Lookup the issuer claim.

lookupSubject :: Claims -> Maybe Subject Source #

Lookup the subject claim.

lookupAudience :: Claims -> Maybe Audience Source #

Lookup the audience claim.

lookupExpiration :: Claims -> Maybe Expiration Source #

Lookup the expiration claim.

lookupNotBefore :: Claims -> Maybe NotBefore Source #

Lookup the "not before" claim.

lookupIssuedAt :: Claims -> Maybe IssuedAt Source #

Lookup the "issued at" claim.

lookupTokenIdentifier :: Claims -> Maybe TokenIdentifier Source #

Lookup the token identifier claim.

lookupCustom :: UnregisteredClaimKey -> Claims -> Maybe Value Source #

Lookup a custom unregistered claim.

null :: Claims -> Bool Source #

Whether a collection of claims is empty.

size :: Claims -> Int Source #

Size of a collection of claims.

Conversion

toList :: Claims -> [Claim] Source #

Convert a collection of Claims to a list of Claims.

fromList :: [Claim] -> Claims Source #

Convert a list of Claims to a collection of Claims.

Note that if the provided list contains more than one value for the same claim, the last value for that claim is retained.