jwt

package
v1.13.7 Latest Latest
Warning

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

Go to latest
Published: Sep 14, 2023 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	NowFunc = time.Now
)

Functions

This section is empty.

Types

type Claims

type Claims struct {
	Id       string `json:"jti,omitempty"`
	Issuer   string `json:"iss,omitempty"`
	Subject  string `json:"sub,omitempty"`
	IssuedAt int64  `json:"iat,omitempty"`

	Extra map[string]any `json:"ext,omitempty"`
}

func FromContext

func FromContext(ctx context.Context) (*Claims, error)

func New

func New(id, iss, sub string, iat time.Time, ext map[string]any) *Claims

func Parse

func Parse(raw string, skipValidate ...bool) (*Claims, error)

func (*Claims) Sign

func (c *Claims) Sign() (string, error)

func (*Claims) Valid

func (c *Claims) Valid() error

func (*Claims) WithContext

func (c *Claims) WithContext(ctx context.Context) context.Context

Jump to

Keyboard shortcuts

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