authentication

package
v0.0.0-...-f9738e6 Latest Latest
Warning

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

Go to latest
Published: Feb 6, 2025 License: MIT Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Init

func Init(conf *config.Authentication, watcher config.Watcher)

Types

type Authentication

type Authentication interface {
	AddWhitelist(path string, method string)
	RemoveWhitelist(path, method string)
	IsWhitelist(path string, method string) bool
	Auth(role, path, method string) bool
	GetRole(ctx context.Context) (string, error)
	Enforce() *casbin.Enforcer
	IsSkipRole(role string) bool
	SetAuth(req *http.Request, data string)
	ParseAuth(req context.Context, dst any) error
}

func Instance

func Instance() Authentication

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
JackTT - Gopher 🇻🇳