ocireference

package
v0.2.8 Latest Latest
Warning

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

Go to latest
Published: Oct 25, 2026 License: MIT Imports: 9 Imported by: 0

Documentation

Overview

Package ocireference parses and binds the OCI references crossing the controller/data-plane trust boundary.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Authority

func Authority(rawReference string) (string, error)

Authority returns the canonical HTTP authority selected by the OCI client. ORAS maps a small number of logical registry names to a different request host, so authorization must use Reference.Host rather than the parsed Registry field. Beyond that client-defined mapping, comparison deliberately does not resolve DNS names, collapse explicit ports, or remove trailing dots.

func CanonicalAuthority

func CanonicalAuthority(raw string) (string, error)

CanonicalAuthority validates an authority-only host[:port] value and applies only the case folding permitted for a registry host. Transport schemes, credentials, paths, and encoded separators are rejected rather than normalized into a broader credential scope.

func MatchAuthority

func MatchAuthority(rawReference, rawGrant string) error

MatchAuthority requires a Secret-owned authority grant to name the exact registry selected by an OCI reference.

func MatchRequested

func MatchRequested(requested, reported string) error

MatchRequested verifies that a resolver report describes exactly the requested repository and effective selector. This deliberately treats an omitted selector and :latest as equivalent.

func ValidatePinned

func ValidatePinned(pinned, digest string) error

ValidatePinned verifies an already-bound immutable reference and digest.

func ValidateResolution

func ValidateResolution(requested, pinned, digest string) error

ValidateResolution binds a pinned reference to the same repository as the request and to the exact reported SHA-256 digest.

Types

type Reference

type Reference struct {
	Registry   string
	Repository string
	Selector   string
	IsDigest   bool
}

Reference is the security-relevant identity of an OCI reference. Selector is the effective tag or digest; an omitted selector is represented as "latest", matching the data-plane parser.

func Parse

func Parse(raw string) (Reference, error)

Parse rejects transport decorations and returns the effective OCI identity.

Jump to

Keyboard shortcuts

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