aboutsummaryrefslogtreecommitdiff
path: root/src/returnable.rs
diff options
context:
space:
mode:
authorFuwn <[email protected]>2022-06-13 04:10:53 +0000
committerFuwn <[email protected]>2022-06-13 04:10:53 +0000
commit0736c56990e2203efa090774eb6217f8bd93fa6c (patch)
tree11a47f69ef078a293de14fdd99198e240efe6fd7 /src/returnable.rs
parentrefactor: fix qualifications (diff)
downloadwindmark-0736c56990e2203efa090774eb6217f8bd93fa6c.tar.xz
windmark-0736c56990e2203efa090774eb6217f8bd93fa6c.zip
feat(router): allow access to client certs
Pretty happy to finally get this one over with...
Diffstat (limited to 'src/returnable.rs')
-rw-r--r--src/returnable.rs31
1 files changed, 22 insertions, 9 deletions
diff --git a/src/returnable.rs b/src/returnable.rs
index 31d7e4f..ef34c77 100644
--- a/src/returnable.rs
+++ b/src/returnable.rs
@@ -17,56 +17,69 @@
// SPDX-License-Identifier: GPL-3.0-only
use matchit::Params;
+use openssl::x509::X509;
use tokio::net::TcpStream;
use url::Url;
pub struct RouteContext<'a> {
- pub tcp: &'a TcpStream,
- pub url: &'a Url,
- pub params: &'a Params<'a, 'a>,
+ pub tcp: &'a TcpStream,
+ pub url: &'a Url,
+ pub params: &'a Params<'a, 'a>,
+ pub certificate: &'a Option<X509>,
}
impl<'a> RouteContext<'a> {
pub const fn new(
tcp: &'a TcpStream,
url: &'a Url,
params: &'a Params<'a, 'a>,
+ certificate: &'a Option<X509>,
) -> Self {
Self {
tcp,
url,
params,
+ certificate,
}
}
}
pub struct ErrorContext<'a> {
- pub tcp: &'a TcpStream,
- pub url: &'a Url,
+ pub tcp: &'a TcpStream,
+ pub url: &'a Url,
+ pub certificate: &'a Option<X509>,
}
impl<'a> ErrorContext<'a> {
- pub const fn new(tcp: &'a TcpStream, url: &'a Url) -> Self {
+ pub const fn new(
+ tcp: &'a TcpStream,
+ url: &'a Url,
+ certificate: &'a Option<X509>,
+ ) -> Self {
Self {
tcp,
url,
+ certificate,
}
}
}
pub struct CallbackContext<'a> {
- pub tcp: &'a TcpStream,
- pub url: &'a Url,
- pub params: Option<&'a Params<'a, 'a>>,
+ pub tcp: &'a TcpStream,
+ pub url: &'a Url,
+ pub params: Option<&'a Params<'a, 'a>>,
+ pub certificate: &'a Option<X509>,
}
impl<'a> CallbackContext<'a> {
pub const fn new(
tcp: &'a TcpStream,
url: &'a Url,
params: Option<&'a Params<'a, 'a>>,
+ certificate: &'a Option<X509>,
) -> Self {
Self {
tcp,
url,
params,
+ certificate,
}
}
}