cozy-data-system
cozy-data-system copied to clipboard
Creation of a sharing controller
In order to implement the cozy-to-cozy sharing, we need to create a sharing controller. As a first iteration, this controller could be conceptually split in 3 parts :
- Creation (sharing creator) : creates a Sharing document including the sharing metadata (recipient urls, description, docids, etc), and sends a sharing proposition for each recipient (could be considered as a Cozy notification).
- Validation (sharing recipient) : called when a recipient accepts or denies a sharing proposition. If accepted, it creates a new Access document for this sharing. The answer and the credentials (if any) are sent to the sharing creator.
- Answer (sharing creator) : depending on the recipient's answer, saves the credentials and triggers a CouchDB replication, or removes the recipient from the Sharing document.
Maybe, it's better to call it 'sharing service' instead of 'sharing controller', as controller has a specific meaning in cozy.
I think @Gara64 talks about Express/Americano controllers.
But on the architectural point of view, we could include it as a service like we talked for files.
Yes, I meant an Americano controller, but this could indeed be viewed as a service.