Documentation
¶
Overview ¶
Package policy supplies plugin collectors for the shared CEL and Starlark policy engine.
Index ¶
- Constants
- func DevelopmentPath(project, directory string) string
- func Login(ctx context.Context, host string) error
- func Package(ctx context.Context, operation, source string, definition *manifest.Config, ...) error
- func Source(ctx context.Context, operation, source string, options ...Option) error
- type Option
- type Registry
- func (r Registry) Delete(ctx context.Context, ref name.Digest) error
- func (r Registry) Get(ctx context.Context, ref name.Reference) (*remote.Descriptor, error)
- func (r Registry) Head(ctx context.Context, ref name.Reference) (*v1.Descriptor, error)
- func (r Registry) Referrers(ctx context.Context, ref name.Digest) (v1.ImageIndex, error)
- func (r Registry) Tags(ctx context.Context, repository name.Repository) ([]string, error)
- func (r Registry) WriteImage(ctx context.Context, ref name.Reference, img v1.Image) error
- func (r Registry) WriteIndex(ctx context.Context, ref name.Reference, index v1.ImageIndex) error
Constants ¶
const OperationTest = "test"
OperationTest gates running a plugin's conformance fixtures and authored tests. It acts on an explicit local development directory with no release provenance, so it is deliberately not subject to plugins.policy.require_signature: an author must be able to test an unsigned local plugin before there is anything to sign. Organizations restrict it with rules such as `input.operation == 'test'`, optionally combined with `input.development`. Compiling a plugin (`plugin build`) is not a policy operation: it admits nothing and runs no plugin code.
Variables ¶
This section is empty.
Functions ¶
func DevelopmentPath ¶
DevelopmentPath renders a local plugin directory for policy input.
Inside the project directory it is a clean forward-slash path relative to it, with symlinks resolved, so a rule can compare it against relative allow-roots such as `build/`. A directory outside the project, or one that cannot be related to it, is returned absolute and slash-normalized instead. The result never contains a `..` segment, so a relative allow-root cannot match a directory that escapes the project.
func Package ¶
func Package(ctx context.Context, operation, source string, definition *manifest.Config, options ...Option) error
Package checks inspected metadata before installing or activating executable code. It never treats a catalog entry or lockfile verification label as authenticated metadata.
Types ¶
type Option ¶
type Option func(*options)
Option supplies inspected evidence and the artifact origin.
func WithCache ¶
func WithCache() Option
WithCache identifies verified cached bytes selected through a project lock.
func WithDigest ¶
WithDigest supplies the inspected release index digest.
func WithExtensions ¶
WithExtensions supplies registered contracts for metadata-only capability discovery.
func WithLayout ¶
func WithLayout() Option
WithLayout identifies an explicit local OCI import, whose claimed repository has not been contacted by this operation.
type Registry ¶
Registry admits each actual destination before OCI resolves credentials or performs I/O. It also covers discovery, publication, deletion, and signature attachment transport.
func (Registry) Referrers ¶
Referrers preserves signature discovery while enforcing destination policy.
func (Registry) WriteImage ¶
WriteImage admits catalog and signature publication.
func (Registry) WriteIndex ¶
WriteIndex admits plugin publication.