Gozala / lunet

Exploration: P2P Network access through the service worker
https://lunet.link
36 stars 2 forks source link

API to add a pinning bot to lunet #12

Open Gozala opened 5 years ago

Gozala commented 5 years ago

Goals

Proposed solution

At the moment dealing with UI is probably not the best use of our time. Instead we can create special URL pattern such that navigating to it would add a pinning bot to the lunet. e.g.

https://lunet.link/@invite/pinbot/https://mypinningbot.sh?token=apiAccessToken

Above will add pinning service with a name pinbot to the registry. On pin requests it would issue request to the provided url https://mypinningbot.sh?token=apiAccessToken and pass API access token via query argument.

Lunet will not know when user wishes to pin data there. In long term app will issue request to lunet triggering share user interaction, where user will be able to choose who (bot or person) to share with. But in the meantime we could introduce yet another URL pattern to address that e.g.

https://lunet.link/peerdium.gozala.io/${CID}@pinbot/`

Could tell lunet to load CID document into peerdium.gozala.io and pin all PUT requests into service named @pinbot.

Gozala commented 5 years ago

TODO

Look at the existing pinning service APIs ideally it should be possible to encode them as pinbots