You've already forked step-ca-cli
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:
@@ -45,7 +45,8 @@ func createCommand() cli.Command {
|
|||||||
[**--password-file**=<path>] [**--ca**=<issuer-cert>]
|
[**--password-file**=<path>] [**--ca**=<issuer-cert>]
|
||||||
[**--ca-key**=<issuer-key>] [**--ca-password-file**=<path>]
|
[**--ca-key**=<issuer-key>] [**--ca-password-file**=<path>]
|
||||||
[**--san**=<SAN>] [**--bundle**] [**--key**=<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
|
Description: `**step certificate create** generates a certificate or a
|
||||||
certificate signing request (CSR) that can be signed later using 'step
|
certificate signing request (CSR) that can be signed later using 'step
|
||||||
certificate sign' (or some other tool) to produce a certificate.
|
certificate sign' (or some other tool) to produce a certificate.
|
||||||
@@ -421,7 +422,7 @@ func createAction(ctx *cli.Context) error {
|
|||||||
insecure := ctx.Bool("insecure")
|
insecure := ctx.Bool("insecure")
|
||||||
noPass := ctx.Bool("no-password")
|
noPass := ctx.Bool("no-password")
|
||||||
if noPass && !insecure {
|
if noPass && !insecure {
|
||||||
return errs.RequiredWithFlag(ctx, "insecure", "no-password")
|
return errs.RequiredWithFlag(ctx, "no-password", "insecure")
|
||||||
}
|
}
|
||||||
|
|
||||||
subject := ctx.Args().Get(0)
|
subject := ctx.Args().Get(0)
|
||||||
|
@@ -100,7 +100,7 @@ func changePassAction(ctx *cli.Context) error {
|
|||||||
decryptPassFile := ctx.String("password-file")
|
decryptPassFile := ctx.String("password-file")
|
||||||
encryptPassFile := ctx.String("new-password-file")
|
encryptPassFile := ctx.String("new-password-file")
|
||||||
if noPass && !insecure {
|
if noPass && !insecure {
|
||||||
return errs.RequiredWithFlag(ctx, "insecure", "no-password")
|
return errs.RequiredWithFlag(ctx, "no-password", "insecure")
|
||||||
}
|
}
|
||||||
|
|
||||||
keyPath := ctx.Args().Get(0)
|
keyPath := ctx.Args().Get(0)
|
||||||
|
@@ -20,7 +20,7 @@ func createKeyPairCommand() cli.Command {
|
|||||||
Usage: "generate a public / private keypair in PEM format",
|
Usage: "generate a public / private keypair in PEM format",
|
||||||
UsageText: `**step crypto keypair** <pub_file> <priv_file>
|
UsageText: `**step crypto keypair** <pub_file> <priv_file>
|
||||||
[**--kty**=<key-type>] [**--curve**=<curve>] [**--size**=<size>]
|
[**--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 /
|
Description: `**step crypto keypair** generates a raw public /
|
||||||
private keypair in PEM format. These keys can be used by other operations
|
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
|
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")
|
return errs.IncompatibleFlag(ctx, "no-password", "password-file")
|
||||||
}
|
}
|
||||||
if noPass && !insecure {
|
if noPass && !insecure {
|
||||||
return errs.RequiredWithFlag(ctx, "insecure", "no-password")
|
return errs.RequiredWithFlag(ctx, "no-password", "insecure")
|
||||||
}
|
}
|
||||||
|
|
||||||
// Read password if necessary
|
// Read password if necessary
|
||||||
|
Reference in New Issue
Block a user