home *** CD-ROM | disk | FTP | other *** search
/ Internet Info 1997 December / Internet_Info_CD-ROM_Walnut_Creek_December_1997.iso / drafts / draft_ietf_a_c / draft-ietf-asid-string-filter-v2-00.txt < prev    next >
Text File  |  1996-10-16  |  8KB  |  237 lines

  1.  
  2. Network Working Group                                        Tim Howes
  3. INTERNET DRAFT                            Netscape Communications Corp.
  4. OBSOLETES: RFC 1960                                      October, 1996
  5. Expire in six months                                             
  6.  
  7.  
  8.              A String Representation of LDAP Search Filters
  9.                <draft-ietf-asid-string-filter-v2-00.txt>
  10.  
  11.  
  12. 1.  Status of this Memo
  13.  
  14. This document is an Internet-Draft.  Internet-Drafts are  working  docu-
  15. ments  of the Internet Engineering Task Force (IETF), its areas, and its
  16. working groups.  Note that other  groups  may  also  distribute  working
  17. documents as Internet-Drafts.
  18.  
  19. Internet-Drafts are draft documents valid for a maximum  of  six  months
  20. and  may  be  updated,  replaced, or obsoleted by other documents at any
  21. time.  It is inappropriate to use Internet- Drafts as reference material
  22. or to cite them other than as ``work in progress.''
  23.  
  24. To learn the current status of  any  Internet-Draft,  please  check  the
  25. ``1id-abstracts.txt''  listing  contained in the Internet- Drafts Shadow
  26. Directories on ds.internic.net (US East Coast), nic.nordu.net  (Europe),
  27. ftp.isi.edu (US West Coast), or munnari.oz.au (Pacific Rim).
  28.  
  29. 2.  Abstract
  30.  
  31. The Lightweight Directory Access Protocol (LDAP) [1] defines  a  network
  32. representation  of  a search filter transmitted to an LDAP server.  Some
  33. applications may find it useful to have a  common  way  of  representing
  34. these  search filters in a human-readable form.  This document defines a
  35. human-readable string format for representing LDAP search filters.
  36.  
  37. This document replaces RFC 1960, extending the string LDAP filter defin-
  38. ition to include support for LDAP version 3 extended match filters.
  39.  
  40. 3.  LDAP Search Filter Definition
  41.  
  42. An LDAPv3 search filter is defined in [1] as follows:
  43.  
  44.      Filter ::= CHOICE {
  45.              and                [0] SET OF Filter,
  46.              or                 [1] SET OF Filter,
  47.              not                [2] Filter,
  48.              equalityMatch      [3] AttributeValueAssertion,
  49.              substrings         [4] SubstringFilter,
  50.              greaterOrEqual     [5] AttributeValueAssertion,
  51.  
  52.  
  53.  
  54. Howes                                                           [Page 1]
  55.  
  56.  
  57.  
  58.  
  59.  
  60. INTERNET DRAFT                                              October 1996
  61.  
  62.  
  63.              lessOrEqual        [6] AttributeValueAssertion,
  64.              present            [7] AttributeType,
  65.              approxMatch        [8] AttributeValueAssertion,
  66.              extensibleMatch    [9] MatchingRuleAssertion
  67.      }
  68.  
  69.      SubstringFilter ::= SEQUENCE {
  70.              type    AttributeType,
  71.              SEQUENCE OF CHOICE {
  72.                      initial        [0] LDAPString,
  73.                      any            [1] LDAPString,
  74.                      final          [2] LDAPString
  75.              }
  76.      }
  77.  
  78.      AttributeValueAssertion ::= SEQUENCE {
  79.              attributeType   AttributeType,
  80.              attributeValue  AttributeValue
  81.      }
  82.  
  83.      MatchingRuleAssertion ::= SEQUENCE {
  84.              matchingRule    [1] MatchingRuleID OPTIONAL,
  85.              type            [2] AttributeType OPTIONAL,
  86.              matchValue      [3] AssertionValue,
  87.              dnAttributes    [4] BOOLEAN DEFAULT FALSE
  88.      }
  89.  
  90.      AttributeType ::= LDAPString
  91.  
  92.      AttributeValue ::= OCTET STRING
  93.  
  94.      MatchingRuleID ::= LDAPString
  95.  
  96.      LDAPString ::= OCTET STRING
  97.  
  98. where the LDAPString above is limited to the  IA5  character  set.   The
  99. AttributeType  is a string representation of the attribute type name and
  100. is defined in [1].  The AttributeValue OCTET STRING has the form defined
  101. in [2].  The Filter is encoded for transmission over a network using the
  102. Basic Encoding Rules defined in [3], with simplifications  described  in
  103. [1].
  104.  
  105. 4.  String Search Filter Definition
  106.  
  107. The string representation of an LDAP search filter  is  defined  by  the
  108. following grammar.  It uses a prefix format.
  109.  
  110.      <filter> ::= '(' <filtercomp> ')'
  111.  
  112.  
  113.  
  114. Howes                                                           [Page 2]
  115.  
  116.  
  117.  
  118.  
  119.  
  120. INTERNET DRAFT                                              October 1996
  121.  
  122.  
  123.      <filtercomp> ::= <and> | <or> | <not> | <item>
  124.      <and> ::= '&' <filterlist>
  125.      <or> ::= '|' <filterlist>
  126.      <not> ::= '!' <filter>
  127.      <filterlist> ::= <filter> | <filter> <filterlist>
  128.      <item> ::= <simple> | <present> | <substring> | <extensible>
  129.      <simple> ::= <attr> <filtertype> <value>
  130.      <filtertype> ::= <equal> | <approx> | <greater> | <less>
  131.      <equal> ::= '='
  132.      <approx> ::= '~='
  133.      <greater> ::= '>='
  134.      <less> ::= '<='
  135.      <extensible> ::= ( NULL | <attr> ) [ ':dn' ] [ ':' <matchingrule> ]
  136.                              ':=' <value>
  137.      <matchingrule> ::= <matchingrulename> | <oid>
  138.      <present> ::= <attr> '=*'
  139.      <substring> ::= <attr> '=' <initial> <any> <final>
  140.      <initial> ::= NULL | <value>
  141.      <any> ::= '*' <starval>
  142.      <starval> ::= NULL | <value> '*' <starval>
  143.      <final> ::= NULL | <value>
  144.  
  145. <attr> is a string representing an AttributeType,  and  has  the  format
  146. defined  in [1].  <value> is a string representing an AttributeValue, or
  147. part of one, and has the form defined in [2].  If a <value> must contain
  148. one  of the characters '*' or '(' or ')' or '\', these characters should
  149. be escaped by preceding them with the  backslash  '\'  character.   Note
  150. that although both the <substring> and <present> productions can produce
  151. the 'attr=*' construct, this construct is used only to denote a presence
  152. filter.
  153.  
  154. <oid> is a dotted string representation of an object  identifier  (e.g.,
  155. "1.2.3.4")  identifying  a  matching rule to use when comparing <value>.
  156. <matchingrulename> is a name given to a matching  rule,  as  defined  in
  157. [2].  One  of  <attr>  or <matchingrule> is required in the <extensible>
  158. production.
  159.  
  160. 5.  Examples
  161.  
  162. This section gives a few examples of search filters written  using  this
  163. notation.
  164.  
  165.      (cn=Babs Jensen)
  166.      (!(cn=Tim Howes))
  167.      (&(objectClass=Person)(|(sn=Jensen)(cn=Babs J*)))
  168.      (o=univ*of*mich*)
  169.      (o=Parentheses r all your parenthetical needs))
  170.  
  171.  
  172.  
  173.  
  174. Howes                                                           [Page 3]
  175.  
  176.  
  177.  
  178.  
  179.  
  180. INTERNET DRAFT                                              October 1996
  181.  
  182.  
  183. The following two examples illustrate the use of extensible matching.
  184.  
  185.      (cn:1.2.3.4.5:=Fred Flintstone)
  186.      (sn:dn:2.4.6.8.10:=Barney Rubble)
  187.      (o:dn:=Ace Industry)
  188.  
  189. The second example illustrates the use of the ":dn" notation to indicate
  190. that  matching rule "2.4.6.8.10" should be used when making comparisons,
  191. and that the attributes of an entry's distinguished name should be  con-
  192. sidered part of the entry when evaluating the match.
  193.  
  194. The third example denotes an equality match, except that  DN  components
  195. should be considered part of the entry when doing the match.
  196.  
  197. 6.  Security Considerations
  198.  
  199. Security considerations are not discussed in this document.
  200.  
  201. 7.  Bibliography
  202.  
  203. [1]  Lightweight Directory Access Protocol (v3), M. Wahl, T.  Howes,  S.
  204.      Kille,   Internet   Draft   draft-ietf-asid-ldapv3-protocol-03.txt,
  205.      October 1996.
  206.  
  207. [2]  Lightweight Directory Access Protocol: Standard and Pilot Attribute
  208.      Definitions,  M.  Wahl,  A.  Coulbeck, T. Howes, S. Kille, Internet
  209.      Draft draft-ietf-asid-ldapv3-attributes-03.txt, October 1996.
  210.  
  211. [3]  Specification of Basic Encoding Rules for Abstract Syntax  Notation
  212.      One (ASN.1).  CCITT Recommendation X.209, 1988.
  213.  
  214. 8.  Author's Address
  215.  
  216.    Tim Howes
  217.    Netscape Communications Corp.
  218.    501 E. Middlefield Road
  219.    Mountain View, CA 94043
  220.    USA
  221.    +1 415 937-3419
  222.    howes@netscape.com
  223.  
  224.  
  225.  
  226.  
  227.  
  228.  
  229.  
  230.  
  231.  
  232.  
  233.  
  234. Howes                                                           [Page 4]
  235.  
  236.  
  237.