Bug 50343 - Python 3: Get rid of decode_ignorelist and compatible_modstring
Python 3: Get rid of decode_ignorelist and compatible_modstring
Status: VERIFIED FIXED
Product: UCS
Classification: Unclassified
Component: UDM (Generic)
UCS 4.4
Other Linux
: P5 normal (vote)
: UCS 5.1
Assigned To: Florian Best
Marius Meschter
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2019-10-10 16:54 CEST by Florian Best
Modified: 2024-03-08 10:34 CET (History)
1 user (show)

See Also:
What kind of report is it?: Development Internal
What type of bug is this?: ---
Who will be affected by this bug?: ---
How will those affected feel about the bug?: ---
User Pain:
Enterprise Customer affected?:
School Customer affected?:
ISV affected?:
Waiting Support:
Flags outvoted (downgraded) after PO Review:
Ticket number:
Bug group (optional):
Max CVSS v3 score:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Florian Best univentionstaff 2019-10-10 16:54:15 CEST
For python3 we need to explicit know about the encoding for every UDM property and LDAP attribute.

We should get rid of the decode_ignorelist in univention.uldap.access() and in univention.s4connector.s4.

We should get rid of the UCR variable 'ldap/binaryattributes'.

We should get rid of the DECODE_IGNORELIST in univention.s4connector.s4.

We should get rid of compatible_modstring() in univention.s4connector.s4.

Every univention.admin.property() should have the information which encoding the property has.

The mapping from LDAP attributes (UDM oldattr) to UDM properties (UDM info) should apply the encoding. LDAP attributes are python "bytes", UDM properties are python "unicode" objects.
Most attributes can have encoding='UTF-8'. All binary attributes must use encoding='latin-1'.

The mapping in the S4-Connector should also have the encoding information for each attribute (ucs_attribute, ldap_attribute, con_attribute).

Information about the encoding per LDAP syntax of each attribute can be obtained at:
https://tools.ietf.org/html/rfc4517
https://social.technet.microsoft.com/wiki/contents/articles/52570.active-directory-syntaxes-of-attributes.aspx
Comment 1 Florian Best univentionstaff 2022-02-21 13:29:19 CET
(In reply to Florian Best from comment #0)
> For python3 we need to explicit know about the encoding for every UDM
> property and LDAP attribute.
> 
> We should get rid of the decode_ignorelist in univention.uldap.access() and
> in univention.s4connector.s4.
partly done. UDM only still uses it with Python 2.

> We should get rid of the UCR variable 'ldap/binaryattributes'.
TODO

> We should get rid of the DECODE_IGNORELIST in univention.s4connector.s4.
done

> We should get rid of compatible_modstring() in univention.s4connector.s4.
done

> Every univention.admin.property() should have the information which encoding
> the property has.
done

> The mapping from LDAP attributes (UDM oldattr) to UDM properties (UDM info)
> should apply the encoding. LDAP attributes are python "bytes", UDM
> properties are python "unicode" objects.
> Most attributes can have encoding='UTF-8'. All binary attributes must use
> encoding='latin-1'.
done (binary attributes are decoded with base64)
 
> The mapping in the S4-Connector should also have the encoding information
> for each attribute (ucs_attribute, ldap_attribute, con_attribute).
done: `con_attribute_encoding`
Comment 3 Marius Meschter univentionstaff 2023-12-15 14:38:25 CET
QA:
code review: OK
changelog entry: OK
decode_ignorelist not used anymore: OK
searching compatible_modstring returns no results in code: OK
Comment 4 Florian Best univentionstaff 2024-03-08 10:34:10 CET
univention-python (14.0.5)
8723aea0a978 | refactor(udm): remove decode_ignorelist

univention-lib (10.0.6)
8723aea0a978 | refactor(udm): remove decode_ignorelist

univention-directory-manager-modules (16.0.9)
8723aea0a978 | refactor(udm): remove decode_ignorelist

univention-base-files (10.0.5)
8723aea0a978 | refactor(udm): remove decode_ignorelist

ucs-test (11.0.12)
8723aea0a978 | refactor(udm): remove decode_ignorelist