Documentation ¶
Overview ¶
Package filter provides the definition of the filter interface. The LDAP search filter syntax according to RFC 4515 and RFC 2254 is supported. Additionally, a custom syntax is supported to allow more complex highly readable filters.
Index ¶
- func EscapeFilter(filter string) string
- func ReplaceAliases(in string) string
- type Alias
- func AliasForAnd() Alias
- func AliasForAttr() Alias
- func AliasForBand() Alias
- func AliasForBor() Alias
- func AliasForContains() Alias
- func AliasForData() Alias
- func AliasForDc() Alias
- func AliasForDisabled() Alias
- func AliasForEnabled() Alias
- func AliasForEndsWith() Alias
- func AliasForEquals() Alias
- func AliasForExists() Alias
- func AliasForExpired() Alias
- func AliasForGreaterThan() Alias
- func AliasForGreaterThanOrEqual() Alias
- func AliasForGroup() Alias
- func AliasForId() Alias
- func AliasForLessThan() Alias
- func AliasForLessThanOrEqual() Alias
- func AliasForLike() Alias
- func AliasForMemberOf() Alias
- func AliasForNot() Alias
- func AliasForNotExists() Alias
- func AliasForNotExpired() Alias
- func AliasForOr() Alias
- func AliasForRecursive() Alias
- func AliasForStartsWith() Alias
- func AliasForUser() Alias
- func ListAliases() []Alias
- type Filter
- func And(property Filter, properties ...Filter) Filter
- func ByID(id string) Filter
- func HasExpired() Filter
- func IsDomainController() Filter
- func IsEnabled() Filter
- func IsGroup() Filter
- func IsUser() Filter
- func MemberOf(parent string, recursive bool) Filter
- func Not(property Filter) Filter
- func Or(property Filter, properties ...Filter) Filter
- func ParseRaw(raw string) (*Filter, error)
- type Kind
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func EscapeFilter ¶
EscapeFilter returns a string representation of a filter with escaped values according to RFC 4515
func ReplaceAliases ¶
ReplaceAliases replaces alias expressions in the input string
Types ¶
type Alias ¶
type Alias struct { // ID is the identifier of the alias ID string // Kind is the kind of the alias Kind Kind // Parameters are the parameters of the alias used for substitution Parameters []string // Substitution is the function used to substitute the alias Substitution func([]string) string }
Alias is used to define shortcuts for filters and matching rules
func AliasForAnd ¶ added in v2.6.3
func AliasForAnd() Alias
func AliasForAttr ¶ added in v2.6.3
func AliasForAttr() Alias
func AliasForBand ¶ added in v2.6.3
func AliasForBand() Alias
func AliasForBor ¶ added in v2.6.3
func AliasForBor() Alias
func AliasForContains ¶ added in v2.6.5
func AliasForContains() Alias
func AliasForData ¶ added in v2.6.3
func AliasForData() Alias
func AliasForDc ¶ added in v2.6.3
func AliasForDc() Alias
func AliasForDisabled ¶ added in v2.6.3
func AliasForDisabled() Alias
func AliasForEnabled ¶ added in v2.6.3
func AliasForEnabled() Alias
func AliasForEndsWith ¶ added in v2.6.5
func AliasForEndsWith() Alias
func AliasForEquals ¶ added in v2.6.5
func AliasForEquals() Alias
func AliasForExists ¶ added in v2.6.5
func AliasForExists() Alias
func AliasForExpired ¶ added in v2.6.3
func AliasForExpired() Alias
func AliasForGreaterThan ¶ added in v2.6.5
func AliasForGreaterThan() Alias
func AliasForGreaterThanOrEqual ¶ added in v2.6.5
func AliasForGreaterThanOrEqual() Alias
func AliasForGroup ¶ added in v2.6.3
func AliasForGroup() Alias
func AliasForId ¶ added in v2.6.3
func AliasForId() Alias
func AliasForLessThan ¶ added in v2.6.5
func AliasForLessThan() Alias
func AliasForLessThanOrEqual ¶ added in v2.6.5
func AliasForLessThanOrEqual() Alias
func AliasForLike ¶ added in v2.6.5
func AliasForLike() Alias
func AliasForMemberOf ¶ added in v2.6.3
func AliasForMemberOf() Alias
func AliasForNot ¶ added in v2.6.3
func AliasForNot() Alias
func AliasForNotExists ¶ added in v2.6.5
func AliasForNotExists() Alias
func AliasForNotExpired ¶ added in v2.6.3
func AliasForNotExpired() Alias
func AliasForOr ¶ added in v2.6.3
func AliasForOr() Alias
func AliasForRecursive ¶ added in v2.6.3
func AliasForRecursive() Alias
func AliasForStartsWith ¶ added in v2.6.5
func AliasForStartsWith() Alias
func AliasForUser ¶ added in v2.6.3
func AliasForUser() Alias
type Filter ¶
type Filter struct { // Attribute is the attribute to filter on Attribute attributes.Attribute // Value is the value to filter for Value string // Rule is the matching rule bit mask to use Rule attributes.MatchingRule }
Filter is used to define an LDAP filter
func ByID ¶
ByID returns a filter that matches an object by its ID (CN, DN, GUID, SAN, UPN, Name or DisplayName)
func HasExpired ¶
func HasExpired() Filter
HasExpired returns a filter that matches an object that has expired
func IsDomainController ¶
func IsDomainController() Filter
IsDomainController returns a filter that matches a domain controller
func IsEnabled ¶
func IsEnabled() Filter
IsEnabled returns a filter that matches a not disabled user object
func (Filter) ExpandAlias ¶
ExpandAlias expands an filter to a filter by itself or its attribute alias
type Kind ¶
type Kind string
Kind is used to define the kind of an alias
const ( // FilterImplementation is the kind of an alias that is a custom filter implementation FilterImplementation Kind = "filter implementation" FilterComposition Kind = "filter composition" // MatchingRule is the kind of an alias that is a matching rule bit mask MatchingRule Kind = "matching rule" )