Skip to content

refactor(ldap)!: switch LDAP server config from host/port to uri#983

Merged
JohnVillalovos merged 1 commit intodevelopfrom
jlvillal/ldap_uri
Apr 9, 2026
Merged

refactor(ldap)!: switch LDAP server config from host/port to uri#983
JohnVillalovos merged 1 commit intodevelopfrom
jlvillal/ldap_uri

Conversation

@JohnVillalovos
Copy link
Copy Markdown
Collaborator

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.

Copilot AI review requested due to automatic review settings February 8, 2026 02:13
@JohnVillalovos JohnVillalovos marked this pull request as draft February 8, 2026 02:13
Copy link
Copy Markdown
Contributor

Copilot AI left a 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 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/port to required uri (space-separated for multiple servers).
  • Remove vendored PEAR/Net_LDAP2 sources and rely on pear/net_ldap2 via Composer (documented + suggested in composer.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.

Comment thread plugins/Authentication/Ldap/LdapOptions.php Outdated
Comment thread plugins/Authentication/Ldap/Ldap2Wrapper.php
@JohnVillalovos JohnVillalovos force-pushed the jlvillal/ldap_uri branch 2 times, most recently from d7f2f49 to 12c1a52 Compare February 10, 2026 00:53
@JohnVillalovos JohnVillalovos force-pushed the jlvillal/ldap_uri branch 3 times, most recently from ce3057b to f8dfe6e Compare April 9, 2026 02:38
@JohnVillalovos JohnVillalovos marked this pull request as ready for review April 9, 2026 02:40
@JohnVillalovos JohnVillalovos requested a review from Copilot April 9, 2026 02:47
Copy link
Copy Markdown
Contributor

Copilot AI left a 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 7 out of 7 changed files in this pull request and generated 3 comments.

Comment thread plugins/Authentication/Ldap/Ldap.php
Comment thread plugins/Authentication/Ldap/LdapOptions.php
Comment thread docs/source/LDAP-Authentication.rst Outdated
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.
@JohnVillalovos JohnVillalovos merged commit bd01c04 into develop Apr 9, 2026
16 checks passed
@JohnVillalovos JohnVillalovos deleted the jlvillal/ldap_uri branch April 9, 2026 04:31
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.

2 participants