auth

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Oct 26, 2021 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GenerateToken

func GenerateToken(req GenerateTokenRequest) (string, error)

func NewCasbinEnforcer

func NewCasbinEnforcer() *casbin.Enforcer

NewCasbinEnforcer is

func NewCasbinEnforcerByDB

func NewCasbinEnforcerByDB(db *gorm.DB) *casbin.Enforcer

func VerifyToken

func VerifyToken(encodedToken string, secretKey string) (*jwt.Token, error)

Types

type CustomClaims

type CustomClaims struct {
	Activated bool
	Email     string
	ID        int64
	Role      string
	jwt.StandardClaims
}

type GenerateTokenRequest

type GenerateTokenRequest struct {
	Audience  string
	Issuer    string
	Subject   string
	ID        int64
	Email     string
	Activated bool
	Role      string
	SecretKey string
}

Jump to

Keyboard shortcuts

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