jwt

package
v1.6.0 Latest Latest
Warning

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

Go to latest
Published: Jan 7, 2024 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Jwt

type Jwt struct {
	PrivateKey *rsa.PrivateKey
	PublicKey  *rsa.PublicKey
	Options    *Options
}

func NewRSA added in v1.2.5

func NewRSA(o *Options) *Jwt

func (*Jwt) AccessToken

func (jwt *Jwt) AccessToken(uid uint64, rid int32, iss string) (*string, error)

func (*Jwt) RefreshToken

func (jwt *Jwt) RefreshToken(uid uint64, rid int32, iss string) (*string, *string, error)

func (*Jwt) Validate

func (jwt *Jwt) Validate(t string) (*TokenClaimsV1, error)

type Options added in v1.2.5

type Options struct {
	PrivateKeyPath       string
	PublicKeyPath        string
	AccessTokenLifetime  int
	RefreshTokenLifetime int
}

type TokenClaimsV1 added in v1.4.3

type TokenClaimsV1 struct {
	UID    uint64
	RoleId int32
	Type   string
	Key    *string
	j.RegisteredClaims
}

Jump to

Keyboard shortcuts

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