This is an automated email from the ASF dual-hosted git repository.

janhoy pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/solr.git


The following commit(s) were added to refs/heads/main by this push:
     new c54251ea161 SOLR-18282 Factor in dump logic and better use of constants
c54251ea161 is described below

commit c54251ea1614a6635410083839011cf20bfe189b
Author: Jan Høydahl <[email protected]>
AuthorDate: Sun Jun 28 01:37:24 2026 +0200

    SOLR-18282 Factor in dump logic and better use of constants
---
 .../org/apache/solr/handler/admin/ZookeeperInfoHandler.java   | 11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)

diff --git 
a/solr/core/src/java/org/apache/solr/handler/admin/ZookeeperInfoHandler.java 
b/solr/core/src/java/org/apache/solr/handler/admin/ZookeeperInfoHandler.java
index 71c5efc3584..1f0eb6c2fb3 100644
--- a/solr/core/src/java/org/apache/solr/handler/admin/ZookeeperInfoHandler.java
+++ b/solr/core/src/java/org/apache/solr/handler/admin/ZookeeperInfoHandler.java
@@ -16,6 +16,7 @@
  */
 package org.apache.solr.handler.admin;
 
+import static 
org.apache.solr.common.cloud.ZkStateReader.SOLR_SECURITY_CONF_PATH;
 import static org.apache.solr.common.params.CommonParams.OMIT_HEADER;
 import static org.apache.solr.common.params.CommonParams.PATH;
 
@@ -100,9 +101,8 @@ public final class ZookeeperInfoHandler extends 
RequestHandlerBase {
   public Name getPermissionName(AuthorizationContext request) {
     var params = request.getParams();
     String path = normalizePath(params.get(PATH, ""));
-    boolean returnsContent =
-        params.getBool(PARAM_DETAIL, false) || params.getBool(PARAM_DUMP, 
false);
-    if ("/security.json".equalsIgnoreCase(path) && returnsContent) {
+    if (path.equals(SOLR_SECURITY_CONF_PATH)
+        || (params.getBool(PARAM_DUMP, false) && "/".equals(path))) {
       return Name.SECURITY_READ_PERM;
     } else {
       return Name.ZK_READ_PERM;
@@ -433,9 +433,14 @@ public final class ZookeeperInfoHandler extends 
RequestHandlerBase {
    * @return JSON string representing the ZooKeeper path data
    */
   private ZkBaseResponseBuilder handlePathViewRequest(SolrParams params) {
+    // Extract path parameter
     String path = normalizePath(params.get(PATH));
+
+    // Extract display options
     boolean detail = params.getBool(PARAM_DETAIL, false);
     boolean dump = params.getBool(PARAM_DUMP, false);
+
+    // Create response builder for specific path
     return new ZkPathResponseBuilder(cores.getZkController(), path, detail, 
dump);
   }
 

Reply via email to