refactor(ldap)!: switch LDAP server config from host/port to uri#983
Merged
JohnVillalovos merged 1 commit intodevelopfrom Apr 9, 2026
Merged
refactor(ldap)!: switch LDAP server config from host/port to uri#983JohnVillalovos merged 1 commit intodevelopfrom
JohnVillalovos merged 1 commit intodevelopfrom
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR refactors the LDAP authentication plugin to configure LDAP servers via a required URI string (supporting multiple servers), aligning better with PHP LDAP connection semantics and removing support for legacy host/port.
Changes:
- Replace LDAP plugin configuration from
host/portto requireduri(space-separated for multiple servers). - Remove vendored PEAR/Net_LDAP2 sources and rely on
pear/net_ldap2via Composer (documented + suggested incomposer.json). - Update LDAP plugin runtime checks, tests, and documentation to reflect the new configuration and dependency model.
Reviewed changes
Copilot reviewed 25 out of 25 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/Plugins/Authentication/Ldap/LdapTest.php | Updates tests to use URI-based config and adds coverage for rejecting legacy host/port. |
| plugins/Authentication/Ldap/namespace.php | Removes PEAR include-path bootstrapping; relies on normal loading paths. |
| plugins/Authentication/Ldap/LdapOptions.php | Switches option construction to read/validate uri and rejects legacy host/port. |
| plugins/Authentication/Ldap/LdapConfigKeys.php | Removes HOST/PORT keys and introduces URI config key metadata. |
| plugins/Authentication/Ldap/Ldap2Wrapper.php | Uses PEAR::isError checks and adds a runtime guard for missing pear/net_ldap2. |
| plugins/Authentication/Ldap/Ldap.config.dist.php | Updates distributed config template to document and default uri. |
| plugins/Authentication/Ldap/LDAP2/Util.php | Deletes vendored Net_LDAP2 implementation file (now external dependency). |
| plugins/Authentication/Ldap/LDAP2/SimpleFileSchemaCache.php | Deletes vendored Net_LDAP2 implementation file (now external dependency). |
| plugins/Authentication/Ldap/LDAP2/Search.php | Deletes vendored Net_LDAP2 implementation file (now external dependency). |
| plugins/Authentication/Ldap/LDAP2/SchemaCache.interface.php | Deletes vendored Net_LDAP2 implementation file (now external dependency). |
| plugins/Authentication/Ldap/LDAP2/Schema.php | Deletes vendored Net_LDAP2 implementation file (now external dependency). |
| plugins/Authentication/Ldap/LDAP2/RootDSE.php | Deletes vendored Net_LDAP2 implementation file (now external dependency). |
| plugins/Authentication/Ldap/LDAP2/LDIF.php | Deletes vendored Net_LDAP2 implementation file (now external dependency). |
| plugins/Authentication/Ldap/LDAP2/Filter.php | Deletes vendored Net_LDAP2 implementation file (now external dependency). |
| plugins/Authentication/Ldap/LDAP2/Entry.php | Deletes vendored Net_LDAP2 implementation file (now external dependency). |
| lib/external/pear/license.txt | Removes vendored PEAR license file (PEAR no longer shipped in-tree). |
| lib/external/pear/PEAR.php | Removes vendored PEAR core (now external dependency if needed). |
| lib/external/pear/Config/Container/PHPArray.php | Removes vendored PEAR Config component (no longer shipped in-tree). |
| lib/external/pear/Config/Container.php | Removes vendored PEAR Config component (no longer shipped in-tree). |
| lib/external/pear/Config.php | Removes vendored PEAR Config component (no longer shipped in-tree). |
| docs/source/LDAP-Authentication.rst | Documents prerequisites (pear/net_ldap2) and the new uri configuration with examples. |
| docs/source/INSTALLATION.rst | Updates installation guidance to prefer composer install --no-dev by default. |
| composer.json | Adds pear/net_ldap2 as a suggested dependency for LDAP plugin usage. |
| .github/workflows/lint-and-analyse-php.yml | Minor workflow comment cleanup. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
d7f2f49 to
12c1a52
Compare
ce3057b to
f8dfe6e
Compare
To work better with PHP's `ldap_connect()` function, we have switched to requiring a URI to specify the LDAP server(s). This allows specifying multiple LDAP servers, if desired. BREAKING CHANGE: LDAP plugin configuration now requires `uri` and no longer supports `host` or `port`. Migrate to: `'uri' => 'ldap://host:389'` or `'uri' => 'ldaps://host:636'` For multiple servers, provide a space-separated URI string.
f8dfe6e to
c275018
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
To work better with PHP's
ldap_connect()function, we have switched torequiring a URI to specify the LDAP server(s).
This allows specifying multiple LDAP servers, if desired.
BREAKING CHANGE: LDAP plugin configuration now requires
uriand nolonger supports
hostorport. Migrate to:'uri' => 'ldap://host:389'or'uri' => 'ldaps://host:636'For multipleservers, provide a space-separated URI string.