1
0
Fork 0
mirror of https://codeberg.org/tyy/aspm synced 2024-12-22 15:59:29 -07:00

A few changes that I forgor to commit

This commit is contained in:
Tyler Beckman 2023-07-29 17:44:02 -06:00
parent b44f4ca359
commit f70b1fcce8
Signed by: Ty
GPG key ID: 2813440C772555A4
6 changed files with 23 additions and 11 deletions

View file

@ -4,9 +4,13 @@
"Aspe",
"Aspm",
"josekit",
"keygrip",
"keywrap",
"PKCS",
"Pkey",
"printdoc",
"subkey",
"subkeys",
"writedoc"
]
}

10
Cargo.lock generated
View file

@ -195,6 +195,7 @@ dependencies = [
"asp",
"async-trait",
"clap 4.3.9",
"clap-stdin",
"data-encoding",
"dialoguer",
"indoc",
@ -480,6 +481,15 @@ dependencies = [
"once_cell",
]
[[package]]
name = "clap-stdin"
version = "0.2.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3617daa8b997570ed9adb631a57ab10d7a1969fad433950d56e8c24e66ab3aaa"
dependencies = [
"thiserror",
]
[[package]]
name = "clap_builder"
version = "4.3.9"

View file

@ -23,9 +23,10 @@ dialoguer = { version = "0.10.4", features = ["password"] }
argon2 = { version = "0.5.0", features = ["std"] }
data-encoding = "2.4.0"
sea-orm = { version = "0.11.3", features = ["sqlx-sqlite", "runtime-tokio-native-tls"] }
tokio = { version = "1.29.1", features = ["macros", "rt-multi-thread"] }
sea-orm-migration = "0.11.3"
async-trait = "0.1.68"
tokio = "1.29.1"
clap-stdin = "0.2.0"
[profile.release]
strip = true

View file

@ -97,18 +97,15 @@ impl AspmSubcommand for KeysExportCommand {
eprintln!(
"{style}Exported key \"{alias}\" with fingerprint {fingerprint}:{reset}",
style = Anstyle::new()
.bold()
.underline()
.fg_color(Some(AnstyleColor::Ansi(AnsiColor::BrightMagenta)))
.render(),
.bold()
.underline()
.fg_color(Some(AnstyleColor::Ansi(AnsiColor::BrightMagenta)))
.render(),
alias = key.alias,
fingerprint = decrypted.fingerprint,
reset = Reset.render()
);
let _ = writedoc!(
std::io::stdout(),
"{export}"
);
let _ = writedoc!(std::io::stdout(), "{export}");
} else {
eprintln!("There was an error decrypting the key, please make sure the password you entered was correct");
}

View file

@ -23,7 +23,7 @@ pub struct KeysGenerateCommand {
/// It doesn't really matter that much which one is used, as they both work fine, but Ed25519 is used as a safe default.
#[clap(value_enum, default_value_t = KeyGenerationType::Ed25519, long_about, ignore_case = true)]
key_type: KeyGenerationType,
/// Tha alias of the key to generate. This can be anything, and it can also be omitted to prompt interactively. This has no purpose other than providing a way to nicely name keys, rather than having to remember a fingerprint.
/// The alias of the key to generate. This can be anything, and it can also be omitted to prompt interactively. This has no purpose other than providing a way to nicely name keys, rather than having to remember a fingerprint.
#[arg(short = 'n', long)]
key_alias: Option<String>,
}

View file

@ -2,7 +2,7 @@ use anstyle::{AnsiColor, Reset, Style as Anstyle};
use anyhow::Context;
use asp::keys::AspKeyType;
use clap::Parser;
use indoc::{writedoc};
use indoc::writedoc;
use sea_orm::EntityTrait;
use std::io::Write;