mirror of
https://gitlab.com/fabinfra/fabaccess/bffh.git
synced 2024-11-29 09:44:54 +01:00
33 lines
748 B
Rust
33 lines
748 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> {
|
|
self.state = State::Aborted;
|
|
Promise::ok(())
|
|
}
|
|
} |