Closed juansensio closed 2 months ago
Hi Juan,
can you point me to the code eotdl is using to store the metadata in the geoDB?
Here we store metadata in geodb (see ingest_stac function)
https://github.com/earthpulse/eotdl/blob/main/api/api/src/usecases/datasets/ingest_file.py
The code used
# ingest to geodb
credentials = retrieve_user_credentials(user)
geodb_repo = GeoDBRepo(credentials)
geodb_repo.insert(dataset.id, values)
Here is the GeoDB repository:
https://github.com/earthpulse/eotdl/blob/main/api/api/src/repos/geodb/GeoDBRepo.py
Is used to create the client given the credentials of the user and then interact with geodb. We need to know which user inserts data but then enable any user (even without geodb credentials) to retrieve it.
Thanks! All you have to do is add the line
self.client.publish_collection(collection, self.database)
to GeoDBRepo.py
after line 29.
Hi, I added the line, however when I try to retrieve a datasets with a different user I still get the smae error
xcube_geodb.core.geodb.GeoDBError: b'{"code":"42P01","details":null,"hint":null,"message":"relation \"public.geodb_616b019942cfbe00690b958a_6633483d3d962cb56ebf92c6\" does not exist"}'
Solved issue !
We need to set a common name for self.database
to allow for public collections.
Only the user that ingests the dataset can download it, other users get a "You are not authorized to perform this action".
This is due to how the metadata is stored in geodb, only the user that stores it can retrieve it. Can we store metadata in geodb that is public, so any user can retrieve it?