mirror of
https://github.com/goauthentik/authentik
synced 2026-04-27 18:07:15 +02:00
* packages/client-go: init Signed-off-by: Marc 'risson' Schmitt <marc.schmitt@risson.space> * format Signed-off-by: Jens Langhammer <jens@goauthentik.io> * remove mod/sum Signed-off-by: Jens Langhammer <jens@goauthentik.io> * fix translate Signed-off-by: Jens Langhammer <jens@goauthentik.io> * no go replace Signed-off-by: Jens Langhammer <jens@goauthentik.io> * update rust makefile with pwd Signed-off-by: Marc 'risson' Schmitt <marc.schmitt@risson.space> * fix build Signed-off-by: Jens Langhammer <jens@goauthentik.io> * fix docs Signed-off-by: Jens Langhammer <jens@goauthentik.io> * don't need a version ig? Signed-off-by: Jens Langhammer <jens@goauthentik.io> * exclude go client from cspell Signed-off-by: Jens Langhammer <jens@goauthentik.io> * fix main docker build Signed-off-by: Jens Langhammer <jens@goauthentik.io> --------- Signed-off-by: Marc 'risson' Schmitt <marc.schmitt@risson.space> Signed-off-by: Jens Langhammer <jens@goauthentik.io> Co-authored-by: Jens Langhammer <jens@goauthentik.io>
28 lines
591 B
Go
28 lines
591 B
Go
package ldap_test
|
|
|
|
import (
|
|
"testing"
|
|
|
|
"beryju.io/ldap"
|
|
"github.com/stretchr/testify/assert"
|
|
api "goauthentik.io/packages/client-go"
|
|
)
|
|
|
|
func Test_UserEntry(t *testing.T) {
|
|
pi := ProviderInstance()
|
|
u := api.User{
|
|
Username: "foo",
|
|
Name: "bar",
|
|
}
|
|
entry := pi.UserEntry(u)
|
|
assert.Equal(t, "cn=foo,ou=users,dc=ldap,dc=goauthentik,dc=io", entry.DN)
|
|
assert.Contains(t, entry.Attributes, &ldap.EntryAttribute{
|
|
Name: "cn",
|
|
Values: []string{u.Username},
|
|
})
|
|
assert.Contains(t, entry.Attributes, &ldap.EntryAttribute{
|
|
Name: "displayName",
|
|
Values: []string{u.Name},
|
|
})
|
|
}
|