filters

package
v1.21.5 Latest Latest
Warning

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

Go to latest
Published: Sep 7, 2022 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var WhitePrefixList = []string{
	"/docs",
	"/v2/login",
}

Functions

func IsWhiteList

func IsWhiteList(req *restful.Request) bool

func Log

func Log(req *restful.Request, resp *restful.Response, chain *restful.FilterChain)

Types

type AuditMiddleware

type AuditMiddleware struct{}

func NewAuditMiddleware

func NewAuditMiddleware() *AuditMiddleware

func (*AuditMiddleware) FilterFunc

func (a *AuditMiddleware) FilterFunc(req *restful.Request, resp *restful.Response, chain *restful.FilterChain)

type AuthMiddleware

type AuthMiddleware struct {
	// contains filtered or unexported fields
}

func NewAuthMiddleware

func NewAuthMiddleware(opts *jwt.Options) *AuthMiddleware

func (*AuthMiddleware) FilterFunc

func (l *AuthMiddleware) FilterFunc(req *restful.Request, resp *restful.Response, chain *restful.FilterChain)

type BasicAuthUserLoader

type BasicAuthUserLoader struct{}

BasicAuthUserLoader basic认证 eg: Authorization: Basic YWxhZGRpbjpvcGVuc2VzYW1l

func (*BasicAuthUserLoader) GetUser

func (l *BasicAuthUserLoader) GetUser(req *http.Request) (userData user.CommonUserIface, exist bool)

type BearerTokenUserLoader

type BearerTokenUserLoader struct {
	JWT *jwt.JWT
}

BearerTokenUserLoader bearer type

func (*BearerTokenUserLoader) GetUser

func (l *BearerTokenUserLoader) GetUser(req *http.Request) (u user.CommonUserIface, exist bool)

type FirewallMiddeleware

type FirewallMiddeleware struct{}

func (*FirewallMiddeleware) FilterFunc

func (f *FirewallMiddeleware) FilterFunc(req *restful.Request, resp *restful.Response, chain *restful.FilterChain)

type PermMiddleware

type PermMiddleware struct {
	DB *gorm.DB
}

func NewPermMiddleware

func NewPermMiddleware(db *gorm.DB) *PermMiddleware

func (*PermMiddleware) FilterFunc

func (p *PermMiddleware) FilterFunc(req *restful.Request, resp *restful.Response, chain *restful.FilterChain)

type PrivateTokenUserLoader

type PrivateTokenUserLoader struct{}

PrivateTokenUserLoader private-token

func (*PrivateTokenUserLoader) GetUser

func (l *PrivateTokenUserLoader) GetUser(req *http.Request) (u user.CommonUserIface, exist bool)

type UserGetterIface

type UserGetterIface interface {
	GetUser(req *http.Request) (u user.CommonUserIface, exist bool)
}

UserGetterIface

Jump to

Keyboard shortcuts

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