25 lines
659 B
Go
25 lines
659 B
Go
package artifact
|
|
|
|
import "git.cin.su/m/Assistant/platform/ids"
|
|
|
|
import "errors"
|
|
|
|
type ArtifactID ids.ID
|
|
|
|
type AgentArtifactAttestation struct {
|
|
ArtifactID ArtifactID
|
|
ProducerRunID string
|
|
SourceRevision string
|
|
WorktreeID string
|
|
ContentDigest string
|
|
TestEvidenceRef string
|
|
CreatedAtUnixMillis int64
|
|
}
|
|
|
|
func (a AgentArtifactAttestation) Validate() error {
|
|
if a.ArtifactID == "" || a.ProducerRunID == "" || a.SourceRevision == "" || a.WorktreeID == "" || a.ContentDigest == "" || a.TestEvidenceRef == "" || a.CreatedAtUnixMillis < 1 {
|
|
return errors.New("agent artifact attestation is incomplete")
|
|
}
|
|
return nil
|
|
}
|