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

On uploading map/mods add validation to map/mod version to be in range of 1..9999 #908

Closed
Brutus5000 opened this issue Nov 22, 2024 · 3 comments · Fixed by #915
Closed

Comments

@Brutus5000
Copy link
Member

We had integer overflows causing weird file names and potentially errors in parsing of negative values in the clients.

The limit is the database:

  • Maps max is 4 digits,
  • Mods is SMALLINT (max 32767)
@Ivan-Shaml
Copy link
Member

Hi,

As far as I undersand the issue, there are already existing records in the database for com.faforever.api.data.domain.Mod and com.faforever.api.data.domain.Map, which have invalid version numbers, so validation on entity level is not an option.

So in this case, additional validation logic needs to be added to the MapService and ModService classes for the upload methods.

Is my understanding correct ?

@Brutus5000
Copy link
Member Author

Validation on entity level is too late and not suitable for proper error handling. We parse and validate a lua file inside the uploaded zip. MapService and ModService are the places to look for validation.

@Ivan-Shaml
Copy link
Member

Thanks for the answer! When you have time (or any other maintainer), can you please take a look at the PR I have linked.

Especially at the new ErrorCode entries, I am not 100% sure if the messages are user friendly/appropriate.

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