Skip to content

allow creating ldap on existing linked domain - #13945

Open
DaanHoogland wants to merge 4 commits into
4.20from
ghi8732-ldap-createaccount-group-scope
Open

DaanHoogland wants to merge 4 commits into
4.20from
ghi8732-ldap-createaccount-group-scope

Conversation

@DaanHoogland

@DaanHoogland DaanHoogland commented Aug 21, 2026 •

Copy link
Copy Markdown
Contributor

allow creating ldap accounts after linking accounts to the same the domain

Description

This PR...

Fixes: #8732

Types of changes

  • Breaking change (fix or feature that would cause existing functionality to change)
  • New feature (non-breaking change which adds functionality)
  • Bug fix (non-breaking change which fixes an issue)
  • Enhancement (improves an existing feature and functionality)
  • Cleanup (Code refactoring and cleanup, that may add test cases)
  • Build/CI
  • Test (unit or integration test code)

Feature/Enhancement Scale or Bug Severity

Feature/Enhancement Scale

  • Major
  • Minor

Bug Severity

  • BLOCKER
  • Critical
  • Major
  • Minor
  • Trivial

Screenshots (if appropriate):

How Has This Been Tested?

How did you try to break this feature and the system with this change?

@codecov

codecov Bot commented Aug 21, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 92.00000% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 16.46%. Comparing base (18c4bdf) to head (93d32e2).

Files with missing lines Patch % Lines
...pache/cloudstack/ldap/OpenLdapUserManagerImpl.java 92.00% 0 Missing and 2 partials ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##               4.20   #13945      +/-   ##
============================================
+ Coverage     16.44%   16.46%   +0.02%     
- Complexity    13686    13708      +22     
============================================
  Files          5669     5669              
  Lines        501683   501690       +7     
  Branches      60944    60944              
============================================
+ Hits          82480    82583     +103     
+ Misses       409965   409853     -112     
- Partials       9238     9254      +16     
Flag Coverage Δ
uitests 4.16% <ø> (ø)
unittests 17.32% <92.00%> (+0.02%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 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.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@sonarqubecloud

Copy link
Copy Markdown

@DaanHoogland

Copy link
Copy Markdown
Contributor Author

@blueorangutan package

@blueorangutan

Copy link
Copy Markdown

@DaanHoogland a [SL] Jenkins job has been kicked to build packages. It will be bundled with KVM, XenServer and VMware SystemVM templates. I'll keep you posted as I make progress.

@blueorangutan

Copy link
Copy Markdown

Packaging result [SF]: ✔️ el8 ✔️ el9 ✔️ el10 ✖️ debian ✔️ suse15. SL-JID 18985

@DaanHoogland

Copy link
Copy Markdown
Contributor Author

@blueorangutan test

@blueorangutan

Copy link
Copy Markdown

@DaanHoogland a [SL] Trillian-Jenkins test job (ol8 mgmt + kvm-ol8) has been kicked to run smoke tests

@DaanHoogland DaanHoogland changed the title allow creating ldap accounts after linking accounts to the same the d… allow creating ldap on existing linked domain Aug 26, 2026
@blueorangutan

Copy link
Copy Markdown

[SF] Trillian test result (tid-16828)
Environment: kvm-ol8 (x2), zone: Advanced Networking with Mgmt server ol8
Total time taken: 55905 seconds
Marvin logs: https://github.com/blueorangutan/acs-prs/releases/download/trillian/pr13945-t16828-kvm-ol8.zip
Smoke tests completed. 141 look OK, 0 have errors, 0 did not run
Only failed and skipped tests results shown below:

Test Result Time (s) Test File

@kiranchavala kiranchavala left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM Tested manually

Before fix

root@Cloudstack-423:/home/ubuntu# cmk ldap createaccount username=jithin account=arch-team-acct accounttype=0 domainid=73025da2-280a-4bed-9ca8-7a94904347d1
🙈 Error: (HTTP 534, error code 9999) No LDAP user exists with the username of jithin

After fix , able to create account in the domain

cmk link accounttoldap domainid=607ebf06-7d78-4a9c-9a85-864c6f5d882a  account=qa-team-acct accounttype=0 type=GROUP ldapdomain="cn=qa-team,ou=Telco-Bng,dc=example,dc=in

 cmk link accounttoldap domainid=607ebf06-7d78-4a9c-9a85-864c6f5d882a  account=qa-team-acct accounttype=0 type=GROUP ldapdomain="cn=qa-team,ou=Telco-Bng,dc=example,dc=in"

  cmk ldap createaccount username=jithin account=arch-team-acct accounttype=0 domainid=607ebf06-7d78-4a9c-9a85-864c6f5d882a

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Warning

Copilot couldn't run its full agentic review because it didn't start before the timeout. Make sure your repository has a runner available, or add a copilot-code-review.yml file specifying one with the runs-on attribute. See the docs for more details.

Pull request overview

Adds regression coverage and adjusts LDAP user search behavior so that creating/looking up a single user isn’t blocked by pre-linked LDAP groups in the same domain, while keeping group scoping for browsing/importing.

Changes:

  • Updated LDAP user search filter generation to optionally restrict results to already-linked groups (domain trust maps).
  • Adjusted getUser to search without linked-group scoping, while searchUsers/browsing remains scoped.
  • Added unit tests covering filter scoping behavior and paged-results cookie handling.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 4 comments.

File Description
plugins/user-authenticators/ldap/src/main/java/org/apache/cloudstack/ldap/OpenLdapUserManagerImpl.java Adds a “restrict to linked groups” toggle in search filter generation and refactors paged-results cookie extraction.
plugins/user-authenticators/ldap/src/test/java/org/apache/cloudstack/ldap/OpenLdapUserManagerImplTest.java New regression tests validating the new scoping behavior and paging loop behavior.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@DaanHoogland
DaanHoogland force-pushed the ghi8732-ldap-createaccount-group-scope branch from 00e3223 to 93d32e2 Compare November 9, 2026 13:47
@DaanHoogland

Copy link
Copy Markdown
Contributor Author

@shwstppr @nvazquez can you have a look?

@sonarqubecloud

sonarqubecloud Bot commented Nov 9, 2026

Copy link
Copy Markdown

This branch has not been deployed

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

Projects

Status: Ready

Development

Successfully merging this pull request may close these issues.

Unable to create another ldap Account if another account is linked to ldap group in the same domain

4 participants