IACR / latex-submit

Web server to receive uploaded LaTeX and execute it in a docker container.
GNU Affero General Public License v3.0
11 stars 0 forks source link

Need to validate that inst in addauthor corresponds to actual affiliation #47

Closed kmccurley closed 1 year ago

kmccurley commented 1 year ago

If an author uses \addauthor[inst={2}]{Fester Bestertester} but there is not a second affiliation, then it currently gives a 500 error. We need to validate that the values in inst correspond to actual indices in the affiliation array.

kmccurley commented 1 year ago

There are two places to do this:

  1. in webapp/metadata/latex/iacrcc/parser/meta_parse::parse_meta where we could raise an exception.
  2. in webapp/metadata/compilation.py:Meta:root_validator where we validate that the dictionary. It looks like it tries to do this in #2, but fails. We should add a test for this.
kmccurley commented 1 year ago

Fixed by https://github.com/IACR/latex-submit/commit/28c4caaffe44dd0d920e79070a8205662d5bb4f1

kmccurley commented 1 year ago

I added code to fix the validation in the Meta class of compilation.py but the UI is not very helpful because it is caused by a generic schema validation error: image I think I should also add code to check this earlier and give a more understandable error message. This would occur after we call parse_meta in tasks.py.