mirror of
https://github.com/bjdgyc/anylink.git
synced 2025-08-08 12:24:30 +08:00
新增LDAP认证方式
This commit is contained in:
@@ -41,8 +41,24 @@ func TestGetGroupNames(t *testing.T) {
|
||||
err = SetGroup(&g6)
|
||||
ast.Nil(err)
|
||||
|
||||
authData = map[string]interface{}{
|
||||
"type": "ldap",
|
||||
"ldap": map[string]interface{}{
|
||||
"addr": "192.168.8.12:389",
|
||||
"tls": true,
|
||||
"bind_name": "userfind@abc.com",
|
||||
"bind_pwd": "afdbfdsafds",
|
||||
"base_dn": "dc=abc,dc=com",
|
||||
"search_attr": "sAMAccountName",
|
||||
"member_of": "cn=vpn,cn=user,dc=abc,dc=com",
|
||||
},
|
||||
}
|
||||
g7 := Group{Name: "g7", ClientDns: []ValData{{Val: "114.114.114.114"}}, Auth: authData}
|
||||
err = SetGroup(&g7)
|
||||
ast.Nil(err)
|
||||
|
||||
// 判断所有数据
|
||||
gAll := []string{"g1", "g2", "g3", "g4", "g5", "g6"}
|
||||
gAll := []string{"g1", "g2", "g3", "g4", "g5", "g6", "g7"}
|
||||
gs := GetGroupNames()
|
||||
for _, v := range gs {
|
||||
ast.Equal(true, utils.InArrStr(gAll, v))
|
||||
|
Reference in New Issue
Block a user