httpclient

package
v0.0.15 Latest Latest
Warning

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

Go to latest
Published: Nov 16, 2026 License: Apache-2.0 Imports: 9 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package httpclient calls the LDAP API, which ldap/httphandler serves

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	*client.Client
}

Client calls the LDAP API, which ldap/httphandler serves

func New

func New(url string, opts ...client.ClientOpt) (*Client, error)

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

func (c *Client) BindObject(ctx context.Context, dn, password string) (*schema.Object, error)

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

func (c *Client) DeleteGroup(ctx context.Context, name string) (*schema.Object, error)

DeleteGroup deletes the group, and returns it, as it was

func (*Client) DeleteObject

func (c *Client) DeleteObject(ctx context.Context, dn string) (*schema.Object, error)

DeleteObject deletes the entry, which has no children, and returns it, as it was

func (*Client) DeleteUser

func (c *Client) DeleteUser(ctx context.Context, name string) (*schema.Object, error)

DeleteUser deletes the user, and returns it, as it was

func (*Client) GetGroup

func (c *Client) GetGroup(ctx context.Context, name string) (*schema.Object, error)

GetGroup returns the group with the name

func (*Client) GetObject

func (c *Client) GetObject(ctx context.Context, dn string) (*schema.Object, error)

GetObject returns the entry, whose DN is under the base DN, or relative to it

func (*Client) GetUser

func (c *Client) GetUser(ctx context.Context, name string) (*schema.Object, error)

GetUser returns the user with the name

func (*Client) ListAttributeTypes

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

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.

func (*Client) UpdateObject

func (c *Client) UpdateObject(ctx context.Context, dn string, attrs schema.Attrs) (*schema.Object, error)

UpdateObject replaces the entry's attributes which have values, and deletes those which have none. Changing a value of its RDN renames it.

func (*Client) UpdateUser

func (c *Client) UpdateUser(ctx context.Context, name string, attrs schema.Attrs) (*schema.Object, error)

UpdateUser replaces the user's attributes which have values, and deletes those which have none. Changing its name renames it.

Jump to

Keyboard shortcuts

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