Allow POST requests from public user for specific URLs#679
Conversation
|
To demonstrate the original issue, the following requests can be executed after authenticating into OMERO.web using the Console tab of the Developer tools. They should return the first four cells (2 rows, 2 columns) of a table:
Executing the same request against a table in a public OMERO.web instance deployed with the default The ability to slice the table using POST request is critical when slicing large table using large numbers of rows/columns. While GET requests are typically restricted by the maximum URL length, the body sent via a POST request has a larger upper limit. With this code, the expectation is to support the GET and POST requests to the |
|
This looks like a pretty clean solution to the issue. The only thought I had was since only |
I agree that we don't want a separate setting for each method, but I'm also hesitant to make it so you have to allow all methods on a URL if you just need one. For maximum flexibility we could have a setting that takes a Is that going too far? |
|
Suggestion to bundle all read ( |
|
I think we can leave the For the new setting, I wonder if we should simply allow ALL http methods for the specified URLs? If not, then a new setting could be named |
I don't have any scenario in mind but it would be useful for the sake of this conversation to compile the list of non-GET endpoints available via OMERO.web. I think some level of redundancy/consistency between these settings will be necessary. For instance, if you decide to block some URLs in
In all cases, what is proposed here is either deprecating or overriding the behavior of |
for more information, see https://pre-commit.ci
With the introduction of the table slice call in #564, the option to use
POSTrequests (in addition toGET) was included to allow for large number of rows to be fetched in one request.GETrequests are limited by the maximum length of URIs.An issue not previously considered is when
omero.web.public.enabledis enabled in combination withomero.web.public.get_only. In that case there is no way to usePOSTfor the table slice call. AllPOSTrequests would have to be allowed.This PR proposes a new setting to selectively allowPOSTfor some URLs, similar to how a set of URLs can be enabled for public mode.With the latest commits, this PR adds a new setting to allow flexible configuration of URLs per request method, without impacting the functionality of the current settings, i.e. if this new setting is not configured, the behavior remains unchanged.
Example:
This may not be the best or simplest approach, any thoughts or ideas on how else we could approach this?Some tests for the old and new settings have been added via ome/openmicroscopy#6460
cc: @will-moore @sbesson @jburel