I’m playing around building something like a distributed file system on top of IPLD, using js-ipfs.
Within this system, the objects look something like this…
{
"Folder1": {
"canRead":["publicKey1", "publicKey2"],
"files":[
"Folder2": {
"canRead":["publicKey2"],
"files":[
"cat.jpg": {
"link": {"/": "/ipfs/QmUmg7BZC1YP1ca66rRtWKxpXp77WgVHrnv263JtDuvs2k"},
"canRead":[ ],
}
]
}
],
}
}
…where access to cat.jpg
will be garanted only if the requester provides a valid signature for one of the keys within canRead
for all of its parent parent objects (folders).
I’m trying to wrap my head around on what’s the best way to implement it.
I was trying to creatae a new IPLD resolver that handles the authentication, but that requires to modify the resolver functions signatures, to include the the requester authentication data.
Alternatively I could create gateway layer on top of IPLD that takes care of it, but it seems less elegant, and judging by the examples on the IPLD readme like following, it seems you guys have thought about permissioned access already.
{
"files": {
"cat.jpg": {
"link": {"/": "/ipfs/QmUmg7BZC1YP1ca66rRtWKxpXp77WgVHrnv263JtDuvs2k"},
"mode": 0755, <---THIS
"owner": "jbenet"
}
}
}
Any suggestion on how should I do this?
Thanks!