Move ACL structs from labadoor-csv to labadoor-acl
This commit is contained in:
parent
321ab21f8e
commit
e1d1aa1ed8
4 changed files with 25 additions and 23 deletions
|
@ -4,3 +4,5 @@ version = "0.1.0"
|
||||||
edition = "2021"
|
edition = "2021"
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
|
serde = { version = "1.0.130", features = ["derive"] }
|
||||||
|
serde_derive = "1.0.130"
|
||||||
|
|
|
@ -0,0 +1,21 @@
|
||||||
|
use serde_derive::Deserialize;
|
||||||
|
|
||||||
|
#[derive(Deserialize, Debug)]
|
||||||
|
pub struct ACLEntry {
|
||||||
|
pub username: String,
|
||||||
|
pub resource: String,
|
||||||
|
}
|
||||||
|
|
||||||
|
#[derive(Deserialize, Debug)]
|
||||||
|
pub struct AuthMethod {
|
||||||
|
pub username: String,
|
||||||
|
pub method: String,
|
||||||
|
pub identifier: String,
|
||||||
|
}
|
||||||
|
|
||||||
|
#[derive(Deserialize, Debug)]
|
||||||
|
pub struct ResourceShortcuts {
|
||||||
|
pub username: String,
|
||||||
|
pub resource: String,
|
||||||
|
pub id: i8,
|
||||||
|
}
|
|
@ -6,5 +6,4 @@ license = "AGPL-3.0-or-later"
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
csv = "1.1.6"
|
csv = "1.1.6"
|
||||||
serde = "1.0.130"
|
labadoor-acl = { path = "../labadoor-acl" }
|
||||||
serde_derive = "1.0.130"
|
|
||||||
|
|
|
@ -1,24 +1,4 @@
|
||||||
use serde_derive::Deserialize;
|
use labadoor_acl::{ACLEntry, AuthMethod, ResourceShortcuts};
|
||||||
|
|
||||||
#[derive(Deserialize, Debug)]
|
|
||||||
struct ACLEntry {
|
|
||||||
username: String,
|
|
||||||
resource: String,
|
|
||||||
}
|
|
||||||
|
|
||||||
#[derive(Deserialize, Debug)]
|
|
||||||
struct AuthMethod {
|
|
||||||
username: String,
|
|
||||||
method: String,
|
|
||||||
identifier: String,
|
|
||||||
}
|
|
||||||
|
|
||||||
#[derive(Deserialize, Debug)]
|
|
||||||
struct ResourceShortcuts {
|
|
||||||
username: String,
|
|
||||||
resource: String,
|
|
||||||
id: i8,
|
|
||||||
}
|
|
||||||
|
|
||||||
fn get_username(method: String, identifier: String) -> Result<String, ()> {
|
fn get_username(method: String, identifier: String) -> Result<String, ()> {
|
||||||
let mut ret = Err(());
|
let mut ret = Err(());
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue