Skip to content

Commit

Permalink
feat: add git attestation support
Browse files Browse the repository at this point in the history
- Added ent schema support for git attestations
- Created parser plugin for git attestation
- Registered git parser plugin

Signed-off-by: Frederick F. Kautz IV <[email protected]>
  • Loading branch information
fkautz committed Jun 6, 2024
1 parent bb56144 commit 4ff8265
Show file tree
Hide file tree
Showing 35 changed files with 10,807 additions and 1,655 deletions.
5 changes: 5 additions & 0 deletions cmd/archivista/load_modules.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
package main

import (
_ "github.com/in-toto/archivista/pkg/metadatastorage/attestationcollection/git_parser"
)
226 changes: 226 additions & 0 deletions ent.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ type Attestation implements Node {
id: ID!
type: String!
attestationCollection: AttestationCollection!
gitAttestation: GitAttestation
}
type AttestationCollection implements Node {
id: ID!
Expand Down Expand Up @@ -173,6 +174,11 @@ input AttestationWhereInput {
"""
hasAttestationCollection: Boolean
hasAttestationCollectionWith: [AttestationCollectionWhereInput!]
"""
git_attestation edge predicates
"""
hasGitAttestation: Boolean
hasGitAttestationWith: [GitAttestationWhereInput!]
}
"""
Define a Relay Cursor type:
Expand Down Expand Up @@ -284,6 +290,226 @@ input DsseWhereInput {
hasPayloadDigests: Boolean
hasPayloadDigestsWith: [PayloadDigestWhereInput!]
}
type GitAttestation implements Node {
id: ID!
commitHash: String!
author: String!
authorEmail: String!
committerName: String!
committerEmail: String!
commitDate: String!
commitMessage: String!
status: [String!]!
commitType: String!
commitDigest: String!
signature: String!
parentHashes: [String!]!
treeHash: String!
refs: [String!]!
remotes: [String!]!
attestation: Attestation!
}
"""
GitAttestationWhereInput is used for filtering GitAttestation objects.
Input was generated by ent.
"""
input GitAttestationWhereInput {
not: GitAttestationWhereInput
and: [GitAttestationWhereInput!]
or: [GitAttestationWhereInput!]
"""
id field predicates
"""
id: ID
idNEQ: ID
idIn: [ID!]
idNotIn: [ID!]
idGT: ID
idGTE: ID
idLT: ID
idLTE: ID
"""
commit_hash field predicates
"""
commitHash: String
commitHashNEQ: String
commitHashIn: [String!]
commitHashNotIn: [String!]
commitHashGT: String
commitHashGTE: String
commitHashLT: String
commitHashLTE: String
commitHashContains: String
commitHashHasPrefix: String
commitHashHasSuffix: String
commitHashEqualFold: String
commitHashContainsFold: String
"""
author field predicates
"""
author: String
authorNEQ: String
authorIn: [String!]
authorNotIn: [String!]
authorGT: String
authorGTE: String
authorLT: String
authorLTE: String
authorContains: String
authorHasPrefix: String
authorHasSuffix: String
authorEqualFold: String
authorContainsFold: String
"""
author_email field predicates
"""
authorEmail: String
authorEmailNEQ: String
authorEmailIn: [String!]
authorEmailNotIn: [String!]
authorEmailGT: String
authorEmailGTE: String
authorEmailLT: String
authorEmailLTE: String
authorEmailContains: String
authorEmailHasPrefix: String
authorEmailHasSuffix: String
authorEmailEqualFold: String
authorEmailContainsFold: String
"""
committer_name field predicates
"""
committerName: String
committerNameNEQ: String
committerNameIn: [String!]
committerNameNotIn: [String!]
committerNameGT: String
committerNameGTE: String
committerNameLT: String
committerNameLTE: String
committerNameContains: String
committerNameHasPrefix: String
committerNameHasSuffix: String
committerNameEqualFold: String
committerNameContainsFold: String
"""
committer_email field predicates
"""
committerEmail: String
committerEmailNEQ: String
committerEmailIn: [String!]
committerEmailNotIn: [String!]
committerEmailGT: String
committerEmailGTE: String
committerEmailLT: String
committerEmailLTE: String
committerEmailContains: String
committerEmailHasPrefix: String
committerEmailHasSuffix: String
committerEmailEqualFold: String
committerEmailContainsFold: String
"""
commit_date field predicates
"""
commitDate: String
commitDateNEQ: String
commitDateIn: [String!]
commitDateNotIn: [String!]
commitDateGT: String
commitDateGTE: String
commitDateLT: String
commitDateLTE: String
commitDateContains: String
commitDateHasPrefix: String
commitDateHasSuffix: String
commitDateEqualFold: String
commitDateContainsFold: String
"""
commit_message field predicates
"""
commitMessage: String
commitMessageNEQ: String
commitMessageIn: [String!]
commitMessageNotIn: [String!]
commitMessageGT: String
commitMessageGTE: String
commitMessageLT: String
commitMessageLTE: String
commitMessageContains: String
commitMessageHasPrefix: String
commitMessageHasSuffix: String
commitMessageEqualFold: String
commitMessageContainsFold: String
"""
commit_type field predicates
"""
commitType: String
commitTypeNEQ: String
commitTypeIn: [String!]
commitTypeNotIn: [String!]
commitTypeGT: String
commitTypeGTE: String
commitTypeLT: String
commitTypeLTE: String
commitTypeContains: String
commitTypeHasPrefix: String
commitTypeHasSuffix: String
commitTypeEqualFold: String
commitTypeContainsFold: String
"""
commit_digest field predicates
"""
commitDigest: String
commitDigestNEQ: String
commitDigestIn: [String!]
commitDigestNotIn: [String!]
commitDigestGT: String
commitDigestGTE: String
commitDigestLT: String
commitDigestLTE: String
commitDigestContains: String
commitDigestHasPrefix: String
commitDigestHasSuffix: String
commitDigestEqualFold: String
commitDigestContainsFold: String
"""
signature field predicates
"""
signature: String
signatureNEQ: String
signatureIn: [String!]
signatureNotIn: [String!]
signatureGT: String
signatureGTE: String
signatureLT: String
signatureLTE: String
signatureContains: String
signatureHasPrefix: String
signatureHasSuffix: String
signatureEqualFold: String
signatureContainsFold: String
"""
tree_hash field predicates
"""
treeHash: String
treeHashNEQ: String
treeHashIn: [String!]
treeHashNotIn: [String!]
treeHashGT: String
treeHashGTE: String
treeHashLT: String
treeHashLTE: String
treeHashContains: String
treeHashHasPrefix: String
treeHashHasSuffix: String
treeHashEqualFold: String
treeHashContainsFold: String
"""
attestation edge predicates
"""
hasAttestation: Boolean
hasAttestationWith: [AttestationWhereInput!]
}
"""
An object with an ID.
Follows the [Relay Global Object Identification Specification](https://relay.dev/graphql/objectidentification.htm)
Expand Down
23 changes: 21 additions & 2 deletions ent/attestation.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

23 changes: 23 additions & 0 deletions ent/attestation/attestation.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

23 changes: 23 additions & 0 deletions ent/attestation/where.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 4ff8265

Please sign in to comment.