class LDAP::Request::Filter

Defined in:

ldap/request/filter.cr

Constant Summary

ESCAPE_RE = Regex.new(String.build do |str| str << "[" ESCAPES.keys.each do |e| str << (Regex.escape(e)) end str << "]" end)

Compiled character class regexp using the keys from the above hash.

ESCAPES = {"\u0000" => "\\00", "*" => "\\2A", "(" => "\\28", ")" => "\\29", "\\" => "\\5C"}

Constructors

Class Method Summary

Instance Method Summary

Constructor Detail

def self.new(operation : Type, filter : BER) #

[View source]

Class Method Detail

def self.approx(object : String, value, escaped : Bool = false) #

approxMatch [8] — like an equality assertion, but the server applies its approximate-matching rule for the attribute (RFC 4511 §4.5.1.7.6).


[View source]
def self.begins(attribute : String, value) #

[View source]
def self.conjoin(left : BER, right : BER) #

Logical AND [0] of two filters (see also #&). Renamed from the misleading join before 1.0.


[View source]
def self.conjoin(left : Filter, right : Filter) #

Logical AND [0] of two filters (see also #&). Renamed from the misleading join before 1.0.


[View source]
def self.contains(attribute : String, value) #

[View source]
def self.disjoin(left : BER, right : BER) #

Logical OR [1] of two filters (see also #|). Renamed from the misleading intersect before 1.0.


[View source]
def self.disjoin(left : Filter, right : Filter) #

Logical OR [1] of two filters (see also #|). Renamed from the misleading intersect before 1.0.


[View source]
def self.ends(attribute : String, value) #

[View source]
def self.equal(object : String, value, escaped : Bool = false) #

[View source]
def self.escape(string : String) : String #

Escape a string for use in an LDAP filter


[View source]
def self.extensible(value, *, attribute : String | Nil = nil, rule : String | Nil = nil, dn_attributes : Bool = false) #

extensibleMatch [9] MatchingRuleAssertion (RFC 4511 §4.5.1.7.7): { matchingRule [1] OPT, type [2] OPT, matchValue [3], dnAttributes [4] BOOLEAN DEFAULT FALSE } At least one of attribute (type) or rule (matchingRule) must be present. value is a literal assertion value (the parser unescapes before calling).


[View source]
def self.greater_than(object : String, value) #

[View source]
def self.less_than(object : String, value) #

[View source]
def self.negate(filter : Filter) #

[View source]
def self.negate(filter : BER) #

[View source]
def self.not_equal(object : String, value, escaped : Bool = false) #

[View source]
def self.present?(attribute : String) #

[View source]
def self.unescape(value : String, escaped : Bool = false) : String #

[View source]

Instance Method Detail

def &(other) #

Joins two or more filters so that all conditions must be true.


[View source]
def |(other) #

Selects entries where either the left or right side are true.


[View source]
def ~ #

Negates a filter.


[View source]
def operation : Type #

[View source]
def to_ber : ASN1::BER #

[View source]
def to_slice #

[View source]