dsmiley commented on code in PR #2404:
URL: https://github.com/apache/solr/pull/2404#discussion_r1578800441


##########
solr/core/src/java/org/apache/solr/response/transform/SubQueryAugmenterFactory.java:
##########
@@ -340,7 +346,9 @@ public void transform(SolrDocument doc, int docid) {
     final SolrParams docWithDeprefixed =
         SolrParams.wrapDefaults(new DocRowParams(doc, prefix, separator), 
baseSubParams);
     try {
-      QueryResponse rsp = server.query(coreName, docWithDeprefixed);
+      QueryRequest req = new QueryRequest(docWithDeprefixed);
+      req.setUserPrincipal(principal);
+      QueryResponse rsp = req.process(server, coreName);

Review Comment:
   I'm kind of concerned this is merely one spot of potentially many other 
cases.  Could/should we depend on SolrRequestInfo to make this automatic?



##########
solr/core/src/java/org/apache/solr/servlet/SolrRequestParsers.java:
##########
@@ -252,7 +260,11 @@ private SolrQueryRequest buildRequestFrom(
         new SolrQueryRequestBase(core, params, requestTimer) {
           @Override
           public Principal getUserPrincipal() {
-            return req == null ? null : req.getUserPrincipal();
+            if (principal != null) {
+              return principal;
+            } else {
+              return req == null ? null : req.getUserPrincipal();
+            }
           }

Review Comment:
   An idea; not totally sure if it'll work until you try:  Instead of passing 
in a Principal to buildRequestFrom, I think the line you are changing here 
could instead see that *if* HttpServletRequest is null, then see if we can use 
`org.apache.solr.request.SolrRequestInfo#getUserPrincipal` which works off a 
ThreadLocal internally.  There may be no SolrRequestInfo either; so ultimately 
may have null.
   



-- 
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: issues-unsubscr...@solr.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscr...@solr.apache.org
For additional commands, e-mail: issues-h...@solr.apache.org

Reply via email to