1
0
mirror of https://github.com/smallstep/cli.git synced 2025-08-09 03:22:43 +03:00

Reverse insecure and --no-password in RequireWithFlag

This commit is contained in:
max furman
2021-05-17 11:57:10 -07:00
parent 1e905a13b7
commit bff3f1d23b
3 changed files with 6 additions and 5 deletions

View File

@@ -45,7 +45,8 @@ func createCommand() cli.Command {
[**--password-file**=<path>] [**--ca**=<issuer-cert>]
[**--ca-key**=<issuer-key>] [**--ca-password-file**=<path>]
[**--san**=<SAN>] [**--bundle**] [**--key**=<path>]
[**--kty**=<type>] [**--curve**=<curve>] [**--size**=<size>] [**--no-password**]`,
[**--kty**=<type>] [**--curve**=<curve>] [**--size**=<size>]
[**--no-password**] [**--insecure**]`,
Description: `**step certificate create** generates a certificate or a
certificate signing request (CSR) that can be signed later using 'step
certificate sign' (or some other tool) to produce a certificate.
@@ -421,7 +422,7 @@ func createAction(ctx *cli.Context) error {
insecure := ctx.Bool("insecure")
noPass := ctx.Bool("no-password")
if noPass && !insecure {
return errs.RequiredWithFlag(ctx, "insecure", "no-password")
return errs.RequiredWithFlag(ctx, "no-password", "insecure")
}
subject := ctx.Args().Get(0)

View File

@@ -100,7 +100,7 @@ func changePassAction(ctx *cli.Context) error {
decryptPassFile := ctx.String("password-file")
encryptPassFile := ctx.String("new-password-file")
if noPass && !insecure {
return errs.RequiredWithFlag(ctx, "insecure", "no-password")
return errs.RequiredWithFlag(ctx, "no-password", "insecure")
}
keyPath := ctx.Args().Get(0)

View File

@@ -20,7 +20,7 @@ func createKeyPairCommand() cli.Command {
Usage: "generate a public / private keypair in PEM format",
UsageText: `**step crypto keypair** <pub_file> <priv_file>
[**--kty**=<key-type>] [**--curve**=<curve>] [**--size**=<size>]
[**--password-file**=<file>] [**--no-password**]`,
[**--password-file**=<file>] [**--no-password**] [**--insecure**]`,
Description: `**step crypto keypair** generates a raw public /
private keypair in PEM format. These keys can be used by other operations
to sign and encrypt data, and the public key can be bound to an identity
@@ -110,7 +110,7 @@ func createAction(ctx *cli.Context) (err error) {
return errs.IncompatibleFlag(ctx, "no-password", "password-file")
}
if noPass && !insecure {
return errs.RequiredWithFlag(ctx, "insecure", "no-password")
return errs.RequiredWithFlag(ctx, "no-password", "insecure")
}
// Read password if necessary