jwt

package
v0.0.0-...-1d80bfb Latest Latest
Warning

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

Go to latest
Published: Aug 25, 2024 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

type AuthJwt struct {
	JwtSecret           string
	TokenExpireDuration int64
	JwtIssuer           string
}

func GetAuthJwtImpl

func GetAuthJwtImpl() *AuthJwt

func (*AuthJwt) Authentication

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

func (*AuthJwt) GenerateToken

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

func (*AuthJwt) GenerateTokenWithExpired

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

func (*AuthJwt) RefreshToken

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