Documentation
¶
Overview ¶
Package ldap has the LDAP manager's command-line flags, for a server
Index ¶
- type AttrListCmd
- type ClassListCmd
- type GroupAddCmd
- type GroupCommands
- type GroupCreateCmd
- type GroupDeleteCmd
- type GroupGetCmd
- type GroupListCmd
- type GroupRemoveCmd
- type GroupUpdateCmd
- type ObjectBindCmd
- type ObjectCommands
- type ObjectCreateCmd
- type ObjectDeleteCmd
- type ObjectGetCmd
- type ObjectListCmd
- type ObjectPasswordCmd
- type ObjectUpdateCmd
- type SchemaCommands
- type ServerFlags
- type UserCommands
- type UserCreateCmd
- type UserDeleteCmd
- type UserGetCmd
- type UserListCmd
- type UserUpdateCmd
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AttrListCmd ¶ added in v0.0.15
type ClassListCmd ¶ added in v0.0.15
type ClassListCmd struct {
Filter string `arg:"" optional:"" name:"filter" help:"Name or OID"`
Kind string `name:"kind" enum:",ABSTRACT,STRUCTURAL,AUXILIARY" default:"" help:"ABSTRACT, STRUCTURAL or AUXILIARY"`
Must []string `name:"must" help:"Only classes which need the attribute. Repeat for more than one."`
May []string `name:"may" help:"Only classes which can have the attribute. Repeat for more than one."`
For string `name:"for" enum:",user,group" default:"" help:"Only the classes users, or groups, are created with, and their superiors"`
Offset uint64 `name:"offset" help:"Offset within the list"`
Limit *uint64 `name:"limit" help:"Number of classes to list"`
}
type GroupAddCmd ¶ added in v0.0.15
type GroupCommands ¶
type GroupCommands struct {
GroupList GroupListCmd `cmd:"" name:"ldap-groups" help:"List the groups, or a user's, as LDIF." group:"LDAP"`
GroupGet GroupGetCmd `cmd:"" name:"ldap-group" help:"Get a group, by name, as LDIF." group:"LDAP"`
GroupCreate GroupCreateCmd `cmd:"" name:"ldap-group-create" help:"Create a group, with attributes as name=value." group:"LDAP"`
GroupUpdate GroupUpdateCmd `` /* 182-byte string literal not displayed */
GroupDelete GroupDeleteCmd `cmd:"" name:"ldap-group-delete" help:"Delete a group." group:"LDAP"`
GroupAdd GroupAddCmd `cmd:"" name:"ldap-group-add" help:"Add users to a group." group:"LDAP"`
GroupRemove GroupRemoveCmd `cmd:"" name:"ldap-group-remove" help:"Remove users from a group." group:"LDAP"`
}
GroupCommands list, get, create, update and delete groups, by name, and add and remove their members
type GroupCreateCmd ¶ added in v0.0.15
type GroupDeleteCmd ¶ added in v0.0.15
type GroupDeleteCmd struct {
Name string `arg:"" name:"name" help:"Group name"`
}
type GroupGetCmd ¶ added in v0.0.15
type GroupGetCmd struct {
Name string `arg:"" name:"name" help:"Group name, which is its cn"`
}
type GroupListCmd ¶ added in v0.0.15
type GroupListCmd struct {
User string `name:"user" help:"Only the groups the user is a member of"`
Filter string `name:"filter" help:"LDAP filter, such as (cn=a*)"`
Attr []string `name:"attr" help:"Attribute to return. Repeat for more than one."`
Offset uint64 `name:"offset" help:"Offset within the list"`
Limit *uint64 `name:"limit" help:"Number of groups to list"`
}
type GroupRemoveCmd ¶ added in v0.0.15
type GroupUpdateCmd ¶ added in v0.0.15
type ObjectBindCmd ¶ added in v0.0.15
type ObjectBindCmd struct {
DN string `arg:"" name:"dn" help:"DN, relative to the base DN, or under it"`
}
type ObjectCommands ¶
type ObjectCommands struct {
ObjectList ObjectListCmd `cmd:"" name:"ldap-objects" help:"List the entries under the base DN, or a prefix, as LDIF." group:"LDAP"`
ObjectGet ObjectGetCmd `cmd:"" name:"ldap-object" help:"Get an entry, by DN, as LDIF." group:"LDAP"`
ObjectCreate ObjectCreateCmd `` /* 127-byte string literal not displayed */
ObjectUpdate ObjectUpdateCmd `` /* 185-byte string literal not displayed */
ObjectDelete ObjectDeleteCmd `cmd:"" name:"ldap-object-delete" help:"Delete an entry, which has no children." group:"LDAP"`
ObjectBind ObjectBindCmd `cmd:"" name:"ldap-object-bind" help:"Check an entry's password, which is prompted for, or read from the input." group:"LDAP"`
ObjectPassword ObjectPasswordCmd `` /* 156-byte string literal not displayed */
}
ObjectCommands list, get, create, update and delete entries, by DN, bind as them, and change their passwords
type ObjectCreateCmd ¶ added in v0.0.15
type ObjectDeleteCmd ¶ added in v0.0.15
type ObjectDeleteCmd struct {
DN string `arg:"" name:"dn" help:"DN, relative to the base DN, or under it"`
}
type ObjectGetCmd ¶ added in v0.0.15
type ObjectGetCmd struct {
DN string `arg:"" name:"dn" help:"DN, relative to the base DN, or under it"`
}
type ObjectListCmd ¶ added in v0.0.15
type ObjectListCmd struct {
Prefix string `name:"prefix" help:"DN of the subtree to list, relative to the base DN"`
Children bool `name:"children" help:"Only the entries directly under the prefix, or the base DN"`
Filter string `name:"filter" help:"LDAP filter, such as (cn=a*)"`
Attr []string `name:"attr" help:"Attribute to return. Repeat for more than one."`
Offset uint64 `name:"offset" help:"Offset within the list"`
Limit *uint64 `name:"limit" help:"Number of entries to list"`
}
type ObjectPasswordCmd ¶ added in v0.0.15
type ObjectPasswordCmd struct {
DN string `arg:"" name:"dn" help:"DN, relative to the base DN, or under it"`
Old bool `name:"old" help:"Change the password with the old one, which is checked, rather than resetting it"`
Generate bool `name:"generate" help:"Generate the new password, which is printed"`
}
type ObjectUpdateCmd ¶ added in v0.0.15
type SchemaCommands ¶ added in v0.0.15
type SchemaCommands struct {
ClassList ClassListCmd `cmd:"" name:"ldap-classes" help:"List the directory's object classes, by name." group:"LDAP"`
AttrList AttrListCmd `cmd:"" name:"ldap-attrs" help:"List the directory's attribute types, by name." group:"LDAP"`
}
SchemaCommands list the directory's object classes and attribute types
type ServerFlags ¶ added in v0.0.15
type ServerFlags struct {
URL string `` /* 158-byte string literal not displayed */
BaseDN string `name:"base-dn" env:"LDAP_BASE_DN" help:"Base DN, which every DN is under, such as dc=example,dc=com"`
User string `name:"user" env:"LDAP_USER" help:"User to bind as, which is a DN, or a name under the base DN, rather than the URL's"`
Password string `name:"password" env:"LDAP_PASSWORD" help:"Password of the user, rather than the URL's"`
UserDN string `` /* 132-byte string literal not displayed */
UserClass []string `` /* 162-byte string literal not displayed */
GroupDN string `` /* 137-byte string literal not displayed */
GroupClass []string `` /* 162-byte string literal not displayed */
SkipVerify bool `name:"skip-verify" env:"LDAP_SKIP_VERIFY" help:"Don't verify the directory's TLS certificate" negatable:""`
}
ServerFlags configure the LDAP manager: the directory, the user it binds as, and the DNs of its users and groups, which are passed to WithLDAPManager. They're embedded with a prefix, such as ldap.
func (ServerFlags) WithLDAPManager ¶ added in v0.0.15
func (flags ServerFlags) WithLDAPManager(ctx server.Cmd, publisher manager.Publisher, fn func(*manager.Manager) error, opts ...manager.Opt) error
WithLDAPManager creates the LDAP manager, with the command's tracer, and the publisher, such as go-server's broadcaster, when it isn't nil, which publishes its changes, and the manager's own options. It runs the manager, which connects, and reconnects when the connection is lost, and calls fn with it, then disconnects, when fn returns.
type UserCommands ¶
type UserCommands struct {
UserList UserListCmd `cmd:"" name:"ldap-users" help:"List the users, or a group's members, as LDIF." group:"LDAP"`
UserGet UserGetCmd `cmd:"" name:"ldap-user" help:"Get a user, by name, as LDIF." group:"LDAP"`
UserCreate UserCreateCmd `` /* 135-byte string literal not displayed */
UserUpdate UserUpdateCmd `` /* 182-byte string literal not displayed */
UserDelete UserDeleteCmd `cmd:"" name:"ldap-user-delete" help:"Delete a user." group:"LDAP"`
}
UserCommands list, get, create, update and delete users, by name
type UserCreateCmd ¶ added in v0.0.15
type UserCreateCmd struct {
Name string `arg:"" name:"name" help:"User name, which is its uid, or cn in Active Directory"`
Attrs []string `arg:"" optional:"" name:"attrs" help:"Attributes as name=value, repeated for more values"`
AllocateGID bool `name:"allocate-gid" help:"Set the gidNumber to the uidNumber, for a posixAccount"`
}
type UserDeleteCmd ¶ added in v0.0.15
type UserDeleteCmd struct {
Name string `arg:"" name:"name" help:"User name"`
}
type UserGetCmd ¶ added in v0.0.15
type UserGetCmd struct {
Name string `arg:"" name:"name" help:"User name, which is its uid, or cn in Active Directory"`
}
type UserListCmd ¶ added in v0.0.15
type UserListCmd struct {
Group string `name:"group" help:"Only the group's members"`
Filter string `name:"filter" help:"LDAP filter, such as (cn=a*)"`
Attr []string `name:"attr" help:"Attribute to return. Repeat for more than one."`
Offset uint64 `name:"offset" help:"Offset within the list"`
Limit *uint64 `name:"limit" help:"Number of users to list"`
}