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

Function ViewCommand

command/ca/policy/actions/view.go:21–72  ·  view source on GitHub ↗

ViewCommand returns the policy view subcommand

(ctx context.Context)

Source from the content-addressed store, hash-verified

19
20// ViewCommand returns the policy view subcommand
21func ViewCommand(ctx context.Context) cli.Command {
22 commandName := policycontext.GetPrefixedCommandUsage(ctx, "view")
23 return cli.Command{
24 Name: "view",
25 Usage: "view current certificate issuance policy",
26 UsageText: fmt.Sprintf(`**%s**
27[**--provisioner**=<name>] [**--eab-key-id**=<eab-key-id>] [**--eab-key-reference**=<eab-key-reference>]
28[**--admin-cert**=<file>] [**--admin-key**=<file>] [**--admin-subject**=<subject>]
29[**--admin-provisioner**=<name>] [**--admin-password-file**=<file>]
30[**--ca-url**=<uri>] [**--root**=<file>] [**--context**=<name>]`, commandName),
31 Description: fmt.Sprintf(`**%s** shows the currently configured policy.
32
33## EXAMPLES
34
35View the authority certificate issuance policy
36'''
37$ step ca policy authority view
38'''
39
40View a provisioner certificate issuance policy
41'''
42$ step ca policy provisioner view --provisioner my_provisioner
43'''
44
45View an ACME EAB certificate issuance policy by reference
46'''
47$ step ca policy acme view --provisioner my_acme_provisioner --eab-key-reference my_reference
48'''
49
50View an ACME EAB certificate issuance policy by EAB Key ID
51'''
52$ step ca policy acme view --provisioner my_acme_provisioner --eab-key-id "lUOTGwvFQADjk8nxsVufbhyTOwrFmvO2"
53'''`, commandName),
54 Action: command.InjectContext(
55 ctx,
56 viewAction,
57 ),
58 Flags: []cli.Flag{
59 flags.Provisioner,
60 flags.EABKeyID,
61 flags.EABReference,
62 flags.AdminCert,
63 flags.AdminKey,
64 flags.AdminSubject,
65 flags.AdminProvisioner,
66 flags.AdminPasswordFile,
67 flags.CaURL,
68 flags.Root,
69 flags.Context,
70 },
71 }
72}
73
74func viewAction(ctx context.Context) (err error) {
75 var (

Callers 3

CommandFunction · 0.92
CommandFunction · 0.92
CommandFunction · 0.92

Calls 2

GetPrefixedCommandUsageFunction · 0.92
InjectContextFunction · 0.92

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…