Need help with implementing "personalized" stac catalogues... #254
-
Hi @ALL, I need some (high-level) advise on how to implement "personalized" stac catalogues with stac-fastapi-pgstac: Requirement: As the number of users is limited (i.e. less than 100), I'd say that each user could have it's own database. I assume the "correct" solution would be to extend the BasicCrudClient and implement it to "just" dispatch everything to dynamically instantiated (per-user) StacApi instances. This would at least allow to initialize the DB whenever a user is logging in for the first time. Since I am new to python/fastapi/stac, I need some advice on how to solve this... Many thanks, |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 2 replies
-
Hi @parabelboi. Standing up a new database for each user sounds like a difficult path. I would work on building an authentication system in your stac-fastapi-pgstac application instead. There is a fair amount of material about adding authentication to FastAPI apps out there (e.g. https://fastapi.tiangolo.com/tutorial/security/) It is early days, but there is also a new application called stac-auth-proxy which can be helpful for managing per-user STAC API access. Good luck! Please report back here with whatever system you come wind up using. |
Beta Was this translation helpful? Give feedback.
-
Hi @ALL, I want to elaborate a little bit more on a solution for "isolated" (per-user) catalogs: Could the following be a liable solution? If I understand the parameter
If I am making wrong assumptions, please let me know (python noob). Cheers, |
Beta Was this translation helpful? Give feedback.
Hi @parabelboi. Standing up a new database for each user sounds like a difficult path. I would work on building an authentication system in your stac-fastapi-pgstac application instead. There is a fair amount of material about adding authentication to FastAPI apps out there (e.g. https://fastapi.tiangolo.com/tutorial/security/)
It is early days, but there is also a new application called stac-auth-proxy which can be helpful for managing per-user STAC API access. Good luck! Please report back here with whatever system you come wind up using.