Skip to content

Improvements to LdapPublisher-Rebase#1036

Open
Stueypoo wants to merge 1 commit intoKeyfactor:mainfrom
Stueypoo:Imporvements_to_LdapPublisher-Rebase
Open

Improvements to LdapPublisher-Rebase#1036
Stueypoo wants to merge 1 commit intoKeyfactor:mainfrom
Stueypoo:Imporvements_to_LdapPublisher-Rebase

Conversation

@Stueypoo
Copy link
Copy Markdown
Contributor

Describe your changes

Note: This is a replacement pull request superceding #940. Some changes from #940 have not been incorporated as requested.

In testing with LdapPublisher, I found a few issues and provide some fixes as described below:

  1. The method constructLDAPDN() appends the BaseDN after working out the LDAP DN. This is normally OK, but not if the BaseDN is 'blank'. Some situations may require a BaseDN set to 'blank', so have included a fix for this. Note that you could set a 'blank' BaseDN in the GUI by entering a space character.

  2. The method getObjectClassAttribute() was limitted to creation of O and OU object classes. Generally, other object classes should be supported, such as DC, L, ST, and C. This method has been updated for this.

  3. The method createIntermediateNodes() changed to use a recursive process of checking the existence of parent nodes, and then creating the missing nodes as the recursion unwinds. I suggest this code variation is a bit simpler and better handles a BaseDN that could be blank (which is sometimes required).

  4. The method revokeCertificate() has the option to delete the revoked certificate from LDAP. However, if the user has multiple certificates in the LDAP, then all certificates will get deleted. This is mentioned in the documentation, but a better approach would be to keep the remaining certificates in the LDAP. A fix for this has been included.

  5. The method revokeCertificate() can also delete the whole user entry in the LDAP when their certificate is revoked. A better approach would be to only delete an entry if there are no other certificates remaining once the revoked certificate is removed. A fix for this has been included.

  6. Some changes to debug log messages included.

  7. Some methods changed from 'private' to 'protected' to help further subclassing.

How has this been tested?

LdapPublisherUnitTest has been updated with additional tests to confirm these fixes. I have also performed some tests manually using a true LDAP server.

Checklist before requesting a review

  • I have performed a self-review of my code
  • I have kept the patch limited to only change the parts related to the patch
  • This change requires a documentation update - See point 4 above.

See also Contributing Guidelines.

@Stueypoo Stueypoo mentioned this pull request Apr 10, 2026
3 tasks
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.

1 participant