Skip to content

Properly handle Base64-encoded attributes#19

Open
maxbes wants to merge 1 commit intolsc-project:masterfrom
Worteks:fix-encoded-attributes
Open

Properly handle Base64-encoded attributes#19
maxbes wants to merge 1 commit intolsc-project:masterfrom
Worteks:fix-encoded-attributes

Conversation

@maxbes
Copy link

@maxbes maxbes commented Feb 3, 2026

Currently, if I use ExecutableLdifSourceService with a LDIF that contains base64-encoded fields, the attributes will show up incorrectly in LSC:

(actual value: Cécile)

ldif:

givenName:: Q8OpY2lsZQ==

in LSC the value appears, literaly, as :

0x43 0xC3 0xA9 0x63 0x69 0x6C 0x65

This MR fixes the conversion from o.a.d.api.ldap.model.entry.Value to java.lang.String so that Values that were decoded from Base64 no longer appear as a string of hex codes.

⚠️ possible regressions: pure binary data (jpegPhoto) that appears in a LDIF file will also be exposed to LSC as pure binary data from now on

@coudot coudot added this to the 1.4 milestone Feb 3, 2026
@elecharny
Copy link

elecharny commented Feb 3, 2026

A very bad usage of the Value.toString() method, indeed. The fix is valid, calling the Value.getString() method will return the proper string:

  • If the value is HR, the returned value will be the User Provided value (ie the not normalized string)
  • If the value is binary, it will return a String representation of the binary content, assuming it's UTF8 encoded.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants