Design of multi-tenant-based access to a single shacl-vue deployment #387
Labels
No labels
bug
config
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
orinoco/shacl-vue#387
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
The context for this issue is the following:
So the idea would be to have a single
shacl-vuedeployment attached to a single forgejo deployment, and the UI would be accessible via e.g.https://pool.cerebra.fz-juelich.de/<forgejo-org>/ui. Some initial thoughts:shacl-vue, which would allow tenants to specify which UI version they want to use; my feeling is that this should also be part of the URL path, e.g.https://pool.cerebra.fz-juelich.de/<forgejo-org>/ui/v2.0.2. This would allow us to build a single deployment workflow that could automatically deposit theshacl-vuebuild files at a version-specific path.<forgejo-org>, thenui) implies the need for routing, because our singleshacl-vuedeployment wouldn't physically live athttps://pool.cerebra.fz-juelich.de/<forgejo-org>/ui, because that would be at the tenant level and we want a single deployment for all tenants, e.g. athttps://pool.cerebra.fz-juelich.de/ui. Unless I'm missing some important detail, I think a simpler approach (one that doesn't need another component to handle routing) would be to use e.g.https://pool.cerebra.fz-juelich.de/ui/v2.3.4/?forgejo-org=<forgejo-org>. This way the single shacl-vue deployment can be accessed at a single (version-specific) location without routing, and theshacl-vueapp itself will do the work of extracting theforgejo-organd then fetching the dedicated config. This impliesshacl-vueshould gain the ability know that aforgejo-orgURL query param means it should fetch a configuration file somewhere in a forgejo repo. I wonder if such a forgejo-specific feature is the way to go, or if it should be somehow more generic.shacl-vueneed to access a config file in a private forgejo repository, how would it receive the necessary credentials to add to the GET request? This wouldn't come from the client-side, so would we need to implement a server side component for this? Or should we decide from the start that allshacl-vueconfig files should be publicly accessible?In a discussion with @cmo and @bpoldrack the need for a server-side component to handle routing and possible (credential-based) config fetching came up again. A reason for shifting such a tool's implementation outside the scope of
shacl-vuewould be to not overfitshacl-vue's design to the multi-tenant forgejo-based integration. Ideally,shacl-vueshould be usable with a standard api in any context, and without having to implement new support for an additional use-case every time these arise. However,shacl-vuestill needs to support this "standard API". More specifically:shacl-vueshould gain the ability to receive its configuration (either a json object or a URL) from an external source upon startup. And in the general case this means: ashacl-vuedeployment should be able to receive arguments that are unknown before build time.There could be different ways to achieve this. Here are ones that I could think of:
shacl-vuedeployment URL query parameters, e.g.This assumes that the config file is publicly accessible via http request. I am not concerned about this parameter clogging the url and causing bad UX because
shacl-vuecould be updated to read the URL query parameter on startup and then clearing it as soon as it has been used to fetch the config. I do think, though, that adding the full config object to the url is too majestic and trigger happy.This definitely would require a server-side intervention. Then
shacl-vuecould be updated to always check if the application has an embedded config attached to thewindowobject, and make that take preference above the current standard way of providing a config file.It was trivial to implement option 1. Demo:
53e5b0f5e1(and later updates) introduced the ability to get the config url from thex-shacl-vue-configheader in a HEAD request to the deployment's own base URL.The multi-tenant system was designed on the server-side to grab parameters from the original url, e.g.
https://hub.trr379.de/~mui/1/dfgsurvey/2026/where the parameters are:dfgsurvey2026and then grab a
shacl-vue.yamlfile from that repo, then return the content of this config file in the response headerx-shacl-vue-config.These parameter grabbing and rerouting steps are all done server-side by
caddy.