MCPcopy Create free account
hub / github.com/chainloop-dev/chainloop / undefinedChainloopBuiltins

Function undefinedChainloopBuiltins

pkg/policies/policies.go:692–702  ·  view source on GitHub ↗

undefinedChainloopBuiltins extracts chainloop.* function names from OPA undefined-function type errors. Returns nil if the error doesn't involve any chainloop builtins (e.g., intentionally blocked OPA functions like opa.runtime or trace still produce hard errors).

(err error)

Source from the content-addressed store, hash-verified

690// any chainloop builtins (e.g., intentionally blocked OPA functions like
691// opa.runtime or trace still produce hard errors).
692func undefinedChainloopBuiltins(err error) []string {
693 matches := undefinedChainloopBuiltinRe.FindAllStringSubmatch(err.Error(), -1)
694 if len(matches) == 0 {
695 return nil
696 }
697 names := make([]string, 0, len(matches))
698 for _, m := range matches {
699 names = append(names, m[1])
700 }
701 return names
702}
703
704// LoadPolicySpec loads and validates a policy spec from a contract
705func (pv *PolicyVerifier) loadPolicySpec(ctx context.Context, attachment *v1.PolicyAttachment) (*v1.Policy, *PolicyDescriptor, error) {

Callers 2

executeScriptMethod · 0.85

Calls 1

ErrorMethod · 0.65

Tested by 1