I-GUIDE / catalog

The I-GUIDE Catalog is part of the I-GUIDE Platform and provides search, discovery, and dynamic interaction with resources created by or used by I-GUIDE researchers.
https://i-guide.io/platform/
BSD 3-Clause "New" or "Revised" License
1 stars 5 forks source link

Map user/resource privileges to S3 JSON policies and save to CUAHSI MinIO #83

Open sblack-usu opened 7 months ago

sblack-usu commented 7 months ago

The CUAHSI Subsetter application has a router that maps the resourceaccess documents to json policies along with the ability to save the policies on a S3 server, here. Copy this router to the catalogapi and wire it up to events that get the JSON policies saved to MinIO for the user. Below is a proposal to use Mongo changestream but it could instead be accomplished with an alternate solution.

Listen to the Mongo changestrem for userprivileges collection and map each document that has entries in the minio property to S3 JSON policies and save them to console.minio.cuahsi.io. The catalog uses changestreams already and an example of usage can be found at https://github.com/I-GUIDE/catalogapi/blob/develop/triggers/update_catalog.py#L32

The Minio client needs to be installed and configured with the image. Installation of the client is found here https://github.com/CUAHSI/domain-subsetter/blob/subsetter_argo/app/api/Dockerfile#L10

An minio client alias needs to be setup for the cuahsi server. This is done on the fastapi startup event, https://github.com/CUAHSI/domain-subsetter/blob/subsetter_argo/app/api/subsetter/main.py#L103

JIRA=CAM-54