fabaccess-bffh/bffhd/capnp/authenticationsystem.rs

33 lines
748 B
Rust
Raw Normal View History

2022-03-08 16:41:38 +01:00
use std::io::Cursor;
use capnp::capability::Promise;
use capnp::Error;
use capnp_rpc::pry;
use rsasl::session::{Session, Step};
use api::authenticationsystem_capnp::authentication_system::{
Server as AuthenticationSystem,
StepParams, StepResults,
AbortParams, AbortResults,
2022-03-08 16:41:38 +01:00
};
pub struct Authentication {
state: State,
}
enum State {
InvalidMechanism,
Finished,
Aborted,
Running(Session)
}
impl AuthenticationSystem for Authentication {
2022-03-08 16:41:38 +01:00
fn step(&mut self, params: StepParams, mut results: StepResults) -> Promise<(), Error> {
unimplemented!();
2022-03-08 16:41:38 +01:00
}
fn abort(&mut self, _: AbortParams, _: AbortResults) -> Promise<(), Error> {
2022-03-12 01:27:58 +01:00
self.state = State::Aborted;
2022-03-08 16:41:38 +01:00
Promise::ok(())
}
}