uprtcl / js-uprtcl

Libraries, tools and modules to create _Prtcl web apps
http://www.uprtcl.io/
Other
43 stars 13 forks source link

one remote connector that interacts with multiple authorities #145

Closed pepoospina closed 4 years ago

pepoospina commented 4 years ago

Consider the case of OrbitDB

Each OrbitDB author has its own DB to store all his evees. The authority of those evees looks like

orbitdb:${dbManifestA}:evees

where dbManifestA is the manifest of the DB specifying the access control (for owner A).

If the authority property of the EveesRemote returns that string, then it will not be able to read the details of Evees not owned by author A.

Say you find a perspective with manifestB, in the authority. Because the OrbitDB remote is registered using manifestA as remote authority , it will think there is not EveesRemote available to read the details.

But in practice the OrbitDB remote can read the details from another manifest.

This is the same for a Federated WIki provider, or even the Ethereum provider reading evees from different smart contracts.

Possible solutions

  1. Separate the authority string in two parts: the remote identifier, and the remote parameters. Then use the remote identifier to find the remote instance to be used and the remote parameters to configure the way in which the remote behaves

One issue is that the remote class must tell its users the authority of a perspective before it is created. So it must still expose the authority property which will include the "default path" that will be used when creating a new perspective.