Skip to content

[server] Support group-based ACL authorization - #3889

Open
litiliu wants to merge 5 commits into
apache:mainfrom
litiliu:codex/fluss-3829-group-acl
Open

litiliu wants to merge 5 commits into
apache:mainfrom
litiliu:codex/fluss-3829-group-acl

Conversation

@litiliu

@litiliu litiliu commented Aug 7, 2026 •

Copy link
Copy Markdown
Contributor

Purpose

Linked issue: close #3829

Allow authentication mechanisms to return user, group, and role principals through one Iterable<FlussPrincipal> createPrincipals() contract. An authenticated session carries one collection of principals for authorization.

Brief change log

  • Replace ServerAuthenticator.createPrincipal() with createPrincipals() and remove the separate additional-principals API.
  • Snapshot all authenticated principals in FlussRequest and Session.
  • Evaluate ACL and superuser matches against all session principals, independently of iteration order, while retaining one ACL cache snapshot per authorization operation.
  • Use the first principal as the client identity for logging, user metrics, and resource ownership.
  • Adapt PLAINTEXT, SASL/PLAIN, the SASL mechanism delegate, Kafka PLAIN, and test authenticators to the new contract.
  • Update security documentation with authorization semantics and custom authenticator migration guidance.

Tests

112 focused tests passed with no failures, errors, or skips.

  • Focused unit and integration suites: AuthenticationFactoryTest, PlainSaslServerTest, SaslAuthenticatorFactoryTest, AuthenticationTest, SessionTest, RequestChannelTest, DefaultAuthorizerTest, SaslAuthenticationITCase, FlussAuthorizationITCase, KafkaSaslConnectionTest, KafkaSaslConfigTest, and KafkaSaslPlainAuthenticationITCase.
  • Coverage includes immutable snapshots from an arbitrary iterable, group ACL matching, principal-type mismatches, superuser matching at different collection positions, and existing client authorization and Kafka PLAIN behavior.
  • Affected-module compilation and packaging, Checkstyle, Spotless, Apache RAT, and git diff --check.

API and Format

This changes the PublicEvolving ServerAuthenticator interface. Custom implementations must replace createPrincipal() with Iterable<FlussPrincipal> createPrincipals() and be recompiled. Single-identity mechanisms can return Collections.singletonList(principal). The iterable must be non-null and non-empty, without null elements.

All authenticated principals participate in ACL and superuser checks. The first principal remains the client identity for logging, user metrics, and resource ownership.

No RPC wire format or storage format changes.

Documentation

Updated the authorization and security overview documentation, including the custom authenticator migration contract.

@litiliu
litiliu force-pushed the codex/fluss-3829-group-acl branch from b99fb7c to 0fe204e Compare August 10, 2026 06:00
@litiliu
litiliu force-pushed the codex/fluss-3829-group-acl branch from 0fe204e to 34008c4 Compare August 10, 2026 06:30
@litiliu

litiliu commented Aug 10, 2026

Copy link
Copy Markdown
Contributor Author

@loserwang1024 Please help review this PR when you have time, Thanks in advance!

@litiliu

litiliu commented Aug 11, 2026

Copy link
Copy Markdown
Contributor Author

@affo Please take a look when you have time, Thanks!

@litiliu

litiliu commented Aug 12, 2026

Copy link
Copy Markdown
Contributor Author

@polyzos PTAL, Thanks!

@affo affo 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.

Hello and thanks for the amazing contribution!
While the contribution holds valuable, this looks to me as a divergence from the original https://cwiki.apache.org/confluence/spaces/FLUSS/pages/372214350/FIP-2+Fluss+Authentication+and+Authorization in that it replaces a single-principal model with a multi-principal model. It also touches a PublicEvolving interface.
I would favor an explicit FIP round, or even something lighter, but disclosed to the entire community in order to change the model.

For example, why having the concept of "additional principals" and not change FlussPrincipal createPrincipal(); to Iterable<FlussPrincipal> createPrincipals();?

Maybe I am just being picky, I suggest to involve into this review a committer/PMC with a solid grasp of this part of the codebase 🤝

@github-actions

github-actions Bot commented Nov 3, 2026

Copy link
Copy Markdown

This PR has been marked as stale because it has had no activity for 60 days. It will be closed in 10 days unless it receives a new comment, commit or other update.

@github-actions github-actions Bot added the Stale label Nov 3, 2026
Resolve the authorization conflict while preserving immutable ACL snapshots and additional-principal matching in both resource authorization and ACL listing. Extend the group ACL test to cover listing.
@litiliu

litiliu commented Nov 4, 2026

Copy link
Copy Markdown
Contributor Author

@loserwang1024 I've merged the latest main and resolved the conflicts, preserving ACL snapshot consistency for primary and additional principals. Authentication and ACL authorization tests pass. Could you please help review this PR when you have time? Thanks!

@github-actions github-actions Bot removed the Stale label Nov 4, 2026
@litiliu
litiliu marked this pull request as draft November 5, 2026 02:47
@litiliu
litiliu marked this pull request as ready for review November 11, 2026 09:10
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.

[security] Support group-based ACL authorization for authenticated identities

2 participants