-
Notifications
You must be signed in to change notification settings - Fork 4.2k
/
policy.go
47 lines (31 loc) · 971 Bytes
/
policy.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
package command
import (
"strings"
"github.com/mitchellh/cli"
)
var _ cli.Command = (*PolicyCommand)(nil)
// PolicyCommand is a Command that holds the audit commands
type PolicyCommand struct {
*BaseCommand
}
func (c *PolicyCommand) Synopsis() string {
return "Interact with policies"
}
func (c *PolicyCommand) Help() string {
helpText := `
Usage: vault policy <subcommand> [options] [args]
This command groups subcommands for interacting with policies.
Users can write, read, and list policies in Vault.
List all enabled policies:
$ vault policy list
Create a policy named "my-policy" from contents on local disk:
$ vault policy write my-policy ./my-policy.hcl
Delete the policy named my-policy:
$ vault policy delete my-policy
Please see the individual subcommand help for detailed usage information.
`
return strings.TrimSpace(helpText)
}
func (c *PolicyCommand) Run(args []string) int {
return cli.RunResultHelp
}