nethsm_cli/cli/
unlock.rs

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
use clap::Parser;
use expression_format::ex_format;
use nethsm::{SystemState::Locked, UserRole::Administrator};

use crate::passphrase_file::PassphraseFile;

#[derive(Debug, Parser)]
#[command(
    about = "Unlock a device",
    long_about = ex_format!("Unlock a device using the unlock passphrase

The device must be in state \"{Locked}\".

If no passphrase is provided it is prompted for interactively.

Requires authentication of a user in the \"{Administrator}\" role."),
)]
pub struct UnlockCommand {
    #[arg(
        env = "NETHSM_UNLOCK_PASSPHRASE_FILE",
        help = "The path to a file containing the unlock passphrase",
        long_help = "The path to a file containing the unlock passphrase

The passphrase must be >= 10 and <= 200 characters long.",
        long,
        short = 'U'
    )]
    pub unlock_passphrase_file: Option<PassphraseFile>,
}