feat(gateway): expose /routing/v1 server (opt-in)#9877
Conversation
bf22d94 to
562d7f3
Compare
5cec615 to
a01c4f0
Compare
0805ab6 to
5627805
Compare
lidel
left a comment
There was a problem hiding this comment.
Feedback after first pass, mainly ensuring we support legacy schemas, and avoid re-implementing PUTs in near future. Details inline.
|
@lidel I had completely missed the part of your comment on renaming
I’m up to either:
What do you think? |
|
@hacdias I'm leaning towards (2): keeping
(Apologies for flip-flopping this so many times, not familiar with naming conventions here as much as I would like to, but (2) seems to make most sense given the information we have now) |
|
@lidel agreed. Done both in Boxo and here. I think #9877 (comment) is the only missing thing to decide on to be able to merge Boxo and then this one. |
| if cfg.Gateway.ExposeRoutingAPI.WithDefault(config.DefaultExposeRoutingAPI) { | ||
| for _, listener := range listeners { | ||
| fmt.Printf("Routing V1 API exposed at http://%s/routing/v1\n", listener.Addr()) | ||
| } | ||
| } |
There was a problem hiding this comment.
ℹ️ we do this for WebUI URL, would not hurt here – makes it easy for user to eyeball if it is enabled, and copy URL for testing.
Co-authored-by: Marcin Rataj <lidel@lidel.org>
we do this for webui, would not hurt here
lidel
left a comment
There was a problem hiding this comment.
Thank you for including end-to-end in test/cli/delegated_routing_v1_http_proxy_test.go 👍
Since this is opt-in via Gateway.ExposeRoutingAPI, I think its good enough for giving it a try in Kubo 0.23
Summary
This PR adds ability to expose Kubo's routing system as
/routing/v1on the gateway port.This feature is disabled by default, requires opt-in via config (
Gateway.ExposeRoutingAPI=true).Closes #9875. Uses
boxo/routing/http/serverto implement the Routing v1 HTTP server in Kubo.Details
127.0.0.1gateway)