Documentation
¶
Overview ¶
Package cipolicy owns the versioned CI north-star P1 policy manifest.
Index ¶
- Constants
- func CacheKeyDigest(material CacheKeyMaterial) (string, error)
- func ComparePortableArchives(left ArchiveSnapshot, right ArchiveSnapshot) error
- func DetectorDigest() string
- func ExtractVerifiedArtifact(policy Manifest, plan RunPlan, result ResultRecord, ...) error
- func ReadInventory(path string) (cibaseline.Inventory, error)
- func RejectUnsupportedPlatformPasses(plan RunPlan, observations []GeneratedUnsupported) error
- func ValidateArtifactManifest(policy Manifest, plan RunPlan, result ResultRecord, ...) error
- func ValidateCacheRead(policy Manifest, producerPlan RunPlan, producerResult ResultRecord, ...) error
- func ValidateCacheWrite(policy Manifest, plan RunPlan, result ResultRecord, cache CacheManifest, ...) error
- func ValidateCredentialOperation(operation CredentialOperation) error
- func ValidateCurrent(manifest Manifest, inventoryPath string) error
- func ValidateFixtureChangedFiles(knownFiles []FixtureFile, changedFiles []string, exact bool) error
- func ValidateHermeticEnvironment(env map[string]string) error
- func ValidateManifestWorkflowBindings(manifest Manifest, knownFiles []FixtureFile) error
- func ValidateP11JSSurfaceInventory(repoRoot string, inventory cibaseline.Inventory, ...) error
- func ValidateResultRecord(manifest Manifest, plan RunPlan, result ResultRecord, now time.Time) error
- func VerifyArtifact(expect ArtifactExpectation, artifact ArtifactManifest) error
- func VerifyArtifactArchive(artifact ArtifactContractManifest, archive []byte) error
- func VerifyArtifactConsumer(policy Manifest, plan RunPlan, result ResultRecord, ...) error
- func VerifyCachePayload(cache CacheManifest, payload []byte) error
- func VerifyCacheRestore(request CacheRequest, entry CacheEntry) error
- type ArchiveComparison
- type ArchiveEntry
- type ArchiveSnapshot
- type ArtifactCheck
- type ArtifactContractManifest
- type ArtifactExpectation
- type ArtifactFile
- type ArtifactManifest
- type ArtifactManifestInput
- type ArtifactProvenance
- type ArtifactVerificationOptions
- type BaselineInventory
- type BuildFlag
- type CacheEntry
- type CacheKeyMaterial
- type CacheManifest
- type CacheManifestInput
- type CacheProvenance
- type CacheReadOptions
- type CacheRequest
- type CacheRestoreCheck
- type Capability
- type Coordinate
- type CostClass
- type CredentialOperation
- type Detection
- type EventIdentity
- type EventInput
- type EventSelection
- type FanInDecision
- type FanInReport
- type FaultInjection
- type FixtureFile
- type FixtureRun
- type GeneratedUnsupported
- type GeneratedWorkflowData
- type GeneratedWorkflowJob
- type IdentityDigest
- type JobObservation
- type LegacyTrace
- type Manifest
- type Mode
- type P11CompatibilityComparison
- type P11CompatibilitySample
- type P11CompatibilitySampleRequirement
- type P11CredentialExpectation
- type P11JSHelperContract
- type P11ManifestCoordinateExpectation
- type P11ManifestModeExpectation
- type P11WorkflowJob
- type P11WorkflowStep
- type P11WorkflowSummary
- type PlanJob
- type PlanOptions
- type PlanUnsupportedDecision
- type Platform
- type ResultAttempt
- type ResultRecord
- type RunPlan
- type SourceEvent
- type SourceIdentity
- type SourceRevision
- type SyntheticToken
- type TrustTier
- type UnsupportedDecision
Constants ¶
View Source
const ( ArtifactTypeNativeLibghostty = "native-libghostty" ArtifactTypeRelease = "release" ArtifactFormatTar = "tar" ArtifactFormatTarGzip = "tar.gz" ArtifactFileRegular = "file" ArtifactFileSymlink = "symlink" )
View Source
const ( FixtureSchemaVersion = 1 FixtureCanonicalPath = "/usr/bin:/bin" FixtureCanonicalLocale = "C" FixtureCanonicalTimezone = "UTC" )
View Source
const ( SchemaVersion = 1 PolicyVersion = "ci-policy-v1" DefaultManifestPath = "internal/cipolicy/manifest.json" DefaultInventoryPath = "internal/cibaseline/inventory.json" DefaultRepository = "d0ugal/graith" DefaultDefaultBranch = "main" )
View Source
const ( P11JSSurfaceDirectory = ".github/workflows/scripts" P11NextTrancheHelper = ".github/workflows/scripts/regen-auth.test.js" )
View Source
const ( PlanSchemaVersion = 1 DetectorVersion = "cipolicy-detector-v1" )
View Source
const ArtifactSchemaVersion = 1
View Source
const CacheSchemaVersion = 1
View Source
const ResultSchemaVersion = 1
Variables ¶
This section is empty.
Functions ¶
func CacheKeyDigest ¶
func CacheKeyDigest(material CacheKeyMaterial) (string, error)
func ComparePortableArchives ¶
func ComparePortableArchives(left ArchiveSnapshot, right ArchiveSnapshot) error
func DetectorDigest ¶
func DetectorDigest() string
func ExtractVerifiedArtifact ¶
func ExtractVerifiedArtifact( policy Manifest, plan RunPlan, result ResultRecord, artifact ArtifactContractManifest, archive []byte, destination string, options ArtifactVerificationOptions, now time.Time, ) error
func ReadInventory ¶
func ReadInventory(path string) (cibaseline.Inventory, error)
func RejectUnsupportedPlatformPasses ¶
func RejectUnsupportedPlatformPasses(plan RunPlan, observations []GeneratedUnsupported) error
func ValidateArtifactManifest ¶
func ValidateArtifactManifest(policy Manifest, plan RunPlan, result ResultRecord, artifact ArtifactContractManifest, now time.Time) error
func ValidateCacheRead ¶
func ValidateCacheRead( policy Manifest, producerPlan RunPlan, producerResult ResultRecord, consumerPlan RunPlan, consumerJob PlanJob, cache CacheManifest, payload []byte, options CacheReadOptions, now time.Time, ) error
func ValidateCacheWrite ¶
func ValidateCacheWrite(policy Manifest, plan RunPlan, result ResultRecord, cache CacheManifest, payload []byte, now time.Time) error
func ValidateCredentialOperation ¶
func ValidateCredentialOperation(operation CredentialOperation) error
func ValidateCurrent ¶
func ValidateFixtureChangedFiles ¶
func ValidateFixtureChangedFiles(knownFiles []FixtureFile, changedFiles []string, exact bool) error
func ValidateManifestWorkflowBindings ¶
func ValidateManifestWorkflowBindings(manifest Manifest, knownFiles []FixtureFile) error
func ValidateP11JSSurfaceInventory ¶
func ValidateP11JSSurfaceInventory(repoRoot string, inventory cibaseline.Inventory, contracts []P11JSHelperContract) error
func ValidateResultRecord ¶
func VerifyArtifact ¶
func VerifyArtifact(expect ArtifactExpectation, artifact ArtifactManifest) error
func VerifyArtifactArchive ¶
func VerifyArtifactArchive(artifact ArtifactContractManifest, archive []byte) error
func VerifyArtifactConsumer ¶
func VerifyArtifactConsumer( policy Manifest, plan RunPlan, result ResultRecord, artifact ArtifactContractManifest, archive []byte, options ArtifactVerificationOptions, now time.Time, ) error
func VerifyCachePayload ¶
func VerifyCachePayload(cache CacheManifest, payload []byte) error
func VerifyCacheRestore ¶
func VerifyCacheRestore(request CacheRequest, entry CacheEntry) error
Types ¶
type ArchiveComparison ¶
type ArchiveComparison struct {
Left ArchiveSnapshot
Right ArchiveSnapshot
}
type ArchiveEntry ¶
type ArchiveSnapshot ¶
type ArchiveSnapshot struct {
Platform string
Entries []ArchiveEntry
}
type ArtifactCheck ¶
type ArtifactCheck struct {
Expectation ArtifactExpectation
Artifact ArtifactManifest
}
type ArtifactContractManifest ¶
type ArtifactContractManifest struct {
SchemaVersion int `json:"schema_version"`
ManifestDigest string `json:"manifest_digest"`
ArtifactType string `json:"artifact_type"`
ArtifactID string `json:"artifact_id"`
ArtifactFormat string `json:"artifact_format"`
ArtifactDigest string `json:"artifact_digest"`
PolicyVersion string `json:"policy_version"`
PolicyDigest string `json:"policy_digest"`
PlanDigest string `json:"plan_digest"`
ResultDigest string `json:"result_digest"`
DetectorVersion string `json:"detector_version"`
DetectorDigest string `json:"detector_digest"`
Source SourceRevision `json:"source"`
Event EventSelection `json:"event"`
TrustTier string `json:"trust_tier"`
Mode string `json:"mode"`
Coordinate string `json:"coordinate"`
Capability string `json:"capability"`
Platform string `json:"platform"`
OS string `json:"os"`
Architecture string `json:"architecture"`
CostClass string `json:"cost_class"`
Requiredness string `json:"requiredness"`
Matrix map[string]string `json:"matrix"`
Dependencies []IdentityDigest `json:"dependencies"`
Toolchains []IdentityDigest `json:"toolchains"`
BuildFlags []BuildFlag `json:"build_flags"`
Files []ArtifactFile `json:"files"`
Provenance ArtifactProvenance `json:"provenance"`
}
func DecodeArtifactManifest ¶
func DecodeArtifactManifest(name string, data []byte) (ArtifactContractManifest, error)
func NewArtifactManifest ¶
func NewArtifactManifest(policy Manifest, plan RunPlan, result ResultRecord, input ArtifactManifestInput) (ArtifactContractManifest, error)
func ReadArtifactManifest ¶
func ReadArtifactManifest(path string) (ArtifactContractManifest, error)
func (ArtifactContractManifest) Canonical ¶
func (artifact ArtifactContractManifest) Canonical() ArtifactContractManifest
func (ArtifactContractManifest) Digest ¶
func (artifact ArtifactContractManifest) Digest() (string, error)
func (ArtifactContractManifest) MarshalCanonical ¶
func (artifact ArtifactContractManifest) MarshalCanonical() ([]byte, error)
type ArtifactExpectation ¶
type ArtifactFile ¶
type ArtifactManifest ¶
type ArtifactManifestInput ¶
type ArtifactManifestInput struct {
ArtifactType string
ArtifactID string
ArtifactFormat string
ArtifactDigest string
Dependencies []IdentityDigest
Toolchains []IdentityDigest
BuildFlags []BuildFlag
Files []ArtifactFile
Provenance ArtifactProvenance
}
type ArtifactProvenance ¶
type ArtifactProvenance struct {
Workflow string `json:"workflow"`
WorkflowSHA256 string `json:"workflow_sha256"`
RunID int64 `json:"run_id"`
RunAttempt int `json:"run_attempt"`
JobID string `json:"job_id"`
JobName string `json:"job_name"`
ProducerStatus string `json:"producer_status"`
UploadComplete bool `json:"upload_complete"`
ArtifactID string `json:"artifact_id"`
ArtifactDigest string `json:"artifact_digest"`
}
type BaselineInventory ¶
type CacheEntry ¶
type CacheKeyMaterial ¶
type CacheKeyMaterial struct {
SchemaVersion int `json:"schema_version"`
PolicyVersion string `json:"policy_version"`
PolicyDigest string `json:"policy_digest"`
Source SourceRevision `json:"source"`
Mode string `json:"mode"`
Coordinate string `json:"coordinate"`
Capability string `json:"capability"`
Platform string `json:"platform"`
OS string `json:"os"`
Architecture string `json:"architecture"`
Dependencies []IdentityDigest `json:"dependencies"`
Toolchains []IdentityDigest `json:"toolchains"`
BuildFlags []BuildFlag `json:"build_flags"`
}
type CacheManifest ¶
type CacheManifest struct {
SchemaVersion int `json:"schema_version"`
ManifestDigest string `json:"manifest_digest"`
CacheKey string `json:"cache_key"`
CacheKeyDigest string `json:"cache_key_digest"`
CacheFormat string `json:"cache_format"`
CacheDigest string `json:"cache_digest"`
PolicyVersion string `json:"policy_version"`
PolicyDigest string `json:"policy_digest"`
PlanDigest string `json:"plan_digest"`
ResultDigest string `json:"result_digest"`
DetectorVersion string `json:"detector_version"`
DetectorDigest string `json:"detector_digest"`
Source SourceRevision `json:"source"`
Event EventSelection `json:"event"`
TrustTier string `json:"trust_tier"`
Mode string `json:"mode"`
Coordinate string `json:"coordinate"`
Capability string `json:"capability"`
Platform string `json:"platform"`
OS string `json:"os"`
Architecture string `json:"architecture"`
CostClass string `json:"cost_class"`
Requiredness string `json:"requiredness"`
Matrix map[string]string `json:"matrix"`
Dependencies []IdentityDigest `json:"dependencies"`
Toolchains []IdentityDigest `json:"toolchains"`
BuildFlags []BuildFlag `json:"build_flags"`
Files []ArtifactFile `json:"files"`
Provenance CacheProvenance `json:"provenance"`
}
func DecodeCacheManifest ¶
func DecodeCacheManifest(name string, data []byte) (CacheManifest, error)
func NewCacheManifest ¶
func NewCacheManifest(policy Manifest, plan RunPlan, result ResultRecord, input CacheManifestInput) (CacheManifest, error)
func ReadCacheManifest ¶
func ReadCacheManifest(path string) (CacheManifest, error)
func (CacheManifest) Canonical ¶
func (cache CacheManifest) Canonical() CacheManifest
func (CacheManifest) Digest ¶
func (cache CacheManifest) Digest() (string, error)
func (CacheManifest) ExpectedKeyDigest ¶
func (cache CacheManifest) ExpectedKeyDigest() (string, error)
func (CacheManifest) MarshalCanonical ¶
func (cache CacheManifest) MarshalCanonical() ([]byte, error)
type CacheManifestInput ¶
type CacheManifestInput struct {
CacheFormat string
CacheDigest string
Dependencies []IdentityDigest
Toolchains []IdentityDigest
BuildFlags []BuildFlag
Files []ArtifactFile
Provenance CacheProvenance
}
type CacheProvenance ¶
type CacheProvenance struct {
Workflow string `json:"workflow"`
WorkflowSHA256 string `json:"workflow_sha256"`
RunID int64 `json:"run_id"`
RunAttempt int `json:"run_attempt"`
JobID string `json:"job_id"`
JobName string `json:"job_name"`
ProducerStatus string `json:"producer_status"`
UploadComplete bool `json:"upload_complete"`
CacheKey string `json:"cache_key"`
CacheDigest string `json:"cache_digest"`
}
type CacheReadOptions ¶
type CacheReadOptions struct {
Dependencies []IdentityDigest
Toolchains []IdentityDigest
BuildFlags []BuildFlag
}
type CacheRequest ¶
type CacheRestoreCheck ¶
type CacheRestoreCheck struct {
Job PlanJob
Request CacheRequest
Entry CacheEntry
}
type Capability ¶
type Coordinate ¶
type CredentialOperation ¶
type CredentialOperation struct {
Operation string
TrustTier string
Capability string
Token SyntheticToken
Target string
}
type Detection ¶
type Detection struct {
DetectorVersion string `json:"detector_version"`
DetectorDigest string `json:"detector_digest"`
ExactFileList bool `json:"exact_file_list"`
ChangedFilesDigest string `json:"changed_files_digest"`
Capabilities []string `json:"capabilities"`
Superset bool `json:"superset"`
SupersetReasons []string `json:"superset_reasons"`
Errors []string `json:"errors"`
}
type EventIdentity ¶
type EventInput ¶
type EventInput struct {
Source string `json:"source"`
GitHubEvent string `json:"github_event"`
Ref string `json:"ref"`
BaseRef string `json:"base_ref"`
HeadRef string `json:"head_ref"`
BaseRepository string `json:"base_repository"`
HeadRepository string `json:"head_repository"`
Commit string `json:"commit"`
Tree string `json:"tree"`
PullRequestFork bool `json:"pull_request_fork"`
SameRepositoryAgent bool `json:"same_repository_agent"`
TrustedBase bool `json:"trusted_base"`
Publication bool `json:"publication"`
}
type EventSelection ¶
type EventSelection struct {
Source string `json:"source"`
Event string `json:"event"`
GitHubEvent string `json:"github_event"`
Ref string `json:"ref"`
BaseRef string `json:"base_ref"`
HeadRef string `json:"head_ref"`
BaseRepository string `json:"base_repository"`
HeadRepository string `json:"head_repository"`
PullRequestFork bool `json:"pull_request_fork"`
SameRepositoryAgent bool `json:"same_repository_agent"`
TrustedBase bool `json:"trusted_base"`
Publication bool `json:"publication"`
}
func SelectEvent ¶
func SelectEvent(manifest Manifest, input EventInput) (EventSelection, string, error)
type FanInDecision ¶
type FanInReport ¶
type FanInReport struct {
SchemaVersion int `json:"schema_version"`
PlanDigest string `json:"plan_digest"`
PolicyDigest string `json:"policy_digest"`
Source SourceRevision `json:"source"`
Event EventSelection `json:"event"`
TrustTier string `json:"trust_tier"`
Status string `json:"status"`
Accepted []FanInDecision `json:"accepted"`
Rejected []FanInDecision `json:"rejected"`
}
func FanIn ¶
func FanIn(manifest Manifest, plan RunPlan, results []ResultRecord, now time.Time) (FanInReport, error)
func FanInFixture ¶
func FanInFixture(manifest Manifest, plan RunPlan, workflowData GeneratedWorkflowData, observations []JobObservation, now time.Time) (FanInReport, error)
func RunHermeticFixture ¶
func RunHermeticFixture(run FixtureRun) (FanInReport, error)
type FaultInjection ¶
type FaultInjection struct {
ID string
Apply func(*FixtureRun)
}
type FixtureFile ¶
type FixtureFile struct {
Path string `json:"path"`
SHA256 string `json:"sha256"`
Content []byte `json:"-"`
}
func P11KnownFilesFromRepository ¶
func P11KnownFilesFromRepository(repoRoot string, manifest Manifest, extraPaths []string) ([]FixtureFile, error)
type FixtureRun ¶
type FixtureRun struct {
Manifest Manifest
KnownFiles []FixtureFile
Environment map[string]string
PlanOptions PlanOptions
WorkflowData GeneratedWorkflowData
Observations []JobObservation
CacheRestores []CacheRestoreCheck
Artifacts []ArtifactCheck
ArchiveComparisons []ArchiveComparison
CredentialOperations []CredentialOperation
Now time.Time
}
func ApplyFault ¶
func ApplyFault(run FixtureRun, fault FaultInjection) (FixtureRun, error)
type GeneratedUnsupported ¶
type GeneratedWorkflowData ¶
type GeneratedWorkflowData struct {
SchemaVersion int `json:"schema_version"`
PolicyVersion string `json:"policy_version"`
PolicyDigest string `json:"policy_digest"`
PlanDigest string `json:"plan_digest"`
Jobs []GeneratedWorkflowJob `json:"jobs"`
Unsupported []GeneratedUnsupported `json:"unsupported"`
}
func GenerateWorkflowData ¶
func GenerateWorkflowData(plan RunPlan) GeneratedWorkflowData
func (GeneratedWorkflowData) ValidateAgainstPlan ¶
func (data GeneratedWorkflowData) ValidateAgainstPlan(plan RunPlan) error
type GeneratedWorkflowJob ¶
type IdentityDigest ¶
type JobObservation ¶
type LegacyTrace ¶
type LegacyTrace struct {
InventoryMapping string `json:"inventory_mapping"`
LegacyWorkflow string `json:"legacy_workflow"`
LegacyJob string `json:"legacy_job"`
WorkflowPath string `json:"workflow_path"`
WorkflowSHA256 string `json:"workflow_sha256"`
LegacyCondition string `json:"legacy_condition"`
SkipSemantics string `json:"skip_semantics"`
}
type Manifest ¶
type Manifest struct {
SchemaVersion int `json:"schema_version"`
PolicyVersion string `json:"policy_version"`
PolicyDigest string `json:"policy_digest"`
Source SourceIdentity `json:"source"`
TrustTiers []TrustTier `json:"trust_tiers"`
Events []EventIdentity `json:"events"`
Platforms []Platform `json:"platforms"`
CostClasses []CostClass `json:"cost_classes"`
Capabilities []Capability `json:"capabilities"`
Modes []Mode `json:"modes"`
Unsupported []UnsupportedDecision `json:"unsupported"`
}
func FromInventory ¶
func FromInventory(inventory cibaseline.Inventory) (Manifest, error)
func ReadManifest ¶
func (Manifest) MarshalCanonical ¶
type Mode ¶
type Mode struct {
ID string `json:"id"`
Capability string `json:"capability"`
Owner string `json:"owner"`
Requiredness string `json:"requiredness"`
CostClass string `json:"cost_class"`
ProofType string `json:"proof_type"`
SourceEvents []SourceEvent `json:"source_events"`
TrustTiers []string `json:"trust_tiers"`
Coordinates []Coordinate `json:"coordinates"`
EvidenceRefs []string `json:"evidence_refs"`
Trace LegacyTrace `json:"trace"`
}
type P11CompatibilityComparison ¶
type P11CompatibilityComparison struct {
ID string
HelperPath string
PlanDigest string
TrustTier string
Capabilities []string
RequiredModes []string
Coordinates []string
Superset bool
SupersetReasons []string
FanInStatus string
AcceptedCount int
}
func CompareP11CompatibilitySamples ¶
func CompareP11CompatibilitySamples(manifest Manifest, knownFiles []FixtureFile, samples []P11CompatibilitySample, now time.Time) ([]P11CompatibilityComparison, error)
type P11CompatibilitySample ¶
type P11CompatibilitySample struct {
ID string
HelperPath string
Description string
PlanOptions PlanOptions
ExpectedTrustTier string
ExpectedCapabilities []string
ExpectedSupersetReasons []string
ExpectedManifestModes []P11ManifestModeExpectation
ExpectedPresentCoordinates []string
ExpectedAbsentCoordinates []string
CredentialExpectations []P11CredentialExpectation
}
type P11CompatibilitySampleRequirement ¶
func P11RegenAuthCompatibilityRequirements ¶
func P11RegenAuthCompatibilityRequirements() []P11CompatibilitySampleRequirement
type P11JSHelperContract ¶
type P11JSHelperContract struct {
Path string
Owner string
Kind string
Callers []string
PolicyInputs []string
PolicyOutputs []string
Disposition string
ExecutableContract string
DeletionCriterion string
CompatibilitySamples []P11CompatibilitySampleRequirement
Tranche string
}
func P11JSSurfaceContracts ¶
func P11JSSurfaceContracts() []P11JSHelperContract
type P11ManifestModeExpectation ¶
type P11ManifestModeExpectation struct {
ID string
Capability string
Requiredness string
TrustTiers []string
Coordinates []P11ManifestCoordinateExpectation
}
type P11WorkflowJob ¶
type P11WorkflowStep ¶
type P11WorkflowSummary ¶
type P11WorkflowSummary struct {
Name string
Events []string
Permissions map[string]string
PermissionsExpression string
Env map[string]string
Jobs map[string]P11WorkflowJob
}
func ReadP11WorkflowSummary ¶
func ReadP11WorkflowSummary(path string) (P11WorkflowSummary, error)
type PlanJob ¶
type PlanJob struct {
Source string `json:"source"`
Event string `json:"event"`
TrustTier string `json:"trust_tier"`
Mode string `json:"mode"`
Coordinate string `json:"coordinate"`
Capability string `json:"capability"`
Platform string `json:"platform"`
CostClass string `json:"cost_class"`
Requiredness string `json:"requiredness"`
Owner string `json:"owner"`
GitHubName string `json:"github_name"`
Matrix map[string]string `json:"matrix"`
EvidenceRefs []string `json:"evidence_refs"`
}
type PlanOptions ¶
type PlanUnsupportedDecision ¶
type PlanUnsupportedDecision struct {
Mode string `json:"mode"`
Coordinate string `json:"coordinate"`
Source string `json:"source"`
Event string `json:"event"`
Platform string `json:"platform"`
TrustTier string `json:"trust_tier"`
Requiredness string `json:"requiredness"`
Owner string `json:"owner"`
Rationale string `json:"rationale"`
Expires string `json:"expires"`
SilentPassAllowed bool `json:"silent_pass_allowed"`
EvidenceRefs []string `json:"evidence_refs"`
}
type ResultAttempt ¶
type ResultAttempt struct {
Attempt int `json:"attempt"`
Status string `json:"status"`
FailureClass string `json:"failure_class"`
StartedAt time.Time `json:"started_at"`
CompletedAt time.Time `json:"completed_at"`
EvidenceDigest string `json:"evidence_digest"`
ArtifactDigest string `json:"artifact_digest"`
CacheDigest string `json:"cache_digest"`
}
type ResultRecord ¶
type ResultRecord struct {
SchemaVersion int `json:"schema_version"`
ResultDigest string `json:"result_digest"`
PlanDigest string `json:"plan_digest"`
PolicyVersion string `json:"policy_version"`
PolicyDigest string `json:"policy_digest"`
DetectorVersion string `json:"detector_version"`
DetectorDigest string `json:"detector_digest"`
Source SourceRevision `json:"source"`
Event EventSelection `json:"event"`
TrustTier string `json:"trust_tier"`
Mode string `json:"mode"`
Coordinate string `json:"coordinate"`
Capability string `json:"capability"`
Platform string `json:"platform"`
CostClass string `json:"cost_class"`
Requiredness string `json:"requiredness"`
Owner string `json:"owner"`
Matrix map[string]string `json:"matrix"`
Attempts []ResultAttempt `json:"attempts"`
FirstStatus string `json:"first_status"`
FirstFailureClass string `json:"first_failure_class"`
Status string `json:"status"`
FailureClass string `json:"failure_class"`
StartedAt time.Time `json:"started_at"`
CompletedAt time.Time `json:"completed_at"`
EvidenceDigest string `json:"evidence_digest"`
ArtifactDigest string `json:"artifact_digest"`
CacheDigest string `json:"cache_digest"`
SupersededBy string `json:"superseded_by"`
}
func NewResultRecord ¶
func NewResultRecord(plan RunPlan, job PlanJob, attempts []ResultAttempt) (ResultRecord, error)
func NewSupersededResultRecord ¶
func NewSupersededResultRecord(plan RunPlan, job PlanJob, attempts []ResultAttempt, supersededBy string) (ResultRecord, error)
func (ResultRecord) Canonical ¶
func (result ResultRecord) Canonical() ResultRecord
func (ResultRecord) Digest ¶
func (result ResultRecord) Digest() (string, error)
func (ResultRecord) MarshalCanonical ¶
func (result ResultRecord) MarshalCanonical() ([]byte, error)
type RunPlan ¶
type RunPlan struct {
SchemaVersion int `json:"schema_version"`
PlanDigest string `json:"plan_digest"`
PolicyVersion string `json:"policy_version"`
PolicyDigest string `json:"policy_digest"`
DetectorVersion string `json:"detector_version"`
DetectorDigest string `json:"detector_digest"`
Source SourceRevision `json:"source"`
Event EventSelection `json:"event"`
TrustTier string `json:"trust_tier"`
DetectedCapabilities []string `json:"detected_capabilities"`
Capabilities []string `json:"capabilities"`
RequiredModes []string `json:"required_modes"`
Jobs []PlanJob `json:"jobs"`
Unsupported []PlanUnsupportedDecision `json:"unsupported"`
ExactFileList bool `json:"exact_file_list"`
ChangedFilesDigest string `json:"changed_files_digest"`
Superset bool `json:"superset"`
SupersetReasons []string `json:"superset_reasons"`
DetectorErrors []string `json:"detector_errors"`
CreatedAt time.Time `json:"created_at"`
ExpiresAt time.Time `json:"expires_at"`
}
func BuildHermeticPlan ¶
func BuildHermeticPlan(manifest Manifest, knownFiles []FixtureFile, options PlanOptions) (RunPlan, error)
func (RunPlan) MarshalCanonical ¶
type SourceEvent ¶
type SourceIdentity ¶
type SourceIdentity struct {
ID string `json:"id"`
Repository string `json:"repository"`
DefaultBranch string `json:"default_branch"`
PolicyPath string `json:"policy_path"`
BaselineInventory BaselineInventory `json:"baseline_inventory"`
}
type SourceRevision ¶
type SyntheticToken ¶
type UnsupportedDecision ¶
type UnsupportedDecision struct {
Mode string `json:"mode"`
Coordinate string `json:"coordinate"`
Source string `json:"source"`
Event string `json:"event"`
Platform string `json:"platform"`
TrustTier string `json:"trust_tier"`
Requiredness string `json:"requiredness"`
Owner string `json:"owner"`
Rationale string `json:"rationale"`
Expires string `json:"expires"`
SilentPassAllowed bool `json:"silent_pass_allowed"`
EvidenceRefs []string `json:"evidence_refs"`
}
Click to show internal directories.
Click to hide internal directories.