MCPcopy
hub / github.com/smallstep/cli / bootstrapAction

Function bootstrapAction

command/ca/bootstrap.go:85–112  ·  view source on GitHub ↗
(ctx *cli.Context)

Source from the content-addressed store, hash-verified

83}
84
85func bootstrapAction(ctx *cli.Context) error {
86 caURL, err := flags.ParseCaURLIfExists(ctx)
87 if err != nil {
88 return err
89 }
90 fingerprint := strings.TrimSpace(ctx.String("fingerprint"))
91 team := ctx.String("team")
92 teamAuthority := ctx.String("team-authority")
93
94 switch {
95 case team != "" && caURL != "":
96 return errs.IncompatibleFlagWithFlag(ctx, "team", "ca-url")
97 case team != "" && fingerprint != "":
98 return errs.IncompatibleFlagWithFlag(ctx, "team", "fingerprint")
99 case team != "" && teamAuthority != "":
100 return cautils.BootstrapTeamAuthority(ctx, team, teamAuthority)
101 case team != "":
102 return cautils.BootstrapTeamAuthority(ctx, team, "ssh")
103 case teamAuthority != "":
104 return errs.RequiredWithFlag(ctx, "team-authority", "team")
105 case caURL == "":
106 return errs.RequiredFlag(ctx, "ca-url")
107 case fingerprint == "":
108 return errs.RequiredFlag(ctx, "fingerprint")
109 default:
110 return cautils.BootstrapAuthority(ctx, caURL, fingerprint)
111 }
112}

Callers

nothing calls this directly

Calls 4

ParseCaURLIfExistsFunction · 0.92
BootstrapTeamAuthorityFunction · 0.92
BootstrapAuthorityFunction · 0.92
StringMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…