Skip to content

Comments

Fix multi-value attribute encoding for non-ASCII characters#95

Merged
TharmiganK merged 4 commits intofix-bug-8562from
copilot/fix-ldap-issue-8562
Jan 19, 2026
Merged

Fix multi-value attribute encoding for non-ASCII characters#95
TharmiganK merged 4 commits intofix-bug-8562from
copilot/fix-ldap-issue-8562

Conversation

Copy link

Copilot AI commented Jan 19, 2026

Description

When an LDAP attribute has multiple values containing non-ASCII characters, only the first value was returned. The processAttribute method was using attribute.getValueByteArray() (singular) which only returns the first value's byte array, ignoring subsequent values.

Changes:

  • Modified processAttribute to use getValueByteArrays() (plural) and iterate all values when Base64 encoding is required
  • Refactored encodeAttributeValue to accept attribute name and byte array separately
  • Added encodeAttributeValues helper for batch encoding
  • Added null/empty array safety checks
  • Added changelog.md with release note entry linking to the issue

One line release note:

  • Fixed multi-value LDAP attributes with non-ASCII characters returning only the first encoded value

Type of change

  • Bug fix (non-breaking change which fixes an issue)

How Has This Been Tested?

  • Added testMultiValueAttributeWithNonAscii test that creates an entry with multi-value description attribute containing Japanese, Greek, and Chinese characters, then verifies all 3 values are returned

Test Configuration:

  • Ballerina Version: SwanLake Update 12
  • Operating System: Linux
  • Java SDK: 17

Checklist:

Security checks

Original prompt

You are an software enginner familiar with Ballerina, Java and LDAP specification

Fix the issue descriped in ballerina-platform/ballerina-library#8562

Make sure to add proper test cases


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

@CLAassistant
Copy link

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

Copilot AI and others added 2 commits January 19, 2026 09:06
Co-authored-by: TharmiganK <63336800+TharmiganK@users.noreply.github.com>
Co-authored-by: TharmiganK <63336800+TharmiganK@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix issue related to LDAP specification in Ballerina Fix multi-value attribute encoding for non-ASCII characters Jan 19, 2026
Copilot AI requested a review from TharmiganK January 19, 2026 09:10
@TharmiganK TharmiganK marked this pull request as ready for review January 19, 2026 09:11
@codecov
Copy link

codecov bot commented Jan 19, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
⚠️ Please upload report for BASE (fix-bug-8562@4202650). Learn more about missing BASE report.

Additional details and impacted files
@@               Coverage Diff               @@
##             fix-bug-8562      #95   +/-   ##
===============================================
  Coverage                ?   96.66%           
===============================================
  Files                   ?        2           
  Lines                   ?       30           
  Branches                ?       10           
===============================================
  Hits                    ?       29           
  Misses                  ?        1           
  Partials                ?        0           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@TharmiganK
Copy link
Contributor

@copilot Add a change log file similar to this: https://github.com/ballerina-platform/module-ballerina-http/blob/master/changelog.md where you add a one line change and link the issue

Co-authored-by: TharmiganK <63336800+TharmiganK@users.noreply.github.com>
Copy link
Author

Copilot AI commented Jan 19, 2026

@copilot Add a change log file similar to this: https://github.com/ballerina-platform/module-ballerina-http/blob/master/changelog.md where you add a one line change and link the issue

Added changelog.md with a one-line change note linking to issue #8562 in commit 0cf5bcc.

@TharmiganK TharmiganK merged commit 5dc29d1 into fix-bug-8562 Jan 19, 2026
1 check was pending
@TharmiganK TharmiganK deleted the copilot/fix-ldap-issue-8562 branch January 19, 2026 09:33
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