Skip to content

[#1283] Add LDAP proxy backend - #1292

Open
vharseko wants to merge 21 commits into
OpenIdentityPlatform:masterfrom
vharseko:features/proxy-backend
Open

vharseko wants to merge 21 commits into
OpenIdentityPlatform:masterfrom
vharseko:features/proxy-backend

Conversation

@vharseko

@vharseko vharseko commented Nov 13, 2026 •

Copy link
Copy Markdown
Member

Summary

Add an LDAP proxy backend that routes LDAP requests to equivalent remote directories using static or OpenDJ replication discovery. It supports primary/secondary failover, TLS certificate validation, DN and attribute mapping, and forwarding of LDAP operations and controls. Client-facing remote transport failures are normalized to LDAP UNAVAILABLE (52), rather than exposing LDAP SDK client-side result codes.

The proxy preserves client authorization using client-bound connections or LDAP Proxied Authorization V2, with an explicit, configurable policy for choosing the remote operation identity. Search results retain objectClass in both the internal object-class map and the LDAP attribute maps, including class names absent from the local schema. Types-only searches preserve empty attribute types. The proxy can also expose a remote attribute under an additional read-only client name without removing the original attribute.

Search result accounting records entries after successful delivery, including entries forwarded by the proxy and internal search results. Access logs therefore report the number of entries delivered to the client; a regression covers zero, one, and multiple proxy entries and a local backend search.

Proxy access logging

The file-based text access log records PROXY_REQ and PROXY_RES for forwarded operations. The records retain the client operation's conn, op, and msgID, with a local proxyOp to distinguish forwarding attempts. They include the identity mode, shard and rewritten request details, and the endpoint that actually returned the LDAP response. Remote identities and authorization DNs are included when known. These identifiers are not sent to the remote server.

PROXY_RES reports the attempt's result, remote search entry count, and elapsed time measured locally from connection acquisition through completion, including pool wait and network time. If no response is received, the record distinguishes the selected endpoint from a responding server. Pool statistics are included before result when available, without additional configuration; the snapshot is best-effort under concurrent updates. Direct binds do not use a pool. The guide documents the fields and examples. JSON, CSV, and external access publishers do not emit these proxy records.

Operation identity modes

Service discovery exposes operation-identity-mode:

  • auto (default) selects client without service credentials; with credentials it selects proxy-auth only when every route server advertises Proxied Authorization V2, otherwise specific. Unknown or failed capability probes return UNAVAILABLE rather than changing the remote identity.
  • client always uses a connection authenticated by the client through this proxy.
  • specific always uses the service account without a proxied authorization control.
  • proxy-auth requires a service account and Proxied Authorization V2 on every route server; it never falls back to another identity.

The configuration schema registers ds-cfg-operation-identity-mode under the 3A Systems PEN. Static discovery rejects specific and proxy-auth when service credentials are absent.

The administration guide explains configuration, authorization and audit consequences, connection-pool limits, fail-closed availability behavior, and server-specific requirements. It includes OpenDJ, OpenLDAP, 389 Directory Server, and Microsoft Active Directory guidance. AD DS does not implement RFC 4370 Proxied Authorization, so AD routes use specific or client, not proxy-auth.

Tier load balancing

Static and replication discovery mechanisms provide independent primary-load-balancing-algorithm and secondary-load-balancing-algorithm properties. Both default to affinity; the available values are affinity, round-robin, least-requests, failover, and distribution.

The transition between groups is unchanged: every primary connection candidate is exhausted before the secondary policy is used. The selected policy applies both to service-account operations and to client-mode binds. SDK load balancers periodically recheck connection factories marked offline and return recovered members to selection. Client-mode binds use a separate path; an existing client session remains pinned to its selected server and must bind again after losing its connections.

distribution consistently hashes normalized full target DNs across fully replicated servers. It is not LDAP data partitioning and searches are not broadcast. least-requests is local to one proxy and, while recovering from a failed primary candidate, accounts for the selected strict-priority route rather than the finally connected physical server. It is therefore not an exact per-server measure during that case. The implementation deliberately does not add weighted routes, per-operation routing priorities, configurable health probes, or cross-proxy coordination.

The optional, multi-valued server-priority property assigns a non-negative integer to a remote LDAP address; omitted addresses default to 0, and lower numbers are preferred. failover selects in priority order, while least-requests uses priority to break equal active-request counts. Static discovery requires the address to belong to the configured primary or secondary group; replication discovery also accepts addresses not yet discovered. Priorities do not reorder affinity, round-robin, or distribution. The primary group still takes precedence over the secondary group. Changing priorities replaces routes and client-mode sessions must bind again.

The administration guide describes each algorithm, its configuration requirements, and its operational risks. Server insertion order is not an administrator-controlled priority. Distribution uses discovery order for its hash-ring server IDs, which can remap DNs when that order changes.

Remote connections and pools

The proxy backend exposes connection, request, heartbeat, reconnect, and service-account pool settings. Remote request timeout defaults to 30 seconds; the service pool retains up to four idle core connections per remote server and has a maximum of 1,024. A saturated pool waits up to 10 seconds by default, then returns BUSY without marking the server offline or failing over. Core connections are created lazily, not preallocated. Time settings have a maximum of one hour; zero disables the request timeout or selects the operating-system connection timeout where applicable.

Heartbeat settings include the remote search base and filter. Heartbeats operate on existing connections; reconnect checks apply to SDK factories already marked offline. They are not independent proactive availability probes for every remote server, and a heartbeat filter returning no entries is not a PingDS-style availability check. Client-bound pools remain separate; their connections are not automatically reauthenticated or moved after a failure. Capability-probe and replication-discovery administrative timeouts remain separate.

Reconfiguring a backend creates new routes while allowing in-flight operations to finish on retired routes. Client-mode sessions tied to a replaced route must bind again. New settings use existing PingDS OIDs where applicable and 3A Systems OIDs for OpenDJ-specific properties. The administration guide documents defaults, limits, usage, and these distinctions.

Attribute aliases

Proxy backends expose multi-valued attribute-alias, using client-alias=remote-attribute. Unlike attribute-mapping, an alias retains the remote attribute and returns the same values under both names. Multiple aliases may refer to one remote attribute.

Aliases are rewritten in search filters, compare requests, assertion controls, pre-read and post-read attribute lists, and requested-attribute lists. They are read-only: using an alias in an add, modify, DN, or RDN request returns UNWILLING_TO_PERFORM. Overlaps with mappings or other aliases are rejected. Administrators must define custom aliases in the proxy schema with compatible syntax and matching rules. The proxy search path does not enforce local entry or attribute ACIs on returned values; access to the remote source attribute must be enforced through remote-directory ACLs and the configured operation identity. An alias is not a separate security boundary.

Virtual or templated attributes, including values derived from another attribute such as {$uid}@example.com, are intentionally not part of this change.

Discovery provider compatibility

Providers implementing the former ServiceDiscoveryMechanism interface must be ported to extend the current abstract class and rebuilt against the target OpenDJ version. The upgrade guide documents the lifecycle and partition API changes; the upgrade tool does not adapt extension JARs. Incompatible provider binaries produce an actionable configuration diagnostic. Startup logs a rejected mechanism and continues initializing other mechanisms, and rejected configurations can be deleted safely.

CI coverage

The normal Failsafe includes both ProxyBackendOpenLdapIT and ProxyBackend389IT. Linux CI passes the running Docker daemon's API version to Testcontainers, avoiding the obsolete client API rejected in the previous run. These two integration classes fail setup when Docker is unavailable in CI, rather than silently skipping their assertions.

Follow-up work

Per-operation routing priorities, proactive availability checks and monitoring, full directory federation, virtual attributes, and LDIF fallback are deferred to separate issues. Further work is also needed for interrupted-write and recovery tests, global writability enforcement, search cancellation and other result-accounting behavior, and RDN attribute mapping without a remote base DN.

Validation

Local verification after the connection factory compatibility fix: OpenJDK 11.0.33 passed all 8,274 opendj-core tests and 158 server tests (ProxyBackendTest, SearchOperationTestCase, and AbstractTextAccessLogPublisherTest), with no failures, errors, or skips. Without a routing context the load balancer uses the existing connection factory methods; with a context it uses the context-aware methods. git diff --check passed.

Local targeted verification after proxy access logging: OpenJDK 11.0.33 passed 29 SDK tests (ConnectionPoolTestCase, ConnectionsTestCase) and 158 server tests (ProxyBackendTest, SearchOperationTestCase, AbstractTextAccessLogPublisherTest) with no failures, errors, or skips. A regression for distinct deferred proxy failure results failed before the fix and passed afterward. The test for a saturated pool checks the logged result and acquisition wait; a separate slow-subordinate timing integration test was not run. git diff --check passed.

The earlier update handles CodeQL alert #1697 by reporting the full server address when its port cannot be parsed. The regression checks that an overflowing static server port is rejected with an actionable diagnostic.

Local targeted verification after the search entry count fix:

  • OpenJDK 11.0.33: 77 tests passed with no failures, errors, or skips: two ProxyBackendTest scenarios and all 75 SearchOperationTestCase tests. The new access-log regression failed before the fix with nentries=0 for one delivered entry and passed afterward. git diff --check passed.

Local targeted verification after the priority and review updates:

  • After the port-diagnostic update, OpenJDK 11.0.33 passed 57 server tests across ProxyBackendTest, ReplicationDiscoveryRoutingTest, and ReplicationTopologyTest, with no failures, errors, or skips. The new diagnostic regression failed before the fix and passed afterward. git diff --check passed.

  • OpenJDK 11.0.33: 26 SDK tests (ConnectionPoolTestCase and ConnectionsTestCase), plus 56 server tests across ProxyBackendTest, ReplicationDiscoveryRoutingTest, and ReplicationTopologyTest, all passing with no skips.

  • OpenJDK 21.0.12.1: 26 SDK tests and 49 server tests (ProxyBackendTest and ReplicationDiscoveryRoutingTest), all passing with no skips. The round-robin bind test now checks a four-request alternating cycle without assuming discovery's initial server order.

  • OpenJDK 27: 26 SDK tests passed with no skips. Documentation tests passed 26/26 under JDK 11. git diff --check passed.

  • The pool tests hold publication after dequeue to verify cancelled-delivery reclamation, and separately force completion to win cancellation after an interrupt. Removing the corresponding cleanup in each case caused the respective regression to time out; the production code was restored.

  • The configuration test observes the SDK's connection timeout and reconnect interval. A real replication-discovery proxy test observes the configured heartbeat, BUSY with its sole service connection held, and reuse after release. A combined mutation suppressing both timeout settings and both replication-route settings triggered all four corresponding assertions; the production code was restored.

  • Priority tests cover both discovery mechanisms, primary and secondary selection, client binds, tie-breaking versus active load, validation, live updates, and IPv6 zone identifiers. The OpenLDAP and 389 Directory Server container suites were not rerun during this latest targeted verification.

Closes #1283

@vharseko
vharseko requested a review from maximthomas November 13, 2026 07:47
@vharseko vharseko added enhancement java Changes to Java sources protocol LDAP protocol extensions, controls and RFC support monitoring cn=monitor entries, JMX and SNMP monitoring backend Storage backends (JE, PDB, memory) and their database behaviour schema LDAP schema: attribute types, object classes, DIT structure rules, name forms upgrade Upgrading between versions and migrating from other directory servers replication tests Test suites: fixing, enabling, un-disabling docs security Security fixes / CodeQL code-scanning alerts tls TLS connections, certificates, and encrypted handshakes build concurrency Thread-safety / race-condition bugs docker labels Nov 13, 2026
@vharseko

Copy link
Copy Markdown
Member Author

The CodeQL findings are addressed in this update:

  • Made the client authentication reference volatile so that updates are visible to other threads, including reads and writes outside the synchronized setter.
  • Selected and checked the connection factory once before processing the operation, preserving the separate bind and user-connection behavior.

Validation: the targeted Maven run passed 1,171 tests, including the proxy, TLS, bind, and authenticated-user tests. git diff --check also passed. CodeQL will run on the updated commit.

@maximthomas maximthomas left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

praise: Route retirement preserves factories used by active requests.

  • ProxyBackend.execute:847-869 captures factories and increments route.users under routingLock.
  • ProxyBackend.execute:1128-1135 releases the route after connections have been returned, then closes retired resources when no users remain.

issue (blocking): Discovery providers outside org.opends.server.discovery cannot override the lifecycle callbacks.

opendj-server-legacy/src/main/java/org/opends/server/discovery/ServiceDiscoveryMechanism.java:62, :72, :79

These methods were public interface methods at BASE and are now package-private base-class methods. A provider in another package cannot override them, even after adapting its source from implements to extends. ServiceDiscoveryMechanismConfigManager:103,141,155 consequently invokes the base implementations: configuration is accepted, provider initialization is skipped, and provider cleanup is skipped. The configurable java-class still accepts external subclasses.

Restore public visibility for isConfigurationAcceptable, initializeMechanism, and finalizeMechanism, widening their matching overrides in both StaticServiceDiscoveryMechanism and ReplicationServiceDiscoveryMechanism as well. Restore public getName visibility to preserve the former interface contract; listener and partition methods are already public.

Pin: configure a provider fixture in a different package and assert that manager validation, initialization, and deletion invoke its callbacks.


suggestion (non-blocking): Successful paging through active DN and attribute mapping has no regression assertion.

opendj-server-legacy/src/test/java/org/opends/server/backends/ProxyBackendTest.java:1495

The paging case expects UNAVAILABLE_CRITICAL_EXTENSION from a remote backend without paging support. It does not exercise successful pages or continuation cookies, although ProxyRewriter:233-234,260-261 preserves paging controls. ProxyBackendTest passed 26/26 under JDK 11.0.25; no mutation was executed for this coverage observation.

Pin: with a paging-capable remote and active mapping, request page size one, assert a rewritten entry and nonempty cookie, resume with that cookie, and verify each expected entry appears once before an empty terminal cookie. Deferred to the author's discretion.


suggestion (non-blocking): Pre-read request and response rewriting have no proxy regression assertions.

opendj-server-legacy/src/main/java/org/opends/server/backends/ProxyRewriter.java:225, :252

The shared LDAP assertions exercise post-read controls, which use separate OID branches. No proxy/discovery test requests pre-read to check mapped attribute names or the returned entry. This is a static coverage observation; no mutation was executed.

Pin: add a critical pre-read control requesting mapped description and manager to the shared modify scenario. Assert the old values, local entry DN, and local DN-valued manager in the pre-read response. Deferred to the author's discretion.


issue (non-blocking): Failed discovery connection construction leaves factory cleanup to finalization.

opendj-server-legacy/src/main/java/org/opends/server/discovery/ReplicationServiceDiscoveryMechanism.java:280

ConnectionWrapper:153-154 creates an LDAPConnectionFactory and then acquires a connection without failure cleanup. A failed constructor cannot be closed by the caller's try-with-resources. The new periodic discovery calls repeat this path; shared resources remain acquired until ReferenceCountedObject.Reference.finalize() releases them. This is delayed cleanup, not a demonstrated permanent leak; resource growth was not measured.

Close the factory when acquisition fails, preserving successful construction ownership:

connectionFactory = new LDAPConnectionFactory(hostPort.getHost(), hostPort.getPort(), options);
try {
  connection = connectionFactory.getConnection();
} catch (LdapException | RuntimeException e) {
  connectionFactory.close();
  throw e;
}

@vharseko
vharseko force-pushed the features/proxy-backend branch from a60fbd9 to 23ebc7d Compare November 13, 2026 10:46
@vharseko

Copy link
Copy Markdown
Member Author

Addressed in 23ebc7d:

  • Restored public visibility for the discovery lifecycle methods and getName, including the built-in overrides. A provider fixture in a different package verifies validation, initialization, naming, and deletion through the configuration manager.
  • Added an OpenLDAP paging test with active DN and attribute mapping. It follows the continuation cookie until completion and checks that both expected entries are returned exactly once.
  • Added pre-read assertions to the shared rewrite scenario for the old mapped value, local entry DN, and local DN-valued manager.
  • Close the connection factory when connection acquisition fails, while preserving the original exception if cleanup also fails. A regression test checks that the scheduler reference is released after a failed bind.

Validation: the targeted JDK 11 Maven integration run passed 33 tests with no skips, including the OpenLDAP container tests. Both lifecycle and factory cleanup regression tests failed on the original implementation before the fixes. git diff --check passed.

@vharseko
vharseko requested a review from maximthomas November 13, 2026 10:47

@maximthomas maximthomas left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

praise: The update addresses the previous lifecycle, cleanup and rewrite-test findings with concrete fixes and assertions.

  • Public discovery callbacks and ExternalDiscoveryProviderTest cover dispatch from a different package through the configuration manager.
  • Failed connection acquisition now closes its factory; paging and pre-read tests assert mapped results and continuation behavior.

question (blocking): Is porting and rebuilding existing discovery providers an intentional upgrade requirement?

opendj-server-legacy/src/main/java/org/opends/server/discovery/ServiceDiscoveryMechanism.java:38, opendj-server-legacy/src/main/java/org/opends/server/discovery/ServiceDiscoveryMechanismConfigManager.java:74,131-141

BASE declares an interface; HEAD declares an abstract class and replaces getPartitions(Collection<DN>) with getPartition(). The same old implementing binary cannot load against HEAD: it encounters IncompatibleClassChangeError, outside the manager's catch (Exception). The new lifecycle fixture recompiles against HEAD, so it does not cover this upgrade input.

The ABI incompatibility is established, but an affected supported installation is not: BASE configuration metadata references an absent class, and no deployed provider or valid BASE startup fixture was established. Are providers implementing the former SPI supported upgrade inputs? If yes, preserve an interface/adapter path; if deliberately incompatible, document the required migration and rebuild. The answer decides whether a blocking remedy is required. No verified supported-upgrade blocker is claimed today.

Pin: after declaring the policy, exercise the same old-provider binary through the supported upgrade path, or assert the declared unsupported-provider diagnostic. No current test pins that policy.


issue (non-blocking): Proxy search results have an empty internal object-class map.

opendj-server-legacy/src/main/java/org/opends/server/backends/ProxyBackend.java:1083-1097

The conversion puts objectClass in userAttributes and passes null for the Entry object-class map. An internal search returning objectClass: person consequently yields an empty getObjectClasses() and false hasObjectClass(person): SearchResultEntry and the internal delivery path preserve that empty map. This is a verified representation defect; a concrete failing production consumer was not established, and no group-discovery failure is claimed.

Decode object classes separately, as LDIFReader.java:732-749 does. Within this conversion, keep the existing user/operational maps and replace the loop and constructor with:

final Schema localSchema = serverContext != null
        ? serverContext.getSchema() : Schema.getDefaultSchema();
final Map<org.forgerock.opendj.ldap.schema.ObjectClass, String> objectClasses =
        new LinkedHashMap<>();
for (org.forgerock.opendj.ldap.Attribute attr : rewritten.getAllAttributes()) {
    final AttributeType type = attr.getAttributeDescription().getAttributeType();
    if (type.isObjectClass()) {
        for (ByteString value : attr) {
            final String name = value.toString().trim();
            objectClasses.put(localSchema.getObjectClass(name), name);
        }
        continue;
    }
    final AttributeBuilder builder = new AttributeBuilder(attr.getAttributeDescription());
    for (ByteString value : attr) {
        builder.add(value);
    }
    final Map<AttributeType, List<Attribute>> attributes =
            type.isOperational() ? operationalAttributes : userAttributes;
    attributes.computeIfAbsent(type, ignored -> new ArrayList<>()).add(builder.toAttribute());
}
request.sendSearchEntry(new org.opends.server.types.SearchResultEntry(
        new Entry(rewritten.getName(), objectClasses, userAttributes, operationalAttributes),
        convertResponseControls(sr.getControls(), mapping)));

Pin: an internal proxy search returning objectClass: person must satisfy both getObjectClasses() and hasObjectClass(person), rather than checking only LDAP attributes. The suggested code was checked against HEAD APIs but was not compiled or run.


suggestion (non-blocking): Include the two container integration classes in normal CI test selection.

opendj-server-legacy/src/test/java/org/opends/server/discovery/ProxyBackendOpenLdapIT.java:59, opendj-server-legacy/pom.xml:1241-1247, .github/workflows/build.yml:115-118,156

Explicit Failsafe includes match neither ProxyBackendOpenLdapIT nor ProxyBackend389IT. Linux CI runs verify -P precommit without an it.test override, so its green result cannot establish the OpenLDAP paging or 389 Directory Server assertions. The author's targeted manual runs are separate evidence. Deferred test-strength follow-up: add this alongside the existing includes, or rename both classes to an included convention.

<include>**/*IT.java</include>

Pin: a container-capable default CI run must produce report XML naming both classes, with no skips. Selection was verified statically; Maven was not run in this round.


note (non-blocking): Review execution deviated from the reserved-run protocol.

Five sweeps and independent verification completed with no failed or budget-skipped tasks. Budget use is 7/12 agents and 2/3 runs. The verifier compiled and executed a synthetic BASE/HEAD ABI probe before reserving either run; both were retrospectively charged. It used actual SPI sources with dependency stubs, but captured neither JDK identity nor raw logs and did not validate the execution environment. Its output supports only ABI incompatibility, not deployed configuration/startup behavior. No Maven test class was executed in this round. Details: agents/abi-probe-round-2-evidence.md.

@vharseko
vharseko force-pushed the features/proxy-backend branch from 23ebc7d to e9fa1c1 Compare November 13, 2026 14:41
@vharseko

Copy link
Copy Markdown
Member Author

@maximthomas Addressed the remaining review points in e9fa1c1.

  • Discovery SPI compatibility: porting and rebuilding providers that implement the former interface is an intentional upgrade requirement. The upgrade guide now documents the class, lifecycle, and partition API changes. A fixture compiles a provider against the frozen former SPI and loads that provider binary unchanged against the current implementation. Tests verify an actionable rejection diagnostic, continued startup of valid mechanisms, and safe deletion of a rejected configuration. Linkage failures are reported as configuration errors rather than escaping the manager.
  • Internal object classes: proxy search results now populate the server entry's object-class map. The regression checks both getObjectClasses() and hasObjectClass(person) through an internal search. Empty objectClass attributes are retained for types-only searches, and unknown remote class names use the non-strict schema lookup.
  • Container CI selection: normal Failsafe includes now select both ProxyBackendOpenLdapIT and ProxyBackend389IT. The previous CI logs also showed Docker rejecting Testcontainers' API 1.32, so Linux CI now passes the running daemon's API version to Maven. These two suites fail setup when Docker is unavailable in CI, rather than skipping silently.

Validation: the targeted JDK 11 Maven reactor run passed all 67 server tests across 12 classes with zero failures, errors, or skips. It retained the normal Failsafe includes, used exclusions to limit unrelated classes, and did not set it.test; the XML reports contain all three OpenLDAP tests and the 389 Directory Server test. The new regressions failed before their corresponding fixes.

The proxy guide and upgrade considerations passed Asciidoctor's attribute check, and the workflow step and git diff --check passed. The earlier documentation CI failure is fixed in 97ee0e0 by escaping the literal OpenLDAP database index. CI is rerunning on the pushed head.

@vharseko
vharseko requested a review from maximthomas November 13, 2026 14:44
@vharseko vharseko added the CI label Nov 13, 2026

@maximthomas maximthomas left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

praise: The revised implementation and CI address the previous review findings.

  • ExternalDiscoveryProviderTest exercises an unchanged legacy provider binary, migration diagnostics, continued startup and safe deletion; the upgrade guide declares the rebuild requirement.
  • Internal search results now populate Entry.getObjectClasses(), and normal Failsafe selection includes both external-directory integration classes.

suggestion (non-blocking): The internal-search regression lacks a remote-only object class.

opendj-server-legacy/src/test/java/org/opends/server/backends/ProxyBackendTest.java:836-858, :744-745

The fixture contains only locally known classes. Changing the lookup at ProxyBackend.java:1088 to asStrictSchema() would preserve these assertions while rejecting a remote-only class. HEAD correctly resolves unknown classes through placeholders; this is a deferred test-strength follow-up, with no change requested in this PR. The mutation was assessed statically, not executed.

With a fixture returning an auxiliary remoteAux class absent from the local schema, assert successful search and its preservation:

assertThat(entry.getObjectClasses().values()).contains("remoteAux");

Pin: The extended case must fail when the lookup uses asStrictSchema(). Merely removing asNonStrictSchema() is insufficient because SchemaHandler already supplies a non-strict schema. The assertion uses existing HEAD APIs; the extended fixture was not compiled or run during review.

@vharseko

Copy link
Copy Markdown
Member Author

@maximthomas Addressed the remote-only object-class coverage suggestion in b55b3c6.

The new ProxyBackendOpenLdapIT.preservesUnknownRemoteSchema scenario installs an auxiliary remoteAux class and a remoteCode Directory String attribute only in a real OpenLDAP 2.6.10 container. It checks that both definitions are absent from the OpenDJ schema before and after the operations, then verifies add, search, modify, compare, and delete through the proxy. The internal search assertions verify preservation of remoteAux in getObjectClasses(), the known person class, the local entry DN, and the unknown attribute value. LDAP-client assertions check the returned object classes and attribute value as well.

This test also exposed a delivery regression: populating the internal object-class map removed objectClass from the attribute maps consumed by the LDAP encoder. Direct proxy delivery bypasses returnEntry(), which normally adds that attribute. The conversion now retains both representations, including empty attributes for types-only searches.

Validation under JDK 11 passed all 35 targeted tests: ProxyBackendOpenLdapIT (4), ProxyBackendTest (27), and ProxyRewriterTest (4), with zero failures, errors, or skips. Before the delivery fix, the new scenario failed because the LDAP response lacked objectClass. The requested asStrictSchema() mutation was also executed and failed with UnknownSchemaElementException for remoteAux; the non-strict lookup was restored and all 35 tests passed again.

The PR description now includes the schema compatibility coverage and distinguishes this verification from the earlier broader run. Please review the updated head.

@vharseko
vharseko requested a review from maximthomas November 14, 2026 06:40
@vharseko

Copy link
Copy Markdown
Member Author

@maximthomas Since the previous reviewed head, commit 33c50d5 corrects access-log search entry counts, and 441e91d adds proxy request/response access records and pool statistics.

The proxy records retain the client operation identifiers and report the responding endpoint, identity mode, remote identity when known, per-attempt result and elapsed time. Pool state is included when available. If connection acquisition ultimately fails, the attempt timer stops before subordinate backends execute; deferred responses retain the result of their own attempt. The guide documents the fields, including the no-response and direct-bind cases.

On OpenJDK 11.0.33, 29 SDK tests and 158 server tests passed without failures, errors, or skips. The deferred-failure regression failed before its fix and passed afterward. The saturated-pool test checks the acquisition wait and logged result; a separate slow-subordinate timing integration test was not run. git diff --check passed.

Please review the updated head, particularly the proxy logging and per-operation routing context.

@vharseko
vharseko requested a review from maximthomas November 17, 2026 13:18
@vharseko

Copy link
Copy Markdown
Member Author

@maximthomas The fork CI exposed failures in existing load-balancer tests after the proxy logging update: factories without a routing context were called through the new context-aware methods, which the existing mock factories did not implement.

Commit c284640 retains the existing synchronous and asynchronous factory calls when the context is absent; proxy operations still use the context-aware path. The tests were not changed.

On OpenJDK 11.0.33, the full opendj-core suite passed 8,274 tests, and ProxyBackendTest, SearchOperationTestCase, and AbstractTextAccessLogPublisherTest passed 158 tests, all without failures, errors, or skips. git diff --check passed. Please review the updated head.

@maximthomas

Copy link
Copy Markdown
Contributor

praise: The proxy records preserve client operation identifiers, and matching-head CI exercises the logging and external-directory scenarios without skips.

@vharseko
vharseko force-pushed the features/proxy-backend branch from c284640 to c923d42 Compare November 18, 2026 06:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backend Storage backends (JE, PDB, memory) and their database behaviour build CI concurrency Thread-safety / race-condition bugs docker docs enhancement java Changes to Java sources logging Access, error and debug log publishers and their filtering criteria monitoring cn=monitor entries, JMX and SNMP monitoring protocol LDAP protocol extensions, controls and RFC support proxy LDAP proxy backend, routing, and remote directory failover replication schema LDAP schema: attribute types, object classes, DIT structure rules, name forms security Security fixes / CodeQL code-scanning alerts tests Test suites: fixing, enabling, un-disabling tls TLS connections, certificates, and encrypted handshakes upgrade Upgrading between versions and migrating from other directory servers

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add an LDAP proxy backend for high availability and directory federation

3 participants