jwt

package
v0.0.0-...-4e7cb45 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 7, 2023 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrInvalidToken = errors.New("parsed token is invalid")

Functions

func Create

func Create(publicClaims PublicClaims, options ...option) (string, error)

func CreateAccessCookie

func CreateAccessCookie(publicClaims PublicClaims, options ...option) (http.Cookie, error)

func CreateCookie

func CreateCookie(name string, publicClaims PublicClaims, options ...option) (http.Cookie, error)

func ForActor

func ForActor(id string) option

func WithExpiration

func WithExpiration(time time.Time) option

Types

type Claims

type Claims struct {
	Role    string
	Subject string
	Pii     []byte
}

func Parse

func Parse(raw string) (Claims, error)

type PublicClaims

type PublicClaims struct {
	Role string `json:"rol,omitempty"`
	PII  []byte `json:"pii,omitempty"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL