Skip to content
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 client registry and api routes #3955

Merged
merged 9 commits into from
Oct 10, 2023
Merged

Conversation

durch
Copy link
Contributor

@durch durch commented Oct 3, 2023

Description

Adds HTTP API to Gateway, adds client_registry field to Gateway struct. HTTP api supports registering new clients and fetching existing ones. Client struct can be considered a stub where we can put useful stuff in the future. I've copied API structure from the mix node API, hopefully it won't complicate smooshing much.

Checklist:

  • added a changelog entry to CHANGELOG.md

@durch durch requested review from octol and jstuczyn October 3, 2023 20:31
@durch durch self-assigned this Oct 3, 2023
@durch durch added the gateway label Oct 3, 2023
Copy link
Contributor

@octol octol left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! I'll leave any possibly impact on smoosh to @jstuczyn

@jstuczyn
Copy link
Contributor

jstuczyn commented Oct 4, 2023

Oh yeah. the impact on smoosh will be juicy. bunch of merge conflicts expected, especially since I opted to use axum over semi-unmaintained rocket. But that's a future me problem : )

However, to help me out here, mind making the following changes:

  • remove that http_api_port from Gateway struct, @mmsinclair and I decided that the API should be accessible on the good old ports 80/443. This way, as an extra bonus, you don't have to migrate the contract
  • would you mind slightly adjusting the routes? Add /api/v1/ prefix to indicate the API version and maybe also something to show it's a wireguard related route. Maybe /api/v1/gateway/client-interfaces/wireguard/register, /api/v1/gateway/client-interfaces/wireguard/clients and /api/v1/gateway/client-interfaces/wireguard/client<pub_key>.
    The reason I'm suggesting those particular routes is because I'm currently using the following scheme. Though I'm not totally convinced myself for that /gateway/ segment once the full smoosh is finished:

image

@durch durch requested a review from octol October 6, 2023 10:45
@durch
Copy link
Contributor Author

durch commented Oct 6, 2023

Complicated things quite a bit, added MAC verification and replay protection for new registrations, I'll probably do some tidying with the structure, possibly add swagger, but I think the functionality is done now...

Also moved to axum

@durch
Copy link
Contributor Author

durch commented Oct 9, 2023

Rebased off develop

@benedettadavico benedettadavico merged commit 1e900c3 into develop Oct 10, 2023
9 checks passed
@benedettadavico benedettadavico deleted the feature/gateway-auth branch October 10, 2023 08:55
@benedettadavico benedettadavico added this to the Kinder milestone Oct 10, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants