tuwunel_admin/token/mod.rs
1mod commands;
2
3use clap::Subcommand;
4use tuwunel_core::Result;
5
6use crate::admin_command_dispatch;
7
8#[admin_command_dispatch]
9#[derive(Debug, Subcommand)]
10pub(crate) enum TokenCommand {
11 /// - Issue a new registration token
12 Issue {
13 /// The maximum number of times this token is allowed to be used before
14 /// it expires.
15 #[arg(long)]
16 max_uses: Option<u64>,
17
18 /// The maximum age of this token (e.g. 30s, 5m, 7d). It will expire
19 /// after this much time has passed.
20 #[arg(long)]
21 max_age: Option<String>,
22
23 /// A shortcut for `--max-uses 1`.
24 #[arg(long)]
25 once: bool,
26 },
27
28 /// - Revoke a registration token
29 Revoke {
30 /// The token to revoke.
31 token: String,
32 },
33
34 /// - List all registration tokens
35 List,
36}