fabaccess-bffh/bffhd/capnp/session.rs

24 lines
855 B
Rust
Raw Normal View History

2022-03-12 17:31:53 +01:00
use api::authenticationsystem_capnp::response::successful::Builder;
use capnp::capability::Promise;
use crate::authorization::AuthorizationHandle;
use crate::capnp::machinesystem::Machines;
2022-03-12 17:31:53 +01:00
use crate::capnp::permissionsystem::Permissions;
use crate::capnp::user_system::Users;
2022-03-12 17:31:53 +01:00
use crate::session::{SessionHandle, SessionManager};
use crate::users::User;
2021-12-06 21:53:42 +01:00
#[derive(Debug, Clone)]
2022-03-12 17:31:53 +01:00
pub struct APISession;
2021-12-06 21:53:42 +01:00
2022-03-12 17:31:53 +01:00
impl APISession {
2021-12-06 21:53:42 +01:00
pub fn new() -> Self {
2022-03-12 17:31:53 +01:00
Self
}
pub fn build(session: SessionHandle, mut builder: Builder) {
let mut builder = builder.init_session();
builder.set_machine_system(capnp_rpc::new_client(Machines::new(session.clone())));
builder.set_user_system(capnp_rpc::new_client(Users::new(session.clone())));
builder.set_permission_system(capnp_rpc::new_client(Permissions::new(session)));
2021-12-06 21:53:42 +01:00
}
}