Documentation
¶
Index ¶
- Variables
- func Download(ctx context.Context, source string, outputDir string, binaryPath string, ...) (string, error)
- func ExtractAnnotations(comments []*ast.Comment) map[string]interface{}
- func GetAnnotations(ctx context.Context, source string, option ...remote.Option) (map[string]string, error)
- func IsOCI(source string) bool
- func OnError(err error, callback func(err error))
- func PolicyCompiler(ctx context.Context, policyPath string) *ast.Compiler
- func SeededUUID(seedData []string) (uuid.UUID, error)
- func SourceDigest(source, localPath string) string
- func SubtractSlice(left []string, right []string) []string
- func Untar(destination string, tarReader io.Reader) error
Constants ¶
This section is empty.
Variables ¶
var RequiredAnnotations = []string{
"title",
"description",
"controls",
}
Functions ¶
func ExtractAnnotations ¶
ExtractAnnotations takes comments from a rego file, and finds the metadata within. Metadata starts with a line `METADATA`, followed by a yaml document specifying the metadata for the specific policy. We use this to build a better picture of what the policy is used for, which controls it verifies, and who the responsible parties are.
func GetAnnotations ¶ added in v0.3.0
func IsOCI ¶
IsOCI reports whether source parses as an OCI tag with strict validation, which is what our downloader supports. It delegates to the shared agentconfig rule so the agent and the API classify sources identically (R3).
func SourceDigest ¶ added in v0.8.0
SourceDigest returns the digest of what the agent runs from source, extracted at localPath. For an OCI source it is the registry digest recorded when the agent downloaded it, or "" for files extracted before digests were recorded. For a local file, such as a plugin binary, it is the file's SHA-256. Otherwise it is "".
func SubtractSlice ¶
Types ¶
This section is empty.
Directories
¶
| Path | Synopsis |
|---|---|
|
Package agentstate owns the agent's per-instance state directory: the stable instance ID (R31) and the remote configuration cache (R7).
|
Package agentstate owns the agent's per-instance state directory: the stable instance ID (R31) and the remote configuration cache (R7). |
|
Package pluginlib reads which version of this module (the agent library) a plugin binary was built with (R76).
|
Package pluginlib reads which version of this module (the agent library) a plugin binary was built with (R76). |