MCPcopy Index your code
hub / github.com/smallstep/cli / isNonInteractiveInit

Function isNonInteractiveInit

command/ca/init.go:720–752  ·  view source on GitHub ↗
(ctx *cli.Context)

Source from the content-addressed store, hash-verified

718}
719
720func isNonInteractiveInit(ctx *cli.Context) bool {
721 var pkiFlags []string
722 configFlags := []string{
723 "dns", "address", "provisioner",
724 }
725 switch strings.ToLower(ctx.String("ra")) {
726 case apiv1.CloudCAS:
727 pkiFlags = []string{"issuer"}
728 configFlags = append(configFlags, "password-file")
729 case apiv1.StepCAS:
730 pkiFlags = []string{"issuer", "issuer-fingerprint", "issuer-provisioner"}
731 configFlags = append(configFlags, "password-file")
732 default:
733 pkiFlags = []string{"name", "password-file"}
734 }
735
736 for _, s := range pkiFlags {
737 if ctx.String(s) == "" {
738 return false
739 }
740 }
741
742 // If not pki only, then require all config flags.
743 if !ctx.Bool("pki") {
744 for _, s := range configFlags {
745 if ctx.String(s) == "" {
746 return false
747 }
748 }
749 }
750
751 return true
752}
753
754func promptDeploymentType(ctx *cli.Context, isRA bool) (pki.DeploymentType, error) {
755 type deployment struct {

Callers 1

promptDeploymentTypeFunction · 0.85

Calls 1

StringMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…