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

mosh commented on SOLR-13151:
-----------------------------

I was thinking, the validation could be done per RoutedAlias, instead of the 
way it is currently verified in CreateAliasCmd#callCreateRoutedAlias:121
{code:java}
    if (!props.keySet().containsAll(routedAlias.getRequiredParams())) {
      throw new SolrException(BAD_REQUEST, "Not all required params were 
supplied. Missing params: " +
          StrUtils.join(Sets.difference(routedAlias.getRequiredParams(), 
props.keySet()), ','));
    }{code}
There could be a default method RoutedAlias#validateParams, which will have the 
logic implemented above, having each implementing class could override in case 
its parameters have stricter requirements. e.g. in case of a CRA, the 
router.mustMatch parameter must be a valid regex pattern.

[~gus_heck],
 WDYT?

> Provide regex based category validation for CategoryRoutedAliases
> -----------------------------------------------------------------
>
>                 Key: SOLR-13151
>                 URL: https://issues.apache.org/jira/browse/SOLR-13151
>             Project: Solr
>          Issue Type: Sub-task
>      Security Level: Public(Default Security Level. Issues are Public) 
>          Components: UpdateRequestProcessors
>    Affects Versions: master (9.0)
>            Reporter: Gus Heck
>            Priority: Major
>
> This ticket will add the check to enforce a (configurable, optional) regular 
> expression to enreject requests that attempt to add an unexpected category, 
> or a malformed category to a category routed alias. The purpose of this check 
> is to provide a safety valve to ensure that unexpected data values don't 
> cause creation of collections inconsistent with the user's intended design. 
> This check should happen within the validateRouteValue() method specified by 
> RoutedAlias



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

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

Reply via email to