LDAP: improve POSIX support (#18235)

* LDAP: improve POSIX support

* Correctly abtain DN attributes result

* Allow more flexibility with comparison mapping between POSIX group & user

* Add devenv for POSIX LDAP server

* Correct the docs

Fixes #18140
This commit is contained in:
Oleg Gaidarenko
2019-07-24 12:49:18 +03:00
committed by GitHub
parent a4b0ccc138
commit 1e5fc76601
10 changed files with 187 additions and 36 deletions

View File

@ -105,6 +105,16 @@ func TestLDAPHelpers(t *testing.T) {
})
Convey("getAttribute()", t, func() {
Convey("Should get DN", func() {
entry := &ldap.Entry{
DN: "test",
}
result := getAttribute("dn", entry)
So(result, ShouldEqual, "test")
})
Convey("Should get username", func() {
value := []string{"roelgerrits"}
entry := &ldap.Entry{
@ -137,6 +147,16 @@ func TestLDAPHelpers(t *testing.T) {
})
Convey("getArrayAttribute()", t, func() {
Convey("Should get DN", func() {
entry := &ldap.Entry{
DN: "test",
}
result := getArrayAttribute("dn", entry)
So(result, ShouldResemble, []string{"test"})
})
Convey("Should get username", func() {
value := []string{"roelgerrits"}
entry := &ldap.Entry{