[AUTHENTICATION] Add UnboundID-backed LDAP connection pool with failover and cache#7506
Open
moelhoussein wants to merge 1 commit into
Open
[AUTHENTICATION] Add UnboundID-backed LDAP connection pool with failover and cache#7506moelhoussein wants to merge 1 commit into
moelhoussein wants to merge 1 commit into
Conversation
…ver and auth cache Adds an opt-in UnboundID LDAP SDK authentication path (kyuubi.authentication.ldap.pool.enabled, default false) alongside the existing JNDI implementation. When enabled it provides a health-checked connection pool, ordered multi-URL failover with bounded mid-request retry, an optional successful-auth cache (HMAC-keyed, TTL/size-bounded, no negative caching, request coalescing), Prometheus auth/cache/pool metrics with failure classification, and RFC 4515 escaping of user-supplied filter values. The legacy JNDI path is unchanged when the pool is disabled. Proposed and discussed in apache#7497 Assisted-by: Claude Opus 4.8 (claude-opus-4-8) Assisted-by: OpenAI GPT-5.5 Assisted-by: GitHub Copilot Enterprise
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.
This PR adds an UnboundID LDAP SDK-backed authentication path for the LDAP auth provider, as an opt-in alternative to the existing JNDI implementation (
kyuubi.authentication.ldap.pool.enabled, defaultfalse). When disabled, the legacy JNDI path is unchanged.When enabled, it provides:
kyuubi.authentication.ldap.urlentries viaFailoverServerSet, including mid-request retry when a pooled connection breaks with a connection-level error (bounded bypool.search.maxRetries).invalid_credentials/invalid_input/infrastructure), cache hit/miss, and pool statistics.Proposed and discussed in #7497
Why are the changes needed?
The JNDI-based LDAP path has several operational gaps:
This change closes those gaps behind an opt-in flag, leaving existing deployments on the JNDI path untouched unless they explicitly enable the pool.
How was this patch tested?
javax.naming.AuthenticationException→invalid_credentials), RFC 4515 filter-injection escaping, LDAP URL parsing, and JNDI-vs-UnboundID parity forexecuteCustomQuery.kyuubi-commontest suite passes (341 tests).docs/configuration/settings.mdregenerated and verified by theAllKyuubiConfigurationgolden-file test;dev/dependencyListregenerated viabuild/dependency.sh.spotless:checkandscalastyle:checkpass forkyuubi-commonandkyuubi-server.Was this patch authored or co-authored using generative AI tooling?
Yes. Generative AI tooling assisted in authoring and reviewing this patch:
All AI-assisted output was human-reviewed, tested, and is being contributed under the DCO; I take full responsibility for it as the contributor. Per the [ASF Generative Tooling Guidance](https://www.apache.org/legal/generative-tooling.html), I have reviewed each tool's terms and have reasonable certainty that (1) none place restrictions on the output inconsistent with the Open Source Definition, and (2) the contributed output is either non-copyrightable boilerplate or original work that does not incorporate third-party materials. GitHub Copilot Enterprise ran with its "Suggestions matching public code" policy set to Blocked (duplicate-detection filter enabled) and is covered by GitHub's IP indemnification.
Tool terms: [Anthropic Commercial Terms](https://www.anthropic.com/legal/commercial-terms), [OpenAI Terms of Use](https://openai.com/policies/terms-of-use), [GitHub Copilot Trust Center](https://resources.github.com/copilot-trust-center/).