#3521 Lazy conversion of attribute values
Closed: Fixed None Opened 11 years ago by jcholast.

(This is a continuation of LDAP code refactoring)

Currently all attributes are decoded right when a search result is received from LDAP server and encoded right before doing add or modify operations. This is bad for a number of reasons:

  • when invalid attribute values are received from LDAP server, we crash, even if it is an attribute we don't care about (#2131, #3469)
  • access to raw attribute values is limited, which makes it impossible to delete invalid attribute values with --delattr (#2954)
  • in order to properly generate modlists for the modify operation, or to compare entries, attribute values must be converted to common type, which is currently done by dubious ad-hoc routines

To make our code more robust, decoding and encoding of attribute values should be done on-demand, when an attribute is accessed in LDAPEntry. It should also be possible to access raw attribute values from LDAPEntry, which should make handling invalid values as well as entry modifications easier.

The attached patches implement the functionality.


3.4 development was shifted by one month, moving tickets to reflect reality better.

master:

941e968 Use encoded values from entry objects directly when adding new entries.[[BR]]
e60eda3 Use encoded values from entry objects directly when generating modlists.[[BR]]
78f0ca9 Store encoded attribute values from search results directly in entry objects.[[BR]]
a7180ed Remove legacy toDict and origDataDict methods of LDAPEntry.[[BR]]
463407a Make sure attributeTypes updates are done before objectClasses updates.[[BR]]
9ecf4b7 Decode and encode attribute values in LDAPEntry on demand.[[BR]]
5d1d513 Always use lists for values in LDAPEntry internally.[[BR]]
5aadaa6 Introduce IPASimpleLDAPObject.decode method for decoding LDAP values.[[BR]]
4f0814d Make LDAPEntry a wrapper around dict rather than a dict subclass.[[BR]]

Adjusting time plan - 3.4 development was postponed as we focused on 3.3.x testing and stabilization.

master:

df5f4ee Turn LDAPEntry.single_value into a dictionary-like property.

Metadata Update from @jcholast:
- Issue assigned to jcholast
- Issue set to the milestone: FreeIPA 4.0 - 2013/11

7 years ago

Login to comment on this ticket.

Metadata