-
-
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
Gateway.APICommands configuration is ignored #8059
Comments
We're going to go with option A here. |
@lidel : is this a good candidate for @schomatis ? |
Yes, assigning. |
@lidel Working on this, do we want an extra config for
? |
@lidel Looking at I'm temporarily blocking this issue on getting some simple and concrete examples since I don't see any documentation around the option that we need to implement. |
|
We're definitely not prepared to select only a subset of subcommands. This will likely require some reworking of the commands library. |
The simplest approach seems to add a function to prune the commands root given a list of whitelisted commands. The code would use similar logic to the subcommand resolution. We should use a single hardcoded "master" root: from which all the other subsets like the hardcoded read-only variant would instead be generated on-the-fly through a list of strings (just as the
I still can't detect a clear answer to this. When @lidel Blocking until getting confirmation on the proposed approach. |
@schomatis Generating gateway subset on the fly based on
We want nothing – exposing |
Blocked on landing ipfs/go-ipfs-cmds#231. |
@lidel considering the current goal of removing |
@hacdias yep, it is not even documented at |
This one slipped between our fingers:
Problem
Gateway.APICommands
is ignored, go-ipfs 0.8.0 uses hardcoded list of commands:(cmd/ipfs/daemon.go#L669 → core/commands/root.go#L166-L198
Why this matters
This is blocking our users from running their own delegated routing service without additional nginx magic as noted in libp2p/js-libp2p#371:
How to fix it?
Unsure, needs more analysis.
I see two ways to resolve this:
(A) keep implicit safelist, extend it with values added to
APICommands
A backward-compatible way to fix this is to keep current implicit defaults from core/commands/root.go#L166-L198 when
Gateway.APICommands
is empty, but if we do this, how can gateway operator disable/api/v0
entierely if they wish to do so?(B) no
/api/v0
by default, only explicit opt-in safelist viaAPICommands
Perhaps we should make a breaking change and disable
/api/v0
by default on Gateways, unless user explicitly safelisted commands viaGateway.APICommands
?This feels like a way safer default.We have some features that depend on/api/v0
and/ipfs/
endpoint does not provide replacement for them yet, so better to avoid this (eg. we don't want user to safelistdht/put
but breakrefs
as a side effect)It always felt to me like something that should be opt-in, but would appreciate feedback if someone thinks otherwise.
The text was updated successfully, but these errors were encountered: