Documentation ¶
Index ¶
- Constants
- Variables
- func GetSchemaFieldRegistry(schema string, newPassword string) (map[*Field][]string, error)
- func SupportedSchemas() []string
- func ValidSchema(schema string) bool
- type Client
- func (c *Client) Execute(cfg *Config, entries []*ldif.Entry, continueOnFailure bool) (err error)
- func (c *Client) Search(cfg *Config, baseDN string, scope int, filters map[*Field][]string) ([]*Entry, error)
- func (c *Client) UpdateEntry(cfg *Config, baseDN string, scope int, filters map[*Field][]string, ...) error
- func (c *Client) UpdatePassword(cfg *Config, baseDN string, scope int, newValues map[*Field][]string, ...) error
- type Config
- type Entry
- type Field
Constants ¶
const ( SchemaOpenLDAP = "openldap" SchemaAD = "ad" SchemaRACF = "racf" )
Variables ¶
var FieldRegistry = newFieldRegistry()
FieldRegistry is designed to look and feel like an enum from another language like Python.
Example: Accessing constants
FieldRegistry.AccountExpires FieldRegistry.BadPasswordCount
Example: Utility methods
FieldRegistry.List() FieldRegistry.Parse("givenName")
Functions ¶
func GetSchemaFieldRegistry ¶ added in v0.1.1
GetSchemaFieldRegistry type switches field registries depending on the configured schema. For example, IBM RACF has a custom LDAP schema so the password is stored in a different attribute.
func SupportedSchemas ¶ added in v0.1.1
func SupportedSchemas() []string
SupportedSchemas returns a slice of different LDAP schemas supported by the plugin. This is used to change the FieldRegistry when modifying user passwords and to set the default user attribute (userattr).
func ValidSchema ¶ added in v0.1.1
ValidSchema checks if the configured schema is supported by the plugin.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func NewWithClient ¶ added in v0.11.3
func (*Client) UpdateEntry ¶
func (*Client) UpdatePassword ¶
func (c *Client) UpdatePassword(cfg *Config, baseDN string, scope int, newValues map[*Field][]string, filters map[*Field][]string) error
UpdatePassword uses a Modify call under the hood instead of LDAP change password function. This allows AD and OpenLDAP schemas to use the same api without changes to the interface.