Repository navigation
Conversation
|
Thanks a lot for the review, @litiliu! |
litiliu
left a comment
There was a problem hiding this comment.
One compatibility concern with #3047: FlussProtocolPlugin materializes security.sasl.plain.credentials into security.sasl.plain.jaas.config by parsing and regenerating only user_* options. This PR introduces impersonate_* as a non-credential JAAS option, so it will be silently dropped whenever the credentials map is configured or dynamically updated.
Is impersonation intentionally unsupported together with security.sasl.plain.credentials? If not, the JAAS regeneration should preserve impersonate_*, with tests covering both startup and dynamic credentials updates.
|
I'll open a follow-up PR to support dynamically altering the impersonation grants themselves. |
a1915c4 to
bdc67ea
Compare
There was a problem hiding this comment.
Pull request overview
This PR implements end-to-end SASL/PLAIN impersonation (RFC 4616 authorization id) so a client can authenticate as one user (authcid) while requesting an effective principal (authzid), with server-side authorization gated by impersonate_<authcid> JAAS options.
Changes:
- Add client config
client.security.sasl.authorization-idand plumb it into SASL client creation. - Allow server-side impersonation via
AuthorizeCallback+ JAASimpersonate_<user>allowlist (including*wildcard). - Improve/extend tests and harden JAAS config materialization logic used during credential reconfiguration.
Reviewed changes
Copilot reviewed 10 out of 10 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| fluss-rpc/src/test/java/org/apache/fluss/rpc/netty/server/FlussProtocolPluginTest.java | Adds unit coverage for JAAS config regeneration/materialization behavior. |
| fluss-rpc/src/test/java/org/apache/fluss/rpc/netty/authenticate/SaslAuthenticationITCase.java | Extends IT coverage to include an impersonation-capable SASL client configuration during reconfigure tests. |
| fluss-rpc/src/main/java/org/apache/fluss/rpc/netty/server/FlussProtocolPlugin.java | Reworks PLAIN JAAS config materialization to preserve baseline options and overlay credentials safely. |
| fluss-common/src/test/java/org/apache/fluss/security/auth/sasl/plain/PlainSaslServerTest.java | Adds unit tests for allowed/denied impersonation scenarios and expected error messages. |
| fluss-common/src/main/java/org/apache/fluss/security/auth/sasl/plain/PlainServerCallbackHandler.java | Adds AuthorizeCallback handling and JAAS-driven impersonation allowlist parsing. |
| fluss-common/src/main/java/org/apache/fluss/security/auth/sasl/plain/PlainSaslServer.java | Enforces impersonation authorization via callback, sets effective authorization id, and logs impersonation. |
| fluss-common/src/main/java/org/apache/fluss/security/auth/sasl/jaas/SaslServerFactory.java | Updates SASL client creation to accept an explicit authorization id. |
| fluss-common/src/main/java/org/apache/fluss/security/auth/sasl/authenticator/SaslClientAuthenticator.java | Reads the new authorization-id option and passes it into SASL client creation. |
| fluss-common/src/main/java/org/apache/fluss/config/ConfigOptions.java | Introduces client.security.sasl.authorization-id config option and documentation. |
| fluss-client/src/test/java/org/apache/fluss/client/security/acl/FlussAuthorizationITCase.java | Adds an end-to-end authorization test demonstrating proxy-user impersonation effects on ACL evaluation. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
|
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. |
590e301 to
433fdb4
Compare
7c49d43 to
2addee4
Compare
cbec9b1 to
7fee034
Compare
b9a529f to
ae34946
Compare
ae34946 to
e52c73e
Compare
Co-Authored-By: Codex <noreply@openai.com> AI-Model: gpt-6 AI-Contributed/Feature: 372/372 AI-Contributed/UT: 579/579
e52c73e to
90703e3
Compare
Validate proxy grants against bound Fluss SASL listeners and load immutable policies during startup. Reuse those policies in PLAIN handshakes while keeping credential reconfiguration shared with Kafka. Use exact usernames or an explicit wildcard and prevent proxying as configured superusers. Cover listener isolation, credential rotation, mixed Kafka and Fluss listeners, and effective-user ACL checks. Co-Authored-By: Codex <noreply@openai.com> AI-Model: gpt-6 AI-Contributed/Feature: 554/554 AI-Contributed/UT: 659/659
Purpose
Closes #3837.
Allow gateways and other services to authenticate with their own SASL/PLAIN credentials and act as explicitly authorized end users, so existing ACL checks use the effective user's principal.
Brief change log
client.security.sasl.authorization-idand pass it toSasl.createSaslClient. An unset, empty, or identical authorization identity retains the authenticated account. Existing username/password and JAAS configuration are reused.AuthorizeCallbackto check proxy grants insecurity.sasl.proxy-users. Support literal targets,*, and full-stringregex:matches. Reject missing grants, disallowed targets, and super-user targets, respecting the ACL principal case policy.Tests
clean verifyforfluss-common,fluss-rpc,fluss-server, andfluss-clientwith their reactor dependencies, explicitly running 105 related unit and integration test cases based onmainat5bdb5679a. Use-Dfluss.forkCount=1to avoid a local test-port collision encountered in the initial parallel run.API and Format
Adds an optional SASL client authorization-ID setting and a server proxy-grant option. Uses the existing SASL/PLAIN wire format and authentication RPC.
Adds a default
ServerAuthenticationPlugin.configure(Configuration)method for startup initialization. Existing plugins inherit a no-op implementation. The originalcreateServerAuthenticator(Configuration)signature, per-connection creation behavior, and storage formats are unchanged.Documentation
The authentication guide explains SASL/PLAIN impersonation, proxy grants, regex quoting, and client configuration.