jwt

package
v1.10.3 Latest Latest
Warning

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

Go to latest
Published: Apr 26, 2021 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultSecretJWT           = "horusec-secret"
	WarningDefaultJWTSecretKey = "{JWT-INSECURE} horusec JWT secret key is the default one, for security " +
		"reasons please replace it for a secure value, secret key environment variable name --> {HORUSEC_JWT_SECRET_KEY}"
)

Variables

This section is empty.

Functions

func AuthMiddleware

func AuthMiddleware(next http.Handler) http.Handler

func CreateRefreshToken

func CreateRefreshToken() string

func CreateToken

func CreateToken(account *authEntities.Account, permissions []string) (string, time.Time, error)

func DecodeToken

func DecodeToken(tokenString string) (*dto.ClaimsJWT, error)

func GetAccountIDByJWTToken

func GetAccountIDByJWTToken(token string) (uuid.UUID, error)

Types

This section is empty.

Jump to

Keyboard shortcuts

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