Skip to content

LDIF's DefaultAttributeValidationPolicy doesn't comply with RFC2849 - it doesn't allow UTF8 characters in attribute values #492

Closed
@naorbar

Description

@naorbar

The given LDIF doesn't comply with RFC2849: "LDAP Data Interchange Format (LDIF) - Technical Specification"
For more details see:
https://en.wikipedia.org/wiki/LDAP_Data_Interchange_Format
https://tools.ietf.org/html/rfc2849
For instance, it throws an InvalidAttributeFormatException (line 318) when the LDIF contains an attribute such as this one:
company: Østfold Akershus
To workaround it, I could do one of the following:

  1. Implement my own Utf8AttributeValidationPolicy which looks very similar to the DefaultAttributeValidationPolicy and use it in my LdifParser:
    e.g.
    ldifParser.setAttributeValidationPolicy(new UTF8AttributeValidationPolicy());
  2. Extend the DefaultAttributeValidationPolicy class

Option (2) should be easier and follow the open-closed OOD principal, but unfortunately in this case, the class contains only private members which can not be used in the inherited class.

So please fix the following:

  1. Please add support for UTF-8 characters in DefaultAttributeValidationPolicy to comply with RFC2849.
  2. Please change the members' and methods' modifiers in DefaultAttributeValidationPolicy to protected/public, so everyone will be able to extend this class.

Thank you,
Naor

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions