mirror of
https://github.com/WJQSERVER-STUDIO/ghproxy.git
synced 2026-02-03 08:11:11 +08:00
dix auth checker
This commit is contained in:
parent
005a4543d4
commit
d6d54b222f
1 changed files with 9 additions and 7 deletions
|
|
@ -106,6 +106,7 @@ func NoRouteHandler(cfg *config.Config, limiter *rate.RateLimiter, iplimiter *ra
|
||||||
}
|
}
|
||||||
|
|
||||||
// 鉴权
|
// 鉴权
|
||||||
|
if cfg.Auth.Enabled {
|
||||||
var authcheck bool
|
var authcheck bool
|
||||||
authcheck, err = auth.AuthHandler(ctx, c, cfg)
|
authcheck, err = auth.AuthHandler(ctx, c, cfg)
|
||||||
if !authcheck {
|
if !authcheck {
|
||||||
|
|
@ -114,6 +115,7 @@ func NoRouteHandler(cfg *config.Config, limiter *rate.RateLimiter, iplimiter *ra
|
||||||
logWarning("%s %s %s %s %s Auth-Error: %v", c.ClientIP(), c.Method(), rawPath, c.Request.Header.UserAgent(), c.Request.Header.GetProtocol(), err)
|
logWarning("%s %s %s %s %s Auth-Error: %v", c.ClientIP(), c.Method(), rawPath, c.Request.Header.UserAgent(), c.Request.Header.GetProtocol(), err)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// IP METHOD URL USERAGENT PROTO MATCHES
|
// IP METHOD URL USERAGENT PROTO MATCHES
|
||||||
logDebug("%s %s %s %s %s Matched: %v", c.ClientIP(), c.Method(), rawPath, c.Request.Header.UserAgent(), c.Request.Header.GetProtocol(), matcher)
|
logDebug("%s %s %s %s %s Matched: %v", c.ClientIP(), c.Method(), rawPath, c.Request.Header.UserAgent(), c.Request.Header.GetProtocol(), matcher)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue