auth

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

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

Go to latest
Published: Oct 31, 2023 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	TokenTimeOut = time.Second * 3600
	RDB          = config.RDB
)

Functions

func AddPolicy

func AddPolicy(role string, res string, action string) bool

func CheckEnforce

func CheckEnforce(role string, res string, action string) bool

func DeletePolicy

func DeletePolicy(role string, res string, action string) bool

func GetToken

func GetToken(ctx context.Context, token string) model2.User

func KeyMatchFunc

func KeyMatchFunc(args ...interface{}) (interface{}, error)

自定义匹配函数 规则: (r.sub == p.sub && r.obj == p.obj) || (r.sub == p.sub && p.obj == '*')

func SetToken

func SetToken(ctx context.Context, token string, user model2.User) bool

Types

This section is empty.

Jump to

Keyboard shortcuts

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