feat(ldap-auth-advanced): add group collection, group authorization and group-based Consumers - #13791
Draft
janiussyafiq wants to merge 1 commit into
Draft
Conversation
…nd group-based Consumers
janiussyafiq
marked this pull request as draft
August 7, 2026 06:37
Contributor
Author
|
Status of this feature is to be put on hold since no demand for this feature request atm. |
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.
Description
Part 2 of 3 for the
ldap-auth-advancedplugin (part 1: #13762). Adds group support:memberOfattribute on the user entry (default, no extra round trip) or by searchinggroup_base_dnas the service identity (never as the end user;sizeLimit 0so groups are never truncated).groups_requiredauthorization: outer OR of inner ANDs over group names, matched verbatim; an authenticated user failing it gets403, kept distinct from every401path.X-Authenticated-Groups(toggleset_groups_header, defaulttrue; the inbound header is always stripped).group_dn(string, or array that must ALL contain the user), mutually exclusive withuser_dn. An exactuser_dnmatch always wins; among group matches the plugin picks deterministically (alphabetical group-DN order, more-specific array first) and logs a warning naming all candidates when more than one matches.Two implementation notes for reviewers: the plugin resolves Consumers through a plugin-local index cached per consumer config version instead of
consumer_mod.find_consumer, because the shared cache error-logs every consumer missing the lookup key, which would spam logs for legitimate group-only consumers (observable behavior, including the 401 messages, is unchanged). Separately, writing auser_dnconsumer whilegroup_dnconsumers exist triggers the core write-time duplicate check to error-log "missing consumer auth credential" for the valid group consumers; cosmetic only, and fixing it means touching core beyond this PR's scope.One existing test expectation was updated (
t/plugin/ldap-auth-advanced.tTEST 52, one line): withset_groups_headerdefaultingtrue, the echoed headers now legitimately include the collected groups; the spoofed-inbound-value assertion is unchanged.Which issue(s) this PR fixes:
Related: #8958
Checklist
X-Authenticated-Groupsheader is additive; existing consumeruser_dnconfigs are unchanged)