Copilot commented on code in PR #65377:
URL: https://github.com/apache/doris/pull/65377#discussion_r3543050992


##########
be/src/service/http/action/stream_load_forward_handler.cpp:
##########
@@ -32,6 +32,18 @@ namespace doris {
 #include "common/compile_check_begin.h"
 
 int StreamLoadForwardHandler::on_header(HttpRequest* req) {
+    if (!config::enable_group_commit_streamload_be_forward) {
+        HttpChannel::send_reply(req, HttpStatus::FORBIDDEN,
+                                "Stream load forward is disabled. "
+                                "Set 
enable_group_commit_streamload_be_forward=true to enable.");
+        return -1;
+    }
+
+    int auth_ret = HttpHandlerWithAuth::on_header(req);
+    if (auth_ret != 0) {
+        return auth_ret;
+    }

Review Comment:
   The config gate runs before authentication, so unauthenticated callers can 
learn whether this endpoint is enabled (and get a different response than an 
auth failure). For a security-sensitive endpoint, authenticate first, then 
apply the feature/config gate.



##########
be/src/service/http/action/stream_load_forward_handler.h:
##########
@@ -25,7 +25,8 @@
 #include <string>
 
 #include "common/status.h"
-#include "service/http/http_handler.h"
+#include "runtime/exec_env.h"
+#include "service/http/http_handler_with_auth.h"
 #include "service/http/http_request.h"

Review Comment:
   stream_load_forward_handler.h includes runtime/exec_env.h, but 
http_handler_with_auth.h already includes it. This duplicate include increases 
compile-time dependencies unnecessarily.



-- 
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]

Reply via email to