You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@solr.apache.org by GitBox <gi...@apache.org> on 2022/09/21 20:50:20 UTC

[GitHub] [solr] gerlowskija opened a new pull request, #1035: SOLR-16392: Support REST-ful path lookup in V2HttpCall

gerlowskija opened a new pull request, #1035:
URL: https://github.com/apache/solr/pull/1035

   
   
   
   # Description
   
   Historically, V2HttpCall has determined whether a given API is an "admin" request or a "core" request based on its path. Paths containing a core/collection name are "core" requests, all others are considered "admin" requests. V2HttpCall figures out what request-type its dealing with, and then knows which PluginBag to look for an Api in. This works because the original v2 API was designed with this heuristic in mind: it's one of the main reasons that some paths (e.g. /collections) have so many sub-commands.
   
   But it doesn't work with the more REST-ful paths we hope to use in our v2 API modernization effort.
   
   # Solution
   
   This PR takes a sort of "guess and check" approach, where we try serving ambiguous requests from multiple Jersey apps in series, stopping at the first one that doesn't spit out a quick `NotFoundException`.
   
   # Tests
   
   Manual testing.
   
   # Checklist
   
   Please review the following and check all that apply:
   
   - [x] I have reviewed the guidelines for [How to Contribute](https://wiki.apache.org/solr/HowToContribute) and my code conforms to the standards described there to the best of my ability.
   - [x] I have created a Jira issue and added the issue ID to my pull request title.
   - [x] I have given Solr maintainers [access](https://help.github.com/en/articles/allowing-changes-to-a-pull-request-branch-created-from-a-fork) to contribute to my PR branch. (optional but recommended)
   - [x] I have developed this patch against the `main` branch.
   - [ ] I have run `./gradlew check`.
   - [ ] I have added tests for my changes.
   


-- 
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-unsubscribe@solr.apache.org

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


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


[GitHub] [solr] sonatype-lift[bot] commented on pull request #1035: SOLR-16392: Support REST-ful path lookup in V2HttpCall

Posted by GitBox <gi...@apache.org>.
sonatype-lift[bot] commented on PR #1035:
URL: https://github.com/apache/solr/pull/1035#issuecomment-1262455730

   :warning: **314 God Classes** were detected by Lift in this project. [Visit the Lift web console](https://lift.sonatype.com/results/github.com/apache/solr/01GE4V4NSQXPST7N4PZ7P10E17?tab=technical-debt&utm_source=github.com&utm_campaign=lift-comment&utm_content=apache\%20solr) for more details.


-- 
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-unsubscribe@solr.apache.org

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


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


[GitHub] [solr] sonatype-lift[bot] commented on a diff in pull request #1035: SOLR-16392: Support REST-ful path lookup in V2HttpCall

Posted by GitBox <gi...@apache.org>.
sonatype-lift[bot] commented on code in PR #1035:
URL: https://github.com/apache/solr/pull/1035#discussion_r983704304


##########
solr/core/src/java/org/apache/solr/servlet/HttpSolrCall.java:
##########
@@ -520,13 +527,14 @@ && shouldAuthorize()
 
       HttpServletResponse resp = response;
       switch (action) {
+        case ADMIN_OR_REMOTEQUERY:
+          handleAdminOrRemoteRequest();
+          return RETURN;
         case ADMIN:
           handleAdminRequest();
           return RETURN;
         case REMOTEQUERY:
-          SolrRequestInfo.setRequestInfo(new SolrRequestInfo(req, new SolrQueryResponse(), action));
-          mustClearSolrRequestInfo = true;
-          remoteQuery(coreUrl + path, resp);
+          sendRemoteQuery();

Review Comment:
   *CROSS_SITE_SCRIPTING:*  UserControlledString(HttpServletRequest.getAttribute(...)) in procedure SolrRequestParsers.buildRequestFrom(...) at line 252 ~> HTML(HttpServletResponse.setHeader(...)) in procedure HttpSolrCall.remoteQuery(...) at line 771.
   
   ---
   
   <details><summary><b>â„šī¸ Learn about @sonatype-lift commands</b></summary>
   
   You can reply with the following commands. For example, reply with ***@sonatype-lift ignoreall*** to leave out all findings.
   | **Command** | **Usage** |
   | ------------- | ------------- |
   | `@sonatype-lift ignore` | Leave out the above finding from this PR |
   | `@sonatype-lift ignoreall` | Leave out all the existing findings from this PR |
   | `@sonatype-lift exclude <file\|issue\|path\|tool>` | Exclude specified `file\|issue\|path\|tool` from Lift findings by updating your config.toml file |
   
   **Note:** When talking to LiftBot, you need to **refresh** the page to see its response.
   <sub>[Click here](https://github.com/apps/sonatype-lift/installations/new) to add LiftBot to another repo.</sub></details>
   
   
   
   ---
   
   Was this a good recommendation?
   [ [🙁 Not relevant](https://www.sonatype.com/lift-comment-rating?comment=339972575&lift_comment_rating=1) ] - [ [😕 Won't fix](https://www.sonatype.com/lift-comment-rating?comment=339972575&lift_comment_rating=2) ] - [ [😑 Not critical, will fix](https://www.sonatype.com/lift-comment-rating?comment=339972575&lift_comment_rating=3) ] - [ [🙂 Critical, will fix](https://www.sonatype.com/lift-comment-rating?comment=339972575&lift_comment_rating=4) ] - [ [😊 Critical, fixing now](https://www.sonatype.com/lift-comment-rating?comment=339972575&lift_comment_rating=5) ]



-- 
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-unsubscribe@solr.apache.org

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


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


[GitHub] [solr] gerlowskija commented on a diff in pull request #1035: SOLR-16392: Support REST-ful path lookup in V2HttpCall

Posted by GitBox <gi...@apache.org>.
gerlowskija commented on code in PR #1035:
URL: https://github.com/apache/solr/pull/1035#discussion_r983949445


##########
solr/core/src/java/org/apache/solr/servlet/HttpSolrCall.java:
##########
@@ -520,13 +527,14 @@ && shouldAuthorize()
 
       HttpServletResponse resp = response;
       switch (action) {
+        case ADMIN_OR_REMOTEQUERY:
+          handleAdminOrRemoteRequest();
+          return RETURN;
         case ADMIN:
           handleAdminRequest();
           return RETURN;
         case REMOTEQUERY:
-          SolrRequestInfo.setRequestInfo(new SolrRequestInfo(req, new SolrQueryResponse(), action));
-          mustClearSolrRequestInfo = true;
-          remoteQuery(coreUrl + path, resp);
+          sendRemoteQuery();

Review Comment:
   Not introduced in this PR - it's just code I moved into a method to enable reuse.



-- 
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-unsubscribe@solr.apache.org

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


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


[GitHub] [solr] gerlowskija merged pull request #1035: SOLR-16392: Support REST-ful path lookup in V2HttpCall

Posted by GitBox <gi...@apache.org>.
gerlowskija merged PR #1035:
URL: https://github.com/apache/solr/pull/1035


-- 
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-unsubscribe@solr.apache.org

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


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