1
0
Fork 0
mirror of https://github.com/documize/community.git synced 2025-08-01 03:25:25 +02:00

PRovide LDAP sync and authentication

This commit is contained in:
sauls8t 2018-09-04 17:19:26 +01:00
parent 63b17f9b88
commit 074eea3aeb
38 changed files with 567 additions and 499 deletions

View file

@ -88,14 +88,17 @@ func TestAuthenticate_PublicLDAP(t *testing.T) {
}
defer l.Close()
ok, err := authenticate(l, testConfigPublicLDAP, "newton", "password")
user, ok, err := authenticate(l, testConfigPublicLDAP, "newton", "password")
if err != nil {
t.Error("error during LDAP authentication: ", err.Error())
return
}
if !ok {
t.Error("failed LDAP authentication")
return
}
t.Log("Authenticated", user.Email)
}
func TestNotAuthenticate_PublicLDAP(t *testing.T) {
@ -106,13 +109,14 @@ func TestNotAuthenticate_PublicLDAP(t *testing.T) {
}
defer l.Close()
ok, err := authenticate(l, testConfigPublicLDAP, "junk", "junk")
_, ok, err := authenticate(l, testConfigPublicLDAP, "junk", "junk")
if err != nil {
t.Error("error during LDAP authentication: ", err.Error())
return
}
if ok {
t.Error("incorrect LDAP authentication")
return
}
t.Log("Not authenticated")