4.0.0-beta.0

This commit is contained in:
wjqserver 2025-06-16 08:28:02 +08:00
parent 91c3ad7fd8
commit a4d324a361
38 changed files with 497 additions and 1428 deletions

View file

@ -4,10 +4,10 @@ import (
"fmt"
"ghproxy/config"
"github.com/cloudwego/hertz/pkg/app"
"github.com/infinite-iroha/touka"
)
func AuthParametersHandler(c *app.RequestContext, cfg *config.Config) (isValid bool, err error) {
func AuthParametersHandler(c *touka.Context, cfg *config.Config) (isValid bool, err error) {
if !cfg.Auth.Enabled {
return true, nil
}
@ -19,8 +19,6 @@ func AuthParametersHandler(c *app.RequestContext, cfg *config.Config) (isValid b
authToken = c.Query("auth_token")
}
logDebug("%s %s %s %s %s AUTH_TOKEN: %s", c.ClientIP(), c.Method(), string(c.Path()), c.Request.Header.UserAgent(), c.Request.Header.GetProtocol(), authToken)
if authToken == "" {
return false, fmt.Errorf("Auth token not found")
}