oficina / equipo Public

Clone
git clone https://amadan.net/oficina/equipo

Plain git — no account needed to clone.

Download

Download this file

1package planflow
2
3import (
4 "amadan.net/oficina/equipo/internal/equipo/team"
5 "amadan.net/oficina/equipo/internal/runner/provider"
6 "amadan.net/oficina/equipo/internal/runnerproto"
7 "slices"
8)
9
10// Artifacts rejects material outside the immutable dispatch snapshot.
11func Artifacts(b runnerproto.RunnerBrief, artifacts []team.Artifact) error {
12 if !slices.Equal(b.Step.ArtifactHashes, b.ArtifactHashes) {
13 return provider.ErrIdentity
14 }
15 seen := map[string]bool{}
16 for _, a := range artifacts {
17 if team.ContentDigest(a.Payload) != a.Hash || !slices.Contains(b.Step.ArtifactHashes, a.Hash) {
18 return provider.ErrIdentity
19 }
20 seen[a.Hash] = true
21 }
22 for _, hash := range b.Step.ArtifactHashes {
23 if !seen[hash] && hash != team.ContentDigest(b.CheckDefinition) {
24 return provider.ErrIdentity
25 }
26 }
27 return nil
28}
29