Documentation
¶
Index ¶
- Variables
- func IsWhiteList(req *restful.Request) bool
- func Log(req *restful.Request, resp *restful.Response, chain *restful.FilterChain)
- type AuditMiddleware
- type AuthMiddleware
- type BasicAuthUserLoader
- type BearerTokenUserLoader
- type FirewallMiddeleware
- type PermMiddleware
- type PrivateTokenUserLoader
- type UserGetterIface
Constants ¶
This section is empty.
Variables ¶
View Source
var WhitePrefixList = []string{
"/docs",
"/v2/login",
}
Functions ¶
func IsWhiteList ¶
func IsWhiteList(req *restful.Request) bool
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 ¶
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 ¶
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
Click to show internal directories.
Click to hide internal directories.