fix
This commit is contained in:
parent
760d9928dc
commit
9cb54041cd
|
@ -5,11 +5,21 @@ import (
|
||||||
"net/http"
|
"net/http"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
type LdapVerifyType string
|
||||||
|
|
||||||
|
const (
|
||||||
|
API_PATH LdapVerifyType = "api_path"
|
||||||
|
MENU_PATH LdapVerifyType = "menu_path"
|
||||||
|
)
|
||||||
|
|
||||||
type LdapOptions struct {
|
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")
|
token := r.Header.Get("Ldap-Authorization")
|
||||||
info, err := l.ParseJwtToken(token, l.jwtSecret)
|
info, err := l.ParseJwtToken(token, l.jwtSecret)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
@ -27,9 +37,5 @@ func (l *Ldap) VerifyAuthority(r *http.Request, options ...string) bool {
|
||||||
if len(options) == 0 {
|
if len(options) == 0 {
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
// todo 获取分组信息
|
|
||||||
/*for _, option := range options {
|
|
||||||
|
|
||||||
}*/
|
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user