ViewCommand returns the policy view subcommand
(ctx context.Context)
| 19 | |
| 20 | // ViewCommand returns the policy view subcommand |
| 21 | func 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 | |
| 35 | View the authority certificate issuance policy |
| 36 | ''' |
| 37 | $ step ca policy authority view |
| 38 | ''' |
| 39 | |
| 40 | View a provisioner certificate issuance policy |
| 41 | ''' |
| 42 | $ step ca policy provisioner view --provisioner my_provisioner |
| 43 | ''' |
| 44 | |
| 45 | View 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 | |
| 50 | View 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 | |
| 74 | func viewAction(ctx context.Context) (err error) { |
| 75 | var ( |
no test coverage detected
searching dependent graphs…