[ 
https://issues.apache.org/jira/browse/SOLR-18059?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18146710#comment-18146710
 ] 

Jan Høydahl commented on SOLR-18059:
------------------------------------

Here's a first take: https://github.com/apache/solr/pull/5362

It adds {{AllowListPathChecker}} (next to {{AllowListUrlChecker}}, same shape): 
built from {{NodeConfig}} via {{create(config)}}, or from a plain set of paths. 
{{CoreContainer}} holds one and delegates to it, and 
{{FileSystemConfigSetService}} now gets the checker instead of the container, 
so the null-container hack and TODO from SOLR-18058 are gone.

I didn't go the "SolrPaths with state" route. Several nodes with different 
homes can share a JVM (MiniSolrCloudCluster, embedded), so a static list would 
be either last-writer-wins or a union of all nodes. Instead the checker is per 
node and gets handed to whoever needs it. Every current caller already has a 
core or container to get it from.

Did you have other callers in mind besides {{FileSystemConfigSetService}}? If 
something truly context-free comes up, we could add a static registry on top 
later.

> Expose "allowPath" logic in helper/utility class.
> -------------------------------------------------
>
>                 Key: SOLR-18059
>                 URL: https://issues.apache.org/jira/browse/SOLR-18059
>             Project: Solr
>          Issue Type: Improvement
>            Reporter: Jason Gerlowski
>            Priority: Minor
>              Labels: pull-request-available
>          Time Spent: 20m
>  Remaining Estimate: 0h
>
> Much of the logic for Solr's "allowPath" validation already lives in a 
> utility class called "SolrPaths", which is great.  But the actual set of 
> allowed-paths is loaded and known only to CoreContainer.  The end result is 
> that path-validation can't be done in the code without a reference to a 
> CoreContainer object.
> This ticket proposes refactoring this logic into a new utility class (or 
> perhaps expanding SolrPaths by giving it state), so that solr-core can do 
> path checking without needing an entire SolrCore.



--
This message was sent by Atlassian Jira
(v10.3.26#10030026)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to