main: Use labadoor-auth instead of the CSV module directly

This commit is contained in:
George Kaklamanos 2023-11-22 19:44:10 +02:00
parent 2caad2a5ef
commit e7c34865c5
No known key found for this signature in database
GPG key ID: C0CAB8A6BDC9399D
6 changed files with 41 additions and 30 deletions

View file

@ -1,7 +1,18 @@
pub mod cli;
pub mod to_config;
use labadoor_acl::ACL;
use to_config::ToConfig;
pub fn auth(i: &cli::Cli) {
match i.command {
cli::Command::Open(_) => todo!(),
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(),
),
};
}