Skip to content

Commit

Permalink
adding policyverify schema
Browse files Browse the repository at this point in the history
Signed-off-by: chaosinthecrd <[email protected]>
  • Loading branch information
ChaosInTheCRD committed May 10, 2024
1 parent 1c01821 commit c5ff51a
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 147 deletions.
132 changes: 1 addition & 131 deletions schemagen/git.json
Original file line number Diff line number Diff line change
@@ -1,131 +1 @@
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$ref": "#/$defs/Attestor",
"$defs": {
"Attestor": {
"properties": {
"commithash": {
"type": "string"
},
"author": {
"type": "string"
},
"authoremail": {
"type": "string"
},
"committername": {
"type": "string"
},
"committeremail": {
"type": "string"
},
"commitdate": {
"type": "string"
},
"commitmessage": {
"type": "string"
},
"status": {
"additionalProperties": {
"$ref": "#/$defs/Status"
},
"type": "object"
},
"commitdigest": {
"$ref": "#/$defs/DigestSet"
},
"signature": {
"type": "string"
},
"parenthashes": {
"items": {
"type": "string"
},
"type": "array"
},
"treehash": {
"type": "string"
},
"refs": {
"items": {
"type": "string"
},
"type": "array"
},
"remotes": {
"items": {
"type": "string"
},
"type": "array"
},
"tags": {
"items": {
"$ref": "#/$defs/Tag"
},
"type": "array"
}
},
"additionalProperties": false,
"type": "object",
"required": [
"commithash",
"author",
"authoremail",
"committername",
"committeremail",
"commitdate",
"commitmessage"
]
},
"DigestSet": {
"additionalProperties": {
"type": "string"
},
"type": "object"
},
"Status": {
"properties": {
"staging": {
"type": "string"
},
"worktree": {
"type": "string"
}
},
"additionalProperties": false,
"type": "object"
},
"Tag": {
"properties": {
"name": {
"type": "string"
},
"taggername": {
"type": "string"
},
"taggeremail": {
"type": "string"
},
"when": {
"type": "string"
},
"pgpsignature": {
"type": "string"
},
"message": {
"type": "string"
}
},
"additionalProperties": false,
"type": "object",
"required": [
"name",
"taggername",
"taggeremail",
"when",
"pgpsignature",
"message"
]
}
}
}
{"$schema":"https://json-schema.org/draft/2020-12/schema","$ref":"#/$defs/Attestor","$defs":{"Attestor":{"properties":{"commithash":{"type":"string"},"author":{"type":"string"},"authoremail":{"type":"string"},"committername":{"type":"string"},"committeremail":{"type":"string"},"commitdate":{"type":"string"},"commitmessage":{"type":"string"},"status":{"additionalProperties":{"$ref":"#/$defs/Status"},"type":"object"},"commitdigest":{"$ref":"#/$defs/DigestSet"},"signature":{"type":"string"},"parenthashes":{"items":{"type":"string"},"type":"array"},"treehash":{"type":"string"},"refs":{"items":{"type":"string"},"type":"array"},"remotes":{"items":{"type":"string"},"type":"array"},"tags":{"items":{"$ref":"#/$defs/Tag"},"type":"array"}},"additionalProperties":false,"type":"object","required":["commithash","author","authoremail","committername","committeremail","commitdate","commitmessage"]},"DigestSet":{"additionalProperties":{"type":"string"},"type":"object"},"Status":{"properties":{"staging":{"type":"string"},"worktree":{"type":"string"}},"additionalProperties":false,"type":"object"},"Tag":{"properties":{"name":{"type":"string"},"taggername":{"type":"string"},"taggeremail":{"type":"string"},"when":{"type":"string"},"pgpsignature":{"type":"string"},"message":{"type":"string"}},"additionalProperties":false,"type":"object","required":["name","taggername","taggeremail","when","pgpsignature","message"]}}}
1 change: 1 addition & 0 deletions schemagen/policyverify.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"$schema":"https://json-schema.org/draft/2020-12/schema","$ref":"#/$defs/Attestor","$defs":{"Attestor":{"properties":{"verifier":{"$ref":"#/$defs/Verifier"},"timeVerified":{"type":"string","format":"date-time"},"policy":{"$ref":"#/$defs/ResourceDescriptor"},"inputAttestations":{"items":{"$ref":"#/$defs/ResourceDescriptor"},"type":"array"},"verificationResult":{"type":"string"}},"additionalProperties":false,"type":"object","required":["verifier","timeVerified","policy","inputAttestations","verificationResult"]},"DigestSet":{"additionalProperties":{"type":"string"},"type":"object"},"ResourceDescriptor":{"properties":{"uri":{"type":"string"},"digest":{"$ref":"#/$defs/DigestSet"}},"additionalProperties":false,"type":"object","required":["uri","digest"]},"Verifier":{"properties":{"id":{"type":"string"}},"additionalProperties":false,"type":"object","required":["id"]}}}
18 changes: 2 additions & 16 deletions schemagen/schema.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,23 +20,9 @@ import (
"log"
"os"

// import all the attestation types
_ "github.com/in-toto/go-witness"
"github.com/in-toto/go-witness/attestation"
// this feels like an annoying way of importing them as it will need edited for each attestor added
_ "github.com/in-toto/go-witness/attestation/aws-iid"
_ "github.com/in-toto/go-witness/attestation/commandrun"
_ "github.com/in-toto/go-witness/attestation/environment"
_ "github.com/in-toto/go-witness/attestation/gcp-iit"
_ "github.com/in-toto/go-witness/attestation/git"
_ "github.com/in-toto/go-witness/attestation/github"
_ "github.com/in-toto/go-witness/attestation/gitlab"
_ "github.com/in-toto/go-witness/attestation/jwt"
_ "github.com/in-toto/go-witness/attestation/link"
_ "github.com/in-toto/go-witness/attestation/material"
_ "github.com/in-toto/go-witness/attestation/maven"
_ "github.com/in-toto/go-witness/attestation/oci"
_ "github.com/in-toto/go-witness/attestation/product"
_ "github.com/in-toto/go-witness/attestation/sarif"
_ "github.com/in-toto/go-witness/attestation/slsa"
)

var directory string
Expand Down

0 comments on commit c5ff51a

Please sign in to comment.