File tree Expand file tree Collapse file tree 2 files changed +9
-0
lines changed
keyring/providers/hashicorp Expand file tree Collapse file tree 2 files changed +9
-0
lines changed Original file line number Diff line number Diff line change @@ -47,6 +47,10 @@ pub struct UploadCommand {
47
47
/// verify that provided key name is defined in the config
48
48
#[ clap( long = "no-check-defined-key" ) ]
49
49
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 ,
50
54
}
51
55
52
56
/// Import Secret Key Request
@@ -184,6 +188,7 @@ impl UploadCommand {
184
188
& self . key_name ,
185
189
client:: CreateKeyType :: Ed25519 ,
186
190
& base64:: encode ( wrapped_aes) ,
191
+ self . exportable ,
187
192
)
188
193
. expect ( "import key error!" ) ;
189
194
}
@@ -297,6 +302,7 @@ mod tests {
297
302
payload : Some ( ED25519 . into ( ) ) ,
298
303
payload_file : None ,
299
304
no_check_defined_key : false ,
305
+ exportable : false ,
300
306
} ;
301
307
302
308
let config = HashiCorpConfig {
Original file line number Diff line number Diff line change @@ -61,6 +61,7 @@ pub(crate) struct ImportRequest {
61
61
pub r#type : String ,
62
62
pub ciphertext : String ,
63
63
pub hash_function : String ,
64
+ pub exportable : bool ,
64
65
}
65
66
66
67
#[ allow( dead_code) ]
@@ -365,11 +366,13 @@ impl TendermintValidatorApp {
365
366
key_name : & str ,
366
367
key_type : CreateKeyType ,
367
368
ciphertext : & str ,
369
+ exportable : bool ,
368
370
) -> Result < ( ) , Error > {
369
371
let body = ImportRequest {
370
372
r#type : key_type. to_string ( ) ,
371
373
ciphertext : ciphertext. into ( ) ,
372
374
hash_function : "SHA256" . into ( ) ,
375
+ exportable,
373
376
} ;
374
377
375
378
let _ = self
You can’t perform that action at this time.
0 commit comments