You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
According to RFC 7482 section 3.2.1 the form "domains?name=XXXX" allows the search of names either in LDH format or as U-Label. Currently at the server there's a problem when the next variables are met (all at the same time):
Server configured with the property 'allow_search_wildcards_anywhere' as 'false'.
Search a domain as U-Label at /domains?name.
Use a wildcard at the end of the label being searched (eg. /domains?name=exámplé*).
When the search is made the server will respond with a 422 error code and the message 'Partial search can only have wildcards at the end of each label'.
The response is incorrect. First of all is a valid search (the search should reach to the implementation at least), and second, the error message is wrong since the configuration allows to have a wilcard at the end of the label.
The issue is at mx.nic.rdap.server.servlet.RdapSearchRequest.validatePartialSearchValue(String, boolean), exactly below the commented line:
// validates that asterisk are only in the end of the search patternif (isEntity) {
if (!valuePattern.endsWith("*")) {
thrownewUnprocessableEntityException(
"Partial search can only have a wildcard at the end of the search");
}
intasteriskCount = valuePattern.length() - valuePattern.replaceAll("\\*", "").length();
if (asteriskCount > 1) {
thrownewUnprocessableEntityException("Partial search can only have one wildcard");
}
} else {
// FIXME Right here is the issue: this REGEX doesn't allow U-Labelsif (!PARTIAL_DOMAIN_SEARCH_PATTERN.matcher(valuePattern).matches()) {
thrownewUnprocessableEntityException(
"Partial search can only have wildcards at the end of each label");
}
}
The text was updated successfully, but these errors were encountered:
The validation has been refactored, the regex used to validate the labels was incomplete since it wasn't allowing searches using unicode characters.
The refactor was made at the use of wildcards and its validations whenever a search pattern is used (applies to "/domains?(name | nsLdhName | nsIp)", "/nameservers?(name | ip)", "/entities?(fn | handle)"):
A new configuration property was added: 'allow_multiple_search_wildcards'. If set to true then multiple wildcards can be used at the search patterns, if false then only one wildcard can be used.
The property 'allow_search_wildcards_anywhere' was renamed to 'allow_search_wildcard_anywhere', its value is ignored when the new property 'allow_multiple_search_wildcards' is set to true. The behaviour is basically the same (true means that the only wildcard allowed can be anywhere in the search pattern, false means that it must be at the end).
Multiple wildcards are treated as one. Eg. 'fo**.bar' will be treated as 'fo*.bar'. This is to avoid "bad" searches, such as "/domains?name=*****" that will surpass the default validation of 'minimum_search_pattern_length' (it's default value is 5).
The new 'allow_multiple_search_wildcards' property can be configured and loaded from WEB-INF/configuration.properties. If the property is setted "true", the search module allows multiple wildcars (for each label/segment), no matter the place they took (at begging, in the middle, at the end). This property applies for domains, nameserver and entities searches.
If multiple wildcards are used together (for example name=******domain.com ) , they are treated now as one (name=*domain.com)
If the allow_multiple_search_wildcards property is setted true, the allow_search_wildcard_anywhere property is ignored.
According to RFC 7482 section 3.2.1 the form "domains?name=XXXX" allows the search of names either in LDH format or as U-Label. Currently at the server there's a problem when the next variables are met (all at the same time):
When the search is made the server will respond with a 422 error code and the message 'Partial search can only have wildcards at the end of each label'.
The response is incorrect. First of all is a valid search (the search should reach to the implementation at least), and second, the error message is wrong since the configuration allows to have a wilcard at the end of the label.
The issue is at
mx.nic.rdap.server.servlet.RdapSearchRequest.validatePartialSearchValue(String, boolean)
, exactly below the commented line:The text was updated successfully, but these errors were encountered: