-
Notifications
You must be signed in to change notification settings - Fork 923
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
rec: move to embedded web service written in Rust #15114
Conversation
f711cd6
to
594f444
Compare
Pull Request Test Coverage Report for Build 13197595043Warning: This coverage report may be inaccurate.This pull request's base commit is no longer the HEAD commit of its target branch. This means it includes changes from outside the original pull request, including, potentially, unrelated coverage changes.
Details
💛 - Coveralls |
594f444
to
6e1bfee
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.
Take these with a large grain of salt due to my rusty skills.
using Logger = ::Logr::Logger; | ||
struct KeyValue; | ||
|
||
template <typename A> |
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.
In order to be future-proof:
template <typename A> | |
template <typename AAAA> |
.build()?; | ||
|
||
// For each listening address we spawn a tokio handler an then a single Posix thread is created that | ||
// waits (forever) for all of them to complete by joining them all. |
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.
// waits (forever) for all of them to complete by joining them all. | |
// waits (forever) for all of them to complete by joining them all and in the darkness bind them all. |
dd3b266
to
a759843
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.
A few more typos
value: String, | ||
} | ||
|
||
// Clippy does not seem to understand what cxx does and complains about needless_lifetimes |
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.
Clippy does not seem to understand what cxx does
we don't either...
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.
This is a big PR but it looks good, nice work! I did not realize before that the logging was done in the rust code as well, I'll have to figure out how to handle that if I want to integrate this in DNSdist (but I'll wait until our structured logging code is ready anyway).
.urls | ||
.iter() | ||
.position(|x| String::from("/") + x == uripath); | ||
if pos.is_none() { |
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.
It's not clear to me why we are doing this lookup?
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.
Originally I had a plan to fully implement the file access in Rust, but that plan changed. Some remains are left, will remove.
…libsettings.a into librecrust.a
… Cargo.lock version = 3 The default rusttls provider has quite some dependecies that need newer Rust. ring is much morer lenient.
Co-authored-by: Miod Vallat <miod.vallat@open-xchange.com>
baad227
to
25c8beb
Compare
Rebased to fix conflicts |
Hmm, I hate it when a rebase shows no issues but the result does. |
Co-authored-by: Remi Gacogne <github@coredump.fr>
6731ae4
to
81a428a
Compare
I'll check if it is possible to do this via callbacks or whatever, so you can plug in your own logging function. Answer: in |
Short description
This PR introduces a Rust written embedded web service
Main new features
hyper
andrusttls
), instead of YaHTTP. We still use a few existing YaHTTP classes to represent http related data on the C++ side, but header only.settings
directory a been changed to the more generalrec-rust-lib
as it contains settings and web related code. The produced static lib is also renamed. We work in one crate as having multiple crates is a bit of a pain in combination with a static lib. See https://cxx.rs/build/other.html#linking-the-c-and-rust-together. To be revisited in the future.Future areas of improvement:
The new authentication and authorization code needs a good review to establish it's indeed equivalent to the existing code.
Checklist
I have: