Documentation
¶
Overview ¶
Copyright 2020 NGR Softlab
Ldap_common - pack with common ldap functions (working with Active Directory).
Copyright 2020 NGR Softlab ¶
ldap_common - pack with ldap functions (supports ldap and openLdap now (tls & noTls)).
creator: everyone using: ldapper "github.com/NGRsoftlab/ngr-ldapper"
Index ¶
- Constants
- func RecursiveADSearch(prevLevel *[]GroupInfo, userName, passWord, host string, port interface{}, ...) *[]GroupInfo
- func TestBaseDn(userName, passWord, host string, port interface{}, baseDn string, ...) error
- func TryAccess(userName, passWord, host string, port interface{}, useTls bool) error
- type ADStruct
- type GroupInfo
- type ImportInfo
- type LdapConn
- type UserInfo
Constants ¶
View Source
const ( // User search AD pattern SearchFilterUserAd = "(userPrincipalName=%s*)" // User search openLdap pattern SearchFilterUserLinux = "(|(&(objectClass=person)(cn=%s))(structuralObjectClass=organizationalRole))" // department pattern FilterGroup = "(&(objectClass=organizationalUnit))" // user obj in ou pattern FilterUserAd = "(&(objectClass=User))" FilterUserLinux = "(&(objectClass=person))" // For get AD struct DepthOfLdapSearch = 4 )
Variables ¶
This section is empty.
Functions ¶
func RecursiveADSearch ¶
Types ¶
type GroupInfo ¶
type GroupInfo struct { Name string `json:"name"` DName string `json:"distinguishedName"` // long department name Ou string `json:"ou"` Has []GroupInfo `json:"has"` // list of subdirs (group children) }
Department obj from AD struct.
type ImportInfo ¶
type ImportInfo struct { Name interface{} `json:"name"` // full name (= cn) Login interface{} `json:"login"` Mail interface{} `json:"mail"` Title interface{} `json:"title"` Department interface{} `json:"department"` }
Short info for showing.
func ReadGroupUsers ¶
func ReadGroupUsers(userName, passWord, grp, host string, port interface{}, useTls, openLdap bool) ([]ImportInfo, error)
Reading all users from grp.
type LdapConn ¶ added in v1.0.6
type LdapConn struct { Connection *ldap.Conn // contains filtered or unexported fields }
/////////////////////////////////////////////
func NewLdapConn ¶
type UserInfo ¶
type UserInfo struct { CN interface{} `json:"cn"` // full name Department interface{} `json:"department"` Mobile interface{} `json:"mobile"` // mobile phone Mail interface{} `json:"mail"` // email Title interface{} `json:"title"` // user title Photo interface{} `json:"thumbnailPhoto"` // bad photo from AD Company interface{} `json:"company"` Address interface{} `json:"address"` City interface{} `json:"city"` Index interface{} `json:"index"` Country interface{} `json:"country"` Room interface{} `json:"room"` Phone interface{} `json:"phone"` Manager interface{} `json:"manager"` }
User info from AD struct.
Click to show internal directories.
Click to hide internal directories.