diff options
| author | Fuwn <[email protected]> | 2022-06-13 04:10:53 +0000 |
|---|---|---|
| committer | Fuwn <[email protected]> | 2022-06-13 04:10:53 +0000 |
| commit | 0736c56990e2203efa090774eb6217f8bd93fa6c (patch) | |
| tree | 11a47f69ef078a293de14fdd99198e240efe6fd7 /src/returnable.rs | |
| parent | refactor: fix qualifications (diff) | |
| download | windmark-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.rs | 31 |
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, } } } |