builtins

package
v1.120.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 8, 2026 License: Apache-2.0 Imports: 7 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const (
	// NonRestrictiveBuiltin is used in builtin definition categories to mark a builtin as non-suitable for Chainloop's restrictive mode
	NonRestrictiveBuiltin = "non-restrictive"
)

Variables

This section is empty.

Functions

func Register

func Register(def *ast.Builtin, builtinFunc topdown.BuiltinFunc) error

Register registers built-ins globally with OPA This should be called once during initialization

func RegisterDiscoverBuiltin

func RegisterDiscoverBuiltin(conn *grpc.ClientConn) error

RegisterDiscoverBuiltin is used to register chainloop's Discover endpoint as a builtin Rego function with signature:

chainloop.discover(digest, kind)

For instance, to get the references for an CONTAINER_IMAGE material, and fail if any of them is an attestation with policy violations: ```

violations contains msg if {
  digest := sprintf("sha256:%s",[input.chainloop_metadata.digest.sha256])
  discovered := chainloop.discover(digest, "")

  some ref in discovered.references
  ref.kind == "ATTESTATION"
  ref.metadata.hasPolicyViolations == "true"

  msg:= sprintf("attestation with digest %s contains policy violations [name: %s, project: %s, org: %s]", [ref.digest, ref.metadata.name, ref.metadata.project, ref.metadata.organization])
}

```

func RegisterHelloBuiltin

func RegisterHelloBuiltin() error

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL