mirror of
https://gitlab.com/fabinfra/fabaccess/bffh.git
synced 2024-11-22 06:47:56 +01:00
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:
commit
66c8ed4a8c
@ -122,17 +122,14 @@ fn main() -> anyhow::Result<()> {
|
|||||||
unimplemented!()
|
unimplemented!()
|
||||||
} else if matches.is_present("load") {
|
} else if matches.is_present("load") {
|
||||||
let bffh = Diflouroborane::new(config)?;
|
let bffh = Diflouroborane::new(config)?;
|
||||||
if bffh
|
if let Err(error) = bffh.users.load_file(matches.value_of("load").unwrap()) {
|
||||||
.users
|
|
||||||
.load_file(matches.value_of("load").unwrap())
|
|
||||||
.is_ok()
|
|
||||||
{
|
|
||||||
tracing::info!("loaded users from {}", matches.value_of("load").unwrap());
|
|
||||||
} else {
|
|
||||||
tracing::error!(
|
tracing::error!(
|
||||||
"failed to load users from {}",
|
"failed to load users from {}: {}",
|
||||||
matches.value_of("load").unwrap()
|
matches.value_of("load").unwrap(),
|
||||||
|
error,
|
||||||
);
|
);
|
||||||
|
} else {
|
||||||
|
tracing::info!("loaded users from {}", matches.value_of("load").unwrap());
|
||||||
}
|
}
|
||||||
return Ok(());
|
return Ok(());
|
||||||
} else {
|
} else {
|
||||||
|
8
test/duplicate-users.toml
Normal file
8
test/duplicate-users.toml
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
[UniqueUser]
|
||||||
|
roles = ["foorole", "barrole"]
|
||||||
|
|
||||||
|
[DuplicateUser]
|
||||||
|
roles = ["somerole"]
|
||||||
|
|
||||||
|
[DuplicateUser]
|
||||||
|
roles = ["different", "roles"]
|
Loading…
Reference in New Issue
Block a user