Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Integer8ToTime ¶
Types ¶
type Ad ¶
type Ad struct {
Name string `ldap:"name"`
DistinguishedName string `ldap:"distinguishedName"`
DnsName string `ldap:"dNSHostName"`
Created time.Time `ldap:"whenCreated"`
LastLogon time.Time `ldap:"lastLogon"`
LastPassword time.Time `ldap:"pwdLastSet"`
Description []string `ldap:"description"`
Location string `ldap:"location"`
ManagedBy string `ldap:"managedBy"` // This is returned by the computer object and used to query the related user
ManagedByCn string `ldap:"cn"` // This is obtained by a second query for the managedBy user
ManagedByGid string `ldap:"siemens-gid"` // This is obtained by a second query for the managedBy user
ManagedByDepartment string `ldap:"department"` // This is obtained by a second query for the managedBy user
Os string `ldap:"operatingSystem"`
OsVersion string `ldap:"operatingSystemVersion"`
ServicePrincipalName []string `ldap:"servicePrincipalName"`
CriticalObject bool `ldap:"isCriticalSystemObject"`
}
func AdodbQuery ¶
AdodbQuery queries the given Active Directory service with implicit Windows authentication and returns a pointer to a populated Ad struct. ATTENTION: Make sure searchCn / ldapAddress are sanitized if taken from user input, to avoid SQL injection attacks!
func LdapQuery ¶
func LdapQuery( logger utils.Logger, searchCn string, ldapAddress string, ldapPort int, ldapDomain string, ldapUser string, ldapPassword string, disableGssapi bool, dialTimeout time.Duration, ) *Ad
LdapQuery queries the given Active Directory service with explicit authentication and returns a pointer to a populated Ad struct. ATTENTION: Make sure searchCn / ldapAddress are sanitized if taken from user input, to avoid SQL injection attacks!
type Cache ¶ added in v1.0.3
type Cache struct {
// contains filtered or unexported fields
}
Cache stores domain controller (dc) and key distribution centers (kdc) per domain/realm with TTL management.
func (*Cache) GetDc ¶ added in v1.0.3
GetDc returns a cached or newly discovered domain controller for a given domain. If a valid entry exists in the cache, it is returned. Otherwise, GetDc attempts to discover a new DC and caches it. If discovery fails but a stale cache entry existed, the stale entry is returned with a debug log.
func (*Cache) GetKdc ¶ added in v1.0.3
GetKdc returns cached or resolved key distribution center addresses for a given kerberos realm. It first checks the cache for valid entries. If none are found, or they are expired, it performs an SRV lookup to discover key distribution centers and caches the results. If SRV lookup fails but a stale cache entry exists, it falls back to the stale entry.