2023-11-22 18:18:51 +02:00
|
|
|
pub mod cli;
|
2023-11-22 19:44:10 +02:00
|
|
|
pub mod to_config;
|
|
|
|
use labadoor_acl::ACL;
|
|
|
|
use to_config::ToConfig;
|
2023-11-22 18:18:51 +02:00
|
|
|
|
2023-11-22 19:44:10 +02:00
|
|
|
pub fn auth(i: &cli::Cli, config: config::Config) {
|
|
|
|
let acl = match &i.backend {
|
|
|
|
#[cfg(feature = "csv")]
|
|
|
|
cli::Backend::CSV => config.get::<cli::CSV>("csv").unwrap().to_config().new(),
|
|
|
|
};
|
|
|
|
match &i.command {
|
|
|
|
cli::Command::Open(open) => acl.auth_user(
|
|
|
|
open.method.clone(),
|
|
|
|
open.identifier.clone(),
|
|
|
|
open.resource.clone(),
|
|
|
|
),
|
2023-11-22 18:18:51 +02:00
|
|
|
};
|
|
|
|
}
|