fractal-analytics-platform / fractal-vizarr-viewer

Prototype to explore serving/viewing zarr data
BSD 3-Clause "New" or "Revised" License
2 stars 0 forks source link

Review authorization method #4

Closed tcompa closed 3 months ago

tcompa commented 3 months ago

In https://github.com/fractal-analytics-platform/fractal-data/pull/3, I (provisionally) removed the authorization mechanism - to make testing easier.

Another option would be to just check the is_superuser attribute of the user. In this way we'd have a safety-check that if deploy the fractal-data app and link it to an existing fractal-server instance we'd not automatically expose folders to all users.

What I propose is the following:

  1. Deny authorization for any user who is not a superuser.
  2. Deny authorization for any path which is not relative to a known folder. E.g. we can say that all relevant zarrs will be in ~/zarrs_for_testing/, and that's were we'll place our zarrs (directly or via mount points).

Side note: if/when we implement teams or roles in fractal-server (e.g. one team per cluster service user), that could become the first version of an authorization filter.