application-research / outercore-eng-kb

Official Knowledge base repo of Estuary
https://estuary.tech
5 stars 0 forks source link

WHYPFS dedicated gateway provisioning and subscription #13

Open alvin-reyes opened 1 year ago

alvin-reyes commented 1 year ago

Idea/Proposal: Dedicated Estuary Gateway provisioning and subscription

Contributors @alvin-reyes  
Status Draft
Revision  

Proposal

NOTE: This is a draft and is not finalize yet. We'll have to polish it until we all agreed on the approach.

We need to allow users to avail their own dedicated gateway so they can directly interact with for their contents.

image

1 - user needs to subscribe to a gateway. We will need to ask for the parameters

2 - We need to develop a wizard like page to get gateway information.

3 - we need to develop a page for each user to navigate and manage their gateway(s).

4 - middleware code

5 - backend

jimmylee commented 1 year ago

1 - user needs to subscribe to a gateway. We will need to ask for the parameters

2 - We need to develop a wizard like page to get gateway information.

3 - we need to develop a page for each user to navigate and manage their gateway(s).

4 - middleware code

5 - backend

Thanks for taking the initiative on this.

10d9e commented 1 year ago

@alvin-reyes Clarifying question:

we will need to have an authentication to only serve contents from the user uploaded on the specific gateway only

This might be tough if we are serving everything through bitswap via WhyPFS, right?

alvin-reyes commented 1 year ago

I was thinking we can create an authentication on the DAG service of the whypfs-core.

https://github.com/application-research/whypfs-core/blob/main/whypfs.go#L694

func (p *Node) GetFile(ctx context.Context, c cid.Cid) (ufsio.ReadSeekCloser, error) {

        **// AUTHENTICATE first either here or the CALLER of this function.**

    n, err := p.Get(ctx, c)
    if err == nil {
        return ufsio.NewDagReader(ctx, n, p.DAGService)
    }
    if err != nil {
        return nil, err
    }
    return ufsio.NewDagReader(ctx, n, p)
}

We can create a custom node that's peered with other IPFS node AND authenticate the CIDs before it actually PULL or PUSH the file. The authentication protect the methods to get and add file (on the code above).

If someone else pulls the data, a different node or gateway, I think we can live with this since this just increases the replication and retrievability rate of the CID - it'll fits with our value proposition of reliable retrieval of CID.