contract

package
v0.7.0 Latest Latest
Warning

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

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

Documentation

Overview

Package contract holds shared checks below portable models and artifact validation.

Index

Constants

View Source
const MaxPathBytes = 1024

Variables

View Source
var (
	IdentifierPattern = regexp.MustCompile(`^[a-z0-9][a-z0-9._-]{0,127}$`)
	EnvPattern        = regexp.MustCompile(`^[A-Z_][A-Z0-9_]*$`)
)

Functions

func DigestBytes

func DigestBytes(data []byte) string

func EvidenceImplementation

func EvidenceImplementation(id, version, digest string) bool

EvidenceImplementation checks the same public implementation identity used by runtime profiles and evaluation evidence without depending on either model.

func EvidenceToken

func EvidenceToken(value string) bool

func IsJSONNull

func IsJSONNull(raw json.RawMessage) bool

func IsValidDigest

func IsValidDigest(value string) bool

func RequiredObject

func RequiredObject(data []byte, required string) (map[string]json.RawMessage, string)

RequiredObject preserves missing-before-null refusal ordering. Every present field, not only required ones, must be non-null. Codes are interpreted by the caller so model errors and sanitized evidence refusals keep their own types.

func UnsafeInjectionEnv

func UnsafeInjectionEnv(name string) bool

func ValidateContentPath

func ValidateContentPath(value string) (string, error)

Types

This section is empty.

Jump to

Keyboard shortcuts

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