Skip to content

Commit 83c588a

Browse files
committed
Generalize the csr_spec option to the sign command.
When this was initially written we only had one type of spec to sign so it was given a name specific to that type of spec file. This should have been updated when we added our second spec type but it fell through the cracks.
1 parent c20d47d commit 83c588a

File tree

1 file changed

+13
-8
lines changed

1 file changed

+13
-8
lines changed

src/main.rs

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ enum Command {
111111
/// `ca initialize`, and `ca sign`.
112112
Ceremony {
113113
#[clap(long, env, default_value = INPUT_PATH)]
114-
csr_spec: PathBuf,
114+
spec: PathBuf,
115115

116116
#[clap(long, env, default_value = INPUT_PATH)]
117117
key_spec: PathBuf,
@@ -155,8 +155,13 @@ enum CaCommand {
155155
/// Use the CA associated with the provided key spec to sign the
156156
/// provided CSR.
157157
Sign {
158+
/// Path to a spec file describing the signing operation to execute.
159+
/// If the path provided is a directory OKS will attempt to process
160+
/// all of files in the directory that match a known spec file
161+
/// suffix. This is currently limited to `*.csrspec.json` and
162+
/// `*dcsrspec.json`.
158163
#[clap(long, env, default_value = INPUT_PATH)]
159-
csr_spec: PathBuf,
164+
spec: PathBuf,
160165
},
161166
}
162167

@@ -341,7 +346,7 @@ fn get_new_passwd(hsm: Option<&mut Hsm>) -> Result<Zeroizing<String>> {
341346
/// Perform all operations that make up the ceremony for provisioning an
342347
/// offline keystore.
343348
fn do_ceremony<P: AsRef<Path>>(
344-
csr_spec: P,
349+
spec: P,
345350
key_spec: P,
346351
pkcs11_path: P,
347352
output: &SecretOutputArg,
@@ -439,7 +444,7 @@ fn do_ceremony<P: AsRef<Path>>(
439444
)?;
440445
sign_all(
441446
&cas,
442-
csr_spec.as_ref(),
447+
spec.as_ref(),
443448
&args.state,
444449
&args.output,
445450
args.transport,
@@ -731,11 +736,11 @@ fn main() -> Result<()> {
731736
)?;
732737
Ok(())
733738
}
734-
CaCommand::Sign { csr_spec } => {
739+
CaCommand::Sign { spec } => {
735740
let cas = load_all_ca(&args.state)?;
736741
sign_all(
737742
&cas,
738-
&csr_spec,
743+
&spec,
739744
&args.state,
740745
&args.output,
741746
args.transport,
@@ -971,13 +976,13 @@ fn main() -> Result<()> {
971976
}
972977
}
973978
Command::Ceremony {
974-
ref csr_spec,
979+
ref spec,
975980
ref key_spec,
976981
ref pkcs11_path,
977982
ref secret_method,
978983
passwd_challenge,
979984
} => do_ceremony(
980-
csr_spec,
985+
spec,
981986
key_spec,
982987
pkcs11_path,
983988
secret_method,

0 commit comments

Comments
 (0)