Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add git attestation support #297

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions cmd/archivista/load_modules.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
// Copyright 2024 The Archivista Contributors
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
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
2 changes: 1 addition & 1 deletion ent.resolvers.go

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

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.

Loading
Loading