Skip to main content

auths_cli/commands/device/
mod.rs

1pub mod authorization;
2pub mod pair;
3pub mod verify_attestation;
4
5pub use authorization::{DeviceCommand, DeviceSubcommand, handle_device};
6pub use pair::{PairCommand, handle_pair};
7pub use verify_attestation::{VerifyCommand, handle_verify};
8
9use crate::commands::executable::ExecutableCommand;
10use crate::config::CliConfig;
11use anyhow::Result;
12
13impl ExecutableCommand for PairCommand {
14    fn execute(&self, ctx: &CliConfig) -> Result<()> {
15        handle_pair(self.clone(), &ctx.env_config)
16    }
17}
18
19impl ExecutableCommand for DeviceCommand {
20    fn execute(&self, ctx: &CliConfig) -> Result<()> {
21        handle_device(
22            self.clone(),
23            ctx.repo_path.clone(),
24            self.overrides.identity_ref.clone(),
25            self.overrides.identity_blob.clone(),
26            self.overrides.attestation_prefix.clone(),
27            self.overrides.attestation_blob.clone(),
28            ctx.passphrase_provider.clone(),
29            &ctx.env_config,
30        )
31    }
32}