jwx

package
v1.9.87 Latest Latest
Warning

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

Go to latest
Published: Dec 23, 2022 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// DurationAccessToken #
	DurationAccessToken = 15 * time.Minute
	// DurationRefreshToken #
	DurationRefreshToken = 16 * time.Hour
)

Functions

func CheckElapsedToken added in v1.9.7

func CheckElapsedToken(withLock bool)

CheckElapsedToken #

func GetRefreshToken added in v1.9.7

func GetRefreshToken(accessToken string) (*jwt.JWToken, error)

GetRefreshToken #

func RawToken2Sub added in v1.9.6

func RawToken2Sub(headToken string) string

RawToken2Sub #

func TokenDelete added in v1.9.8

func TokenDelete(uid string)

TokenDelete #

func Validate added in v1.9.8

func Validate(headToken string, signKey string) (map[string]interface{}, error)

Validate #

Types

type LoginUser added in v1.9.7

type LoginUser struct {
	Pwd     string
	Expired int64
	App     string
	UUID    string
	URL     string

	Sub     string
	SignKey string
	Access  *jwt.JWToken
	Refresh *jwt.JWToken
}

LoginUser #

func CheckUserToken added in v1.9.8

func CheckUserToken(kk string) *LoginUser

CheckUserToken #

func GenerateTokenPair

func GenerateTokenPair(m *map[string]interface{}, key string, signKey string) (*LoginUser, error)

GenerateTokenPair #

type MemToken added in v1.9.8

type MemToken struct {
	App     string
	Expired int64
	UUID    string
	Refresh string
}

MemToken #

func GetMemToken added in v1.9.8

func GetMemToken(app string) []MemToken

GetMemToken #

Jump to

Keyboard shortcuts

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