优化鉴权

This commit is contained in:
GoEdgeLab
2022-08-30 11:24:07 +08:00
parent 606e8721b5
commit 6348e97214
11 changed files with 3526 additions and 3384 deletions

View File

@@ -7,8 +7,17 @@ import "net/http"
// HTTPAuthMethodInterface HTTP认证接口定义
type HTTPAuthMethodInterface interface {
// Init 初始化
Init(params map[string]interface{}) error
Init(params map[string]any) error
// MatchRequest 是否匹配请求
MatchRequest(req *http.Request) bool
// Filter 过滤
Filter(req *http.Request, subReqFunc func(subReq *http.Request) (status int, err error), formatter func(string) string) (bool, error)
Filter(req *http.Request, subReqFunc func(subReq *http.Request) (status int, err error), formatter func(string) string) (ok bool, newURI string, uriChanged bool, err error)
// SetExts 设置扩展名
SetExts(exts []string)
// SetDomains 设置域名
SetDomains(domains []string)
}