ldap

package
v1.0.6 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 13, 2026 License: MIT Imports: 10 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetBTR added in v1.0.1

func GetBTR(val string) string

GetBTR extracts BTR value from given user DN value

func GetBTRUsersFromGroup added in v1.0.1

func GetBTRUsersFromGroup(
	ldapURL, login, password, baseDN, groupCN string, recursionLevel, verbose int,
) ([]string, error)

func GetGroups added in v0.9.1

func GetGroups(ldapURL, login, password, baseDN string) ([]string, error)

GetGroups queries LDAP and returns all group CNs

func GetUsers added in v0.9.1

func GetUsers(ldapURL, login, password, baseDN string) ([]string, error)

GetUsers queries LDAP and returns all user CNs

func Search(ldapURL, login, password, baseDN, user string, attributes []string) (*ldap.SearchResult, error)

Search provides LDAP search for our FOXDEN LDAP service

Types

type Cache

type Cache struct {
	Map map[string]Entry
	// contains filtered or unexported fields
}

Cache represent LDAP cache

func (*Cache) Search

func (c *Cache) Search(login, password, user string) (Entry, error)

Search provides cached search results

type Entry

type Entry struct {
	DN        string
	Groups    []string
	Btrs      []string
	Beamlines []string
	Expire    time.Time
	Foxdens   []string
}

Entry represents LDAP user entry

func (*Entry) Belong

func (e *Entry) Belong(group string) bool

Belong checks if group belongs with LDAP entry

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL