feat: v0.3.1
This commit is contained in:
2
Cargo.lock
generated
2
Cargo.lock
generated
@@ -741,7 +741,7 @@ checksum = "57bcfdad1b858c2db7c38303a6d2ad4dfaf5eb53dfeb0910128b2c26d6158503"
|
||||
|
||||
[[package]]
|
||||
name = "local-mini-kms"
|
||||
version = "0.3.0"
|
||||
version = "0.3.1"
|
||||
dependencies = [
|
||||
"base64",
|
||||
"clap",
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "local-mini-kms"
|
||||
version = "0.3.0"
|
||||
version = "0.3.1"
|
||||
edition = "2021"
|
||||
|
||||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
||||
|
||||
@@ -30,6 +30,14 @@ local-mini-kms cli --encrypt --value hello
|
||||
local-mini-kms cli --decrypt --value LKMS:***
|
||||
```
|
||||
|
||||
```shell
|
||||
local-mini-kms cli --read --name test
|
||||
```
|
||||
|
||||
```shell
|
||||
local-mini-kms cli --write --name test --value hello [--force-write]
|
||||
```
|
||||
|
||||
## cURL
|
||||
|
||||
Write value:
|
||||
|
||||
12
src/cli.rs
12
src/cli.rs
@@ -27,10 +27,10 @@ impl Command for CommandImpl {
|
||||
.arg(Arg::with_name("decrypt").long("decrypt").help("Decrypt text"))
|
||||
.arg(Arg::with_name("read").long("read").help("Read value"))
|
||||
.arg(Arg::with_name("write").long("write").help("Write value"))
|
||||
.arg(Arg::with_name("value").long("value").takes_value(true).help("Value, for encrypt or decrypt"))
|
||||
.arg(Arg::with_name("key").long("key").takes_value(true).help("Read/Write key name"))
|
||||
.arg(Arg::with_name("value-hex").long("value-hex").takes_value(true).help("Value(hex), for encrypt"))
|
||||
.arg(Arg::with_name("value-base64").long("value-base64").takes_value(true).help("Value(base64), for encrypt"))
|
||||
.arg(Arg::with_name("name").long("name").short("n").takes_value(true).help("Read/Write key name"))
|
||||
.arg(Arg::with_name("value").long("value").short("v").takes_value(true).help("Value, for encrypt or decrypt"))
|
||||
.arg(Arg::with_name("value-hex").long("value-hex").short("x").takes_value(true).help("Value(hex), for encrypt"))
|
||||
.arg(Arg::with_name("value-base64").long("value-base64").short("b").takes_value(true).help("Value(base64), for encrypt"))
|
||||
.arg(Arg::with_name("yubikey-challenge").long("yubikey-challenge").short("c").takes_value(true).help("Yubikey challenge"))
|
||||
.arg(Arg::with_name("force-write").long("force-write").short("F").help("Force write value"))
|
||||
}
|
||||
@@ -131,8 +131,8 @@ async fn do_init(_arg_matches: &ArgMatches<'_>, sub_arg_matches: &ArgMatches<'_>
|
||||
}
|
||||
|
||||
async fn do_read(_arg_matches: &ArgMatches<'_>, sub_arg_matches: &ArgMatches<'_>) -> CommandError {
|
||||
let body = if let Some(key) = sub_arg_matches.value_of("key") {
|
||||
json!({ "name": key })
|
||||
let body = if let Some(name) = sub_arg_matches.value_of("name") {
|
||||
json!({ "name": name })
|
||||
} else {
|
||||
return simple_error!("Require key");
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user