kanidm_unix/opt/
tool.rs

1use clap::Subcommand;
2
3#[derive(Debug, Subcommand)]
4#[clap(about = "Kanidm Unixd Management Utility")]
5pub enum KanidmUnixOpt {
6    /// Test authentication of a user via the unixd resolver "pam" channel. This does not
7    /// test that your pam configuration is correct - only that unixd is correctly processing
8    /// and validating authentications.
9    AuthTest {
10        #[clap(short, long)]
11        debug: bool,
12        #[clap(short = 'D', long = "name")]
13        account_id: String,
14    },
15    /// Erase the content of the unixd resolver cache. You should probably use `invalidate`
16    /// instead.
17    CacheClear {
18        #[clap(short, long)]
19        debug: bool,
20        #[clap(long)]
21        really: bool,
22    },
23    /// Invalidate, but don't erase the content of the unixd resolver cache. This will force
24    /// the unixd daemon to refresh all user and group content immediately. If the connection
25    /// is offline, entries will still be available and will be refreshed as soon as the daemon
26    /// is online again.
27    CacheInvalidate {
28        #[clap(short, long)]
29        debug: bool,
30    },
31    /// Check that the unixd daemon is online and able to connect correctly to the kanidmd server.
32    Status {
33        #[clap(short, long)]
34        debug: bool,
35    },
36    /// Show the version of this tool.
37    Version {
38        #[clap(short, long)]
39        debug: bool,
40    }
41}
42
43#[derive(Debug, clap::Parser)]
44#[clap(about = "Kanidm Unixd Management Utility")]
45#[command(name = "kanidm_unixd")]
46pub struct KanidmUnixParser {
47    #[clap(subcommand)]
48    pub commands: KanidmUnixOpt,
49}
50