Skip to content

Commit ecaefa3

Browse files
committed
add exportable flag to hashicorp::upload
1 parent e1a526f commit ecaefa3

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

src/commands/hashicorp/upload.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,10 @@ pub struct UploadCommand {
4747
/// verify that provided key name is defined in the config
4848
#[clap(long = "no-check-defined-key")]
4949
no_check_defined_key: bool,
50+
51+
/// this allows for all the valid keys in the key ring to be exported. Once set, this cannot be disabled.
52+
#[clap(long = "exportable")]
53+
exportable: bool,
5054
}
5155

5256
/// Import Secret Key Request
@@ -184,6 +188,7 @@ impl UploadCommand {
184188
&self.key_name,
185189
client::CreateKeyType::Ed25519,
186190
&base64::encode(wrapped_aes),
191+
self.exportable,
187192
)
188193
.expect("import key error!");
189194
}
@@ -297,6 +302,7 @@ mod tests {
297302
payload: Some(ED25519.into()),
298303
payload_file: None,
299304
no_check_defined_key: false,
305+
exportable: false,
300306
};
301307

302308
let config = HashiCorpConfig {

src/keyring/providers/hashicorp/client.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@ pub(crate) struct ImportRequest {
6161
pub r#type: String,
6262
pub ciphertext: String,
6363
pub hash_function: String,
64+
pub exportable: bool,
6465
}
6566

6667
#[allow(dead_code)]
@@ -365,11 +366,13 @@ impl TendermintValidatorApp {
365366
key_name: &str,
366367
key_type: CreateKeyType,
367368
ciphertext: &str,
369+
exportable: bool,
368370
) -> Result<(), Error> {
369371
let body = ImportRequest {
370372
r#type: key_type.to_string(),
371373
ciphertext: ciphertext.into(),
372374
hash_function: "SHA256".into(),
375+
exportable,
373376
};
374377

375378
let _ = self

0 commit comments

Comments
 (0)