Documentation ¶
Index ¶
- Variables
- type Group
- type Ldap
- func (l Ldap) AddGroup(group string, description string) error
- func (l *Ldap) AddUser(user string, pass string, gid int) error
- func (l Ldap) AddUserGroup(user string, group string) error
- func (l Ldap) ChangeGroupOpenPGPkey(group string, fingerprint string, expiry time.Time, key []byte, wkdHash string) error
- func (l Ldap) ChangeLocked(user string, locked Locked) error
- func (l Ldap) ChangePass(user string, oldpass string, newpass string) error
- func (l Ldap) ChangePassAdmin(user string, pass string) error
- func (l Ldap) ChangeRole(user string, role Role) error
- func (l Ldap) ChangeShell(user, shell string) error
- func (l Ldap) ChangeUserOpenPGPkey(user string, fingerprint string, expiry time.Time, key []byte, wkdHash string) error
- func (l Ldap) DelGroup(group string) error
- func (l Ldap) DelUser(user string) error
- func (l Ldap) DelUserGroup(user string, group string) error
- func (l Ldap) DeleteOpenPGPkey(dn string) error
- func (l Ldap) EmptyGroup(group string) error
- func (l Ldap) GetGID(gid int) (Group, error)
- func (l Ldap) GetGroup(name string) (Group, error)
- func (l Ldap) GetUser(name string) (User, error)
- func (l Ldap) GetUserRole(user string) Role
- func (l Ldap) InGroup(user string, group string) bool
- func (l *Ldap) Init() error
- func (l Ldap) IsUserPassUptodate(user string) bool
- func (l Ldap) ListGroups() ([]Group, error)
- func (l Ldap) ListUsers() ([]User, error)
- func (l Ldap) UpdateGroupDescription(group string, description string) error
- func (l Ldap) UserGroups(user string) ([]Group, error)
- func (l Ldap) ValidateUser(user string, pass string) (User, error)
- type Locked
- type OpenPGPkey
- type Role
- type User
Constants ¶
This section is empty.
Variables ¶
var ErrAlreadyExist = errors.New("Already exist an entry with this uid/cn")
var ErrNotFound = errors.New("Can't find the record in the ldap")
Functions ¶
This section is empty.
Types ¶
type Group ¶
type Group struct { DN string Name string GID int Description string Members []string OpenPGPkey *OpenPGPkey }
Group has the ldap data of the group
type Ldap ¶
type Ldap struct { Addr string Domain string Pass string HomePath string DC string MailDomain string RO bool }
Ldap configuration
func (Ldap) AddUserGroup ¶
AddUserGroup add user into the group members
func (Ldap) ChangeGroupOpenPGPkey ¶
func (l Ldap) ChangeGroupOpenPGPkey(group string, fingerprint string, expiry time.Time, key []byte, wkdHash string) error
ChangeGroupOpenPGPkey updates or sets a new OpenPGPkey for the group
func (Ldap) ChangeLocked ¶
ChangeLocked for the user
func (Ldap) ChangePass ¶
ChangePass changes logged in user's password
func (Ldap) ChangePassAdmin ¶
ChangePassAdmin changes user's password as admin (without knowing the old password)
func (Ldap) ChangeRole ¶
ChangeRole for the user
func (Ldap) ChangeShell ¶
ChangeShell for the user
func (Ldap) ChangeUserOpenPGPkey ¶
func (l Ldap) ChangeUserOpenPGPkey(user string, fingerprint string, expiry time.Time, key []byte, wkdHash string) error
ChangeUserOpenPGPkey updates or sets a new OpenPGPkey for the user
func (Ldap) DelUserGroup ¶
DelUserGroup removes the user from the group members
func (Ldap) DeleteOpenPGPkey ¶
func (Ldap) EmptyGroup ¶
EmptyGroup removes all the members from the group
func (Ldap) GetUserRole ¶
GetUserRole returns the role of the user
func (Ldap) IsUserPassUptodate ¶
IsUserPassUptodate will be true if the password for that user in ldap is using the latest crypto
func (Ldap) ListGroups ¶
ListGroups returns all groups in ldap with members
func (Ldap) UpdateGroupDescription ¶
UpdateGroupDescription set a new description for the group
func (Ldap) UserGroups ¶
UserGroups returns a list of groups the user is member of