Merge branch 'feature/duplicate-users' into development

* feature/duplicate-users:
  Add a duplicate user example table
  Include source error message when failing --load
This commit is contained in:
Nadja Reitzenstein 2022-05-20 18:28:01 +02:00
commit 66c8ed4a8c
2 changed files with 14 additions and 9 deletions

View File

@ -122,17 +122,14 @@ fn main() -> anyhow::Result<()> {
unimplemented!()
} else if matches.is_present("load") {
let bffh = Diflouroborane::new(config)?;
if bffh
.users
.load_file(matches.value_of("load").unwrap())
.is_ok()
{
tracing::info!("loaded users from {}", matches.value_of("load").unwrap());
} else {
if let Err(error) = bffh.users.load_file(matches.value_of("load").unwrap()) {
tracing::error!(
"failed to load users from {}",
matches.value_of("load").unwrap()
"failed to load users from {}: {}",
matches.value_of("load").unwrap(),
error,
);
} else {
tracing::info!("loaded users from {}", matches.value_of("load").unwrap());
}
return Ok(());
} else {

View File

@ -0,0 +1,8 @@
[UniqueUser]
roles = ["foorole", "barrole"]
[DuplicateUser]
roles = ["somerole"]
[DuplicateUser]
roles = ["different", "roles"]