Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CNToGroupName ¶
CNToGroupName will transform a full CN string ("cn=adminUser,ou=groups,dc=org,dc=example") to a group name ("adminUser").
Types ¶
type Directory ¶
Directory is an interface which represents a queryable directory service, such as LDAP.
type GroupSet ¶
GroupSet represents a set of groups, on which we can perform set operations (difference, intersection, etc).
type LdapConfig ¶
type LdapConfig struct { HostURL string BindDN string BindPassword string GroupAttribute string BaseDN string // Base DN on which to search Filter string // Filter which uniquely identifies the user }
LdapConfig represents all the configuration required to connect to an LDAP server and run queries.
func GenerateLdapConfig ¶
func GenerateLdapConfig() LdapConfig
GenerateLdapConfig generates an LDAP config object from external config files or environment variables.
type LdapDirectory ¶
type LdapDirectory struct {
// contains filtered or unexported fields
}
LdapDirectory represents a queryable LDAP directory service,
func NewLdapDirectory ¶
func NewLdapDirectory(config LdapConfig) *LdapDirectory
NewLdapDirectory acts as a constructor for LdapDirectory
func (LdapDirectory) Search ¶
func (l LdapDirectory) Search(lookup string) (GroupSet, error)
Search performs a search against the configured LDAP server by substituting the `lookup` argument into the configured filter.
func (LdapDirectory) Sync ¶
func (l LdapDirectory) Sync() error
Sync gets this directory service ready to issue searches. In the case of LDAP, this method does nothing.
type YamlDirectory ¶
type YamlDirectory struct {
// contains filtered or unexported fields
}
YamlDirectory exposes the group database file as a query directory service.
func NewYamlDirectory ¶
func NewYamlDirectory(filepath string) *YamlDirectory
NewYamlDirectory acts as a constructor for YamlDirectory
func (YamlDirectory) AnnotationFunction ¶
func (y YamlDirectory) AnnotationFunction(string) string
AnnotationFunction can be used to associate groups with descriptions present in the group database file. Useful to make a list of groups more human readable in program output.
func (*YamlDirectory) Search ¶
func (y *YamlDirectory) Search(lookup string) (GroupSet, error)
Search performs a search on the in-memory group database by finding roles which match the given `lookup` string.
func (*YamlDirectory) Sync ¶
func (y *YamlDirectory) Sync() error
Sync gets this directory service ready to issue searches. In the case of YAML, this method reads the database file into memory.
type YamlGroupFile ¶
type YamlGroupFile struct { SchemaVersion string `yaml:"schema_version"` Roles []YamlRole Groups []YamlGroup }
YamlGroupFile is the in-memory representation of a group database file.