ldap

package
v1.2.5 Latest Latest
Warning

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

Go to latest
Published: Mar 26, 2026 License: MIT Imports: 11 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BtrMembers added in v1.2.3

func BtrMembers(login, password, btr string) ([]string, error)

BtrMembers provides list of CLASSE users which associated with BTR

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)

GetBTRUsersFromGroup fetch BTR user information

func GetEmail added in v1.2.3

func GetEmail(login, password, name string) (string, error)

GetEmail lookup user's email for provided user name

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

func SearchBy added in v1.1.4

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

SearchBy provides LDAP search for our FOXDEN LDAP service

Types

type Cache

type Cache struct {
	Map     map[string]Entry
	Verbose int
	// 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

func (*Cache) SearchBy added in v1.1.4

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

SearchBy provides cached search results

type Entry

type Entry struct {
	DN        string
	Name      string
	Email     string
	Uid       string
	UidNumber int
	GidNumber int
	Groups    []string
	Btrs      []string
	Beamlines []string
	Expire    time.Time
	Foxdens   []string
}

Entry represents LDAP user entry

func Records added in v1.1.9

func Records(login, password, user, method string, verbose int) ([]Entry, error)

MultiSearch provides cached search results

func (*Entry) Belong

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

Belong checks if group belongs with LDAP entry

type UserInfo added in v1.2.2

type UserInfo struct {
	DN        string    `json:"DN"`
	Name      string    `json:"Name"`
	Email     string    `json:"Email"`
	Uid       string    `json:"Uid"`
	UidNumber int       `json:"UidNumber"`
	GidNumber int       `json:"GidNumber"`
	Groups    []string  `json:"Groups"`
	Btrs      []string  `json:"Btrs"`
	Beamlines []string  `json:"Beamlines"`
	Expire    time.Time `json:"Expire"`
	Foxdens   []string  `json:"Foxdens"`
}

UserInfo represents the structure returned by the user service.

Jump to

Keyboard shortcuts

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