Documentation
¶
Index ¶
Constants ¶
View Source
const (
AppName string = "policy"
)
Variables ¶
This section is empty.
Functions ¶
func ConfigExpander ¶
Types ¶
type ApplyCmd ¶
type ApplyCmd struct {
Template string `name:"template" arg:"" required:"true" help:"name of the template to apply"`
Output string `name:"output" short:"o" help:"output directory (defaults to current directory)" default:"."`
Overwrite bool `name:"overwrite" help:"overwrite existing files" default:"false"`
RegoVersion string `name:"rego-version" enum:"rego.v0, rego.v1" default:"rego.v1" help:"Set rego version flag (enum: rego.v0 or rego.v1)."`
}
type BuildCmd ¶
type BuildCmd struct {
Tag string `name:"tag" short:"t" help:"Name and optionally a tag in the 'name:tag' format, if not provided it will be 'default:latest'"`
Path []string `name:"path" arg:"" help:"Path to the policy sources." type:"string"`
Annotations map[string]string `name:"annotations" short:"a" help:"Annotations to apply to the policy." type:"string:string"`
RunConfigFile string `name:"build-config-file" help:"Set path of configuration file."`
Target string `name:"target" default:"rego" help:"Set the output bundle target type."`
OptimizationLevel int `name:"optimize" short:"O" default:"0" help:"Set optimization level."`
Entrypoints []string `name:"entrypoint" short:"e" help:"Set slash separated entrypoint path."`
Revision string `name:"revision" short:"r" help:"Set output bundle revision."`
Ignore []string `name:"ignore" help:"Set file and directory names to ignore during loading (e.g., '.*' excludes hidden files)."`
Capabilities string `name:"capabilities" help:"Set capabilities.json file path."`
VerificationKey string `name:"verification-key" help:"Set the secret (HMAC) or path of the PEM file containing the public key (RSA and ECDSA)."`
VerificationKeyID string `name:"verification-key-id" default:"default" help:"Name assigned to the verification key used for bundle verification."`
Algorithm string `name:"signing-alg" default:"RS256" help:"Name of the signing algorithm."`
Scope string `name:"scope" help:"Scope to use for bundle signature verification."`
ExcludeVerifyFiles []string `name:"exclude-files-verify" help:"Set file names to exclude during bundle verification."`
SigningKey string `name:"signing-key" help:"Set the secret (HMAC) or path of the PEM file containing the private key (RSA and ECDSA)."`
ClaimsFile string `` /* 151-byte string literal not displayed */
RegoVersion string `` /* 138-byte string literal not displayed */
}
type CLI ¶
type CLI struct {
Config string `flag:"" short:"c" type:"path" help:"Path to the policy CLI config file." default:"${userHome}/.config/policy/config.yaml"`
Debug bool `flag:"" help:"Enable debug mode."`
Verbosity int `flag:"" short:"v" type:"counter" help:"Use to increase output verbosity."`
Insecure bool `flag:"" short:"k" help:"Do not verify TLS connections."`
Plaintext bool `flag:"" help:"Use HTTP instead of HTTPS to connect to a registry."`
Build BuildCmd `cmd:"" help:"Build policies."`
Images ImagesCmd `cmd:"" help:"List policy images."`
Push PushCmd `cmd:"" help:"Push policies to a registry."`
Pull PullCmd `cmd:"" help:"Pull policies from a registry."`
Login LoginCmd `cmd:"" help:"Login to a registry."`
Logout LogoutCmd `cmd:"" help:"Logout from a registry."`
Save SaveCmd `cmd:"" help:"Save a policy to a local bundle tarball."`
Tag TagCmd `cmd:"" help:"Create a new tag for an existing policy."`
Rm RmCmd `cmd:"" help:"Removes a policy from the local registry."`
Inspect InspectCmd `cmd:"" help:"Displays information about a policy."`
Repl ReplCmd `cmd:"" help:"Sets you up with a shell for running queries using an OPA instance with a policy loaded."`
Templates TemplatesCmd `cmd:"" help:"List and apply templates"`
Version VersionCmd `cmd:"" help:"Prints version information."`
}
type Globals ¶
type ImagesCmd ¶
type InspectCmd ¶
type InspectCmd struct {
Policy string `name:"policy" arg:"" help:"Policy to inspect."`
}
func (*InspectCmd) Run ¶
func (c *InspectCmd) Run(g *Globals) error
type LoginCmd ¶
type LoginCmd struct {
Server string `name:"server" short:"s" help:"Server to connect to." default:"{{ .DefaultDomain }}"`
Username string `name:"username" required:"" short:"u" help:"Username for logging into the server."`
Password string `name:"password" short:"p" help:"Password for logging into the server."`
PasswordStdin bool `name:"password-stdin" help:"Take the password from stdin"`
DefaultDomain bool `name:"default-domain" short:"d" help:"Do not ask for setting default domain"`
}
type LogoutCmd ¶
type LogoutCmd struct {
Server string `name:"server" short:"s" help:"Server to logout from." default:"{{ .DefaultDomain }}"`
}
type PullCmd ¶
type PullCmd struct {
Policies []string `name:"policy" arg:"" help:"Policies to pull from the remote registry."`
}
type PushCmd ¶
type PushCmd struct {
Policies []string `name:"policy" arg:"" help:"Policies to push."`
}
type ReplCmd ¶
type RmCmd ¶
type SaveCmd ¶
type TagCmd ¶
type TemplatesCmd ¶
type VersionCmd ¶
type VersionCmd struct{}
func (*VersionCmd) Run ¶
func (c *VersionCmd) Run(g *Globals) error
Click to show internal directories.
Click to hide internal directories.