-
-
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: make API commands configurable #5565
Conversation
License: MIT Signed-off-by: Lars Gierth <larsg@systemli.org>
Whoops, totally forgot updating the go tests. otherwise still happy about review :) |
24aa7ab
to
0545005
Compare
I am pretty sure that sharness t0236-cli-api-dns-resolve.sh is failing on Jenkins because of a |
License: MIT Signed-off-by: Lars Gierth <larsg@systemli.org>
0545005
to
47c78e2
Compare
This one is ready for review |
License: MIT Signed-off-by: keks <keks@cryptoscope.co>
} | ||
} | ||
|
||
if commands { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why don't you do this inside the loop (at line 64, where you currently set commands
to true)?
|
||
nextOut := new(cmds.Command) | ||
*nextOut = *nextIn | ||
nextOut.Subcommands = map[string]*cmds.Command{} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hm, so you unconditionally create a new subcommand mal. That confuses me. Because if you have e.g. both dag/get
and dag/resolve
in allowed
, you would overwrite dag
and delete dag/get
when adding dag/resolve
.
Checking the tests now to see why this passes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I updated the tests and now they fail. Could you fix this?
It will be much simpler to back delegated routing by a modified branch of go-ipfs, so I'm closing this PR.
|
@lgierth did this ever land in some other PR? was there anything more to the story? We were trying to use |
We never did. |
This is for Delegated Routing in js-libp2p (ipfs/js-ipfs#1459 & libp2p/js-libp2p#120) and supersedes #4595.
It lets us configure the commands available through :8080/api/v0/ -- for delegated routing, we would then e.g. expose
swarm/connect
,refs
,dht/findprovs
, anddht/findpeer
.By default,
Gateway.APICommands
is empty, which means go-ipfs will use the default :8080 commands.