mirror of
https://gitlab.com/fabinfra/fabaccess/bffh.git
synced 2024-11-26 00:24:55 +01:00
33 lines
771 B
Rust
33 lines
771 B
Rust
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,
|
|
};
|
|
|
|
pub struct Authentication {
|
|
state: State,
|
|
}
|
|
|
|
enum State {
|
|
InvalidMechanism,
|
|
Finished,
|
|
Aborted,
|
|
Running(Session)
|
|
}
|
|
|
|
impl AuthenticationSystem for Authentication {
|
|
fn step(&mut self, params: StepParams, mut results: StepResults) -> Promise<(), Error> {
|
|
unimplemented!();
|
|
}
|
|
|
|
fn abort(&mut self, _: AbortParams, _: AbortResults) -> Promise<(), Error> {
|
|
std::mem::replace(&mut self.state, State::Aborted);
|
|
Promise::ok(())
|
|
}
|
|
} |