mirror of
https://codeberg.org/tyy/aspm
synced 2024-12-22 21:49:28 -07:00
A few changes that I forgor to commit
This commit is contained in:
parent
b44f4ca359
commit
f70b1fcce8
6 changed files with 23 additions and 11 deletions
4
.vscode/settings.json
vendored
4
.vscode/settings.json
vendored
|
@ -4,9 +4,13 @@
|
||||||
"Aspe",
|
"Aspe",
|
||||||
"Aspm",
|
"Aspm",
|
||||||
"josekit",
|
"josekit",
|
||||||
|
"keygrip",
|
||||||
|
"keywrap",
|
||||||
"PKCS",
|
"PKCS",
|
||||||
"Pkey",
|
"Pkey",
|
||||||
"printdoc",
|
"printdoc",
|
||||||
|
"subkey",
|
||||||
|
"subkeys",
|
||||||
"writedoc"
|
"writedoc"
|
||||||
]
|
]
|
||||||
}
|
}
|
10
Cargo.lock
generated
10
Cargo.lock
generated
|
@ -195,6 +195,7 @@ dependencies = [
|
||||||
"asp",
|
"asp",
|
||||||
"async-trait",
|
"async-trait",
|
||||||
"clap 4.3.9",
|
"clap 4.3.9",
|
||||||
|
"clap-stdin",
|
||||||
"data-encoding",
|
"data-encoding",
|
||||||
"dialoguer",
|
"dialoguer",
|
||||||
"indoc",
|
"indoc",
|
||||||
|
@ -480,6 +481,15 @@ dependencies = [
|
||||||
"once_cell",
|
"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]]
|
[[package]]
|
||||||
name = "clap_builder"
|
name = "clap_builder"
|
||||||
version = "4.3.9"
|
version = "4.3.9"
|
||||||
|
|
|
@ -23,9 +23,10 @@ dialoguer = { version = "0.10.4", features = ["password"] }
|
||||||
argon2 = { version = "0.5.0", features = ["std"] }
|
argon2 = { version = "0.5.0", features = ["std"] }
|
||||||
data-encoding = "2.4.0"
|
data-encoding = "2.4.0"
|
||||||
sea-orm = { version = "0.11.3", features = ["sqlx-sqlite", "runtime-tokio-native-tls"] }
|
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"
|
sea-orm-migration = "0.11.3"
|
||||||
async-trait = "0.1.68"
|
async-trait = "0.1.68"
|
||||||
|
tokio = "1.29.1"
|
||||||
|
clap-stdin = "0.2.0"
|
||||||
|
|
||||||
[profile.release]
|
[profile.release]
|
||||||
strip = true
|
strip = true
|
||||||
|
|
|
@ -97,18 +97,15 @@ impl AspmSubcommand for KeysExportCommand {
|
||||||
eprintln!(
|
eprintln!(
|
||||||
"{style}Exported key \"{alias}\" with fingerprint {fingerprint}:{reset}",
|
"{style}Exported key \"{alias}\" with fingerprint {fingerprint}:{reset}",
|
||||||
style = Anstyle::new()
|
style = Anstyle::new()
|
||||||
.bold()
|
.bold()
|
||||||
.underline()
|
.underline()
|
||||||
.fg_color(Some(AnstyleColor::Ansi(AnsiColor::BrightMagenta)))
|
.fg_color(Some(AnstyleColor::Ansi(AnsiColor::BrightMagenta)))
|
||||||
.render(),
|
.render(),
|
||||||
alias = key.alias,
|
alias = key.alias,
|
||||||
fingerprint = decrypted.fingerprint,
|
fingerprint = decrypted.fingerprint,
|
||||||
reset = Reset.render()
|
reset = Reset.render()
|
||||||
);
|
);
|
||||||
let _ = writedoc!(
|
let _ = writedoc!(std::io::stdout(), "{export}");
|
||||||
std::io::stdout(),
|
|
||||||
"{export}"
|
|
||||||
);
|
|
||||||
} else {
|
} else {
|
||||||
eprintln!("There was an error decrypting the key, please make sure the password you entered was correct");
|
eprintln!("There was an error decrypting the key, please make sure the password you entered was correct");
|
||||||
}
|
}
|
||||||
|
|
|
@ -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.
|
/// 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)]
|
#[clap(value_enum, default_value_t = KeyGenerationType::Ed25519, long_about, ignore_case = true)]
|
||||||
key_type: KeyGenerationType,
|
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)]
|
#[arg(short = 'n', long)]
|
||||||
key_alias: Option<String>,
|
key_alias: Option<String>,
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,7 +2,7 @@ use anstyle::{AnsiColor, Reset, Style as Anstyle};
|
||||||
use anyhow::Context;
|
use anyhow::Context;
|
||||||
use asp::keys::AspKeyType;
|
use asp::keys::AspKeyType;
|
||||||
use clap::Parser;
|
use clap::Parser;
|
||||||
use indoc::{writedoc};
|
use indoc::writedoc;
|
||||||
use sea_orm::EntityTrait;
|
use sea_orm::EntityTrait;
|
||||||
|
|
||||||
use std::io::Write;
|
use std::io::Write;
|
||||||
|
|
Loading…
Reference in a new issue