-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathconstants_and_vars.go
52 lines (41 loc) · 1.38 KB
/
constants_and_vars.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
// Copyright 2020-2024 NGR Softlab
package ldapper
////////////////////////////////////////////// Constants
const (
// searchFilterUserAD User search AD pattern
searchFilterUserAD = "(userPrincipalName=%s*)"
// searchFilterUserOpenLDAP User search openLdap pattern
searchFilterUserOpenLDAP = "(|(&(objectClass=person)(cn=%s))(structuralObjectClass=organizationalRole))"
// filterGroup department pattern
filterGroup = "(&(objectClass=organizationalUnit))"
// filterUserAD, FilterUserLinux user obj in ou pattern
filterUserAD = "(&(objectClass=User))"
filterUserOpenLDAP = "(&(objectClass=person))"
// DepthOfLdapSearch For get AD struct
DepthOfLdapSearch = 4
)
////////////////////////////////////////////// Attr templates
var (
testBaseDNAttr = []string{"cn"}
openLDAPUserAttrs = []string{"cn", "departmentNumber", "mobile", "mail", "title", "jpegPhoto"}
ADUserAttrs = []string{
"cn",
"department",
"mobile",
"mail",
"title",
"thumbnailPhoto",
"manager",
"telephoneNumber",
"streetAddress",
"l",
"physicalDeliveryOfficeName",
"postalCode",
"co",
"company",
}
openLDAPGroupUserAttrs = []string{"cn", "departmentNumber", "mail", "uid", "title"}
ADGroupUserAttrs = []string{"cn", "mail", "userPrincipalName", "title", "department"}
openLDAPGroupAttrs = []string{"ou"}
ADGroupAttrs = []string{"name", "ou", "distinguishedName"}
)