libjwt-typed-0.2: A Haskell implementation of JSON Web Token (JWT)
Safe HaskellNone
LanguageHaskell2010
Extensions
  • UndecidableInstances
  • MonoLocalBinds
  • ScopedTypeVariables
  • TypeFamilies
  • DataKinds
  • TypeSynonymInstances
  • FlexibleInstances
  • ConstrainedClassMethods
  • MultiParamTypeClasses
  • KindSignatures
  • ExplicitNamespaces
  • ExplicitForAll

Libjwt.Encoding

Description

JWT encoding definition

This module can be considered internal to the library Users should never need to implement the Encode typeclass or use any of the exported functions or types directly. You'll only need to know of Encode typeclass if you want to write a function polymorphic in the type of payloads.

If you want to extend the types supported by the library, see Libjwt.Classes

Synopsis

Documentation

class Encode c where Source #

Definition of claims encoding.

The only use for the user is probably to write a function that is polymorphic in the payload type.

Methods

encode :: c -> JwtT -> EncodeResult Source #

Perform the encoding as impure action

Instances

Instances details
Encode Typ Source # 
Instance details

Defined in Libjwt.Header

Encode Jti Source # 
Instance details

Defined in Libjwt.RegisteredClaims

Encode Iat Source # 
Instance details

Defined in Libjwt.RegisteredClaims

Encode Nbf Source # 
Instance details

Defined in Libjwt.RegisteredClaims

Encode Exp Source # 
Instance details

Defined in Libjwt.RegisteredClaims

Encode Aud Source # 
Instance details

Defined in Libjwt.RegisteredClaims

Encode Sub Source # 
Instance details

Defined in Libjwt.RegisteredClaims

Encode Iss Source # 
Instance details

Defined in Libjwt.RegisteredClaims

(ClaimEncoder a, KnownSymbol name, KnownNamespace ns, Encode (PrivateClaims tl ns)) => Encode (PrivateClaims ((name ->> a) ': tl) ns) Source # 
Instance details

Defined in Libjwt.PrivateClaims

Methods

encode :: PrivateClaims ((name ->> a) ': tl) ns -> JwtT -> EncodeResult Source #

Encode (PrivateClaims Empty ns) Source # 
Instance details

Defined in Libjwt.PrivateClaims

Encode (PrivateClaims pc ns) => Encode (Payload pc ns) Source # 
Instance details

Defined in Libjwt.Payload

Methods

encode :: Payload pc ns -> JwtT -> EncodeResult Source #

class ClaimEncoder t where Source #

Low-level definition of JWT claims encoding.

Methods

encodeClaim :: String -> t -> JwtT -> EncodeResult Source #

Given a pointer to jwt_t, mutate the structure it points to to encode the value as a named claim It relies on the functions exported from Libjwt.FFI.Jwt to perform an impure effect of encoding

Instances

Instances details
(EncoderDef a ~ ty, ClaimEncoder' ty a) => ClaimEncoder a Source # 
Instance details

Defined in Libjwt.Encoding

nullEncode :: b -> EncodeResult Source #

Do not perform any action. It is used to encode things like empty lists or Nothing