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


##########
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 commented re: SolrRequestInfo separately but will add detail there. The 
question is: what can we assume about the contents of SolrRequestInfo? In the 
context of subquery execution, what we find at the top of the stack inside 
SolrRequestInfo is the _new_ subquery request that we've constructed, not the 
enclosing/original request that contained the authentication info. The 
following excerpt from EmbeddedSolrServer shows how SolrRequestInfo gets set 
before a subquery is actually executed:
   
   ```
         req = _parser.buildRequestFrom(core, params, 
getContentStreams(request));
         SolrQueryResponse rsp = new SolrQueryResponse();
         SolrRequestInfo.setRequestInfo(new SolrRequestInfo(req, rsp));
         core.execute(handler, req, rsp);
   ```
   
   My basic intuition is that if we're creating a brand new QueryRequest, we 
really _should_ be copying any authentication info onto it that needs to be 
used in its execution. I don't see any notion in the codebase of a parent/child 
relationship between queries, where a child query could somehow know who its 
parent is and derive auth info from the parent. Therefore, it really seems to 
me like copying the auth info is the logical option.
   



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