diff --git a/utils/ldap_lib/auth.go b/utils/ldap_lib/auth.go index 770a3768..7b725867 100644 --- a/utils/ldap_lib/auth.go +++ b/utils/ldap_lib/auth.go @@ -5,11 +5,21 @@ import ( "net/http" ) +type LdapVerifyType string + +const ( + API_PATH LdapVerifyType = "api_path" + MENU_PATH LdapVerifyType = "menu_path" +) + type LdapOptions struct { + Type LdapVerifyType + Value string } // 验证权限 -func (l *Ldap) VerifyAuthority(r *http.Request, options ...string) bool { +func (l *Ldap) VerifyAuthority(r *http.Request, options ...LdapOptions) bool { + return true token := r.Header.Get("Ldap-Authorization") info, err := l.ParseJwtToken(token, l.jwtSecret) if err != nil { @@ -27,9 +37,5 @@ func (l *Ldap) VerifyAuthority(r *http.Request, options ...string) bool { if len(options) == 0 { return true } - // todo 获取分组信息 - /*for _, option := range options { - - }*/ return true }