Textbox Character Set Validation
RealistikDash opened this issue · 3 comments
Geometry Dash textboxes feature a limited character space. This is usually only includes alphanumeric characters, but may occasionally allow extra characters (such as email allowing @
and passwords including more characters).
Enforcing this would be beneficial as the Geometry Dash response format does not support escaping characters. This means that currently, a level with a |
in its name can genuinely completely prevent the game from reading the response.
Additionally, would help against botting.
An ideal solution would leverage pydantic's parsing, perhaps an implementation similar to the Base64String
validator. Should be efficient as it will likely be used on many endpoints. https://github.com/RealistikDash/RealistikGDPS/blob/d767f4083241f9fbd40771bba4fbfa6c4a2cce62/rgdps/common/validators.py#L9-L30
It'd be a better idea to let server owners decide whether or not character limits (the amount of characters you are able to type inside the boxes) are enforced inside their configuration files. Deny all requests with text input above the respective character limits with enforced character limits enabled.
Escaping illegal characters however, using regex or a similar method is a must and will ensure stability on the server's side.
I personally don't see a point to that degree of customisability. It is a usecase very few would be able to take advantage of (they require third party modifications that are not commonly used) and it would cause a sizable complexity increase for development. The field sizes in the databases also make reference to textbox sizes in geometry dash.
TL;DR: configurable limits are not worth it as they currently already match the clients'.
That's fair. Maybe in the future this would become more of a possibility than it is now. Hopefully.