Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wildcards "%" and "_" can be used on partial searches #6

Closed
pcarana opened this issue Jul 7, 2017 · 1 comment
Closed

Wildcards "%" and "_" can be used on partial searches #6

pcarana opened this issue Jul 7, 2017 · 1 comment

Comments

@pcarana
Copy link
Contributor

pcarana commented Jul 7, 2017

The issue was originally reported at the server (rdap-server issue 35), but this issue is for the provider.

When a partial search is made using the only wildcard allowed "*", I still can use other wildcards to get more information in the response. Here are some cases assuming that the minimum of characters allowed for the search is 5:
"/domains?name=%%a%*" will search for all the domains that have the char 'a' in their names.
"/domains?name=__e_*" will search for all the domains that the 3rd char of its name is the char 'e' followed by at least another char.

This wildcards can be used because the queries used for the searches use the sentence "LIKE", so they should be escaped if they are going to reach the query executed at DB. The escape could be made at the models (mx.nic.rdap.sql.model) just when the wildcard "*" is replaced by "%". The issue applies only for extended searches, so the models where the solution can be applied are:

  • DomainModel
  • EntityModel
  • NameserverModel
@pcarana pcarana added this to the v1.1.1 milestone Sep 22, 2017
@pcarana pcarana added the solved label Sep 22, 2017
@TheRedTrainer
Copy link

TheRedTrainer commented Oct 11, 2017

Verified. All the special chars used as a wildcard were escaped. The only wildcard allowed is * (asterisk). If an user executes the following searches, he receives the corresponding response:

http://localhost:8080/rdap-server/nameservers?name=_s*
{"rdapConformance":["rdap_level_0"],"errorCode":"404","title":"Object not found","description":""}

http://localhost:8080/rdap-server/nameservers?name=%s*
{"rdapConformance":["rdap_level_0"],"errorCode":"400","description":"The request must contain at least one of the following parameters: [ip, name]"}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants