This is an automated email from the ASF dual-hosted git repository.
janhoy pushed a commit to branch branch_10x
in repository https://gitbox.apache.org/repos/asf/solr.git
The following commit(s) were added to refs/heads/branch_10x by this push:
new 589f89eb6bf SOLR-18282 Factor in dump logic and better use of constants
589f89eb6bf is described below
commit 589f89eb6bf556c81f2d46a7d995ef6afe2a44ed
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
(cherry picked from commit c54251ea1614a6635410083839011cf20bfe189b)
---
.../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);
}