github-actions[bot] commented on code in PR #69747:
URL: https://github.com/apache/doris/pull/69747#discussion_r4399108910
##########
fe/fe-core/src/main/java/org/apache/doris/service/FrontendServiceImpl.java:
##########
@@ -2265,6 +2265,26 @@ private static int nextGroupCommitFollowerIndex(int
followerCount) {
return Math.floorMod(GROUP_COMMIT_FOLLOWER_INDEX.getAndIncrement(),
followerCount);
}
+ private void checkGroupCommitStreamLoadAuth(TStreamLoadPutRequest request)
throws AuthenticationException {
+ // Explicit group commit skips loadTxnBegin, so authenticate and
authorize the standard Stream Load
+ // request here before it can be forwarded or planned. Requests with
load_sql use the separate HTTP
+ // Stream path, whose planner performs its own authorization and whose
internal caller uses a token.
+ if (!Strings.isNullOrEmpty(request.getLoadSql()) ||
!request.isSetGroupCommitMode()
+ || request.getGroupCommitMode().equalsIgnoreCase("off_mode")) {
+ return;
+ }
+
+ if (request.isSetAuthCode()) {
Review Comment:
[P1] Reject unvalidated auth_code in the new authorization gate
The new check can still be bypassed through the public BE Stream Load
endpoint: send `group_commit: async_mode` and `auth_code: 1` with invalid Basic
credentials to a normal table with light schema change enabled.
`parse_basic_auth` (`be/src/service/http/utils.cpp:89-139`) accepts any numeric
auth_code header, and `set_request_auth` copies it into this field while
discarding the password. This empty branch then skips both credential
validation and the target-table LOAD check; explicit group commit skips
transaction begin, and the downstream planner uses `analyzeWithoutCheckPriv`.
Thus the authorization fix remains ineffective for this request variant. Reject
the deprecated credential here or validate it before treating it as trusted,
and cover this header in the regression test.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]