Ticket #1920 (new defect)

Opened 11 years ago

A widget or field type to implement LDAP postalAddress syntax

Reported by: gracinet Owned by: madarche
Priority: P3 Milestone: CPS 3.5.7
Component: CPSDirectory Version: TRUNK
Severity: normal Keywords: LDAP address
Cc:

Description

CPSLDAPSetup has been leveraging the postalAddress attribute for some time. But this has a special multi-line syntax. Quoting RFC 2252:

6.27. Postal Address

   ( 1.3.6.1.4.1.1466.115.121.1.41 DESC 'Postal Address' )




Wahl, et. al.               Standards Track                    [Page 22]
 
RFC 2252                   LADPv3 Attributes               December 1997


   Values in this syntax are encoded according to the following BNF:

      postal-address = dstring *( "$" dstring )

   In the above, each dstring component of a postal address value is
   encoded as a value of type Directory String syntax.  Backslashes and
   dollar characters, if they occur in the component, are quoted as
   described in section 4.3.   Many servers limit the postal address to
   six lines of up to thirty characters.

   Example:

      1234 Main St.$Anytown, CA 12345$USA
      \241,000,000 Sweepstakes$PO Box 1000000$Anytown, CA 12345$USA

For interoperability, it looks necessary to understand this. Maybe at the presentation layer (widget, easy), or maybe better at field level (toLDAP method?, what with multiple addresses?)

Here's the escaping scheme (loc.cit. section 4.3)

In encodings where an arbitrary string, not a Distinguished Name, is
   used as part of a larger production, and other than as part of a
   Distinguished Name, a backslash quoting mechanism is used to escape
   the following separator symbol character (such as "'", "$" or "#") if
   it should occur in that string.  The backslash is followed by a pair
   of hexadecimal digits representing the next character.  A backslash
   itself in the string which forms part of a larger syntax is always
   transmitted as '\5C' or '\5c'. An example is given in section 6.27.

Indeed:

>>> chr(0x24)
'$'
Note: See TracTickets for help on using tickets.