Documentation
¶
Index ¶
- type Manager
- func (manager *Manager) Bind(ctx context.Context, dn, password string) (*schema.Object, error)
- func (manager *Manager) ChangePassword(ctx context.Context, dn, old string, new *string) (*schema.Object, error)
- func (manager *Manager) Connect() error
- func (manager *Manager) Create(ctx context.Context, dn string, attr url.Values) (*schema.Object, error)
- func (manager *Manager) CreateGroup(ctx context.Context, user string, attrs url.Values) (*schema.Object, error)
- func (manager *Manager) CreateUser(ctx context.Context, user string, attrs url.Values) (*schema.Object, error)
- func (manager *Manager) Delete(ctx context.Context, dn string) (*schema.Object, error)
- func (manager *Manager) DeleteGroup(ctx context.Context, group string) (*schema.Object, error)
- func (manager *Manager) DeleteUser(ctx context.Context, user string) (*schema.Object, error)
- func (ldap *Manager) Disconnect() error
- func (manager *Manager) Get(ctx context.Context, dn string) (*schema.Object, error)
- func (manager *Manager) GetGroup(ctx context.Context, group string) (*schema.Object, error)
- func (manager *Manager) GetUser(ctx context.Context, user string) (*schema.Object, error)
- func (ldap *Manager) Host() string
- func (manager *Manager) List(ctx context.Context, request schema.ObjectListRequest) (*schema.ObjectList, error)
- func (manager *Manager) ListAttributeTypes(ctx context.Context) ([]*schema.AttributeType, error)
- func (manager *Manager) ListGroups(ctx context.Context, request schema.ObjectListRequest) (*schema.ObjectList, error)
- func (manager *Manager) ListObjectClasses(ctx context.Context) ([]*schema.ObjectClass, error)
- func (manager *Manager) ListUsers(ctx context.Context, request schema.ObjectListRequest) (*schema.ObjectList, error)
- func (ldap *Manager) Port() int
- func (manager *Manager) Run(ctx context.Context) error
- func (manager *Manager) Update(ctx context.Context, dn string, attr url.Values) (*schema.Object, error)
- func (ldap *Manager) User() string
- func (manager *Manager) WhoAmI() (string, error)
- type Opt
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Manager ¶
LDAP manager
func NewManager ¶
func (*Manager) Bind ¶
Bind a user to check if they are authenticated, returns httpresponse.ErrNotAuthorized if the credentials are invalid
func (*Manager) ChangePassword ¶
func (manager *Manager) ChangePassword(ctx context.Context, dn, old string, new *string) (*schema.Object, error)
Change a password for a user. If the new password is empty, then the password is reset to a new random password and returned. The old password is required for the change if the ldap connection is not bound to the admin user.
func (*Manager) Create ¶
func (manager *Manager) Create(ctx context.Context, dn string, attr url.Values) (*schema.Object, error)
Create an object
func (*Manager) CreateGroup ¶ added in v1.5.13
func (manager *Manager) CreateGroup(ctx context.Context, user string, attrs url.Values) (*schema.Object, error)
Create a group
func (*Manager) CreateUser ¶ added in v1.5.13
func (manager *Manager) CreateUser(ctx context.Context, user string, attrs url.Values) (*schema.Object, error)
Create a user
func (*Manager) DeleteGroup ¶ added in v1.5.13
Delete a group
func (*Manager) DeleteUser ¶ added in v1.5.13
Delete a user
func (*Manager) Disconnect ¶
Disconnect from the LDAP server
func (*Manager) List ¶
func (manager *Manager) List(ctx context.Context, request schema.ObjectListRequest) (*schema.ObjectList, error)
Return the objects as a list
func (*Manager) ListAttributeTypes ¶ added in v1.5.13
Returns attribute types
func (*Manager) ListGroups ¶ added in v1.5.13
func (manager *Manager) ListGroups(ctx context.Context, request schema.ObjectListRequest) (*schema.ObjectList, error)
Return all groups
func (*Manager) ListObjectClasses ¶ added in v1.5.13
Returns object classes
func (*Manager) ListUsers ¶ added in v1.5.13
func (manager *Manager) ListUsers(ctx context.Context, request schema.ObjectListRequest) (*schema.ObjectList, error)
Return all users
func (*Manager) Update ¶
func (manager *Manager) Update(ctx context.Context, dn string, attr url.Values) (*schema.Object, error)
Update attributes for an object. It will replace the attributes where the values is not empty, and delete the attributes where the values is empty. The object is returned after the update.
type Opt ¶
type Opt func(*opt) error
Opt represents a function that modifies the options
func WithBaseDN ¶
func WithGroupSchema ¶ added in v1.5.13
func WithPassword ¶
func WithSkipVerify ¶
func WithSkipVerify() Opt