Documentation
¶
Overview ¶
Package users support all common action on the system for user handling.
Index ¶
- Variables
- type Config
- type Manager
- func (m *Manager) AllGroups() ([]types.GroupEntry, error)
- func (m *Manager) AllShadows() ([]types.ShadowEntry, error)
- func (m *Manager) AllUsers() ([]types.UserEntry, error)
- func (m *Manager) BrokerForUser(username string) (string, error)
- func (m *Manager) GroupByID(gid uint32) (types.GroupEntry, error)
- func (m *Manager) GroupByName(groupname string) (types.GroupEntry, error)
- func (m *Manager) RegisterUserPreAuth(name string) (uint32, error)
- func (m *Manager) ShadowByName(username string) (types.ShadowEntry, error)
- func (m *Manager) Stop() error
- func (m *Manager) UpdateBrokerForUser(username, brokerID string) error
- func (m *Manager) UpdateUser(u types.UserInfo) (err error)
- func (m *Manager) UserByID(uid uint32) (types.UserEntry, error)
- func (m *Manager) UserByName(username string) (types.UserEntry, error)
- type NoDataFoundError
- type Option
Constants ¶
This section is empty.
Variables ¶
var DefaultConfig = Config{
UIDMin: 1000000000,
UIDMax: 1999999999,
GIDMin: 1000000000,
GIDMax: 1999999999,
}
DefaultConfig is the default configuration for the user manager.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct {
UIDMin uint32 `mapstructure:"uid_min" yaml:"uid_min"`
UIDMax uint32 `mapstructure:"uid_max" yaml:"uid_max"`
GIDMin uint32 `mapstructure:"gid_min" yaml:"gid_min"`
GIDMax uint32 `mapstructure:"gid_max" yaml:"gid_max"`
}
Config is the configuration for the user manager.
type Manager ¶
type Manager struct {
// contains filtered or unexported fields
}
Manager is the manager for any user related operation.
func NewManager ¶
NewManager creates a new user manager.
func (*Manager) AllGroups ¶
func (m *Manager) AllGroups() ([]types.GroupEntry, error)
AllGroups returns all groups.
func (*Manager) AllShadows ¶
func (m *Manager) AllShadows() ([]types.ShadowEntry, error)
AllShadows returns all shadow entries.
func (*Manager) BrokerForUser ¶
BrokerForUser returns the broker ID for the given user.
func (*Manager) GroupByID ¶
func (m *Manager) GroupByID(gid uint32) (types.GroupEntry, error)
GroupByID returns the group information for the given group ID.
func (*Manager) GroupByName ¶
func (m *Manager) GroupByName(groupname string) (types.GroupEntry, error)
GroupByName returns the group information for the given group name.
func (*Manager) RegisterUserPreAuth ¶ added in v0.4.1
RegisterUserPreAuth registers a temporary user with a unique UID in our NSS handler (in memory, not in the database).
The temporary user record is removed when UpdateUser is called with the same username.
func (*Manager) ShadowByName ¶
func (m *Manager) ShadowByName(username string) (types.ShadowEntry, error)
ShadowByName returns the shadow information for the given user name.
func (*Manager) UpdateBrokerForUser ¶
UpdateBrokerForUser updates the broker ID for the given user.
func (*Manager) UpdateUser ¶
UpdateUser updates the user information in the db.
type NoDataFoundError ¶
type NoDataFoundError = db.NoDataFoundError
NoDataFoundError is the error returned when no entry is found in the db.
type Option ¶ added in v0.4.1
type Option func(*options)
Option is a function that allows changing some of the default behaviors of the manager.
func WithIDGenerator ¶ added in v0.4.1
func WithIDGenerator(g tempentries.IDGenerator) Option
WithIDGenerator makes the manager use a specific ID generator. This option is only useful in tests.
Directories
¶
| Path | Synopsis |
|---|---|
|
Package db handles transaction with an underlying database to store user and group information.
|
Package db handles transaction with an underlying database to store user and group information. |
|
bbolt
Package bbolt handles transaction with the deprecated bbolt database
|
Package bbolt handles transaction with the deprecated bbolt database |
|
Package idgenerator provides an ID generator that generates UIDs and GIDs in a specific range.
|
Package idgenerator provides an ID generator that generates UIDs and GIDs in a specific range. |
|
Package localentries provides functions to access the local user and group database.
|
Package localentries provides functions to access the local user and group database. |
|
testutils
Package localgrouptestutils export users test functionalities used by other packages to change cmdline and group file.
|
Package localgrouptestutils export users test functionalities used by other packages to change cmdline and group file. |
|
Package userslocking implements locking of the local user and group files (/etc/passwd, /etc/groups, /etc/shadow, /etc/gshadow) via the libc lckpwdf() function.
|
Package userslocking implements locking of the local user and group files (/etc/passwd, /etc/groups, /etc/shadow, /etc/gshadow) via the libc lckpwdf() function. |
|
Package tempentries provides a temporary user and group records.
|
Package tempentries provides a temporary user and group records. |
|
Package userstestutils export db test functionalities used by other packages.
|
Package userstestutils export db test functionalities used by other packages. |
|
Package types provides types for the users package.
|
Package types provides types for the users package. |