libero / publisher

The starting point for raising issues for Libero Publisher
MIT License
16 stars 4 forks source link

Allow multiple origins for the same article-store #370

Open giorgiosironi opened 4 years ago

giorgiosironi commented 4 years ago

The Article Store might be accessed through various origins (eg http://localhost:8080/, http://article-store:8080); IRIs are currently persisted as absolute so can only be accessed through the origin that they were also created on (eg http://localhost:8080/some-iri). Storing them as relative IRIs (eg /some-iri) and making them absolute at runtime allows them to be accessed through any origin.

Definition of Done:

Related

Tasks

thewilkybarkid commented 4 years ago

Thinking about it, using a different origin to the 'real' one won't work unless clients then rewrite it if re-exposing it elsewhere, which seems thorny and dangerous.

To add a bit more meat to the bones of the example, if we have a Docker Compose setup of:

If http://localhost:8082 would be considered the real origin, the Web App needs to know to request http://article-store:8080 when it sees http://localhost:8082 (or equivalent) somehow.

Less of a problem in a real setup (since localhost isn't involved). If the public Article Store origin is a CDN, both the Hydra Console and Web App would be able to use it and benefit from caching, though at a bandwidth expense (unless using the same cloud provider) and potential increase of latency.

thewilkybarkid commented 4 years ago

Think we should still persist relative IRIs though, but it's far less important.

thewilkybarkid commented 4 years ago

Wonder how multi-tenancy affects this: could be that http://publisher-a-article-store/ and http://publisher-b-article-store/ are both accessible, so IRIs can't be persisted relative.