jwt

package
v1.7.2 Latest Latest
Warning

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

Go to latest
Published: Dec 29, 2022 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const BearerTokenPrefix = "Bearer"

Variables

Functions

This section is empty.

Types

type AuthJwt added in v1.1.0

type AuthJwt struct {
	JwtSecret           string
	TokenExpireDuration int64
	JwtIssuer           string
}

func GetAuthJwtImpl added in v1.1.0

func GetAuthJwtImpl() *AuthJwt

func (*AuthJwt) Authentication added in v1.1.0

func (a *AuthJwt) Authentication(token string) (user *v1beta1.UserInfo, err error)

func (*AuthJwt) GenerateToken added in v1.1.0

func (a *AuthJwt) GenerateToken(user *v1beta1.UserInfo) (string, error)

func (*AuthJwt) GenerateTokenWithExpired added in v1.1.0

func (a *AuthJwt) GenerateTokenWithExpired(user *v1beta1.UserInfo, expireDuration int64) (string, error)

func (*AuthJwt) RefreshToken added in v1.1.0

func (a *AuthJwt) RefreshToken(token string) (*v1beta1.UserInfo, string, error)

type Claims

type Claims struct {
	UserInfo v1beta1.UserInfo
	jwt.StandardClaims
}

Jump to

Keyboard shortcuts

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