-
-
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
feat(gateway): expose /routing/v1 server (opt-in) #9877
Conversation
bf22d94
to
562d7f3
Compare
5cec615
to
a01c4f0
Compare
0805ab6
to
5627805
Compare
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.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ℹ️ 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 <[email protected]>
we do this for webui, would not hurt here
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.
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/v1
on the gateway port.This feature is disabled by default, requires opt-in via config (
Gateway.ExposeRoutingAPI=true
).Closes #9875. Uses
boxo/routing/http/server
to implement the Routing v1 HTTP server in Kubo.Details
127.0.0.1
gateway)