-
Notifications
You must be signed in to change notification settings - Fork 36
Add LDAP as an option for authenticating a User. #1225
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: master
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
This pull request adds LDAP authentication support to the HiveMQ Edge Admin API, allowing users to be authenticated against an LDAP directory server instead of using a static user list in the configuration file.
Key Changes:
- Implemented comprehensive LDAP client library with support for multiple TLS modes (NONE, LDAPS, START_TLS)
- Added XML configuration schema and entities for LDAP authentication
- Refactored authentication provider interface from
IUsernamePasswordProvider
toIUsernameRolesProvider
- Integrated UnboundID LDAP SDK and Testcontainers for testing
Reviewed Changes
Copilot reviewed 45 out of 45 changed files in this pull request and generated 8 comments.
Show a summary per file
File | Description |
---|---|
hivemq-edge/src/main/java/com/hivemq/api/auth/provider/impl/ldap/*.java |
Core LDAP client implementation with connection management, DN resolution strategies, and TLS support |
hivemq-edge/src/main/java/com/hivemq/configuration/entity/api/Ldap*.java |
XML configuration entities for LDAP authentication settings |
hivemq-edge/src/main/resources/config.xsd |
Schema definition for LDAP configuration elements |
hivemq-edge/src/main/java/com/hivemq/api/auth/provider/IUsernameRolesProvider.java |
Refactored authentication provider interface |
hivemq-edge/src/main/java/com/hivemq/api/ioc/ApiModule.java |
Dependency injection configuration for LDAP authentication |
hivemq-edge/src/test/java/com/hivemq/api/auth/provider/impl/ldap/*.java |
Comprehensive integration and unit tests with testcontainers |
hivemq-edge/build.gradle.kts , gradle/libs.versions.toml |
Added UnboundID LDAP SDK and Testcontainers dependencies |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
hivemq-edge/src/test/java/com/hivemq/configuration/writer/ConfigFileWriterTest.java
Outdated
Show resolved
Hide resolved
hivemq-edge/src/main/java/com/hivemq/api/auth/provider/impl/ldap/LdapUsernameRolesProvider.java
Outdated
Show resolved
Hide resolved
hivemq-edge/src/test/java/com/hivemq/api/auth/provider/impl/ldap/OpenLdapTest.java
Outdated
Show resolved
Hide resolved
hivemq-edge/src/main/java/com/hivemq/configuration/entity/api/UsernameRolesSourceEntity.java
Outdated
Show resolved
Hide resolved
...rc/main/java/com/hivemq/configuration/entity/api/UserlistBasedUsernameRolesSourceEntity.java
Outdated
Show resolved
Hide resolved
hivemq-edge/src/main/java/com/hivemq/api/auth/provider/impl/ldap/LdapUsernameRolesProvider.java
Show resolved
Hide resolved
81fc017
to
554e05a
Compare
…igFileWriterTest.java Co-authored-by: Copilot <[email protected]>
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.
looks good to me, all tests pass. I left a few knits to pick.
hivemq-edge/src/main/java/com/hivemq/http/core/UsernamePasswordRoles.java
Show resolved
Hide resolved
hivemq-edge/src/main/java/com/hivemq/api/auth/handler/impl/BasicAuthenticationHandler.java
Outdated
Show resolved
Hide resolved
hivemq-edge/src/main/java/com/hivemq/api/auth/provider/IUsernameRolesProvider.java
Outdated
Show resolved
Hide resolved
hivemq-edge/src/main/java/com/hivemq/api/auth/provider/impl/ldap/LdapConnectionProperties.java
Show resolved
Hide resolved
hivemq-edge/src/main/java/com/hivemq/api/auth/provider/impl/ldap/LdapClient.java
Show resolved
Hide resolved
hivemq-edge/src/main/java/com/hivemq/api/auth/provider/impl/ldap/SearchFilterDnResolver.java
Show resolved
Hide resolved
hivemq-edge/src/main/java/com/hivemq/api/auth/provider/impl/ldap/LdapUsernameRolesProvider.java
Show resolved
Hide resolved
hivemq-edge/src/main/java/com/hivemq/api/resources/impl/AuthenticationResourceImpl.java
Show resolved
Hide resolved
hivemq-edge/src/main/java/com/hivemq/api/resources/impl/AuthenticationResourceImpl.java
Show resolved
Hide resolved
…ap/OpenLdapTest.java Co-authored-by: Copilot <[email protected]>
hivemq-edge/src/main/java/com/hivemq/api/auth/provider/impl/ldap/LdapClient.java
Show resolved
Hide resolved
hivemq-edge/src/main/java/com/hivemq/api/auth/provider/impl/ldap/LdapConnectionProperties.java
Show resolved
Hide resolved
hivemq-edge/src/main/java/com/hivemq/api/auth/provider/impl/ldap/LdapConnectionProperties.java
Show resolved
Hide resolved
hivemq-edge/src/main/java/com/hivemq/api/auth/provider/impl/ldap/TlsMode.java
Outdated
Show resolved
Hide resolved
.../src/main/java/com/hivemq/api/auth/provider/impl/simple/SimpleUsernameRolesProviderImpl.java
Show resolved
Hide resolved
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.
LGTM
Motivation
Resolves #36525
Changes
Add LDAP authentication support