mirror of
https://gitlab.com/fabinfra/fabaccess/bffh.git
synced 2024-11-21 14:37:56 +01:00
Better Connection handling and some ideas
This commit is contained in:
parent
2c321d77b4
commit
8b4296e749
1
build.rs
1
build.rs
@ -1,4 +1,5 @@
|
||||
fn main() {
|
||||
::capnpc::CompilerCommand::new().file("schema/connection.capnp").run().unwrap();
|
||||
::capnpc::CompilerCommand::new().file("schema/api.capnp").run().unwrap();
|
||||
::capnpc::CompilerCommand::new().file("schema/auth.capnp").run().unwrap();
|
||||
}
|
||||
|
34
connection-state.dot
Normal file
34
connection-state.dot
Normal file
@ -0,0 +1,34 @@
|
||||
strict digraph connection {
|
||||
Establish [label="TCP/SCTP connection established"];
|
||||
Closed [label="TCP/SCTP connection closed"];
|
||||
|
||||
Establish -> Open [label=open];
|
||||
|
||||
Open -> Closed [label=close];
|
||||
|
||||
Open -> SASL [label=auth];
|
||||
SASL -> SASL [label=step];
|
||||
// Authentication fails
|
||||
SASL -> Closed [label=fails];
|
||||
// Authentication succeeds
|
||||
SASL -> Authenticated [label=successful];
|
||||
|
||||
Open -> STARTTLS [label=starttls];
|
||||
// TLS wrapping succeeds
|
||||
STARTTLS -> Encrypted [label=successful];
|
||||
// TLS wrapping fails
|
||||
STARTTLS -> Closed [label=fails];
|
||||
|
||||
Authenticated -> SASL_TLS [label=starttls];
|
||||
SASL_TLS -> Closed [label=fails];
|
||||
SASL_TLS -> AuthEnc [label=successful];
|
||||
|
||||
Encrypted -> TLS_SASL [label=auth];
|
||||
TLS_SASL -> TLS_SASL [label=step];
|
||||
TLS_SASL -> Closed [label=fails];
|
||||
TLS_SASL -> AuthEnc [label=successful];
|
||||
|
||||
// Only authenticated connections may open RPC. For "unauth", use the `Anonymous` SASL method.
|
||||
AuthEnc -> RPC [label=bootstrap];
|
||||
Authenticated -> RPC [label=bootstrap];
|
||||
}
|
2
schema
2
schema
@ -1 +1 @@
|
||||
Subproject commit 16a4aba76abc2667cce80d2937ca923bce225817
|
||||
Subproject commit 120ee4ea804a2da703a61f2a7e0d011a69140aa4
|
4
src/connection.rs
Normal file
4
src/connection.rs
Normal file
@ -0,0 +1,4 @@
|
||||
pub mod gen {
|
||||
include!(concat!(env!("OUT_DIR"), "/schema/connection_capnp.rs"));
|
||||
}
|
||||
|
@ -12,6 +12,7 @@ mod api;
|
||||
mod config;
|
||||
mod error;
|
||||
mod machine;
|
||||
mod connection;
|
||||
|
||||
use signal_hook::iterator::Signals;
|
||||
|
||||
@ -43,6 +44,7 @@ use error::Error;
|
||||
// `crate::<file>_capnp` hierarchy.
|
||||
use api::gen as api_capnp;
|
||||
use auth::gen as auth_capnp;
|
||||
use connection::gen as connection_capnp;
|
||||
|
||||
// Returning a `Result` from `main` allows us to use the `?` shorthand.
|
||||
// In the case of an Err it will be printed using `fmt::Debug`
|
||||
|
Loading…
Reference in New Issue
Block a user