Documentation
¶
Overview ¶
Package httpclient calls the LDAP API, which ldap/httphandler serves
Index ¶
- type Client
- func (c *Client) AddGroupUsers(ctx context.Context, group string, users ...string) (*schema.Object, error)
- func (c *Client) BindObject(ctx context.Context, dn, password string) (*schema.Object, error)
- func (c *Client) ChangeObjectPassword(ctx context.Context, dn string, req schema.ObjectPasswordRequest) (*schema.PasswordResponse, error)
- func (c *Client) CreateGroup(ctx context.Context, name string, attrs schema.Attrs) (*schema.Object, error)
- func (c *Client) CreateObject(ctx context.Context, dn string, attrs schema.Attrs) (*schema.Object, error)
- func (c *Client) CreateUser(ctx context.Context, name string, attrs schema.Attrs, allocateGID bool) (*schema.Object, error)
- func (c *Client) DeleteGroup(ctx context.Context, name string) (*schema.Object, error)
- func (c *Client) DeleteObject(ctx context.Context, dn string) (*schema.Object, error)
- func (c *Client) DeleteUser(ctx context.Context, name string) (*schema.Object, error)
- func (c *Client) GetGroup(ctx context.Context, name string) (*schema.Object, error)
- func (c *Client) GetObject(ctx context.Context, dn string) (*schema.Object, error)
- func (c *Client) GetUser(ctx context.Context, name string) (*schema.Object, error)
- func (c *Client) ListAttributeTypes(ctx context.Context, req schema.AttributeTypeListRequest) (*schema.AttributeTypeListResponse, error)
- func (c *Client) ListGroups(ctx context.Context, req schema.GroupListRequest) (*schema.ObjectList, error)
- func (c *Client) ListObjectClasses(ctx context.Context, req schema.ObjectClassListRequest) (*schema.ObjectClassListResponse, error)
- func (c *Client) ListObjects(ctx context.Context, req schema.ObjectListRequest) (*schema.ObjectList, error)
- func (c *Client) ListUsers(ctx context.Context, req schema.UserListRequest) (*schema.ObjectList, error)
- func (c *Client) RemoveGroupUsers(ctx context.Context, group string, users ...string) (*schema.Object, error)
- func (c *Client) UpdateGroup(ctx context.Context, name string, attrs schema.Attrs) (*schema.Object, error)
- func (c *Client) UpdateObject(ctx context.Context, dn string, attrs schema.Attrs) (*schema.Object, error)
- func (c *Client) UpdateUser(ctx context.Context, name string, attrs schema.Attrs) (*schema.Object, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
Client calls the LDAP API, which ldap/httphandler serves
func New ¶
New returns a client of the LDAP API at the URL, such as "http://localhost:8080/api"
func (*Client) AddGroupUsers ¶
func (c *Client) AddGroupUsers(ctx context.Context, group string, users ...string) (*schema.Object, error)
AddGroupUsers adds the users, by name, to the group, and returns it
func (*Client) BindObject ¶
BindObject checks the entry's password, and returns the entry, or auth.ErrInvalidProvider, when it's wrong
func (*Client) ChangeObjectPassword ¶
func (c *Client) ChangeObjectPassword(ctx context.Context, dn string, req schema.ObjectPasswordRequest) (*schema.PasswordResponse, error)
ChangeObjectPassword changes the entry's password, with the old one, or resets it, without, and returns the entry, with the password, when it's generated
func (*Client) CreateGroup ¶
func (c *Client) CreateGroup(ctx context.Context, name string, attrs schema.Attrs) (*schema.Object, error)
CreateGroup creates a group with the name, and the attributes, which can be none
func (*Client) CreateObject ¶
func (c *Client) CreateObject(ctx context.Context, dn string, attrs schema.Attrs) (*schema.Object, error)
CreateObject creates the entry, with the attributes, which need an objectClass
func (*Client) CreateUser ¶
func (c *Client) CreateUser(ctx context.Context, name string, attrs schema.Attrs, allocateGID bool) (*schema.Object, error)
CreateUser creates a user with the name, and the attributes, which can be none. With allocateGID, its gidNumber is its uidNumber.
func (*Client) DeleteGroup ¶
DeleteGroup deletes the group, and returns it, as it was
func (*Client) DeleteObject ¶
DeleteObject deletes the entry, which has no children, and returns it, as it was
func (*Client) DeleteUser ¶
DeleteUser deletes the user, and returns it, as it was
func (*Client) GetObject ¶
GetObject returns the entry, whose DN is under the base DN, or relative to it
func (*Client) ListAttributeTypes ¶
func (c *Client) ListAttributeTypes(ctx context.Context, req schema.AttributeTypeListRequest) (*schema.AttributeTypeListResponse, error)
ListAttributeTypes returns the directory's attribute types, by name, which match the request
func (*Client) ListGroups ¶
func (c *Client) ListGroups(ctx context.Context, req schema.GroupListRequest) (*schema.ObjectList, error)
ListGroups returns the groups, or a user's, which match the request
func (*Client) ListObjectClasses ¶
func (c *Client) ListObjectClasses(ctx context.Context, req schema.ObjectClassListRequest) (*schema.ObjectClassListResponse, error)
ListObjectClasses returns the directory's object classes, by name, which match the request
func (*Client) ListObjects ¶
func (c *Client) ListObjects(ctx context.Context, req schema.ObjectListRequest) (*schema.ObjectList, error)
ListObjects returns the entries under the base DN, or the prefix, which match the request
func (*Client) ListUsers ¶
func (c *Client) ListUsers(ctx context.Context, req schema.UserListRequest) (*schema.ObjectList, error)
ListUsers returns the users, or a group's members, which match the request
func (*Client) RemoveGroupUsers ¶
func (c *Client) RemoveGroupUsers(ctx context.Context, group string, users ...string) (*schema.Object, error)
RemoveGroupUsers removes the users, by name, from the group, and returns it
func (*Client) UpdateGroup ¶
func (c *Client) UpdateGroup(ctx context.Context, name string, attrs schema.Attrs) (*schema.Object, error)
UpdateGroup replaces the group's attributes which have values, and deletes those which have none. Changing its cn renames it.