You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Oct 31, 2023. It is now read-only.
/// Path to issuer seed key. If this flag is not provided, the will be sourced from $WASH_KEYS ($HOME/.wash/keys) or generated for you if it cannot be found.
85
111
#[structopt(short = "i", long = "issuer")]
86
-
issuer_key_path:String,
112
+
issuer:Option<String>,
87
113
88
-
/// Subject seed key path (usually a .nk file)
114
+
/// Path to subject seed key. If this flag is not provided, the will be sourced from $WASH_KEYS ($HOME/.wash/keys) or generated for you if it cannot be found.
89
115
#[structopt(short = "u", long = "subject")]
90
-
subject_key_path:String,
116
+
subject:Option<String>,
117
+
118
+
/// Location of key files for signing. Defaults to $WASH_KEYS ($HOME/.wash/keys)
119
+
#[structopt(
120
+
short = "d",
121
+
long = "directory",
122
+
env = "WASH_KEYS",
123
+
hide_env_values = true
124
+
)]
125
+
directory:Option<String>,
91
126
92
127
/// Indicates the token expires in the given amount of days. If this option is left off, the token will never expire
/// Helper function to locate and extract keypair from user input
171
171
pubfnextract_keypair(
172
172
input:Option<String>,
173
-
module_path:String,
173
+
module_path:Option<String>,
174
174
directory:Option<String>,
175
175
keypair_type:KeyPairType,
176
+
disable_keygen:bool,
176
177
) -> Result<KeyPair,Box<dyn std::error::Error>>{
177
178
let seed = ifletSome(input_str) = input {
178
179
matchFile::open(input_str.clone()){
@@ -185,10 +186,10 @@ pub fn extract_keypair(
185
186
// User provided seed as an argument
186
187
Err(_e) => input_str,
187
188
}
188
-
}else{
189
+
}elseifletSome(module) = module_path {
189
190
// No seed value provided, attempting to source from provided or default directory
190
191
let dir = determine_directory(directory);
191
-
let module_name = PathBuf::from(module_path)
192
+
let module_name = PathBuf::from(module)
192
193
.file_stem()
193
194
.unwrap()
194
195
.to_str()
@@ -208,23 +209,28 @@ pub fn extract_keypair(
208
209
s
209
210
}
210
211
// No default key, generating for user
211
-
Err(_e) => {
212
+
Err(_e)if !disable_keygen => {
212
213
let kp = KeyPair::new(keypair_type);
213
-
println!("No keypair found in {}, we will generate one for you and place it there. If you'd like to use alternative keys, you can supply them as a flag.", path);
214
+
println!("No keypair found in \"{}\".\nWe will generate one for you and place it there.\nIf you'd like to use alternative keys, you can supply them as a flag.\n", path);
Copy file name to clipboardexpand all lines: src/par.rs
+16-4
Original file line number
Diff line number
Diff line change
@@ -88,6 +88,10 @@ struct CreateCommand {
88
88
/// Include a compressed provider archive
89
89
#[structopt(long = "compress")]
90
90
compress:bool,
91
+
92
+
/// Disables autogeneration of signing keys
93
+
#[structopt(long = "disable-keygen")]
94
+
disable_keygen:bool,
91
95
}
92
96
93
97
#[derive(StructOpt,Debug,Clone)]
@@ -127,6 +131,10 @@ struct InsertCommand {
127
131
/// Path to subject seed key (service). If this flag is not provided, the will be sourced from $WASH_KEYS ($HOME/.wash/keys) or generated for you if it cannot be found.
0 commit comments