Documentation
¶
Overview ¶
Package jwtmint turns function results of one composite type into signed JWTs (PostGraphile's pgJwtType): a function returning schema.type yields an HS256 token string whose claims are the composite's fields; an exp field becomes the token expiry.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Mint ¶
func Mint(o Options, raw json.RawMessage, set bool) (json.RawMessage, error)
Mint signs one claims object (or, with set, each element of an array of them) rendered as JSON, returning the JSON string(s). JSON null stays null.
Types ¶
type Options ¶
type Options struct {
Schema string // pg schema of the composite, e.g. "public"
Type string // composite type name, e.g. "jwt"
Secret string
Issuer string
Audience string
}
Options selects the composite type and the signing parameters.
func (Options) MintsFunction ¶
func (o Options) MintsFunction(f *introspect.Function) bool
MintsFunction reports whether f's return type is the mint composite (or SETOF it).
Click to show internal directories.
Click to hide internal directories.