MCPcopy Create free account
hub / github.com/Macmod/godap / getDN

Function getDN

tui/tree.go:806–822  ·  view source on GitHub ↗
(entry *ldap.Entry)

Source from the content-addressed store, hash-verified

804}
805
806func getDN(entry *ldap.Entry) string {
807 dn := entry.DN
808
809 if dn == "" {
810 dnIds := []string{"distinguishedName", "dn"}
811 for _, dnId := range dnIds {
812 currentId := entry.GetAttributeValue(dnId)
813
814 if currentId != "" {
815 dn = currentId
816 break
817 }
818 }
819 }
820
821 return strings.ToUpper(dn)
822}
823
824func dnPartToDomainName(dn string) string {
825 return strings.TrimPrefix(strings.ReplaceAll(dn, ",DC=", "."), "DC=")

Callers 1

getNodeNameFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected