You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@kudu.apache.org by "mintao (Code Review)" <ge...@cloudera.org> on 2026/09/14 03:35:02 UTC

[kudu-CR] [java] Add proxy user client support

Hello Zoltan Chovan, Alexey Serbin,

I'd like you to do a code review. Please visit

    http://gerrit.cloudera.org:8080/24830

to review the following change.


Change subject: [java] Add proxy user client support
......................................................................

[java] Add proxy user client support

Expose AsyncKuduClientBuilder.effectiveUser() and
KuduClientBuilder.effectiveUser(). The client still authenticates using
its real Kerberos identity.

SecurityContext carries the effective user and exports and imports it
as part of AuthenticationCredentialsPB, so a proxied identity survives
driver-to-executor credential propagation. The real user is unchanged
and continues to drive SASL PLAIN negotiation.

The Java negotiator sends the effective user as the SASL authorization
identity, populates the (deprecated) connection context user info
consistently, and disables authentication tokens for proxied
connections: tokens are bound to their original user and cannot be used
to impersonate another user.

The credentials round trip is covered by a test in
TestSecurityContextRealUser.

Change-Id: I77897a52cfa01e5b7af97703437cd45d2df9fb52
---
M java/kudu-client/src/main/java/org/apache/kudu/client/AsyncKuduClient.java
M java/kudu-client/src/main/java/org/apache/kudu/client/KuduClient.java
M java/kudu-client/src/main/java/org/apache/kudu/client/Negotiator.java
M java/kudu-client/src/main/java/org/apache/kudu/client/SecurityContext.java
M java/kudu-client/src/test/java/org/apache/kudu/client/TestNegotiator.java
M java/kudu-client/src/test/java/org/apache/kudu/client/TestSecurityContextRealUser.java
6 files changed, 70 insertions(+), 5 deletions(-)



  git pull ssh://gerrit.cloudera.org:29418/kudu refs/changes/30/24830/1
-- 
To view, visit http://gerrit.cloudera.org:8080/24830
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: I77897a52cfa01e5b7af97703437cd45d2df9fb52
Gerrit-Change-Number: 24830
Gerrit-PatchSet: 1
Gerrit-Owner: mintao <mi...@gmail.com>
Gerrit-Reviewer: Alexey Serbin <al...@apache.org>
Gerrit-Reviewer: Zoltan Chovan <zc...@cloudera.com>

[kudu-CR] [java] Add proxy user client support

Posted by "Kudu Jenkins (Code Review)" <ge...@cloudera.org>.
Kudu Jenkins has posted comments on this change. ( http://gerrit.cloudera.org:8080/24830 )

Change subject: [java] Add proxy user client support
......................................................................


Patch Set 4: Verified-1

Build Failed 

http://jenkins.kudu.apache.org/job/pre_commit/3184/ : FAILURE


-- 
To view, visit http://gerrit.cloudera.org:8080/24830
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I77897a52cfa01e5b7af97703437cd45d2df9fb52
Gerrit-Change-Number: 24830
Gerrit-PatchSet: 4
Gerrit-Owner: mintao <mi...@gmail.com>
Gerrit-Reviewer: Alexey Serbin <al...@apache.org>
Gerrit-Reviewer: Kudu Jenkins (120)
Gerrit-Reviewer: Marton Greber <gr...@gmail.com>
Gerrit-Reviewer: Zoltan Chovan <zc...@cloudera.com>
Gerrit-Comment-Date: Tue, 27 Oct 2026 16:21:12 +0000
Gerrit-HasComments: No

[kudu-CR] [java] Add proxy user client support

Posted by "Kudu Jenkins (Code Review)" <ge...@cloudera.org>.
Kudu Jenkins has posted comments on this change. ( http://gerrit.cloudera.org:8080/24830 )

Change subject: [java] Add proxy user client support
......................................................................


Patch Set 1: Verified-1

Build Failed 

http://jenkins.kudu.apache.org/job/pre_commit/2958/ : FAILURE


-- 
To view, visit http://gerrit.cloudera.org:8080/24830
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I77897a52cfa01e5b7af97703437cd45d2df9fb52
Gerrit-Change-Number: 24830
Gerrit-PatchSet: 1
Gerrit-Owner: mintao <mi...@gmail.com>
Gerrit-Reviewer: Alexey Serbin <al...@apache.org>
Gerrit-Reviewer: Kudu Jenkins (120)
Gerrit-Reviewer: Zoltan Chovan <zc...@cloudera.com>
Gerrit-Comment-Date: Mon, 14 Sep 2026 04:27:14 +0000
Gerrit-HasComments: No

[kudu-CR] [java] Add proxy user client support

Posted by "Marton Greber (Code Review)" <ge...@cloudera.org>.
Marton Greber has posted comments on this change. ( http://gerrit.cloudera.org:8080/24830 )

Change subject: [java] Add proxy user client support
......................................................................


Patch Set 4:

(6 comments)

Missing tests:
- A TestNegotiator case with effectiveUser set, checking the connection-context user, the PLAIN authzid, that no TOKEN is offered and that no JWT is offered. The existing assertion at :170 only checks the default.
- The round-trip test is a pure unit test, but it sits in a class that starts a Kerberized cluster; it belongs in a plain unit-test class.

http://gerrit.cloudera.org:8080/#/c/24830/4/java/kudu-client/src/main/java/org/apache/kudu/client/AsyncKuduClient.java
File java/kudu-client/src/main/java/org/apache/kudu/client/AsyncKuduClient.java:

http://gerrit.cloudera.org:8080/#/c/24830/4/java/kudu-client/src/main/java/org/apache/kudu/client/AsyncKuduClient.java@3108
PS4, Line 3108:      * @param effectiveUser the proxy user, or null to use the authenticated user
'the proxy user' should be 'the user to impersonate'. Please also treat an empty value as null and follow the neighbouring 'Set ... / Optional.' javadoc style.


http://gerrit.cloudera.org:8080/#/c/24830/4/java/kudu-client/src/main/java/org/apache/kudu/client/Negotiator.java
File java/kudu-client/src/main/java/org/apache/kudu/client/Negotiator.java:

http://gerrit.cloudera.org:8080/#/c/24830/4/java/kudu-client/src/main/java/org/apache/kudu/client/Negotiator.java@270
PS4, Line 270:       if (securityContext.getEffectiveUser() != null) {
Read effectiveUser once into a final field in the constructor, like authnToken, so the token decision, the authzid and the connection context can't disagree.


http://gerrit.cloudera.org:8080/#/c/24830/4/java/kudu-client/src/main/java/org/apache/kudu/client/Negotiator.java@287
PS4, Line 287:     JwtRawPB jwt = securityContext.getJsonWebToken();
We still offer the JWT on proxied connections, and if the server picks it the effective user is silently dropped. Please turn the JWT off here too, or fail fast.


http://gerrit.cloudera.org:8080/#/c/24830/4/java/kudu-client/src/main/java/org/apache/kudu/client/Negotiator.java@519
PS4, Line 519:                                             securityContext.getEffectiveUser(),
Indentation is off by one.


http://gerrit.cloudera.org:8080/#/c/24830/4/java/kudu-client/src/main/java/org/apache/kudu/client/SecurityContext.java
File java/kudu-client/src/main/java/org/apache/kudu/client/SecurityContext.java:

http://gerrit.cloudera.org:8080/#/c/24830/4/java/kudu-client/src/main/java/org/apache/kudu/client/SecurityContext.java@289
PS4, Line 289:     if (effectiveUser != null) {
On an executor without Kerberos the imported token is ignored because effectiveUser is set, so propagation from driver to executor doesn't actually work. Please rework this or remove the claim from the commit message, and add a test.


http://gerrit.cloudera.org:8080/#/c/24830/4/java/kudu-client/src/main/java/org/apache/kudu/client/SecurityContext.java@361
PS4, Line 361:       if (pb.hasEffectiveUser()) {
Import order differs from C++ (where the builder wins), and importing after connections exist mixes identities because ConnectionCache isn't keyed by user. Should import reject a different effectiveUser?



-- 
To view, visit http://gerrit.cloudera.org:8080/24830
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I77897a52cfa01e5b7af97703437cd45d2df9fb52
Gerrit-Change-Number: 24830
Gerrit-PatchSet: 4
Gerrit-Owner: mintao <mi...@gmail.com>
Gerrit-Reviewer: Alexey Serbin <al...@apache.org>
Gerrit-Reviewer: Kudu Jenkins (120)
Gerrit-Reviewer: Marton Greber <gr...@gmail.com>
Gerrit-Reviewer: Zoltan Chovan <zc...@cloudera.com>
Gerrit-Comment-Date: Tue, 27 Oct 2026 15:08:45 +0000
Gerrit-HasComments: Yes

[kudu-CR] [java] Add proxy user client support

Posted by "Zoltan Chovan (Code Review)" <ge...@cloudera.org>.
Zoltan Chovan has uploaded a new patch set (#2) to the change originally created by mintao. ( http://gerrit.cloudera.org:8080/24830 )

Change subject: [java] Add proxy user client support
......................................................................

[java] Add proxy user client support

Expose AsyncKuduClientBuilder.effectiveUser() and
KuduClientBuilder.effectiveUser(). The client still authenticates using
its real Kerberos identity.

SecurityContext carries the effective user and exports and imports it
as part of AuthenticationCredentialsPB, so a proxied identity survives
driver-to-executor credential propagation. The real user is unchanged
and continues to drive SASL PLAIN negotiation.

The Java negotiator sends the effective user as the SASL authorization
identity, populates the (deprecated) connection context user info
consistently, and disables authentication tokens for proxied
connections: tokens are bound to their original user and cannot be used
to impersonate another user.

The credentials round trip is covered by a test in
TestSecurityContextRealUser.

Change-Id: I77897a52cfa01e5b7af97703437cd45d2df9fb52
---
M java/kudu-client/src/main/java/org/apache/kudu/client/AsyncKuduClient.java
M java/kudu-client/src/main/java/org/apache/kudu/client/KuduClient.java
M java/kudu-client/src/main/java/org/apache/kudu/client/Negotiator.java
M java/kudu-client/src/main/java/org/apache/kudu/client/SecurityContext.java
M java/kudu-client/src/test/java/org/apache/kudu/client/TestNegotiator.java
M java/kudu-client/src/test/java/org/apache/kudu/client/TestSecurityContextRealUser.java
6 files changed, 69 insertions(+), 5 deletions(-)


  git pull ssh://gerrit.cloudera.org:29418/kudu refs/changes/30/24830/2
-- 
To view, visit http://gerrit.cloudera.org:8080/24830
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: newpatchset
Gerrit-Change-Id: I77897a52cfa01e5b7af97703437cd45d2df9fb52
Gerrit-Change-Number: 24830
Gerrit-PatchSet: 2
Gerrit-Owner: mintao <mi...@gmail.com>
Gerrit-Reviewer: Alexey Serbin <al...@apache.org>
Gerrit-Reviewer: Kudu Jenkins (120)
Gerrit-Reviewer: Zoltan Chovan <zc...@cloudera.com>

[kudu-CR] KUDU-3586 [java] Add proxy user client support

Posted by "Kudu Jenkins (Code Review)" <ge...@cloudera.org>.
Kudu Jenkins has posted comments on this change. ( https://gerrit.cloudera.org/24830 )

Change subject: KUDU-3586 [java] Add proxy user client support
......................................................................


Patch Set 7:

Build Started http://jenkins.kudu.apache.org/job/pre_commit/3247/


-- 
To view, visit https://gerrit.cloudera.org/24830
To unsubscribe, visit https://gerrit.cloudera.org/settings

Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I77897a52cfa01e5b7af97703437cd45d2df9fb52
Gerrit-Change-Number: 24830
Gerrit-PatchSet: 7
Gerrit-Owner: mintao <mi...@gmail.com>
Gerrit-Reviewer: Alexey Serbin <al...@apache.org>
Gerrit-Reviewer: Kudu Jenkins (120)
Gerrit-Reviewer: Marton Greber <gr...@gmail.com>
Gerrit-Reviewer: Zoltan Chovan <zc...@cloudera.com>
Gerrit-Comment-Date: Tue, 03 Nov 2026 17:15:51 +0000
Gerrit-HasComments: No

[kudu-CR] KUDU-3586 [java] Add proxy user client support

Posted by "Kudu Jenkins (Code Review)" <ge...@cloudera.org>.
Kudu Jenkins has posted comments on this change. ( http://gerrit.cloudera.org:8080/24830 )

Change subject: KUDU-3586 [java] Add proxy user client support
......................................................................


Patch Set 5: Verified-1

Build Failed 

http://jenkins.kudu.apache.org/job/pre_commit/3214/ : FAILURE


-- 
To view, visit http://gerrit.cloudera.org:8080/24830
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I77897a52cfa01e5b7af97703437cd45d2df9fb52
Gerrit-Change-Number: 24830
Gerrit-PatchSet: 5
Gerrit-Owner: mintao <mi...@gmail.com>
Gerrit-Reviewer: Alexey Serbin <al...@apache.org>
Gerrit-Reviewer: Kudu Jenkins (120)
Gerrit-Reviewer: Marton Greber <gr...@gmail.com>
Gerrit-Reviewer: Zoltan Chovan <zc...@cloudera.com>
Gerrit-Comment-Date: Fri, 30 Oct 2026 13:37:39 +0000
Gerrit-HasComments: No

[kudu-CR] KUDU-3586 [java] Add proxy user client support

Posted by "Kudu Jenkins (Code Review)" <ge...@cloudera.org>.
Kudu Jenkins has posted comments on this change. ( http://gerrit.cloudera.org:8080/24830 )

Change subject: KUDU-3586 [java] Add proxy user client support
......................................................................


Patch Set 6:

Build Started http://jenkins.kudu.apache.org/job/pre_commit/3223/


-- 
To view, visit http://gerrit.cloudera.org:8080/24830
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I77897a52cfa01e5b7af97703437cd45d2df9fb52
Gerrit-Change-Number: 24830
Gerrit-PatchSet: 6
Gerrit-Owner: mintao <mi...@gmail.com>
Gerrit-Reviewer: Alexey Serbin <al...@apache.org>
Gerrit-Reviewer: Kudu Jenkins (120)
Gerrit-Reviewer: Marton Greber <gr...@gmail.com>
Gerrit-Reviewer: Zoltan Chovan <zc...@cloudera.com>
Gerrit-Comment-Date: Fri, 30 Oct 2026 13:46:11 +0000
Gerrit-HasComments: No

[kudu-CR] KUDU-3586 [java] Add proxy user client support

Posted by "Kudu Jenkins (Code Review)" <ge...@cloudera.org>.
Kudu Jenkins has posted comments on this change. ( http://gerrit.cloudera.org:8080/24830 )

Change subject: KUDU-3586 [java] Add proxy user client support
......................................................................


Patch Set 6: Verified-1

Build Failed 

http://jenkins.kudu.apache.org/job/pre_commit/3223/ : FAILURE


-- 
To view, visit http://gerrit.cloudera.org:8080/24830
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I77897a52cfa01e5b7af97703437cd45d2df9fb52
Gerrit-Change-Number: 24830
Gerrit-PatchSet: 6
Gerrit-Owner: mintao <mi...@gmail.com>
Gerrit-Reviewer: Alexey Serbin <al...@apache.org>
Gerrit-Reviewer: Kudu Jenkins (120)
Gerrit-Reviewer: Marton Greber <gr...@gmail.com>
Gerrit-Reviewer: Zoltan Chovan <zc...@cloudera.com>
Gerrit-Comment-Date: Fri, 30 Oct 2026 16:25:55 +0000
Gerrit-HasComments: No

[kudu-CR] [java] Add proxy user client support

Posted by "Kudu Jenkins (Code Review)" <ge...@cloudera.org>.
Kudu Jenkins has posted comments on this change. ( http://gerrit.cloudera.org:8080/24830 )

Change subject: [java] Add proxy user client support
......................................................................


Patch Set 2:

Build Started http://jenkins.kudu.apache.org/job/pre_commit/3158/


-- 
To view, visit http://gerrit.cloudera.org:8080/24830
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I77897a52cfa01e5b7af97703437cd45d2df9fb52
Gerrit-Change-Number: 24830
Gerrit-PatchSet: 2
Gerrit-Owner: mintao <mi...@gmail.com>
Gerrit-Reviewer: Alexey Serbin <al...@apache.org>
Gerrit-Reviewer: Kudu Jenkins (120)
Gerrit-Reviewer: Zoltan Chovan <zc...@cloudera.com>
Gerrit-Comment-Date: Mon, 26 Oct 2026 13:41:16 +0000
Gerrit-HasComments: No

[kudu-CR] [java] Add proxy user client support

Posted by "Kudu Jenkins (Code Review)" <ge...@cloudera.org>.
Kudu Jenkins has posted comments on this change. ( http://gerrit.cloudera.org:8080/24830 )

Change subject: [java] Add proxy user client support
......................................................................


Patch Set 3:

Build Started http://jenkins.kudu.apache.org/job/pre_commit/3172/


-- 
To view, visit http://gerrit.cloudera.org:8080/24830
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I77897a52cfa01e5b7af97703437cd45d2df9fb52
Gerrit-Change-Number: 24830
Gerrit-PatchSet: 3
Gerrit-Owner: mintao <mi...@gmail.com>
Gerrit-Reviewer: Alexey Serbin <al...@apache.org>
Gerrit-Reviewer: Kudu Jenkins (120)
Gerrit-Reviewer: Zoltan Chovan <zc...@cloudera.com>
Gerrit-Comment-Date: Tue, 27 Oct 2026 12:58:19 +0000
Gerrit-HasComments: No

[kudu-CR] [java] Add proxy user client support

Posted by "Kudu Jenkins (Code Review)" <ge...@cloudera.org>.
Kudu Jenkins has posted comments on this change. ( http://gerrit.cloudera.org:8080/24830 )

Change subject: [java] Add proxy user client support
......................................................................


Patch Set 4:

Build Started http://jenkins.kudu.apache.org/job/pre_commit/3184/


-- 
To view, visit http://gerrit.cloudera.org:8080/24830
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I77897a52cfa01e5b7af97703437cd45d2df9fb52
Gerrit-Change-Number: 24830
Gerrit-PatchSet: 4
Gerrit-Owner: mintao <mi...@gmail.com>
Gerrit-Reviewer: Alexey Serbin <al...@apache.org>
Gerrit-Reviewer: Kudu Jenkins (120)
Gerrit-Reviewer: Zoltan Chovan <zc...@cloudera.com>
Gerrit-Comment-Date: Tue, 27 Oct 2026 14:33:04 +0000
Gerrit-HasComments: No

[kudu-CR] [java] Add proxy user client support

Posted by "Zoltan Chovan (Code Review)" <ge...@cloudera.org>.
Zoltan Chovan has posted comments on this change. ( http://gerrit.cloudera.org:8080/24830 )

Change subject: [java] Add proxy user client support
......................................................................


Patch Set 4:

(6 comments)

SecurityContext no longer compares the effective user with user.name (see 24828, client.cc:471). TestSecurityContextRealUser.testEmptyEffectiveUserIsUnset checks that an effective user equal to the OS user name is kept.

Connection.java now fails fast with NotAuthorized when a proxied connection is rejected, instead of retrying "connection closed" until timeout.

Missing tests:
Added TestNegotiator.testProxiedNegotiation. The context has an authn token, a JWT and trusted certs, and the test checks that only SASL is offered, the PLAIN message starts with "proxy-target\0\0", and the connection context carries proxy-target. 
The pure unit tests moved to a new TestSecurityContextEffectiveUser, which starts no cluster. TestSecurityContextRealUser is unchanged from master again.

http://gerrit.cloudera.org:8080/#/c/24830/4/java/kudu-client/src/main/java/org/apache/kudu/client/AsyncKuduClient.java
File java/kudu-client/src/main/java/org/apache/kudu/client/AsyncKuduClient.java:

http://gerrit.cloudera.org:8080/#/c/24830/4/java/kudu-client/src/main/java/org/apache/kudu/client/AsyncKuduClient.java@3108
PS4, Line 3108:      * @param effectiveUser the proxy user, or null to use the authenticated user
> 'the proxy user' should be 'the user to impersonate'. Please also treat an 
Done


http://gerrit.cloudera.org:8080/#/c/24830/4/java/kudu-client/src/main/java/org/apache/kudu/client/Negotiator.java
File java/kudu-client/src/main/java/org/apache/kudu/client/Negotiator.java:

http://gerrit.cloudera.org:8080/#/c/24830/4/java/kudu-client/src/main/java/org/apache/kudu/client/Negotiator.java@270
PS4, Line 270:       if (securityContext.getEffectiveUser() != null) {
> Read effectiveUser once into a final field in the constructor, like authnTo
Done


http://gerrit.cloudera.org:8080/#/c/24830/4/java/kudu-client/src/main/java/org/apache/kudu/client/Negotiator.java@287
PS4, Line 287:     JwtRawPB jwt = securityContext.getJsonWebToken();
> We still offer the JWT on proxied connections, and if the server picks it t
Done, proxied connections don't offer JWT.


http://gerrit.cloudera.org:8080/#/c/24830/4/java/kudu-client/src/main/java/org/apache/kudu/client/Negotiator.java@519
PS4, Line 519:                                             securityContext.getEffectiveUser(),
> Indentation is off by one.
Done


http://gerrit.cloudera.org:8080/#/c/24830/4/java/kudu-client/src/main/java/org/apache/kudu/client/SecurityContext.java
File java/kudu-client/src/main/java/org/apache/kudu/client/SecurityContext.java:

http://gerrit.cloudera.org:8080/#/c/24830/4/java/kudu-client/src/main/java/org/apache/kudu/client/SecurityContext.java@289
PS4, Line 289:     if (effectiveUser != null) {
> On an executor without Kerberos the imported token is ignored because effec
Reworked, see 24828: the exported credentials carry the token for the effective user, so an executor without Kerberos acts as the effective user. 

Covered by TestProxyUser.testExportedCredentialsActAsTarget and TestSecurityContextRealUser.


http://gerrit.cloudera.org:8080/#/c/24830/4/java/kudu-client/src/main/java/org/apache/kudu/client/SecurityContext.java@361
PS4, Line 361:       if (pb.hasEffectiveUser()) {
> Import order differs from C++ (where the builder wins), and importing after
Importing no longer touches the effective user, which is fixed for the client's lifetime, so connections can't mix identities and the builder always wins.



-- 
To view, visit http://gerrit.cloudera.org:8080/24830
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I77897a52cfa01e5b7af97703437cd45d2df9fb52
Gerrit-Change-Number: 24830
Gerrit-PatchSet: 4
Gerrit-Owner: mintao <mi...@gmail.com>
Gerrit-Reviewer: Alexey Serbin <al...@apache.org>
Gerrit-Reviewer: Kudu Jenkins (120)
Gerrit-Reviewer: Marton Greber <gr...@gmail.com>
Gerrit-Reviewer: Zoltan Chovan <zc...@cloudera.com>
Gerrit-Comment-Date: Fri, 30 Oct 2026 13:30:13 +0000
Gerrit-HasComments: Yes

[kudu-CR] [java] Add proxy user client support

Posted by "Kudu Jenkins (Code Review)" <ge...@cloudera.org>.
Kudu Jenkins has posted comments on this change. ( http://gerrit.cloudera.org:8080/24830 )

Change subject: [java] Add proxy user client support
......................................................................


Patch Set 1:

Build Started http://jenkins.kudu.apache.org/job/pre_commit/2958/


-- 
To view, visit http://gerrit.cloudera.org:8080/24830
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I77897a52cfa01e5b7af97703437cd45d2df9fb52
Gerrit-Change-Number: 24830
Gerrit-PatchSet: 1
Gerrit-Owner: mintao <mi...@gmail.com>
Gerrit-Reviewer: Alexey Serbin <al...@apache.org>
Gerrit-Reviewer: Kudu Jenkins (120)
Gerrit-Reviewer: Zoltan Chovan <zc...@cloudera.com>
Gerrit-Comment-Date: Mon, 14 Sep 2026 03:35:05 +0000
Gerrit-HasComments: No

[kudu-CR] [java] Add proxy user client support

Posted by "Kudu Jenkins (Code Review)" <ge...@cloudera.org>.
Kudu Jenkins has posted comments on this change. ( http://gerrit.cloudera.org:8080/24830 )

Change subject: [java] Add proxy user client support
......................................................................


Patch Set 2: Verified-1

Build Failed 

http://jenkins.kudu.apache.org/job/pre_commit/3158/ : FAILURE


-- 
To view, visit http://gerrit.cloudera.org:8080/24830
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I77897a52cfa01e5b7af97703437cd45d2df9fb52
Gerrit-Change-Number: 24830
Gerrit-PatchSet: 2
Gerrit-Owner: mintao <mi...@gmail.com>
Gerrit-Reviewer: Alexey Serbin <al...@apache.org>
Gerrit-Reviewer: Kudu Jenkins (120)
Gerrit-Reviewer: Zoltan Chovan <zc...@cloudera.com>
Gerrit-Comment-Date: Mon, 26 Oct 2026 14:43:25 +0000
Gerrit-HasComments: No

[kudu-CR] KUDU-3586 [java] Add proxy user client support

Posted by "Zoltan Chovan (Code Review)" <ge...@cloudera.org>.
Zoltan Chovan has uploaded a new patch set (#5) to the change originally created by mintao. ( http://gerrit.cloudera.org:8080/24830 )

Change subject: KUDU-3586 [java] Add proxy user client support
......................................................................

KUDU-3586 [java] Add proxy user client support

Expose AsyncKuduClientBuilder.effectiveUser() and
KuduClientBuilder.effectiveUser(). The client still authenticates using
its real Kerberos identity. A null or empty name means the client acts
as the real user; as in the C++ client, the effective user is not
compared with the local OS user name. The effective user is
fixed for the lifetime of the client, since connections are not keyed
by user.

The Java negotiator reads the effective user once per negotiation, sends
it as the SASL authorization identity, and populates the (deprecated)
connection context user info consistently. Proxied connections use
neither authentication tokens nor JWTs: they carry no authorization
identity, so the impersonation would be silently dropped. When the
servers reject a proxy request, the client fails with NotAuthorized and
the reason from the server instead of retrying until it times out.

As in the C++ client, a proxied client exports the authentication token
issued for the effective user, so a client importing the credentials,
e.g. a Spark executor without Kerberos credentials, acts as the
effective user. Importing credentials never changes the effective user
of a client.

The credentials semantics are covered by the unit tests in
TestSecurityContextEffectiveUser. A new TestNegotiator case checks that
a proxied client with an authn token, a JWT and trusted certificates
only offers SASL, sends the effective user as the PLAIN authorization
identity, and puts it into the connection context.

Co-authored-by: hzmintao <mi...@gmail.com>
Change-Id: I77897a52cfa01e5b7af97703437cd45d2df9fb52
---
M java/kudu-client/src/main/java/org/apache/kudu/client/AsyncKuduClient.java
M java/kudu-client/src/main/java/org/apache/kudu/client/Connection.java
M java/kudu-client/src/main/java/org/apache/kudu/client/KuduClient.java
M java/kudu-client/src/main/java/org/apache/kudu/client/Negotiator.java
M java/kudu-client/src/main/java/org/apache/kudu/client/SecurityContext.java
M java/kudu-client/src/test/java/org/apache/kudu/client/TestNegotiator.java
A java/kudu-client/src/test/java/org/apache/kudu/client/TestSecurityContextEffectiveUser.java
7 files changed, 263 insertions(+), 12 deletions(-)


  git pull ssh://gerrit.cloudera.org:29418/kudu refs/changes/30/24830/5
-- 
To view, visit http://gerrit.cloudera.org:8080/24830
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: newpatchset
Gerrit-Change-Id: I77897a52cfa01e5b7af97703437cd45d2df9fb52
Gerrit-Change-Number: 24830
Gerrit-PatchSet: 5
Gerrit-Owner: mintao <mi...@gmail.com>
Gerrit-Reviewer: Alexey Serbin <al...@apache.org>
Gerrit-Reviewer: Kudu Jenkins (120)
Gerrit-Reviewer: Marton Greber <gr...@gmail.com>
Gerrit-Reviewer: Zoltan Chovan <zc...@cloudera.com>

[kudu-CR] KUDU-3586 [java] Add proxy user client support

Posted by "Kudu Jenkins (Code Review)" <ge...@cloudera.org>.
Kudu Jenkins has posted comments on this change. ( http://gerrit.cloudera.org:8080/24830 )

Change subject: KUDU-3586 [java] Add proxy user client support
......................................................................


Patch Set 5:

Build Started http://jenkins.kudu.apache.org/job/pre_commit/3214/


-- 
To view, visit http://gerrit.cloudera.org:8080/24830
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I77897a52cfa01e5b7af97703437cd45d2df9fb52
Gerrit-Change-Number: 24830
Gerrit-PatchSet: 5
Gerrit-Owner: mintao <mi...@gmail.com>
Gerrit-Reviewer: Alexey Serbin <al...@apache.org>
Gerrit-Reviewer: Kudu Jenkins (120)
Gerrit-Reviewer: Marton Greber <gr...@gmail.com>
Gerrit-Reviewer: Zoltan Chovan <zc...@cloudera.com>
Gerrit-Comment-Date: Fri, 30 Oct 2026 13:30:36 +0000
Gerrit-HasComments: No

[kudu-CR] [java] Add proxy user client support

Posted by "Kudu Jenkins (Code Review)" <ge...@cloudera.org>.
Kudu Jenkins has posted comments on this change. ( http://gerrit.cloudera.org:8080/24830 )

Change subject: [java] Add proxy user client support
......................................................................


Patch Set 3: Verified-1

Build Failed 

http://jenkins.kudu.apache.org/job/pre_commit/3172/ : FAILURE


-- 
To view, visit http://gerrit.cloudera.org:8080/24830
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I77897a52cfa01e5b7af97703437cd45d2df9fb52
Gerrit-Change-Number: 24830
Gerrit-PatchSet: 3
Gerrit-Owner: mintao <mi...@gmail.com>
Gerrit-Reviewer: Alexey Serbin <al...@apache.org>
Gerrit-Reviewer: Kudu Jenkins (120)
Gerrit-Reviewer: Zoltan Chovan <zc...@cloudera.com>
Gerrit-Comment-Date: Tue, 27 Oct 2026 13:31:18 +0000
Gerrit-HasComments: No

[kudu-CR] KUDU-3586 [java] Add proxy user client support

Posted by "Kudu Jenkins (Code Review)" <ge...@cloudera.org>.
Kudu Jenkins has posted comments on this change. ( https://gerrit.cloudera.org/24830 )

Change subject: KUDU-3586 [java] Add proxy user client support
......................................................................


Patch Set 7: Verified-1

Build Failed 

http://jenkins.kudu.apache.org/job/pre_commit/3247/ : FAILURE


-- 
To view, visit https://gerrit.cloudera.org/24830
To unsubscribe, visit https://gerrit.cloudera.org/settings

Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I77897a52cfa01e5b7af97703437cd45d2df9fb52
Gerrit-Change-Number: 24830
Gerrit-PatchSet: 7
Gerrit-Owner: mintao <mi...@gmail.com>
Gerrit-Reviewer: Alexey Serbin <al...@apache.org>
Gerrit-Reviewer: Kudu Jenkins (120)
Gerrit-Reviewer: Marton Greber <gr...@gmail.com>
Gerrit-Reviewer: Zoltan Chovan <zc...@cloudera.com>
Gerrit-Comment-Date: Tue, 03 Nov 2026 20:51:59 +0000
Gerrit-HasComments: No