mirror of
https://github.com/grafana/grafana.git
synced 2025-07-30 02:22:43 +08:00
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:
@ -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{
|
||||
|
Reference in New Issue
Block a user