ListElements should no longer allow listing on all corpora
Although it is now impossible in the frontend to list elements on all corpora at once (frontend#48 (closed)), it is still possible to cause a heavy load on any server by calling cli.request('ListElements')
or just by opening https://arkindex.teklia.com/api/v1/elements/ in a browser. This especially exacerbates #458 (closed).
Thanks to the way the filters work in OpenAPI for ListElements
, if we do our changes properly, cli.request('ListElements', corpus='...')
should still work even with a new URL like /api/v1/corpus/<id>/elements/
or /api/v1/elements/<id>/
. This however definitely needs testing.
An immediate fix without updating URLs would be to cause a HTTP 400 if the ?corpus=…
filter is missing.