ietf-corpus

rfc-1960

A String Representation of LDAP Search Filters

T. Howes
date1996-06 streamIETF areaapp wgasid statusPROPOSED STANDARD pages3 canonicalhttps://www.rfc-editor.org/rfc/rfc1960 doi10.17487/RFC1960
The Lightweight Directory Access Protocol (LDAP) [1] defines a network representation of a search filter transmitted to an LDAP server. Some applications may find it useful to have a common way of representing these search filters in a human-readable form. This document defines a human-readable string format for representing LDAP search filters. [STANDARDS-TRACK]

obsoleted by

obsoletes

Extracted elements (14)

design-rationale §1

A human-readable string format is defined separately from the BER wire encoding so that applications can represent LDAP search filters in a form usable outside the protocol context, such as in configuration files or user interfaces.

ldap

design-rationale §3

The string representation uses a prefix format with mandatory parenthesized grouping for every filter. This eliminates operator precedence ambiguity in nested boolean expressions without requiring a precedence table.

ldap

interoperability-note §3

Although both the <substring> and <present> grammar productions can produce the 'attr=*' string, this construct is used only to denote a presence filter; parsers must not treat it as a degenerate substring filter.

ldap

interoperability-note §1

This document obsoletes RFC 1558, the previous definition of the string representation of LDAP search filters. Implementations should migrate to the grammar defined here.

ldap

normative-requirement §3 SHOULD

If a <value> must contain the characters '*', '(', or ')', these characters should be escaped by preceding them with the backslash '\' character.

ldap

protocol-element §3

And filters are represented as '(&<filterlist>)' and or filters as '(|<filterlist>)' where filterlist is one or more parenthesized filters. Not filters use '(!<filter>)'.

ldap

protocol-element §2

LDAP search filters are defined as an ASN.1 CHOICE type with nine alternatives: and, or, not, equalityMatch, substrings, greaterOrEqual, lessOrEqual, present, and approxMatch. This type is BER-encoded for network transmission per CCITT X.209.

ldap

protocol-element §3

Simple item filters have the form '<attr><filtertype><value>' where filtertype is '=' (equality), '~=' (approximate match), '>=' (greater or equal), or '<=' (less or equal).

ldap

protocol-element §3

Substring filters use '<attr>=<initial><any><final>' where <any> is '*' followed by '<starval>', which recursively allows '<value>*<starval>'. Initial and final components are optional (NULL).

ldap

protocol-element §2

SubstringFilter is an ASN.1 SEQUENCE of an AttributeType and a SEQUENCE OF CHOICE containing initial [0], any [1], and final [2] LDAPString components, enabling partial-string matching with wildcard positions.

ldap

protocol-element §3

The presence filter is represented as '(<attr>=*)' asserting that the named attribute is present regardless of value.

ldap

security-consideration §5

Security considerations are explicitly not discussed in this memo. Implementors must consult the base LDAP specification (RFC 1777) and related documents for security guidance.

security, ldap

wire-format §2

LDAPString is an OCTET STRING restricted to the IA5 character set. AttributeType is a string representation of the attribute type name per RFC 1777; AttributeValue has the form defined in RFC 1778.

ldap

wire-format §3

The complete string filter grammar uses prefix notation: '<filter> ::= '(' <filtercomp> ')'' where filtercomp is one of and, or, not, or item. Compound filters use '&', '|', and '!' prefix operators respectively.

ldap