CalvinKirs commented on code in PR #66205:
URL: https://github.com/apache/doris/pull/66205#discussion_r3773756976
##########
fe/fe-core/src/main/java/org/apache/doris/httpv2/restv2/MetaInfoActionV2.java:
##########
@@ -117,7 +120,9 @@ public Object getAllCatalogs(
public Object getAllDatabases(
@PathVariable(value = NS_KEY) String ns,
HttpServletRequest request, HttpServletResponse response) {
- checkWithCookie(request, response, false);
+ // Authenticate; the per-object SHOW filters below authorize. See
checkInstanceOverdueIfCloud.
+ ActionAuthorizationInfo authInfo = checkWithCookie(request, response,
false);
+ checkInstanceOverdueIfCloud(authInfo.userIdentity);
Review Comment:
Fixed in b31dcf6: both `getAllDatabases` and `getTables` now pass
`catalogName` to the SHOW privilege check, matching `getTableSchema`.
##########
fe/fe-core/src/main/java/org/apache/doris/httpv2/rest/MetaInfoAction.java:
##########
@@ -105,22 +106,25 @@ public Object getAllDatabases(
if (catalog == null) {
return ResponseEntityBuilder.badRequest("Unknown catalog " + ns);
}
- List<String> dbNames = new ArrayList<>(catalog.getDbNames());
- List<String> dbNameSet = Lists.newArrayList();
+ // getDbNames() may return an immutable view (see the external meta
cache refactor); this
Review Comment:
Reworded in b31dcf6: the comment no longer claims immutability; it just
states the method only iterates the list and sorts its own filtered copy, so it
works with either a fresh or a shared list.
--
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]