-
-
Notifications
You must be signed in to change notification settings - Fork 561
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(rust): implemented control api http server #8776
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
74372a1
to
7ecee78
Compare
6645a26
to
157bee1
Compare
5c7f677
to
f4fd9c0
Compare
f4fd9c0
to
2160819
Compare
ab7da65
to
c338ad2
Compare
c338ad2
to
3179b25
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.
Nice piece of work! Looks really nice 🎉
implementations/rust/ockam/ockam_api/src/control_api/backend/common.rs
Outdated
Show resolved
Hide resolved
implementations/rust/ockam/ockam_api/src/control_api/backend/common.rs
Outdated
Show resolved
Hide resolved
implementations/rust/ockam/ockam_api/src/control_api/backend/entrypoint.rs
Outdated
Show resolved
Hide resolved
implementations/rust/ockam/ockam_api/src/control_api/backend/inlet.rs
Outdated
Show resolved
Hide resolved
implementations/rust/ockam/ockam_api/src/control_api/frontend.rs
Outdated
Show resolved
Hide resolved
adrianbenavides
approved these changes
Feb 14, 2025
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR implements CRUD for portals over a brand-new HTTP service. The temporary name I've given to this API is "Control API".
This service is split into two pieces:
The API is fully defined within the
protocol
module, this is to avoid any accidental breakage when changing other data structures and also to have the full flexibility to adjust data structure as needed. The API schema will also be exported using OpenAPI in a future PR, and the schema will be used to verify back-compatibility.The frontend uses a hyper server and converts HTTP requests into a single ockam message (up to 256kb for now) and sends it to the backend. The backend replies with a single message containing the result, which is converted back into HTTP. Two mechanisms are available to resolve a node name into a node: either the node name is converted into a DNS address and a connection is performed, or the node is converted into a worker address (assuming a relay was created by the node).
The authentication is performed on the frontend level and, for now, only implements a basic "Bearer" with a constant time comparison. Frontend and backend mutually authenticate via credential policy, which by default are
control_api_frontend
andcontrol_api_backend
.To start the services it is necessary to use the
--launch-configuration
, with this PR everything is disabled by default.OpenAPI schema is generated via
utoipa
library. I'm planning to add the schema to the repository and fail the CI whenever differs from the generated one, but in a different PR. To generate the OpenAPI schema:Current schema:
Click to expand