Files
husk-milter/src/commands/introducer.rs
T
Malte Meiboom 799f6eb588 Complete skeleton dispatcher
- Complete the dispatcher for the 'introducer' and 'local' command. This
  is currently only a skeleton.
- The 'introducer list' command is added.
2026-04-27 13:17:03 +02:00

35 lines
974 B
Rust

use anyhow::Result;
use crate::cli::cli_args::{IntroducerCommand, IntroducerSubcommand};
use crate::config::HuskConfigContainer;
use crate::types::husk_context::HuskContext;
use crate::crypto;
pub mod add;
pub mod remove;
pub async fn dispatch(cmd: IntroducerCommand, config: HuskConfigContainer) -> Result<()> {
match cmd.subcommand {
IntroducerSubcommand::Add(add_cmd) => {
add::dispatch(add_cmd, &config).await?;
},
IntroducerSubcommand::Remove(rm_cmd) => {
remove::dispatch(rm_cmd, &config).await?;
},
IntroducerSubcommand::List => {
println!("list");
let context = HuskContext::new(&config.into())?;
for introducer in crypto::get_introducers(
&context.cert_store,
&context.policy,
context.local_trust_root.fingerprint()) {
println!("{}", introducer);
}
},
}
Ok(())
}