-
-
Notifications
You must be signed in to change notification settings - Fork 3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Restrict ipfs object patch in ro api #2251
Conversation
License: MIT Signed-off-by: rht <[email protected]>
i see no reason to restrict any of these |
I'd interpret that as "the 'ro' in ro api refers to restricting any mutation on the graph-scale, but not on the node-scale". |
consequence: anyone could reconstruct an |
It'd be helpful to get the nomenclature ambiguity cleared once for all, since in its usage, 'object' could refer to the dag while at other time it is used to refer to the local dag node (e.g. here). |
An example of usage ambiguity of the term 'object': #1891 (comment). |
I'm in favor of closing this, yes someone could 'reproduce add' through a bunch of calls, but the difference is that |
Agreed |
So technically, 'RO' refers to restricting against pinning? |
eh, i'm not gonna give a concrete definition of what it refers to. its really just API's that we feel should be there |
Even if you're not putting a concrete definition, that's what the RO API is as it is currently. It allows unpinned dag-scale add, which is more direct than implicit add through GET. Allowing 'add' doesn't sound like what 'RO' usually refer to. I heard there is something called 'append' for the case of acl? @(go-ipfs maintainers), right, it's your branch and your rules. I'm just making suggestion+reasons that it should not be there. Feel free to close it if you have concluded otherwise. |
Hm. This is tricky. Because as a user, if I expose a read only thing, I wouldn't expect that to cause data added to my disk. I understand the get problem though. It's likely we should rename "RO" to something else. I'm not sure what. But which included reading objects from the network and add without pinning. We could then restrict further to a true RO mode where it only hits only local storage or otherwise a mode where it fetches from network but strictly in memory only, not disk. I'm not sure this is needed yet. I'd probably just hange the name. Anyone have any suggestions? |
Read-only API should allow for at least for what gateway itself allows so I see no reason to disallowing network fetches. Temporary write would be really useful feature but without pinning there is non-zero risk that object will be GCed before anything can be done with it. This could be solved by temporary pin, pin working only for 5-10min (maximum value declared in code and by user, actual in the request). Other thing that was mentioned elsewhere is that many API commands are not side-effect free (they fetch data and save it on disk) but use |
AFAIU, the side effect concerned with This could work if the client is/has an If the client is not an Currently, While side-effects are relevant to this PR, this PR is specific on the issue of allowing directly building a node/graph on a "RO" gateway (currently,
This is also a problem in local |
closing, i'm fine with how patch currently is exposed. If anyone has a really compelling argument otherwise file an issue to discuss. |
add-link
is local node-specific operation, so it is relatively safer. But I think it should have been removed.