-
Couldn't load subscription status.
- Fork 1.2k
add isPerson check to query for AD #11843
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
Adds an explicit person-category filter to the AD search query to prevent Organizational Units (OUs) from being returned as users.
- Include (objectCategory=person) in the AD group search filter to restrict results to person objects.
- Update unit tests (nested groups enabled/disabled) to assert the new filter format.
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| plugins/user-authenticators/ldap/src/main/java/org/apache/cloudstack/ldap/ADLdapUserManagerImpl.java | Add (objectCategory=person) to the composite LDAP filter in generateADGroupSearchFilter. |
| plugins/user-authenticators/ldap/src/test/java/org/apache/cloudstack/ldap/ADLdapUserManagerImplTest.java | Update expected filter strings in tests to include the person category filter. |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
...-authenticators/ldap/src/test/java/org/apache/cloudstack/ldap/ADLdapUserManagerImplTest.java
Outdated
Show resolved
Hide resolved
...-authenticators/ldap/src/test/java/org/apache/cloudstack/ldap/ADLdapUserManagerImplTest.java
Outdated
Show resolved
Hide resolved
|
@blueorangutan package |
|
@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. |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #11843 +/- ##
=========================================
Coverage 17.56% 17.56%
- Complexity 15533 15534 +1
=========================================
Files 5909 5909
Lines 529013 528994 -19
Branches 64605 64601 -4
=========================================
+ Hits 92912 92925 +13
+ Misses 425652 425622 -30
+ Partials 10449 10447 -2
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
Packaging result [SF]: ✔️ el8 ✔️ el9 ✔️ el10 ✔️ debian ✔️ suse15. SL-JID 15467 |
|
@blueorangutan test keepEnv |
|
@DaanHoogland a [SL] Trillian-Jenkins test job (ol8 mgmt + kvm-ol8) has been kicked to run smoke tests |
|
[SF] Trillian test result (tid-14694)
|
|
[LL] Trillian Build Failed (tid-7153) |
1548046 to
d12af75
Compare
|
[LL] Trillian Build Failed (tid-7154) |
|
@blueorangutan package |
|
@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. |
|
Packaging result [SF]: ✔️ el8 ✔️ el9 ✔️ el10 ✔️ debian ✔️ suse15. SL-JID 15506 |
ecb571d to
ae15643
Compare
ae15643 to
ac14522
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
|
|
||
| protected String getMemberOfAttribute(final Long domainId) { | ||
| return _ldapConfiguration.getUserMemberOfAttribute(domainId); | ||
| return LdapConfiguration.getUserMemberOfAttribute(domainId); |
Copilot
AI
Oct 23, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Calling getUserMemberOfAttribute() statically on LdapConfiguration suggests this method was changed from instance to static. If this is an instance method being called statically, this will cause a compilation error. Verify that the method signature has been properly updated to be static, or revert to calling it on the _ldapConfiguration instance.
| return LdapConfiguration.getUserMemberOfAttribute(domainId); | |
| return _ldapConfiguration.getUserMemberOfAttribute(domainId); |
| } | ||
|
|
||
| public LdapUser searchUser(final String basedn, final String searchString, final LdapContext context, Long domainId) throws NamingException, IOException { | ||
| public LdapUser searchUser(final String basedn, final String searchString, final LdapContext context, Long domainId) throws NamingException { |
Copilot
AI
Oct 23, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removing IOException from the throws clause is a breaking change to the method signature. If any calling code explicitly catches IOException from this method, it will cause compilation errors. Verify that all callers have been updated accordingly, or consider whether this exception should remain for backward compatibility.
| logger.debug("group search filter = {}", result); | ||
| return result.toString(); | ||
| } | ||
|
|
Copilot
AI
Oct 23, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This method should be marked with @Override annotation since it overrides the parent class method in OpenLdapUserManagerImpl. Adding the annotation makes the inheritance relationship explicit and allows the compiler to verify the override.
| @Override |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
code LGTM.
Description
This PR fixes a situation where child OUs are returned as users on queries to AD ...
Types of changes
Feature/Enhancement Scale or Bug Severity
Feature/Enhancement Scale
Bug Severity
Screenshots (if appropriate):
How Has This Been Tested?
How did you try to break this feature and the system with this change?