From e49ce9e0f813b8ca865650bac4c42b833ef99385 Mon Sep 17 00:00:00 2001 From: Brandon Lum Date: Fri, 21 Jul 2023 11:34:03 -0400 Subject: [PATCH] update client GQL fragments to public usable by go (#1085) * update client GQL fragments to public usable by go Signed-off-by: Brandon Lum * rebase magic Signed-off-by: Brandon Lum * update codegen Signed-off-by: Brandon Lum --------- Signed-off-by: Brandon Lum --- pkg/assembler/clients/generated/operations.go | 29158 ++++++++-------- .../clients/operations/certifyGood.graphql | 6 +- .../operations/certifyVEXStatement.graphql | 12 +- .../clients/operations/contact.graphql | 6 +- .../clients/operations/hasSBOM.graphql | 4 +- .../clients/operations/hasSLSA.graphql | 4 +- .../clients/operations/hasSourceAt.graphql | 2 +- .../clients/operations/hashEqual.graphql | 2 +- .../clients/operations/isDependency.graphql | 4 +- .../operations/isVulnerability.graphql | 4 +- .../clients/operations/metadata.graphql | 6 +- pkg/assembler/clients/operations/path.graphql | 88 +- .../clients/operations/pkgEqual.graphql | 2 +- .../clients/operations/trees.graphql | 26 +- 14 files changed, 14662 insertions(+), 14662 deletions(-) diff --git a/pkg/assembler/clients/generated/operations.go b/pkg/assembler/clients/generated/operations.go index 16dcedfa76..704a0281ec 100644 --- a/pkg/assembler/clients/generated/operations.go +++ b/pkg/assembler/clients/generated/operations.go @@ -36,6 +36,23 @@ func (v *AllArtifactTree) GetAlgorithm() string { return v.Algorithm } // GetDigest returns AllArtifactTree.Digest, and is useful for accessing the field via an interface. func (v *AllArtifactTree) GetDigest() string { return v.Digest } +// AllBuilderTree includes the GraphQL fields of Builder requested by the fragment AllBuilderTree. +// The GraphQL type's documentation follows. +// +// Builder represents the builder (e.g., FRSCA or GitHub Actions). +// +// Currently builders are identified by the uri field. +type AllBuilderTree struct { + Id string `json:"id"` + Uri string `json:"uri"` +} + +// GetId returns AllBuilderTree.Id, and is useful for accessing the field via an interface. +func (v *AllBuilderTree) GetId() string { return v.Id } + +// GetUri returns AllBuilderTree.Uri, and is useful for accessing the field via an interface. +func (v *AllBuilderTree) GetUri() string { return v.Uri } + // AllCertifyBad includes the GraphQL fields of CertifyBad requested by the fragment AllCertifyBad. // The GraphQL type's documentation follows. // @@ -505,144 +522,156 @@ func (v *AllCertifyBadSubjectSource) __premarshalJSON() (*__premarshalAllCertify return &retval, nil } -// AllCertifyScorecard includes the GraphQL fields of CertifyScorecard requested by the fragment AllCertifyScorecard. +// AllCertifyGood includes the GraphQL fields of CertifyGood requested by the fragment AllCertifyGood. // The GraphQL type's documentation follows. // -// CertifyScorecard is an attestation to attach a Scorecard analysis to a -// particular source repository. -type AllCertifyScorecard struct { - Id string `json:"id"` - // The source repository that is being scanned (attestation subject) - Source AllCertifyScorecardSource `json:"source"` - // The Scorecard attached to the repository (attestation object) - Scorecard AllCertifyScorecardScorecard `json:"scorecard"` +// CertifyGood is an attestation that a package, source, or artifact is considered +// good. +// +// All evidence trees record a justification for the property they represent as +// well as the document that contains the attestation (origin) and the collector +// that collected the document (collector). +// +// The certification applies to a subject which is a package, source, or artifact. +// If the attestation targets a package, it must target a PackageName or a +// PackageVersion. If the attestation targets a source, it must target a +// SourceName. +type AllCertifyGood struct { + Id string `json:"id"` + Justification string `json:"justification"` + Subject AllCertifyGoodSubjectPackageSourceOrArtifact `json:"-"` + Origin string `json:"origin"` + Collector string `json:"collector"` } -// GetId returns AllCertifyScorecard.Id, and is useful for accessing the field via an interface. -func (v *AllCertifyScorecard) GetId() string { return v.Id } +// GetId returns AllCertifyGood.Id, and is useful for accessing the field via an interface. +func (v *AllCertifyGood) GetId() string { return v.Id } -// GetSource returns AllCertifyScorecard.Source, and is useful for accessing the field via an interface. -func (v *AllCertifyScorecard) GetSource() AllCertifyScorecardSource { return v.Source } +// GetJustification returns AllCertifyGood.Justification, and is useful for accessing the field via an interface. +func (v *AllCertifyGood) GetJustification() string { return v.Justification } -// GetScorecard returns AllCertifyScorecard.Scorecard, and is useful for accessing the field via an interface. -func (v *AllCertifyScorecard) GetScorecard() AllCertifyScorecardScorecard { return v.Scorecard } +// GetSubject returns AllCertifyGood.Subject, and is useful for accessing the field via an interface. +func (v *AllCertifyGood) GetSubject() AllCertifyGoodSubjectPackageSourceOrArtifact { return v.Subject } -// AllCertifyScorecardScorecard includes the requested fields of the GraphQL type Scorecard. -// The GraphQL type's documentation follows. -// -// Scorecard contains all of the fields present in a Scorecard attestation. -// -// We also include fields to specify under what conditions the check was performed -// (time of scan, version of scanners, etc.) as well as how this information got -// included into GUAC (origin document and the collector for that document). -type AllCertifyScorecardScorecard struct { - // Exact timestamp when the source was last scanned (in RFC 3339 format) - TimeScanned time.Time `json:"timeScanned"` - // Overall Scorecard score for the source - AggregateScore float64 `json:"aggregateScore"` - // Individual Scorecard check scores (Branch-Protection, Code-Review, ...) - Checks []AllCertifyScorecardScorecardChecksScorecardCheck `json:"checks"` - // Version of the Scorecard scanner used to analyze the source - ScorecardVersion string `json:"scorecardVersion"` - // Commit of the Scorecards repository at the time of scanning the source - ScorecardCommit string `json:"scorecardCommit"` - // Document from which this attestation is generated from - Origin string `json:"origin"` - // GUAC collector for the document - Collector string `json:"collector"` -} +// GetOrigin returns AllCertifyGood.Origin, and is useful for accessing the field via an interface. +func (v *AllCertifyGood) GetOrigin() string { return v.Origin } -// GetTimeScanned returns AllCertifyScorecardScorecard.TimeScanned, and is useful for accessing the field via an interface. -func (v *AllCertifyScorecardScorecard) GetTimeScanned() time.Time { return v.TimeScanned } +// GetCollector returns AllCertifyGood.Collector, and is useful for accessing the field via an interface. +func (v *AllCertifyGood) GetCollector() string { return v.Collector } -// GetAggregateScore returns AllCertifyScorecardScorecard.AggregateScore, and is useful for accessing the field via an interface. -func (v *AllCertifyScorecardScorecard) GetAggregateScore() float64 { return v.AggregateScore } +func (v *AllCertifyGood) UnmarshalJSON(b []byte) error { -// GetChecks returns AllCertifyScorecardScorecard.Checks, and is useful for accessing the field via an interface. -func (v *AllCertifyScorecardScorecard) GetChecks() []AllCertifyScorecardScorecardChecksScorecardCheck { - return v.Checks + if string(b) == "null" { + return nil + } + + var firstPass struct { + *AllCertifyGood + Subject json.RawMessage `json:"subject"` + graphql.NoUnmarshalJSON + } + firstPass.AllCertifyGood = v + + err := json.Unmarshal(b, &firstPass) + if err != nil { + return err + } + + { + dst := &v.Subject + src := firstPass.Subject + if len(src) != 0 && string(src) != "null" { + err = __unmarshalAllCertifyGoodSubjectPackageSourceOrArtifact( + src, dst) + if err != nil { + return fmt.Errorf( + "unable to unmarshal AllCertifyGood.Subject: %w", err) + } + } + } + return nil } -// GetScorecardVersion returns AllCertifyScorecardScorecard.ScorecardVersion, and is useful for accessing the field via an interface. -func (v *AllCertifyScorecardScorecard) GetScorecardVersion() string { return v.ScorecardVersion } +type __premarshalAllCertifyGood struct { + Id string `json:"id"` -// GetScorecardCommit returns AllCertifyScorecardScorecard.ScorecardCommit, and is useful for accessing the field via an interface. -func (v *AllCertifyScorecardScorecard) GetScorecardCommit() string { return v.ScorecardCommit } + Justification string `json:"justification"` -// GetOrigin returns AllCertifyScorecardScorecard.Origin, and is useful for accessing the field via an interface. -func (v *AllCertifyScorecardScorecard) GetOrigin() string { return v.Origin } + Subject json.RawMessage `json:"subject"` -// GetCollector returns AllCertifyScorecardScorecard.Collector, and is useful for accessing the field via an interface. -func (v *AllCertifyScorecardScorecard) GetCollector() string { return v.Collector } + Origin string `json:"origin"` -// AllCertifyScorecardScorecardChecksScorecardCheck includes the requested fields of the GraphQL type ScorecardCheck. -// The GraphQL type's documentation follows. -// -// ScorecardCheck are the individual checks from scorecard and their values as a -// key-value pair. -// -// For example: Branch-Protection, Code-Review...etc -// -// Based off scorecard's: -// type jsonCheckResultV2 struct { -// Details []string `json:"details"` -// Score int `json:"score"` -// Reason string `json:"reason"` -// Name string `json:"name"` -// Doc jsonCheckDocumentationV2 `json:"documentation"` -// } -// This node cannot be directly referred by other parts of GUAC. -type AllCertifyScorecardScorecardChecksScorecardCheck struct { - Check string `json:"check"` - Score int `json:"score"` + Collector string `json:"collector"` } -// GetCheck returns AllCertifyScorecardScorecardChecksScorecardCheck.Check, and is useful for accessing the field via an interface. -func (v *AllCertifyScorecardScorecardChecksScorecardCheck) GetCheck() string { return v.Check } +func (v *AllCertifyGood) MarshalJSON() ([]byte, error) { + premarshaled, err := v.__premarshalJSON() + if err != nil { + return nil, err + } + return json.Marshal(premarshaled) +} -// GetScore returns AllCertifyScorecardScorecardChecksScorecardCheck.Score, and is useful for accessing the field via an interface. -func (v *AllCertifyScorecardScorecardChecksScorecardCheck) GetScore() int { return v.Score } +func (v *AllCertifyGood) __premarshalJSON() (*__premarshalAllCertifyGood, error) { + var retval __premarshalAllCertifyGood -// AllCertifyScorecardSource includes the requested fields of the GraphQL type Source. + retval.Id = v.Id + retval.Justification = v.Justification + { + + dst := &retval.Subject + src := v.Subject + var err error + *dst, err = __marshalAllCertifyGoodSubjectPackageSourceOrArtifact( + &src) + if err != nil { + return nil, fmt.Errorf( + "unable to marshal AllCertifyGood.Subject: %w", err) + } + } + retval.Origin = v.Origin + retval.Collector = v.Collector + return &retval, nil +} + +// AllCertifyGoodSubjectArtifact includes the requested fields of the GraphQL type Artifact. // The GraphQL type's documentation follows. // -// Source represents the root of the source trie/tree. -// -// We map source information to a trie, as a derivative of the pURL specification: -// each path in the trie represents a type, namespace, name and an optional -// qualifier that stands for tag/commit information. +// Artifact represents an artifact identified by a checksum hash. // -// This node represents the type part of the trie path. It is used to represent -// the version control system that is being used. +// The checksum is split into the digest value and the algorithm used to generate +// it. Both fields are mandatory and canonicalized to be lowercase. // -// Since this node is at the root of the source trie, it is named Source, not -// SourceType. -type AllCertifyScorecardSource struct { - AllSourceTree `json:"-"` +// If having a checksum Go object, algorithm can be +// strings.ToLower(string(checksum.Algorithm)) and digest can be checksum.Value. +type AllCertifyGoodSubjectArtifact struct { + Typename *string `json:"__typename"` + AllArtifactTree `json:"-"` } -// GetId returns AllCertifyScorecardSource.Id, and is useful for accessing the field via an interface. -func (v *AllCertifyScorecardSource) GetId() string { return v.AllSourceTree.Id } +// GetTypename returns AllCertifyGoodSubjectArtifact.Typename, and is useful for accessing the field via an interface. +func (v *AllCertifyGoodSubjectArtifact) GetTypename() *string { return v.Typename } -// GetType returns AllCertifyScorecardSource.Type, and is useful for accessing the field via an interface. -func (v *AllCertifyScorecardSource) GetType() string { return v.AllSourceTree.Type } +// GetId returns AllCertifyGoodSubjectArtifact.Id, and is useful for accessing the field via an interface. +func (v *AllCertifyGoodSubjectArtifact) GetId() string { return v.AllArtifactTree.Id } -// GetNamespaces returns AllCertifyScorecardSource.Namespaces, and is useful for accessing the field via an interface. -func (v *AllCertifyScorecardSource) GetNamespaces() []AllSourceTreeNamespacesSourceNamespace { - return v.AllSourceTree.Namespaces -} +// GetAlgorithm returns AllCertifyGoodSubjectArtifact.Algorithm, and is useful for accessing the field via an interface. +func (v *AllCertifyGoodSubjectArtifact) GetAlgorithm() string { return v.AllArtifactTree.Algorithm } -func (v *AllCertifyScorecardSource) UnmarshalJSON(b []byte) error { +// GetDigest returns AllCertifyGoodSubjectArtifact.Digest, and is useful for accessing the field via an interface. +func (v *AllCertifyGoodSubjectArtifact) GetDigest() string { return v.AllArtifactTree.Digest } + +func (v *AllCertifyGoodSubjectArtifact) UnmarshalJSON(b []byte) error { if string(b) == "null" { return nil } var firstPass struct { - *AllCertifyScorecardSource + *AllCertifyGoodSubjectArtifact graphql.NoUnmarshalJSON } - firstPass.AllCertifyScorecardSource = v + firstPass.AllCertifyGoodSubjectArtifact = v err := json.Unmarshal(b, &firstPass) if err != nil { @@ -650,22 +679,24 @@ func (v *AllCertifyScorecardSource) UnmarshalJSON(b []byte) error { } err = json.Unmarshal( - b, &v.AllSourceTree) + b, &v.AllArtifactTree) if err != nil { return err } return nil } -type __premarshalAllCertifyScorecardSource struct { +type __premarshalAllCertifyGoodSubjectArtifact struct { + Typename *string `json:"__typename"` + Id string `json:"id"` - Type string `json:"type"` + Algorithm string `json:"algorithm"` - Namespaces []AllSourceTreeNamespacesSourceNamespace `json:"namespaces"` + Digest string `json:"digest"` } -func (v *AllCertifyScorecardSource) MarshalJSON() ([]byte, error) { +func (v *AllCertifyGoodSubjectArtifact) MarshalJSON() ([]byte, error) { premarshaled, err := v.__premarshalJSON() if err != nil { return nil, err @@ -673,207 +704,63 @@ func (v *AllCertifyScorecardSource) MarshalJSON() ([]byte, error) { return json.Marshal(premarshaled) } -func (v *AllCertifyScorecardSource) __premarshalJSON() (*__premarshalAllCertifyScorecardSource, error) { - var retval __premarshalAllCertifyScorecardSource +func (v *AllCertifyGoodSubjectArtifact) __premarshalJSON() (*__premarshalAllCertifyGoodSubjectArtifact, error) { + var retval __premarshalAllCertifyGoodSubjectArtifact - retval.Id = v.AllSourceTree.Id - retval.Type = v.AllSourceTree.Type - retval.Namespaces = v.AllSourceTree.Namespaces + retval.Typename = v.Typename + retval.Id = v.AllArtifactTree.Id + retval.Algorithm = v.AllArtifactTree.Algorithm + retval.Digest = v.AllArtifactTree.Digest return &retval, nil } -// AllCertifyVuln includes the GraphQL fields of CertifyVuln requested by the fragment AllCertifyVuln. +// AllCertifyGoodSubjectPackage includes the requested fields of the GraphQL type Package. // The GraphQL type's documentation follows. // -// CertifyVuln is an attestation to attach vulnerability information to a package. +// Package represents the root of the package trie/tree. // -// This information is obtained via a scanner. If there is no vulnerability -// detected (no OSV, CVE, or GHSA), we attach the special NoVuln node. -type AllCertifyVuln struct { - Id string `json:"id"` - // The package that is attested - Package AllCertifyVulnPackage `json:"package"` - // The vulnerability object. Can be an OSV, CVE, or GHSA or the special NoVuln node. - Vulnerability AllCertifyVulnVulnerability `json:"-"` - // Metadata attached to the certification - Metadata AllCertifyVulnMetadataVulnerabilityMetaData `json:"metadata"` +// We map package information to a trie, closely matching the pURL specification +// (https://github.com/package-url/purl-spec/blob/0dd92f26f8bb11956ffdf5e8acfcee71e8560407/README.rst), +// but deviating from it where GUAC heuristics allow for better representation of +// package information. Each path in the trie fully represents a package; we split +// the trie based on the pURL components. +// +// This node matches a pkg: partial pURL. The type field matches the +// pURL types but we might also use "guac" for the cases where the pURL +// representation is not complete or when we have custom rules. +// +// Since this node is at the root of the package trie, it is named Package, not +// PackageType. +type AllCertifyGoodSubjectPackage struct { + Typename *string `json:"__typename"` + AllPkgTree `json:"-"` } -// GetId returns AllCertifyVuln.Id, and is useful for accessing the field via an interface. -func (v *AllCertifyVuln) GetId() string { return v.Id } +// GetTypename returns AllCertifyGoodSubjectPackage.Typename, and is useful for accessing the field via an interface. +func (v *AllCertifyGoodSubjectPackage) GetTypename() *string { return v.Typename } -// GetPackage returns AllCertifyVuln.Package, and is useful for accessing the field via an interface. -func (v *AllCertifyVuln) GetPackage() AllCertifyVulnPackage { return v.Package } +// GetId returns AllCertifyGoodSubjectPackage.Id, and is useful for accessing the field via an interface. +func (v *AllCertifyGoodSubjectPackage) GetId() string { return v.AllPkgTree.Id } -// GetVulnerability returns AllCertifyVuln.Vulnerability, and is useful for accessing the field via an interface. -func (v *AllCertifyVuln) GetVulnerability() AllCertifyVulnVulnerability { return v.Vulnerability } +// GetType returns AllCertifyGoodSubjectPackage.Type, and is useful for accessing the field via an interface. +func (v *AllCertifyGoodSubjectPackage) GetType() string { return v.AllPkgTree.Type } -// GetMetadata returns AllCertifyVuln.Metadata, and is useful for accessing the field via an interface. -func (v *AllCertifyVuln) GetMetadata() AllCertifyVulnMetadataVulnerabilityMetaData { return v.Metadata } +// GetNamespaces returns AllCertifyGoodSubjectPackage.Namespaces, and is useful for accessing the field via an interface. +func (v *AllCertifyGoodSubjectPackage) GetNamespaces() []AllPkgTreeNamespacesPackageNamespace { + return v.AllPkgTree.Namespaces +} -func (v *AllCertifyVuln) UnmarshalJSON(b []byte) error { +func (v *AllCertifyGoodSubjectPackage) UnmarshalJSON(b []byte) error { if string(b) == "null" { return nil } var firstPass struct { - *AllCertifyVuln - Vulnerability json.RawMessage `json:"vulnerability"` + *AllCertifyGoodSubjectPackage graphql.NoUnmarshalJSON } - firstPass.AllCertifyVuln = v - - err := json.Unmarshal(b, &firstPass) - if err != nil { - return err - } - - { - dst := &v.Vulnerability - src := firstPass.Vulnerability - if len(src) != 0 && string(src) != "null" { - err = __unmarshalAllCertifyVulnVulnerability( - src, dst) - if err != nil { - return fmt.Errorf( - "unable to unmarshal AllCertifyVuln.Vulnerability: %w", err) - } - } - } - return nil -} - -type __premarshalAllCertifyVuln struct { - Id string `json:"id"` - - Package AllCertifyVulnPackage `json:"package"` - - Vulnerability json.RawMessage `json:"vulnerability"` - - Metadata AllCertifyVulnMetadataVulnerabilityMetaData `json:"metadata"` -} - -func (v *AllCertifyVuln) MarshalJSON() ([]byte, error) { - premarshaled, err := v.__premarshalJSON() - if err != nil { - return nil, err - } - return json.Marshal(premarshaled) -} - -func (v *AllCertifyVuln) __premarshalJSON() (*__premarshalAllCertifyVuln, error) { - var retval __premarshalAllCertifyVuln - - retval.Id = v.Id - retval.Package = v.Package - { - - dst := &retval.Vulnerability - src := v.Vulnerability - var err error - *dst, err = __marshalAllCertifyVulnVulnerability( - &src) - if err != nil { - return nil, fmt.Errorf( - "unable to marshal AllCertifyVuln.Vulnerability: %w", err) - } - } - retval.Metadata = v.Metadata - return &retval, nil -} - -// AllCertifyVulnMetadataVulnerabilityMetaData includes the requested fields of the GraphQL type VulnerabilityMetaData. -// The GraphQL type's documentation follows. -// -// VulnerabilityMetaData is the metadata attached to vulnerability certification. -// -// It contains metadata about the scanner process that created the certification. -type AllCertifyVulnMetadataVulnerabilityMetaData struct { - // URI of the vulnerability database used by the scanner - DbUri string `json:"dbUri"` - // Version of the vulnerability database used by the scanner - DbVersion string `json:"dbVersion"` - // URI of the scanner - ScannerUri string `json:"scannerUri"` - // Version of the scanner - ScannerVersion string `json:"scannerVersion"` - // Time of scan (in RFC 3339 format) - TimeScanned time.Time `json:"timeScanned"` - // Document from which this attestation is generated from - Origin string `json:"origin"` - // GUAC collector for the document - Collector string `json:"collector"` -} - -// GetDbUri returns AllCertifyVulnMetadataVulnerabilityMetaData.DbUri, and is useful for accessing the field via an interface. -func (v *AllCertifyVulnMetadataVulnerabilityMetaData) GetDbUri() string { return v.DbUri } - -// GetDbVersion returns AllCertifyVulnMetadataVulnerabilityMetaData.DbVersion, and is useful for accessing the field via an interface. -func (v *AllCertifyVulnMetadataVulnerabilityMetaData) GetDbVersion() string { return v.DbVersion } - -// GetScannerUri returns AllCertifyVulnMetadataVulnerabilityMetaData.ScannerUri, and is useful for accessing the field via an interface. -func (v *AllCertifyVulnMetadataVulnerabilityMetaData) GetScannerUri() string { return v.ScannerUri } - -// GetScannerVersion returns AllCertifyVulnMetadataVulnerabilityMetaData.ScannerVersion, and is useful for accessing the field via an interface. -func (v *AllCertifyVulnMetadataVulnerabilityMetaData) GetScannerVersion() string { - return v.ScannerVersion -} - -// GetTimeScanned returns AllCertifyVulnMetadataVulnerabilityMetaData.TimeScanned, and is useful for accessing the field via an interface. -func (v *AllCertifyVulnMetadataVulnerabilityMetaData) GetTimeScanned() time.Time { - return v.TimeScanned -} - -// GetOrigin returns AllCertifyVulnMetadataVulnerabilityMetaData.Origin, and is useful for accessing the field via an interface. -func (v *AllCertifyVulnMetadataVulnerabilityMetaData) GetOrigin() string { return v.Origin } - -// GetCollector returns AllCertifyVulnMetadataVulnerabilityMetaData.Collector, and is useful for accessing the field via an interface. -func (v *AllCertifyVulnMetadataVulnerabilityMetaData) GetCollector() string { return v.Collector } - -// AllCertifyVulnPackage includes the requested fields of the GraphQL type Package. -// The GraphQL type's documentation follows. -// -// Package represents the root of the package trie/tree. -// -// We map package information to a trie, closely matching the pURL specification -// (https://github.com/package-url/purl-spec/blob/0dd92f26f8bb11956ffdf5e8acfcee71e8560407/README.rst), -// but deviating from it where GUAC heuristics allow for better representation of -// package information. Each path in the trie fully represents a package; we split -// the trie based on the pURL components. -// -// This node matches a pkg: partial pURL. The type field matches the -// pURL types but we might also use "guac" for the cases where the pURL -// representation is not complete or when we have custom rules. -// -// Since this node is at the root of the package trie, it is named Package, not -// PackageType. -type AllCertifyVulnPackage struct { - AllPkgTree `json:"-"` -} - -// GetId returns AllCertifyVulnPackage.Id, and is useful for accessing the field via an interface. -func (v *AllCertifyVulnPackage) GetId() string { return v.AllPkgTree.Id } - -// GetType returns AllCertifyVulnPackage.Type, and is useful for accessing the field via an interface. -func (v *AllCertifyVulnPackage) GetType() string { return v.AllPkgTree.Type } - -// GetNamespaces returns AllCertifyVulnPackage.Namespaces, and is useful for accessing the field via an interface. -func (v *AllCertifyVulnPackage) GetNamespaces() []AllPkgTreeNamespacesPackageNamespace { - return v.AllPkgTree.Namespaces -} - -func (v *AllCertifyVulnPackage) UnmarshalJSON(b []byte) error { - - if string(b) == "null" { - return nil - } - - var firstPass struct { - *AllCertifyVulnPackage - graphql.NoUnmarshalJSON - } - firstPass.AllCertifyVulnPackage = v + firstPass.AllCertifyGoodSubjectPackage = v err := json.Unmarshal(b, &firstPass) if err != nil { @@ -888,7 +775,9 @@ func (v *AllCertifyVulnPackage) UnmarshalJSON(b []byte) error { return nil } -type __premarshalAllCertifyVulnPackage struct { +type __premarshalAllCertifyGoodSubjectPackage struct { + Typename *string `json:"__typename"` + Id string `json:"id"` Type string `json:"type"` @@ -896,7 +785,7 @@ type __premarshalAllCertifyVulnPackage struct { Namespaces []AllPkgTreeNamespacesPackageNamespace `json:"namespaces"` } -func (v *AllCertifyVulnPackage) MarshalJSON() ([]byte, error) { +func (v *AllCertifyGoodSubjectPackage) MarshalJSON() ([]byte, error) { premarshaled, err := v.__premarshalJSON() if err != nil { return nil, err @@ -904,37 +793,39 @@ func (v *AllCertifyVulnPackage) MarshalJSON() ([]byte, error) { return json.Marshal(premarshaled) } -func (v *AllCertifyVulnPackage) __premarshalJSON() (*__premarshalAllCertifyVulnPackage, error) { - var retval __premarshalAllCertifyVulnPackage +func (v *AllCertifyGoodSubjectPackage) __premarshalJSON() (*__premarshalAllCertifyGoodSubjectPackage, error) { + var retval __premarshalAllCertifyGoodSubjectPackage + retval.Typename = v.Typename retval.Id = v.AllPkgTree.Id retval.Type = v.AllPkgTree.Type retval.Namespaces = v.AllPkgTree.Namespaces return &retval, nil } -// AllCertifyVulnVulnerability includes the requested fields of the GraphQL interface Vulnerability. +// AllCertifyGoodSubjectPackageSourceOrArtifact includes the requested fields of the GraphQL interface PackageSourceOrArtifact. // -// AllCertifyVulnVulnerability is implemented by the following types: -// AllCertifyVulnVulnerabilityCVE -// AllCertifyVulnVulnerabilityGHSA -// AllCertifyVulnVulnerabilityNoVuln -// AllCertifyVulnVulnerabilityOSV +// AllCertifyGoodSubjectPackageSourceOrArtifact is implemented by the following types: +// AllCertifyGoodSubjectArtifact +// AllCertifyGoodSubjectPackage +// AllCertifyGoodSubjectSource // The GraphQL type's documentation follows. // -// Vulnerability is a union of OSV, CVE, GHSA or the NoVuln node. -type AllCertifyVulnVulnerability interface { - implementsGraphQLInterfaceAllCertifyVulnVulnerability() +// PackageSourceOrArtifact is a union of Package, Source, and Artifact. +type AllCertifyGoodSubjectPackageSourceOrArtifact interface { + implementsGraphQLInterfaceAllCertifyGoodSubjectPackageSourceOrArtifact() // GetTypename returns the receiver's concrete GraphQL type-name (see interface doc for possible values). GetTypename() *string } -func (v *AllCertifyVulnVulnerabilityCVE) implementsGraphQLInterfaceAllCertifyVulnVulnerability() {} -func (v *AllCertifyVulnVulnerabilityGHSA) implementsGraphQLInterfaceAllCertifyVulnVulnerability() {} -func (v *AllCertifyVulnVulnerabilityNoVuln) implementsGraphQLInterfaceAllCertifyVulnVulnerability() {} -func (v *AllCertifyVulnVulnerabilityOSV) implementsGraphQLInterfaceAllCertifyVulnVulnerability() {} +func (v *AllCertifyGoodSubjectArtifact) implementsGraphQLInterfaceAllCertifyGoodSubjectPackageSourceOrArtifact() { +} +func (v *AllCertifyGoodSubjectPackage) implementsGraphQLInterfaceAllCertifyGoodSubjectPackageSourceOrArtifact() { +} +func (v *AllCertifyGoodSubjectSource) implementsGraphQLInterfaceAllCertifyGoodSubjectPackageSourceOrArtifact() { +} -func __unmarshalAllCertifyVulnVulnerability(b []byte, v *AllCertifyVulnVulnerability) error { +func __unmarshalAllCertifyGoodSubjectPackageSourceOrArtifact(b []byte, v *AllCertifyGoodSubjectPackageSourceOrArtifact) error { if string(b) == "null" { return nil } @@ -948,33 +839,30 @@ func __unmarshalAllCertifyVulnVulnerability(b []byte, v *AllCertifyVulnVulnerabi } switch tn.TypeName { - case "CVE": - *v = new(AllCertifyVulnVulnerabilityCVE) - return json.Unmarshal(b, *v) - case "GHSA": - *v = new(AllCertifyVulnVulnerabilityGHSA) + case "Artifact": + *v = new(AllCertifyGoodSubjectArtifact) return json.Unmarshal(b, *v) - case "NoVuln": - *v = new(AllCertifyVulnVulnerabilityNoVuln) + case "Package": + *v = new(AllCertifyGoodSubjectPackage) return json.Unmarshal(b, *v) - case "OSV": - *v = new(AllCertifyVulnVulnerabilityOSV) + case "Source": + *v = new(AllCertifyGoodSubjectSource) return json.Unmarshal(b, *v) case "": return fmt.Errorf( - "response was missing Vulnerability.__typename") + "response was missing PackageSourceOrArtifact.__typename") default: return fmt.Errorf( - `unexpected concrete type for AllCertifyVulnVulnerability: "%v"`, tn.TypeName) + `unexpected concrete type for AllCertifyGoodSubjectPackageSourceOrArtifact: "%v"`, tn.TypeName) } } -func __marshalAllCertifyVulnVulnerability(v *AllCertifyVulnVulnerability) ([]byte, error) { +func __marshalAllCertifyGoodSubjectPackageSourceOrArtifact(v *AllCertifyGoodSubjectPackageSourceOrArtifact) ([]byte, error) { var typename string switch v := (*v).(type) { - case *AllCertifyVulnVulnerabilityCVE: - typename = "CVE" + case *AllCertifyGoodSubjectArtifact: + typename = "Artifact" premarshaled, err := v.__premarshalJSON() if err != nil { @@ -982,11 +870,11 @@ func __marshalAllCertifyVulnVulnerability(v *AllCertifyVulnVulnerability) ([]byt } result := struct { TypeName string `json:"__typename"` - *__premarshalAllCertifyVulnVulnerabilityCVE + *__premarshalAllCertifyGoodSubjectArtifact }{typename, premarshaled} return json.Marshal(result) - case *AllCertifyVulnVulnerabilityGHSA: - typename = "GHSA" + case *AllCertifyGoodSubjectPackage: + typename = "Package" premarshaled, err := v.__premarshalJSON() if err != nil { @@ -994,19 +882,11 @@ func __marshalAllCertifyVulnVulnerability(v *AllCertifyVulnVulnerability) ([]byt } result := struct { TypeName string `json:"__typename"` - *__premarshalAllCertifyVulnVulnerabilityGHSA + *__premarshalAllCertifyGoodSubjectPackage }{typename, premarshaled} return json.Marshal(result) - case *AllCertifyVulnVulnerabilityNoVuln: - typename = "NoVuln" - - result := struct { - TypeName string `json:"__typename"` - *AllCertifyVulnVulnerabilityNoVuln - }{typename, v} - return json.Marshal(result) - case *AllCertifyVulnVulnerabilityOSV: - typename = "OSV" + case *AllCertifyGoodSubjectSource: + typename = "Source" premarshaled, err := v.__premarshalJSON() if err != nil { @@ -1014,58 +894,61 @@ func __marshalAllCertifyVulnVulnerability(v *AllCertifyVulnVulnerability) ([]byt } result := struct { TypeName string `json:"__typename"` - *__premarshalAllCertifyVulnVulnerabilityOSV + *__premarshalAllCertifyGoodSubjectSource }{typename, premarshaled} return json.Marshal(result) case nil: return []byte("null"), nil default: return nil, fmt.Errorf( - `unexpected concrete type for AllCertifyVulnVulnerability: "%T"`, v) + `unexpected concrete type for AllCertifyGoodSubjectPackageSourceOrArtifact: "%T"`, v) } } -// AllCertifyVulnVulnerabilityCVE includes the requested fields of the GraphQL type CVE. +// AllCertifyGoodSubjectSource includes the requested fields of the GraphQL type Source. // The GraphQL type's documentation follows. // -// CVE represents a vulnerability in the Common Vulnerabilities and Exposures -// schema. +// Source represents the root of the source trie/tree. // -// The vulnerability identifier contains a year field, so we are extracting that -// to allow matching for vulnerabilities found in a given year. +// We map source information to a trie, as a derivative of the pURL specification: +// each path in the trie represents a type, namespace, name and an optional +// qualifier that stands for tag/commit information. // -// The vulnerability identifier field is mandatory and canonicalized to be -// lowercase. +// This node represents the type part of the trie path. It is used to represent +// the version control system that is being used. // -// This node can be referred to by other parts of GUAC. -type AllCertifyVulnVulnerabilityCVE struct { - Typename *string `json:"__typename"` - AllCveTree `json:"-"` +// Since this node is at the root of the source trie, it is named Source, not +// SourceType. +type AllCertifyGoodSubjectSource struct { + Typename *string `json:"__typename"` + AllSourceTree `json:"-"` } -// GetTypename returns AllCertifyVulnVulnerabilityCVE.Typename, and is useful for accessing the field via an interface. -func (v *AllCertifyVulnVulnerabilityCVE) GetTypename() *string { return v.Typename } +// GetTypename returns AllCertifyGoodSubjectSource.Typename, and is useful for accessing the field via an interface. +func (v *AllCertifyGoodSubjectSource) GetTypename() *string { return v.Typename } -// GetId returns AllCertifyVulnVulnerabilityCVE.Id, and is useful for accessing the field via an interface. -func (v *AllCertifyVulnVulnerabilityCVE) GetId() string { return v.AllCveTree.Id } +// GetId returns AllCertifyGoodSubjectSource.Id, and is useful for accessing the field via an interface. +func (v *AllCertifyGoodSubjectSource) GetId() string { return v.AllSourceTree.Id } -// GetYear returns AllCertifyVulnVulnerabilityCVE.Year, and is useful for accessing the field via an interface. -func (v *AllCertifyVulnVulnerabilityCVE) GetYear() int { return v.AllCveTree.Year } +// GetType returns AllCertifyGoodSubjectSource.Type, and is useful for accessing the field via an interface. +func (v *AllCertifyGoodSubjectSource) GetType() string { return v.AllSourceTree.Type } -// GetCveId returns AllCertifyVulnVulnerabilityCVE.CveId, and is useful for accessing the field via an interface. -func (v *AllCertifyVulnVulnerabilityCVE) GetCveId() string { return v.AllCveTree.CveId } +// GetNamespaces returns AllCertifyGoodSubjectSource.Namespaces, and is useful for accessing the field via an interface. +func (v *AllCertifyGoodSubjectSource) GetNamespaces() []AllSourceTreeNamespacesSourceNamespace { + return v.AllSourceTree.Namespaces +} -func (v *AllCertifyVulnVulnerabilityCVE) UnmarshalJSON(b []byte) error { +func (v *AllCertifyGoodSubjectSource) UnmarshalJSON(b []byte) error { if string(b) == "null" { return nil } var firstPass struct { - *AllCertifyVulnVulnerabilityCVE + *AllCertifyGoodSubjectSource graphql.NoUnmarshalJSON } - firstPass.AllCertifyVulnVulnerabilityCVE = v + firstPass.AllCertifyGoodSubjectSource = v err := json.Unmarshal(b, &firstPass) if err != nil { @@ -1073,24 +956,24 @@ func (v *AllCertifyVulnVulnerabilityCVE) UnmarshalJSON(b []byte) error { } err = json.Unmarshal( - b, &v.AllCveTree) + b, &v.AllSourceTree) if err != nil { return err } return nil } -type __premarshalAllCertifyVulnVulnerabilityCVE struct { +type __premarshalAllCertifyGoodSubjectSource struct { Typename *string `json:"__typename"` Id string `json:"id"` - Year int `json:"year"` + Type string `json:"type"` - CveId string `json:"cveId"` + Namespaces []AllSourceTreeNamespacesSourceNamespace `json:"namespaces"` } -func (v *AllCertifyVulnVulnerabilityCVE) MarshalJSON() ([]byte, error) { +func (v *AllCertifyGoodSubjectSource) MarshalJSON() ([]byte, error) { premarshaled, err := v.__premarshalJSON() if err != nil { return nil, err @@ -1098,49 +981,154 @@ func (v *AllCertifyVulnVulnerabilityCVE) MarshalJSON() ([]byte, error) { return json.Marshal(premarshaled) } -func (v *AllCertifyVulnVulnerabilityCVE) __premarshalJSON() (*__premarshalAllCertifyVulnVulnerabilityCVE, error) { - var retval __premarshalAllCertifyVulnVulnerabilityCVE +func (v *AllCertifyGoodSubjectSource) __premarshalJSON() (*__premarshalAllCertifyGoodSubjectSource, error) { + var retval __premarshalAllCertifyGoodSubjectSource retval.Typename = v.Typename - retval.Id = v.AllCveTree.Id - retval.Year = v.AllCveTree.Year - retval.CveId = v.AllCveTree.CveId + retval.Id = v.AllSourceTree.Id + retval.Type = v.AllSourceTree.Type + retval.Namespaces = v.AllSourceTree.Namespaces return &retval, nil } -// AllCertifyVulnVulnerabilityGHSA includes the requested fields of the GraphQL type GHSA. +// AllCertifyScorecard includes the GraphQL fields of CertifyScorecard requested by the fragment AllCertifyScorecard. // The GraphQL type's documentation follows. // -// GHSA represents GitHub security advisories. +// CertifyScorecard is an attestation to attach a Scorecard analysis to a +// particular source repository. +type AllCertifyScorecard struct { + Id string `json:"id"` + // The source repository that is being scanned (attestation subject) + Source AllCertifyScorecardSource `json:"source"` + // The Scorecard attached to the repository (attestation object) + Scorecard AllCertifyScorecardScorecard `json:"scorecard"` +} + +// GetId returns AllCertifyScorecard.Id, and is useful for accessing the field via an interface. +func (v *AllCertifyScorecard) GetId() string { return v.Id } + +// GetSource returns AllCertifyScorecard.Source, and is useful for accessing the field via an interface. +func (v *AllCertifyScorecard) GetSource() AllCertifyScorecardSource { return v.Source } + +// GetScorecard returns AllCertifyScorecard.Scorecard, and is useful for accessing the field via an interface. +func (v *AllCertifyScorecard) GetScorecard() AllCertifyScorecardScorecard { return v.Scorecard } + +// AllCertifyScorecardScorecard includes the requested fields of the GraphQL type Scorecard. +// The GraphQL type's documentation follows. // -// The advisory id field is mandatory and canonicalized to be lowercase. +// Scorecard contains all of the fields present in a Scorecard attestation. // -// This node can be referred to by other parts of GUAC. -type AllCertifyVulnVulnerabilityGHSA struct { - Typename *string `json:"__typename"` - AllGHSATree `json:"-"` +// We also include fields to specify under what conditions the check was performed +// (time of scan, version of scanners, etc.) as well as how this information got +// included into GUAC (origin document and the collector for that document). +type AllCertifyScorecardScorecard struct { + // Exact timestamp when the source was last scanned (in RFC 3339 format) + TimeScanned time.Time `json:"timeScanned"` + // Overall Scorecard score for the source + AggregateScore float64 `json:"aggregateScore"` + // Individual Scorecard check scores (Branch-Protection, Code-Review, ...) + Checks []AllCertifyScorecardScorecardChecksScorecardCheck `json:"checks"` + // Version of the Scorecard scanner used to analyze the source + ScorecardVersion string `json:"scorecardVersion"` + // Commit of the Scorecards repository at the time of scanning the source + ScorecardCommit string `json:"scorecardCommit"` + // Document from which this attestation is generated from + Origin string `json:"origin"` + // GUAC collector for the document + Collector string `json:"collector"` } -// GetTypename returns AllCertifyVulnVulnerabilityGHSA.Typename, and is useful for accessing the field via an interface. -func (v *AllCertifyVulnVulnerabilityGHSA) GetTypename() *string { return v.Typename } +// GetTimeScanned returns AllCertifyScorecardScorecard.TimeScanned, and is useful for accessing the field via an interface. +func (v *AllCertifyScorecardScorecard) GetTimeScanned() time.Time { return v.TimeScanned } -// GetId returns AllCertifyVulnVulnerabilityGHSA.Id, and is useful for accessing the field via an interface. -func (v *AllCertifyVulnVulnerabilityGHSA) GetId() string { return v.AllGHSATree.Id } +// GetAggregateScore returns AllCertifyScorecardScorecard.AggregateScore, and is useful for accessing the field via an interface. +func (v *AllCertifyScorecardScorecard) GetAggregateScore() float64 { return v.AggregateScore } -// GetGhsaId returns AllCertifyVulnVulnerabilityGHSA.GhsaId, and is useful for accessing the field via an interface. -func (v *AllCertifyVulnVulnerabilityGHSA) GetGhsaId() string { return v.AllGHSATree.GhsaId } +// GetChecks returns AllCertifyScorecardScorecard.Checks, and is useful for accessing the field via an interface. +func (v *AllCertifyScorecardScorecard) GetChecks() []AllCertifyScorecardScorecardChecksScorecardCheck { + return v.Checks +} -func (v *AllCertifyVulnVulnerabilityGHSA) UnmarshalJSON(b []byte) error { +// GetScorecardVersion returns AllCertifyScorecardScorecard.ScorecardVersion, and is useful for accessing the field via an interface. +func (v *AllCertifyScorecardScorecard) GetScorecardVersion() string { return v.ScorecardVersion } + +// GetScorecardCommit returns AllCertifyScorecardScorecard.ScorecardCommit, and is useful for accessing the field via an interface. +func (v *AllCertifyScorecardScorecard) GetScorecardCommit() string { return v.ScorecardCommit } + +// GetOrigin returns AllCertifyScorecardScorecard.Origin, and is useful for accessing the field via an interface. +func (v *AllCertifyScorecardScorecard) GetOrigin() string { return v.Origin } + +// GetCollector returns AllCertifyScorecardScorecard.Collector, and is useful for accessing the field via an interface. +func (v *AllCertifyScorecardScorecard) GetCollector() string { return v.Collector } + +// AllCertifyScorecardScorecardChecksScorecardCheck includes the requested fields of the GraphQL type ScorecardCheck. +// The GraphQL type's documentation follows. +// +// ScorecardCheck are the individual checks from scorecard and their values as a +// key-value pair. +// +// For example: Branch-Protection, Code-Review...etc +// +// Based off scorecard's: +// type jsonCheckResultV2 struct { +// Details []string `json:"details"` +// Score int `json:"score"` +// Reason string `json:"reason"` +// Name string `json:"name"` +// Doc jsonCheckDocumentationV2 `json:"documentation"` +// } +// This node cannot be directly referred by other parts of GUAC. +type AllCertifyScorecardScorecardChecksScorecardCheck struct { + Check string `json:"check"` + Score int `json:"score"` +} + +// GetCheck returns AllCertifyScorecardScorecardChecksScorecardCheck.Check, and is useful for accessing the field via an interface. +func (v *AllCertifyScorecardScorecardChecksScorecardCheck) GetCheck() string { return v.Check } + +// GetScore returns AllCertifyScorecardScorecardChecksScorecardCheck.Score, and is useful for accessing the field via an interface. +func (v *AllCertifyScorecardScorecardChecksScorecardCheck) GetScore() int { return v.Score } + +// AllCertifyScorecardSource includes the requested fields of the GraphQL type Source. +// The GraphQL type's documentation follows. +// +// Source represents the root of the source trie/tree. +// +// We map source information to a trie, as a derivative of the pURL specification: +// each path in the trie represents a type, namespace, name and an optional +// qualifier that stands for tag/commit information. +// +// This node represents the type part of the trie path. It is used to represent +// the version control system that is being used. +// +// Since this node is at the root of the source trie, it is named Source, not +// SourceType. +type AllCertifyScorecardSource struct { + AllSourceTree `json:"-"` +} + +// GetId returns AllCertifyScorecardSource.Id, and is useful for accessing the field via an interface. +func (v *AllCertifyScorecardSource) GetId() string { return v.AllSourceTree.Id } + +// GetType returns AllCertifyScorecardSource.Type, and is useful for accessing the field via an interface. +func (v *AllCertifyScorecardSource) GetType() string { return v.AllSourceTree.Type } + +// GetNamespaces returns AllCertifyScorecardSource.Namespaces, and is useful for accessing the field via an interface. +func (v *AllCertifyScorecardSource) GetNamespaces() []AllSourceTreeNamespacesSourceNamespace { + return v.AllSourceTree.Namespaces +} + +func (v *AllCertifyScorecardSource) UnmarshalJSON(b []byte) error { if string(b) == "null" { return nil } var firstPass struct { - *AllCertifyVulnVulnerabilityGHSA + *AllCertifyScorecardSource graphql.NoUnmarshalJSON } - firstPass.AllCertifyVulnVulnerabilityGHSA = v + firstPass.AllCertifyScorecardSource = v err := json.Unmarshal(b, &firstPass) if err != nil { @@ -1148,22 +1136,22 @@ func (v *AllCertifyVulnVulnerabilityGHSA) UnmarshalJSON(b []byte) error { } err = json.Unmarshal( - b, &v.AllGHSATree) + b, &v.AllSourceTree) if err != nil { return err } return nil } -type __premarshalAllCertifyVulnVulnerabilityGHSA struct { - Typename *string `json:"__typename"` - +type __premarshalAllCertifyScorecardSource struct { Id string `json:"id"` - GhsaId string `json:"ghsaId"` + Type string `json:"type"` + + Namespaces []AllSourceTreeNamespacesSourceNamespace `json:"namespaces"` } -func (v *AllCertifyVulnVulnerabilityGHSA) MarshalJSON() ([]byte, error) { +func (v *AllCertifyScorecardSource) MarshalJSON() ([]byte, error) { premarshaled, err := v.__premarshalJSON() if err != nil { return nil, err @@ -1171,243 +1159,146 @@ func (v *AllCertifyVulnVulnerabilityGHSA) MarshalJSON() ([]byte, error) { return json.Marshal(premarshaled) } -func (v *AllCertifyVulnVulnerabilityGHSA) __premarshalJSON() (*__premarshalAllCertifyVulnVulnerabilityGHSA, error) { - var retval __premarshalAllCertifyVulnVulnerabilityGHSA +func (v *AllCertifyScorecardSource) __premarshalJSON() (*__premarshalAllCertifyScorecardSource, error) { + var retval __premarshalAllCertifyScorecardSource - retval.Typename = v.Typename - retval.Id = v.AllGHSATree.Id - retval.GhsaId = v.AllGHSATree.GhsaId + retval.Id = v.AllSourceTree.Id + retval.Type = v.AllSourceTree.Type + retval.Namespaces = v.AllSourceTree.Namespaces return &retval, nil } -// AllCertifyVulnVulnerabilityNoVuln includes the requested fields of the GraphQL type NoVuln. +// AllCertifyVEXStatement includes the GraphQL fields of CertifyVEXStatement requested by the fragment AllCertifyVEXStatement. // The GraphQL type's documentation follows. // -// NoVuln is a special vulnerability node to attest that no vulnerability has been -// found during a vulnerability scan. -// -// Backends guarantee that this is a singleton node. -type AllCertifyVulnVulnerabilityNoVuln struct { - Typename *string `json:"__typename"` - Id string `json:"id"` +// CertifyVEXStatement is an attestation to attach VEX statements to a package or +// artifact to clarify the impact of a specific vulnerability (CVE, GHSA or OSV). +type AllCertifyVEXStatement struct { + Id string `json:"id"` + // Subject of attestation + Subject AllCertifyVEXStatementSubjectPackageOrArtifact `json:"-"` + // Attested vulnerability + Vulnerability AllCertifyVEXStatementVulnerability `json:"-"` + // Status of the vulnerabilities with respect to the subject + Status VexStatus `json:"status"` + // Justification from VEX statement + VexJustification VexJustification `json:"vexJustification"` + // VEX statement: impact_statement or action_statement depending on status + Statement string `json:"statement"` + // statusNotes may convey information about how status was determined + StatusNotes string `json:"statusNotes"` + // Timestamp (exact time in RFC 3339 format) for the VEX statement + KnownSince time.Time `json:"knownSince"` + // Document from which this attestation is generated from + Origin string `json:"origin"` + // GUAC collector for the document + Collector string `json:"collector"` } -// GetTypename returns AllCertifyVulnVulnerabilityNoVuln.Typename, and is useful for accessing the field via an interface. -func (v *AllCertifyVulnVulnerabilityNoVuln) GetTypename() *string { return v.Typename } +// GetId returns AllCertifyVEXStatement.Id, and is useful for accessing the field via an interface. +func (v *AllCertifyVEXStatement) GetId() string { return v.Id } -// GetId returns AllCertifyVulnVulnerabilityNoVuln.Id, and is useful for accessing the field via an interface. -func (v *AllCertifyVulnVulnerabilityNoVuln) GetId() string { return v.Id } +// GetSubject returns AllCertifyVEXStatement.Subject, and is useful for accessing the field via an interface. +func (v *AllCertifyVEXStatement) GetSubject() AllCertifyVEXStatementSubjectPackageOrArtifact { + return v.Subject +} -// AllCertifyVulnVulnerabilityOSV includes the requested fields of the GraphQL type OSV. -// The GraphQL type's documentation follows. -// -// OSV represents an Open Source Vulnerability. -// -// The osvId field is mandatory and canonicalized to be lowercase. -// -// This maps to a vulnerability ID specific to the environment (e.g., GHSA ID or -// CVE ID). -// -// This node can be referred to by other parts of GUAC. -type AllCertifyVulnVulnerabilityOSV struct { - Typename *string `json:"__typename"` - AllOSVTree `json:"-"` +// GetVulnerability returns AllCertifyVEXStatement.Vulnerability, and is useful for accessing the field via an interface. +func (v *AllCertifyVEXStatement) GetVulnerability() AllCertifyVEXStatementVulnerability { + return v.Vulnerability } -// GetTypename returns AllCertifyVulnVulnerabilityOSV.Typename, and is useful for accessing the field via an interface. -func (v *AllCertifyVulnVulnerabilityOSV) GetTypename() *string { return v.Typename } +// GetStatus returns AllCertifyVEXStatement.Status, and is useful for accessing the field via an interface. +func (v *AllCertifyVEXStatement) GetStatus() VexStatus { return v.Status } -// GetId returns AllCertifyVulnVulnerabilityOSV.Id, and is useful for accessing the field via an interface. -func (v *AllCertifyVulnVulnerabilityOSV) GetId() string { return v.AllOSVTree.Id } +// GetVexJustification returns AllCertifyVEXStatement.VexJustification, and is useful for accessing the field via an interface. +func (v *AllCertifyVEXStatement) GetVexJustification() VexJustification { return v.VexJustification } -// GetOsvId returns AllCertifyVulnVulnerabilityOSV.OsvId, and is useful for accessing the field via an interface. -func (v *AllCertifyVulnVulnerabilityOSV) GetOsvId() string { return v.AllOSVTree.OsvId } +// GetStatement returns AllCertifyVEXStatement.Statement, and is useful for accessing the field via an interface. +func (v *AllCertifyVEXStatement) GetStatement() string { return v.Statement } -func (v *AllCertifyVulnVulnerabilityOSV) UnmarshalJSON(b []byte) error { +// GetStatusNotes returns AllCertifyVEXStatement.StatusNotes, and is useful for accessing the field via an interface. +func (v *AllCertifyVEXStatement) GetStatusNotes() string { return v.StatusNotes } + +// GetKnownSince returns AllCertifyVEXStatement.KnownSince, and is useful for accessing the field via an interface. +func (v *AllCertifyVEXStatement) GetKnownSince() time.Time { return v.KnownSince } + +// GetOrigin returns AllCertifyVEXStatement.Origin, and is useful for accessing the field via an interface. +func (v *AllCertifyVEXStatement) GetOrigin() string { return v.Origin } + +// GetCollector returns AllCertifyVEXStatement.Collector, and is useful for accessing the field via an interface. +func (v *AllCertifyVEXStatement) GetCollector() string { return v.Collector } + +func (v *AllCertifyVEXStatement) UnmarshalJSON(b []byte) error { if string(b) == "null" { return nil } var firstPass struct { - *AllCertifyVulnVulnerabilityOSV + *AllCertifyVEXStatement + Subject json.RawMessage `json:"subject"` + Vulnerability json.RawMessage `json:"vulnerability"` graphql.NoUnmarshalJSON } - firstPass.AllCertifyVulnVulnerabilityOSV = v + firstPass.AllCertifyVEXStatement = v err := json.Unmarshal(b, &firstPass) if err != nil { return err } - err = json.Unmarshal( - b, &v.AllOSVTree) - if err != nil { - return err + { + dst := &v.Subject + src := firstPass.Subject + if len(src) != 0 && string(src) != "null" { + err = __unmarshalAllCertifyVEXStatementSubjectPackageOrArtifact( + src, dst) + if err != nil { + return fmt.Errorf( + "unable to unmarshal AllCertifyVEXStatement.Subject: %w", err) + } + } + } + + { + dst := &v.Vulnerability + src := firstPass.Vulnerability + if len(src) != 0 && string(src) != "null" { + err = __unmarshalAllCertifyVEXStatementVulnerability( + src, dst) + if err != nil { + return fmt.Errorf( + "unable to unmarshal AllCertifyVEXStatement.Vulnerability: %w", err) + } + } } return nil } -type __premarshalAllCertifyVulnVulnerabilityOSV struct { - Typename *string `json:"__typename"` - +type __premarshalAllCertifyVEXStatement struct { Id string `json:"id"` - OsvId string `json:"osvId"` -} + Subject json.RawMessage `json:"subject"` -func (v *AllCertifyVulnVulnerabilityOSV) MarshalJSON() ([]byte, error) { - premarshaled, err := v.__premarshalJSON() - if err != nil { - return nil, err - } - return json.Marshal(premarshaled) -} - -func (v *AllCertifyVulnVulnerabilityOSV) __premarshalJSON() (*__premarshalAllCertifyVulnVulnerabilityOSV, error) { - var retval __premarshalAllCertifyVulnVulnerabilityOSV - - retval.Typename = v.Typename - retval.Id = v.AllOSVTree.Id - retval.OsvId = v.AllOSVTree.OsvId - return &retval, nil -} - -// AllCveTree includes the GraphQL fields of CVE requested by the fragment AllCveTree. -// The GraphQL type's documentation follows. -// -// CVE represents a vulnerability in the Common Vulnerabilities and Exposures -// schema. -// -// The vulnerability identifier contains a year field, so we are extracting that -// to allow matching for vulnerabilities found in a given year. -// -// The vulnerability identifier field is mandatory and canonicalized to be -// lowercase. -// -// This node can be referred to by other parts of GUAC. -type AllCveTree struct { - Id string `json:"id"` - Year int `json:"year"` - CveId string `json:"cveId"` -} - -// GetId returns AllCveTree.Id, and is useful for accessing the field via an interface. -func (v *AllCveTree) GetId() string { return v.Id } - -// GetYear returns AllCveTree.Year, and is useful for accessing the field via an interface. -func (v *AllCveTree) GetYear() int { return v.Year } - -// GetCveId returns AllCveTree.CveId, and is useful for accessing the field via an interface. -func (v *AllCveTree) GetCveId() string { return v.CveId } - -// AllGHSATree includes the GraphQL fields of GHSA requested by the fragment AllGHSATree. -// The GraphQL type's documentation follows. -// -// GHSA represents GitHub security advisories. -// -// The advisory id field is mandatory and canonicalized to be lowercase. -// -// This node can be referred to by other parts of GUAC. -type AllGHSATree struct { - Id string `json:"id"` - GhsaId string `json:"ghsaId"` -} - -// GetId returns AllGHSATree.Id, and is useful for accessing the field via an interface. -func (v *AllGHSATree) GetId() string { return v.Id } - -// GetGhsaId returns AllGHSATree.GhsaId, and is useful for accessing the field via an interface. -func (v *AllGHSATree) GetGhsaId() string { return v.GhsaId } - -// AllIsOccurrencesTree includes the GraphQL fields of IsOccurrence requested by the fragment AllIsOccurrencesTree. -// The GraphQL type's documentation follows. -// -// IsOccurrence is an attestation to link an artifact to a package or source. -// -// Attestation must occur at the PackageVersion or at the SourceName. -type AllIsOccurrencesTree struct { - Id string `json:"id"` - // Package or source from which the artifact originates - Subject AllIsOccurrencesTreeSubjectPackageOrSource `json:"-"` - // The artifact in the relationship - Artifact AllIsOccurrencesTreeArtifact `json:"artifact"` - // Justification for the attested relationship - Justification string `json:"justification"` - // Document from which this attestation is generated from - Origin string `json:"origin"` - // GUAC collector for the document - Collector string `json:"collector"` -} - -// GetId returns AllIsOccurrencesTree.Id, and is useful for accessing the field via an interface. -func (v *AllIsOccurrencesTree) GetId() string { return v.Id } - -// GetSubject returns AllIsOccurrencesTree.Subject, and is useful for accessing the field via an interface. -func (v *AllIsOccurrencesTree) GetSubject() AllIsOccurrencesTreeSubjectPackageOrSource { - return v.Subject -} - -// GetArtifact returns AllIsOccurrencesTree.Artifact, and is useful for accessing the field via an interface. -func (v *AllIsOccurrencesTree) GetArtifact() AllIsOccurrencesTreeArtifact { return v.Artifact } - -// GetJustification returns AllIsOccurrencesTree.Justification, and is useful for accessing the field via an interface. -func (v *AllIsOccurrencesTree) GetJustification() string { return v.Justification } - -// GetOrigin returns AllIsOccurrencesTree.Origin, and is useful for accessing the field via an interface. -func (v *AllIsOccurrencesTree) GetOrigin() string { return v.Origin } - -// GetCollector returns AllIsOccurrencesTree.Collector, and is useful for accessing the field via an interface. -func (v *AllIsOccurrencesTree) GetCollector() string { return v.Collector } - -func (v *AllIsOccurrencesTree) UnmarshalJSON(b []byte) error { - - if string(b) == "null" { - return nil - } - - var firstPass struct { - *AllIsOccurrencesTree - Subject json.RawMessage `json:"subject"` - graphql.NoUnmarshalJSON - } - firstPass.AllIsOccurrencesTree = v - - err := json.Unmarshal(b, &firstPass) - if err != nil { - return err - } + Vulnerability json.RawMessage `json:"vulnerability"` - { - dst := &v.Subject - src := firstPass.Subject - if len(src) != 0 && string(src) != "null" { - err = __unmarshalAllIsOccurrencesTreeSubjectPackageOrSource( - src, dst) - if err != nil { - return fmt.Errorf( - "unable to unmarshal AllIsOccurrencesTree.Subject: %w", err) - } - } - } - return nil -} + Status VexStatus `json:"status"` -type __premarshalAllIsOccurrencesTree struct { - Id string `json:"id"` + VexJustification VexJustification `json:"vexJustification"` - Subject json.RawMessage `json:"subject"` + Statement string `json:"statement"` - Artifact AllIsOccurrencesTreeArtifact `json:"artifact"` + StatusNotes string `json:"statusNotes"` - Justification string `json:"justification"` + KnownSince time.Time `json:"knownSince"` Origin string `json:"origin"` Collector string `json:"collector"` } -func (v *AllIsOccurrencesTree) MarshalJSON() ([]byte, error) { +func (v *AllCertifyVEXStatement) MarshalJSON() ([]byte, error) { premarshaled, err := v.__premarshalJSON() if err != nil { return nil, err @@ -1415,8 +1306,8 @@ func (v *AllIsOccurrencesTree) MarshalJSON() ([]byte, error) { return json.Marshal(premarshaled) } -func (v *AllIsOccurrencesTree) __premarshalJSON() (*__premarshalAllIsOccurrencesTree, error) { - var retval __premarshalAllIsOccurrencesTree +func (v *AllCertifyVEXStatement) __premarshalJSON() (*__premarshalAllCertifyVEXStatement, error) { + var retval __premarshalAllCertifyVEXStatement retval.Id = v.Id { @@ -1424,21 +1315,36 @@ func (v *AllIsOccurrencesTree) __premarshalJSON() (*__premarshalAllIsOccurrences dst := &retval.Subject src := v.Subject var err error - *dst, err = __marshalAllIsOccurrencesTreeSubjectPackageOrSource( + *dst, err = __marshalAllCertifyVEXStatementSubjectPackageOrArtifact( &src) if err != nil { return nil, fmt.Errorf( - "unable to marshal AllIsOccurrencesTree.Subject: %w", err) + "unable to marshal AllCertifyVEXStatement.Subject: %w", err) } } - retval.Artifact = v.Artifact - retval.Justification = v.Justification + { + + dst := &retval.Vulnerability + src := v.Vulnerability + var err error + *dst, err = __marshalAllCertifyVEXStatementVulnerability( + &src) + if err != nil { + return nil, fmt.Errorf( + "unable to marshal AllCertifyVEXStatement.Vulnerability: %w", err) + } + } + retval.Status = v.Status + retval.VexJustification = v.VexJustification + retval.Statement = v.Statement + retval.StatusNotes = v.StatusNotes + retval.KnownSince = v.KnownSince retval.Origin = v.Origin retval.Collector = v.Collector return &retval, nil } -// AllIsOccurrencesTreeArtifact includes the requested fields of the GraphQL type Artifact. +// AllCertifyVEXStatementSubjectArtifact includes the requested fields of the GraphQL type Artifact. // The GraphQL type's documentation follows. // // Artifact represents an artifact identified by a checksum hash. @@ -1448,30 +1354,36 @@ func (v *AllIsOccurrencesTree) __premarshalJSON() (*__premarshalAllIsOccurrences // // If having a checksum Go object, algorithm can be // strings.ToLower(string(checksum.Algorithm)) and digest can be checksum.Value. -type AllIsOccurrencesTreeArtifact struct { +type AllCertifyVEXStatementSubjectArtifact struct { + Typename *string `json:"__typename"` AllArtifactTree `json:"-"` } -// GetId returns AllIsOccurrencesTreeArtifact.Id, and is useful for accessing the field via an interface. -func (v *AllIsOccurrencesTreeArtifact) GetId() string { return v.AllArtifactTree.Id } +// GetTypename returns AllCertifyVEXStatementSubjectArtifact.Typename, and is useful for accessing the field via an interface. +func (v *AllCertifyVEXStatementSubjectArtifact) GetTypename() *string { return v.Typename } -// GetAlgorithm returns AllIsOccurrencesTreeArtifact.Algorithm, and is useful for accessing the field via an interface. -func (v *AllIsOccurrencesTreeArtifact) GetAlgorithm() string { return v.AllArtifactTree.Algorithm } +// GetId returns AllCertifyVEXStatementSubjectArtifact.Id, and is useful for accessing the field via an interface. +func (v *AllCertifyVEXStatementSubjectArtifact) GetId() string { return v.AllArtifactTree.Id } -// GetDigest returns AllIsOccurrencesTreeArtifact.Digest, and is useful for accessing the field via an interface. -func (v *AllIsOccurrencesTreeArtifact) GetDigest() string { return v.AllArtifactTree.Digest } +// GetAlgorithm returns AllCertifyVEXStatementSubjectArtifact.Algorithm, and is useful for accessing the field via an interface. +func (v *AllCertifyVEXStatementSubjectArtifact) GetAlgorithm() string { + return v.AllArtifactTree.Algorithm +} -func (v *AllIsOccurrencesTreeArtifact) UnmarshalJSON(b []byte) error { +// GetDigest returns AllCertifyVEXStatementSubjectArtifact.Digest, and is useful for accessing the field via an interface. +func (v *AllCertifyVEXStatementSubjectArtifact) GetDigest() string { return v.AllArtifactTree.Digest } + +func (v *AllCertifyVEXStatementSubjectArtifact) UnmarshalJSON(b []byte) error { if string(b) == "null" { return nil } var firstPass struct { - *AllIsOccurrencesTreeArtifact + *AllCertifyVEXStatementSubjectArtifact graphql.NoUnmarshalJSON } - firstPass.AllIsOccurrencesTreeArtifact = v + firstPass.AllCertifyVEXStatementSubjectArtifact = v err := json.Unmarshal(b, &firstPass) if err != nil { @@ -1486,7 +1398,9 @@ func (v *AllIsOccurrencesTreeArtifact) UnmarshalJSON(b []byte) error { return nil } -type __premarshalAllIsOccurrencesTreeArtifact struct { +type __premarshalAllCertifyVEXStatementSubjectArtifact struct { + Typename *string `json:"__typename"` + Id string `json:"id"` Algorithm string `json:"algorithm"` @@ -1494,7 +1408,7 @@ type __premarshalAllIsOccurrencesTreeArtifact struct { Digest string `json:"digest"` } -func (v *AllIsOccurrencesTreeArtifact) MarshalJSON() ([]byte, error) { +func (v *AllCertifyVEXStatementSubjectArtifact) MarshalJSON() ([]byte, error) { premarshaled, err := v.__premarshalJSON() if err != nil { return nil, err @@ -1502,16 +1416,17 @@ func (v *AllIsOccurrencesTreeArtifact) MarshalJSON() ([]byte, error) { return json.Marshal(premarshaled) } -func (v *AllIsOccurrencesTreeArtifact) __premarshalJSON() (*__premarshalAllIsOccurrencesTreeArtifact, error) { - var retval __premarshalAllIsOccurrencesTreeArtifact +func (v *AllCertifyVEXStatementSubjectArtifact) __premarshalJSON() (*__premarshalAllCertifyVEXStatementSubjectArtifact, error) { + var retval __premarshalAllCertifyVEXStatementSubjectArtifact + retval.Typename = v.Typename retval.Id = v.AllArtifactTree.Id retval.Algorithm = v.AllArtifactTree.Algorithm retval.Digest = v.AllArtifactTree.Digest return &retval, nil } -// AllIsOccurrencesTreeSubjectPackage includes the requested fields of the GraphQL type Package. +// AllCertifyVEXStatementSubjectPackage includes the requested fields of the GraphQL type Package. // The GraphQL type's documentation follows. // // Package represents the root of the package trie/tree. @@ -1528,36 +1443,36 @@ func (v *AllIsOccurrencesTreeArtifact) __premarshalJSON() (*__premarshalAllIsOcc // // Since this node is at the root of the package trie, it is named Package, not // PackageType. -type AllIsOccurrencesTreeSubjectPackage struct { +type AllCertifyVEXStatementSubjectPackage struct { Typename *string `json:"__typename"` AllPkgTree `json:"-"` } -// GetTypename returns AllIsOccurrencesTreeSubjectPackage.Typename, and is useful for accessing the field via an interface. -func (v *AllIsOccurrencesTreeSubjectPackage) GetTypename() *string { return v.Typename } +// GetTypename returns AllCertifyVEXStatementSubjectPackage.Typename, and is useful for accessing the field via an interface. +func (v *AllCertifyVEXStatementSubjectPackage) GetTypename() *string { return v.Typename } -// GetId returns AllIsOccurrencesTreeSubjectPackage.Id, and is useful for accessing the field via an interface. -func (v *AllIsOccurrencesTreeSubjectPackage) GetId() string { return v.AllPkgTree.Id } +// GetId returns AllCertifyVEXStatementSubjectPackage.Id, and is useful for accessing the field via an interface. +func (v *AllCertifyVEXStatementSubjectPackage) GetId() string { return v.AllPkgTree.Id } -// GetType returns AllIsOccurrencesTreeSubjectPackage.Type, and is useful for accessing the field via an interface. -func (v *AllIsOccurrencesTreeSubjectPackage) GetType() string { return v.AllPkgTree.Type } +// GetType returns AllCertifyVEXStatementSubjectPackage.Type, and is useful for accessing the field via an interface. +func (v *AllCertifyVEXStatementSubjectPackage) GetType() string { return v.AllPkgTree.Type } -// GetNamespaces returns AllIsOccurrencesTreeSubjectPackage.Namespaces, and is useful for accessing the field via an interface. -func (v *AllIsOccurrencesTreeSubjectPackage) GetNamespaces() []AllPkgTreeNamespacesPackageNamespace { +// GetNamespaces returns AllCertifyVEXStatementSubjectPackage.Namespaces, and is useful for accessing the field via an interface. +func (v *AllCertifyVEXStatementSubjectPackage) GetNamespaces() []AllPkgTreeNamespacesPackageNamespace { return v.AllPkgTree.Namespaces } -func (v *AllIsOccurrencesTreeSubjectPackage) UnmarshalJSON(b []byte) error { +func (v *AllCertifyVEXStatementSubjectPackage) UnmarshalJSON(b []byte) error { if string(b) == "null" { return nil } var firstPass struct { - *AllIsOccurrencesTreeSubjectPackage + *AllCertifyVEXStatementSubjectPackage graphql.NoUnmarshalJSON } - firstPass.AllIsOccurrencesTreeSubjectPackage = v + firstPass.AllCertifyVEXStatementSubjectPackage = v err := json.Unmarshal(b, &firstPass) if err != nil { @@ -1572,7 +1487,7 @@ func (v *AllIsOccurrencesTreeSubjectPackage) UnmarshalJSON(b []byte) error { return nil } -type __premarshalAllIsOccurrencesTreeSubjectPackage struct { +type __premarshalAllCertifyVEXStatementSubjectPackage struct { Typename *string `json:"__typename"` Id string `json:"id"` @@ -1582,7 +1497,7 @@ type __premarshalAllIsOccurrencesTreeSubjectPackage struct { Namespaces []AllPkgTreeNamespacesPackageNamespace `json:"namespaces"` } -func (v *AllIsOccurrencesTreeSubjectPackage) MarshalJSON() ([]byte, error) { +func (v *AllCertifyVEXStatementSubjectPackage) MarshalJSON() ([]byte, error) { premarshaled, err := v.__premarshalJSON() if err != nil { return nil, err @@ -1590,8 +1505,8 @@ func (v *AllIsOccurrencesTreeSubjectPackage) MarshalJSON() ([]byte, error) { return json.Marshal(premarshaled) } -func (v *AllIsOccurrencesTreeSubjectPackage) __premarshalJSON() (*__premarshalAllIsOccurrencesTreeSubjectPackage, error) { - var retval __premarshalAllIsOccurrencesTreeSubjectPackage +func (v *AllCertifyVEXStatementSubjectPackage) __premarshalJSON() (*__premarshalAllCertifyVEXStatementSubjectPackage, error) { + var retval __premarshalAllCertifyVEXStatementSubjectPackage retval.Typename = v.Typename retval.Id = v.AllPkgTree.Id @@ -1600,26 +1515,26 @@ func (v *AllIsOccurrencesTreeSubjectPackage) __premarshalJSON() (*__premarshalAl return &retval, nil } -// AllIsOccurrencesTreeSubjectPackageOrSource includes the requested fields of the GraphQL interface PackageOrSource. +// AllCertifyVEXStatementSubjectPackageOrArtifact includes the requested fields of the GraphQL interface PackageOrArtifact. // -// AllIsOccurrencesTreeSubjectPackageOrSource is implemented by the following types: -// AllIsOccurrencesTreeSubjectPackage -// AllIsOccurrencesTreeSubjectSource +// AllCertifyVEXStatementSubjectPackageOrArtifact is implemented by the following types: +// AllCertifyVEXStatementSubjectArtifact +// AllCertifyVEXStatementSubjectPackage // The GraphQL type's documentation follows. // -// PackageOrSource is a union of Package and Source. -type AllIsOccurrencesTreeSubjectPackageOrSource interface { - implementsGraphQLInterfaceAllIsOccurrencesTreeSubjectPackageOrSource() +// PackageOrArtifact is a union of Package and Artifact. +type AllCertifyVEXStatementSubjectPackageOrArtifact interface { + implementsGraphQLInterfaceAllCertifyVEXStatementSubjectPackageOrArtifact() // GetTypename returns the receiver's concrete GraphQL type-name (see interface doc for possible values). GetTypename() *string } -func (v *AllIsOccurrencesTreeSubjectPackage) implementsGraphQLInterfaceAllIsOccurrencesTreeSubjectPackageOrSource() { +func (v *AllCertifyVEXStatementSubjectArtifact) implementsGraphQLInterfaceAllCertifyVEXStatementSubjectPackageOrArtifact() { } -func (v *AllIsOccurrencesTreeSubjectSource) implementsGraphQLInterfaceAllIsOccurrencesTreeSubjectPackageOrSource() { +func (v *AllCertifyVEXStatementSubjectPackage) implementsGraphQLInterfaceAllCertifyVEXStatementSubjectPackageOrArtifact() { } -func __unmarshalAllIsOccurrencesTreeSubjectPackageOrSource(b []byte, v *AllIsOccurrencesTreeSubjectPackageOrSource) error { +func __unmarshalAllCertifyVEXStatementSubjectPackageOrArtifact(b []byte, v *AllCertifyVEXStatementSubjectPackageOrArtifact) error { if string(b) == "null" { return nil } @@ -1633,27 +1548,27 @@ func __unmarshalAllIsOccurrencesTreeSubjectPackageOrSource(b []byte, v *AllIsOcc } switch tn.TypeName { - case "Package": - *v = new(AllIsOccurrencesTreeSubjectPackage) + case "Artifact": + *v = new(AllCertifyVEXStatementSubjectArtifact) return json.Unmarshal(b, *v) - case "Source": - *v = new(AllIsOccurrencesTreeSubjectSource) + case "Package": + *v = new(AllCertifyVEXStatementSubjectPackage) return json.Unmarshal(b, *v) case "": return fmt.Errorf( - "response was missing PackageOrSource.__typename") + "response was missing PackageOrArtifact.__typename") default: return fmt.Errorf( - `unexpected concrete type for AllIsOccurrencesTreeSubjectPackageOrSource: "%v"`, tn.TypeName) + `unexpected concrete type for AllCertifyVEXStatementSubjectPackageOrArtifact: "%v"`, tn.TypeName) } } -func __marshalAllIsOccurrencesTreeSubjectPackageOrSource(v *AllIsOccurrencesTreeSubjectPackageOrSource) ([]byte, error) { +func __marshalAllCertifyVEXStatementSubjectPackageOrArtifact(v *AllCertifyVEXStatementSubjectPackageOrArtifact) ([]byte, error) { var typename string switch v := (*v).(type) { - case *AllIsOccurrencesTreeSubjectPackage: - typename = "Package" + case *AllCertifyVEXStatementSubjectArtifact: + typename = "Artifact" premarshaled, err := v.__premarshalJSON() if err != nil { @@ -1661,11 +1576,11 @@ func __marshalAllIsOccurrencesTreeSubjectPackageOrSource(v *AllIsOccurrencesTree } result := struct { TypeName string `json:"__typename"` - *__premarshalAllIsOccurrencesTreeSubjectPackage + *__premarshalAllCertifyVEXStatementSubjectArtifact }{typename, premarshaled} return json.Marshal(result) - case *AllIsOccurrencesTreeSubjectSource: - typename = "Source" + case *AllCertifyVEXStatementSubjectPackage: + typename = "Package" premarshaled, err := v.__premarshalJSON() if err != nil { @@ -1673,61 +1588,174 @@ func __marshalAllIsOccurrencesTreeSubjectPackageOrSource(v *AllIsOccurrencesTree } result := struct { TypeName string `json:"__typename"` - *__premarshalAllIsOccurrencesTreeSubjectSource + *__premarshalAllCertifyVEXStatementSubjectPackage }{typename, premarshaled} return json.Marshal(result) case nil: return []byte("null"), nil default: return nil, fmt.Errorf( - `unexpected concrete type for AllIsOccurrencesTreeSubjectPackageOrSource: "%T"`, v) + `unexpected concrete type for AllCertifyVEXStatementSubjectPackageOrArtifact: "%T"`, v) } } -// AllIsOccurrencesTreeSubjectSource includes the requested fields of the GraphQL type Source. -// The GraphQL type's documentation follows. -// -// Source represents the root of the source trie/tree. -// -// We map source information to a trie, as a derivative of the pURL specification: -// each path in the trie represents a type, namespace, name and an optional -// qualifier that stands for tag/commit information. +// AllCertifyVEXStatementVulnerability includes the requested fields of the GraphQL interface Vulnerability. // -// This node represents the type part of the trie path. It is used to represent -// the version control system that is being used. +// AllCertifyVEXStatementVulnerability is implemented by the following types: +// AllCertifyVEXStatementVulnerabilityCVE +// AllCertifyVEXStatementVulnerabilityGHSA +// AllCertifyVEXStatementVulnerabilityNoVuln +// AllCertifyVEXStatementVulnerabilityOSV +// The GraphQL type's documentation follows. // -// Since this node is at the root of the source trie, it is named Source, not -// SourceType. -type AllIsOccurrencesTreeSubjectSource struct { - Typename *string `json:"__typename"` - AllSourceTree `json:"-"` +// Vulnerability is a union of OSV, CVE, GHSA or the NoVuln node. +type AllCertifyVEXStatementVulnerability interface { + implementsGraphQLInterfaceAllCertifyVEXStatementVulnerability() + // GetTypename returns the receiver's concrete GraphQL type-name (see interface doc for possible values). + GetTypename() *string } -// GetTypename returns AllIsOccurrencesTreeSubjectSource.Typename, and is useful for accessing the field via an interface. -func (v *AllIsOccurrencesTreeSubjectSource) GetTypename() *string { return v.Typename } - -// GetId returns AllIsOccurrencesTreeSubjectSource.Id, and is useful for accessing the field via an interface. -func (v *AllIsOccurrencesTreeSubjectSource) GetId() string { return v.AllSourceTree.Id } +func (v *AllCertifyVEXStatementVulnerabilityCVE) implementsGraphQLInterfaceAllCertifyVEXStatementVulnerability() { +} +func (v *AllCertifyVEXStatementVulnerabilityGHSA) implementsGraphQLInterfaceAllCertifyVEXStatementVulnerability() { +} +func (v *AllCertifyVEXStatementVulnerabilityNoVuln) implementsGraphQLInterfaceAllCertifyVEXStatementVulnerability() { +} +func (v *AllCertifyVEXStatementVulnerabilityOSV) implementsGraphQLInterfaceAllCertifyVEXStatementVulnerability() { +} -// GetType returns AllIsOccurrencesTreeSubjectSource.Type, and is useful for accessing the field via an interface. -func (v *AllIsOccurrencesTreeSubjectSource) GetType() string { return v.AllSourceTree.Type } +func __unmarshalAllCertifyVEXStatementVulnerability(b []byte, v *AllCertifyVEXStatementVulnerability) error { + if string(b) == "null" { + return nil + } -// GetNamespaces returns AllIsOccurrencesTreeSubjectSource.Namespaces, and is useful for accessing the field via an interface. -func (v *AllIsOccurrencesTreeSubjectSource) GetNamespaces() []AllSourceTreeNamespacesSourceNamespace { - return v.AllSourceTree.Namespaces + var tn struct { + TypeName string `json:"__typename"` + } + err := json.Unmarshal(b, &tn) + if err != nil { + return err + } + + switch tn.TypeName { + case "CVE": + *v = new(AllCertifyVEXStatementVulnerabilityCVE) + return json.Unmarshal(b, *v) + case "GHSA": + *v = new(AllCertifyVEXStatementVulnerabilityGHSA) + return json.Unmarshal(b, *v) + case "NoVuln": + *v = new(AllCertifyVEXStatementVulnerabilityNoVuln) + return json.Unmarshal(b, *v) + case "OSV": + *v = new(AllCertifyVEXStatementVulnerabilityOSV) + return json.Unmarshal(b, *v) + case "": + return fmt.Errorf( + "response was missing Vulnerability.__typename") + default: + return fmt.Errorf( + `unexpected concrete type for AllCertifyVEXStatementVulnerability: "%v"`, tn.TypeName) + } } -func (v *AllIsOccurrencesTreeSubjectSource) UnmarshalJSON(b []byte) error { +func __marshalAllCertifyVEXStatementVulnerability(v *AllCertifyVEXStatementVulnerability) ([]byte, error) { + + var typename string + switch v := (*v).(type) { + case *AllCertifyVEXStatementVulnerabilityCVE: + typename = "CVE" + + premarshaled, err := v.__premarshalJSON() + if err != nil { + return nil, err + } + result := struct { + TypeName string `json:"__typename"` + *__premarshalAllCertifyVEXStatementVulnerabilityCVE + }{typename, premarshaled} + return json.Marshal(result) + case *AllCertifyVEXStatementVulnerabilityGHSA: + typename = "GHSA" + + premarshaled, err := v.__premarshalJSON() + if err != nil { + return nil, err + } + result := struct { + TypeName string `json:"__typename"` + *__premarshalAllCertifyVEXStatementVulnerabilityGHSA + }{typename, premarshaled} + return json.Marshal(result) + case *AllCertifyVEXStatementVulnerabilityNoVuln: + typename = "NoVuln" + + result := struct { + TypeName string `json:"__typename"` + *AllCertifyVEXStatementVulnerabilityNoVuln + }{typename, v} + return json.Marshal(result) + case *AllCertifyVEXStatementVulnerabilityOSV: + typename = "OSV" + + premarshaled, err := v.__premarshalJSON() + if err != nil { + return nil, err + } + result := struct { + TypeName string `json:"__typename"` + *__premarshalAllCertifyVEXStatementVulnerabilityOSV + }{typename, premarshaled} + return json.Marshal(result) + case nil: + return []byte("null"), nil + default: + return nil, fmt.Errorf( + `unexpected concrete type for AllCertifyVEXStatementVulnerability: "%T"`, v) + } +} + +// AllCertifyVEXStatementVulnerabilityCVE includes the requested fields of the GraphQL type CVE. +// The GraphQL type's documentation follows. +// +// CVE represents a vulnerability in the Common Vulnerabilities and Exposures +// schema. +// +// The vulnerability identifier contains a year field, so we are extracting that +// to allow matching for vulnerabilities found in a given year. +// +// The vulnerability identifier field is mandatory and canonicalized to be +// lowercase. +// +// This node can be referred to by other parts of GUAC. +type AllCertifyVEXStatementVulnerabilityCVE struct { + Typename *string `json:"__typename"` + AllCveTree `json:"-"` +} + +// GetTypename returns AllCertifyVEXStatementVulnerabilityCVE.Typename, and is useful for accessing the field via an interface. +func (v *AllCertifyVEXStatementVulnerabilityCVE) GetTypename() *string { return v.Typename } + +// GetId returns AllCertifyVEXStatementVulnerabilityCVE.Id, and is useful for accessing the field via an interface. +func (v *AllCertifyVEXStatementVulnerabilityCVE) GetId() string { return v.AllCveTree.Id } + +// GetYear returns AllCertifyVEXStatementVulnerabilityCVE.Year, and is useful for accessing the field via an interface. +func (v *AllCertifyVEXStatementVulnerabilityCVE) GetYear() int { return v.AllCveTree.Year } + +// GetCveId returns AllCertifyVEXStatementVulnerabilityCVE.CveId, and is useful for accessing the field via an interface. +func (v *AllCertifyVEXStatementVulnerabilityCVE) GetCveId() string { return v.AllCveTree.CveId } + +func (v *AllCertifyVEXStatementVulnerabilityCVE) UnmarshalJSON(b []byte) error { if string(b) == "null" { return nil } var firstPass struct { - *AllIsOccurrencesTreeSubjectSource + *AllCertifyVEXStatementVulnerabilityCVE graphql.NoUnmarshalJSON } - firstPass.AllIsOccurrencesTreeSubjectSource = v + firstPass.AllCertifyVEXStatementVulnerabilityCVE = v err := json.Unmarshal(b, &firstPass) if err != nil { @@ -1735,24 +1763,24 @@ func (v *AllIsOccurrencesTreeSubjectSource) UnmarshalJSON(b []byte) error { } err = json.Unmarshal( - b, &v.AllSourceTree) + b, &v.AllCveTree) if err != nil { return err } return nil } -type __premarshalAllIsOccurrencesTreeSubjectSource struct { +type __premarshalAllCertifyVEXStatementVulnerabilityCVE struct { Typename *string `json:"__typename"` Id string `json:"id"` - Type string `json:"type"` + Year int `json:"year"` - Namespaces []AllSourceTreeNamespacesSourceNamespace `json:"namespaces"` + CveId string `json:"cveId"` } -func (v *AllIsOccurrencesTreeSubjectSource) MarshalJSON() ([]byte, error) { +func (v *AllCertifyVEXStatementVulnerabilityCVE) MarshalJSON() ([]byte, error) { premarshaled, err := v.__premarshalJSON() if err != nil { return nil, err @@ -1760,373 +1788,250 @@ func (v *AllIsOccurrencesTreeSubjectSource) MarshalJSON() ([]byte, error) { return json.Marshal(premarshaled) } -func (v *AllIsOccurrencesTreeSubjectSource) __premarshalJSON() (*__premarshalAllIsOccurrencesTreeSubjectSource, error) { - var retval __premarshalAllIsOccurrencesTreeSubjectSource +func (v *AllCertifyVEXStatementVulnerabilityCVE) __premarshalJSON() (*__premarshalAllCertifyVEXStatementVulnerabilityCVE, error) { + var retval __premarshalAllCertifyVEXStatementVulnerabilityCVE retval.Typename = v.Typename - retval.Id = v.AllSourceTree.Id - retval.Type = v.AllSourceTree.Type - retval.Namespaces = v.AllSourceTree.Namespaces + retval.Id = v.AllCveTree.Id + retval.Year = v.AllCveTree.Year + retval.CveId = v.AllCveTree.CveId return &retval, nil } -// AllOSVTree includes the GraphQL fields of OSV requested by the fragment AllOSVTree. +// AllCertifyVEXStatementVulnerabilityGHSA includes the requested fields of the GraphQL type GHSA. // The GraphQL type's documentation follows. // -// OSV represents an Open Source Vulnerability. -// -// The osvId field is mandatory and canonicalized to be lowercase. +// GHSA represents GitHub security advisories. // -// This maps to a vulnerability ID specific to the environment (e.g., GHSA ID or -// CVE ID). +// The advisory id field is mandatory and canonicalized to be lowercase. // // This node can be referred to by other parts of GUAC. -type AllOSVTree struct { - Id string `json:"id"` - OsvId string `json:"osvId"` +type AllCertifyVEXStatementVulnerabilityGHSA struct { + Typename *string `json:"__typename"` + AllGHSATree `json:"-"` } -// GetId returns AllOSVTree.Id, and is useful for accessing the field via an interface. -func (v *AllOSVTree) GetId() string { return v.Id } +// GetTypename returns AllCertifyVEXStatementVulnerabilityGHSA.Typename, and is useful for accessing the field via an interface. +func (v *AllCertifyVEXStatementVulnerabilityGHSA) GetTypename() *string { return v.Typename } -// GetOsvId returns AllOSVTree.OsvId, and is useful for accessing the field via an interface. -func (v *AllOSVTree) GetOsvId() string { return v.OsvId } +// GetId returns AllCertifyVEXStatementVulnerabilityGHSA.Id, and is useful for accessing the field via an interface. +func (v *AllCertifyVEXStatementVulnerabilityGHSA) GetId() string { return v.AllGHSATree.Id } -// AllPkgTree includes the GraphQL fields of Package requested by the fragment AllPkgTree. -// The GraphQL type's documentation follows. -// -// Package represents the root of the package trie/tree. -// -// We map package information to a trie, closely matching the pURL specification -// (https://github.com/package-url/purl-spec/blob/0dd92f26f8bb11956ffdf5e8acfcee71e8560407/README.rst), -// but deviating from it where GUAC heuristics allow for better representation of -// package information. Each path in the trie fully represents a package; we split -// the trie based on the pURL components. -// -// This node matches a pkg: partial pURL. The type field matches the -// pURL types but we might also use "guac" for the cases where the pURL -// representation is not complete or when we have custom rules. -// -// Since this node is at the root of the package trie, it is named Package, not -// PackageType. -type AllPkgTree struct { - Id string `json:"id"` - Type string `json:"type"` - Namespaces []AllPkgTreeNamespacesPackageNamespace `json:"namespaces"` -} +// GetGhsaId returns AllCertifyVEXStatementVulnerabilityGHSA.GhsaId, and is useful for accessing the field via an interface. +func (v *AllCertifyVEXStatementVulnerabilityGHSA) GetGhsaId() string { return v.AllGHSATree.GhsaId } -// GetId returns AllPkgTree.Id, and is useful for accessing the field via an interface. -func (v *AllPkgTree) GetId() string { return v.Id } +func (v *AllCertifyVEXStatementVulnerabilityGHSA) UnmarshalJSON(b []byte) error { -// GetType returns AllPkgTree.Type, and is useful for accessing the field via an interface. -func (v *AllPkgTree) GetType() string { return v.Type } + if string(b) == "null" { + return nil + } -// GetNamespaces returns AllPkgTree.Namespaces, and is useful for accessing the field via an interface. -func (v *AllPkgTree) GetNamespaces() []AllPkgTreeNamespacesPackageNamespace { return v.Namespaces } + var firstPass struct { + *AllCertifyVEXStatementVulnerabilityGHSA + graphql.NoUnmarshalJSON + } + firstPass.AllCertifyVEXStatementVulnerabilityGHSA = v -// AllPkgTreeNamespacesPackageNamespace includes the requested fields of the GraphQL type PackageNamespace. -// The GraphQL type's documentation follows. -// -// PackageNamespace is a namespace for packages. -// -// In the pURL representation, each PackageNamespace matches the -// pkg:// partial pURL. -// -// Namespaces are optional and type specific. Because they are optional, we use -// empty string to denote missing namespaces. -type AllPkgTreeNamespacesPackageNamespace struct { - Id string `json:"id"` - Namespace string `json:"namespace"` - Names []AllPkgTreeNamespacesPackageNamespaceNamesPackageName `json:"names"` + err := json.Unmarshal(b, &firstPass) + if err != nil { + return err + } + + err = json.Unmarshal( + b, &v.AllGHSATree) + if err != nil { + return err + } + return nil } -// GetId returns AllPkgTreeNamespacesPackageNamespace.Id, and is useful for accessing the field via an interface. -func (v *AllPkgTreeNamespacesPackageNamespace) GetId() string { return v.Id } +type __premarshalAllCertifyVEXStatementVulnerabilityGHSA struct { + Typename *string `json:"__typename"` -// GetNamespace returns AllPkgTreeNamespacesPackageNamespace.Namespace, and is useful for accessing the field via an interface. -func (v *AllPkgTreeNamespacesPackageNamespace) GetNamespace() string { return v.Namespace } + Id string `json:"id"` -// GetNames returns AllPkgTreeNamespacesPackageNamespace.Names, and is useful for accessing the field via an interface. -func (v *AllPkgTreeNamespacesPackageNamespace) GetNames() []AllPkgTreeNamespacesPackageNamespaceNamesPackageName { - return v.Names + GhsaId string `json:"ghsaId"` } -// AllPkgTreeNamespacesPackageNamespaceNamesPackageName includes the requested fields of the GraphQL type PackageName. -// The GraphQL type's documentation follows. -// -// PackageName is a name for packages. -// -// In the pURL representation, each PackageName matches the -// pkg:// pURL. -// -// Names are always mandatory. -// -// This is the first node in the trie that can be referred to by other parts of -// GUAC. -type AllPkgTreeNamespacesPackageNamespaceNamesPackageName struct { - Id string `json:"id"` - Name string `json:"name"` - Versions []AllPkgTreeNamespacesPackageNamespaceNamesPackageNameVersionsPackageVersion `json:"versions"` +func (v *AllCertifyVEXStatementVulnerabilityGHSA) MarshalJSON() ([]byte, error) { + premarshaled, err := v.__premarshalJSON() + if err != nil { + return nil, err + } + return json.Marshal(premarshaled) } -// GetId returns AllPkgTreeNamespacesPackageNamespaceNamesPackageName.Id, and is useful for accessing the field via an interface. -func (v *AllPkgTreeNamespacesPackageNamespaceNamesPackageName) GetId() string { return v.Id } - -// GetName returns AllPkgTreeNamespacesPackageNamespaceNamesPackageName.Name, and is useful for accessing the field via an interface. -func (v *AllPkgTreeNamespacesPackageNamespaceNamesPackageName) GetName() string { return v.Name } +func (v *AllCertifyVEXStatementVulnerabilityGHSA) __premarshalJSON() (*__premarshalAllCertifyVEXStatementVulnerabilityGHSA, error) { + var retval __premarshalAllCertifyVEXStatementVulnerabilityGHSA -// GetVersions returns AllPkgTreeNamespacesPackageNamespaceNamesPackageName.Versions, and is useful for accessing the field via an interface. -func (v *AllPkgTreeNamespacesPackageNamespaceNamesPackageName) GetVersions() []AllPkgTreeNamespacesPackageNamespaceNamesPackageNameVersionsPackageVersion { - return v.Versions + retval.Typename = v.Typename + retval.Id = v.AllGHSATree.Id + retval.GhsaId = v.AllGHSATree.GhsaId + return &retval, nil } -// AllPkgTreeNamespacesPackageNamespaceNamesPackageNameVersionsPackageVersion includes the requested fields of the GraphQL type PackageVersion. +// AllCertifyVEXStatementVulnerabilityNoVuln includes the requested fields of the GraphQL type NoVuln. // The GraphQL type's documentation follows. // -// PackageVersion is a package version. +// NoVuln is a special vulnerability node to attest that no vulnerability has been +// found during a vulnerability scan. // -// In the pURL representation, each PackageName matches the -// pkg://@ pURL. +// Backends guarantee that this is a singleton node. +type AllCertifyVEXStatementVulnerabilityNoVuln struct { + Typename *string `json:"__typename"` +} + +// GetTypename returns AllCertifyVEXStatementVulnerabilityNoVuln.Typename, and is useful for accessing the field via an interface. +func (v *AllCertifyVEXStatementVulnerabilityNoVuln) GetTypename() *string { return v.Typename } + +// AllCertifyVEXStatementVulnerabilityOSV includes the requested fields of the GraphQL type OSV. +// The GraphQL type's documentation follows. // -// Versions are optional and each Package type defines own rules for handling -// them. For this level of GUAC, these are just opaque strings. +// OSV represents an Open Source Vulnerability. // -// NOTE: The handling of versions might change before this schema becomes stable. +// The osvId field is mandatory and canonicalized to be lowercase. // -// This node can be referred to by other parts of GUAC. +// This maps to a vulnerability ID specific to the environment (e.g., GHSA ID or +// CVE ID). // -// Subpath and qualifiers are optional. Lack of qualifiers is represented by an -// empty list and lack of subpath by empty string (to be consistent with -// optionality of namespace and version). Two nodes that have different qualifiers -// and/or subpath but the same version mean two different packages in the trie -// (they are different). Two nodes that have same version but qualifiers of one -// are a subset of the qualifier of the other also mean two different packages in -// the trie. -type AllPkgTreeNamespacesPackageNamespaceNamesPackageNameVersionsPackageVersion struct { - Id string `json:"id"` - Version string `json:"version"` - Qualifiers []AllPkgTreeNamespacesPackageNamespaceNamesPackageNameVersionsPackageVersionQualifiersPackageQualifier `json:"qualifiers"` - Subpath string `json:"subpath"` -} - -// GetId returns AllPkgTreeNamespacesPackageNamespaceNamesPackageNameVersionsPackageVersion.Id, and is useful for accessing the field via an interface. -func (v *AllPkgTreeNamespacesPackageNamespaceNamesPackageNameVersionsPackageVersion) GetId() string { - return v.Id -} - -// GetVersion returns AllPkgTreeNamespacesPackageNamespaceNamesPackageNameVersionsPackageVersion.Version, and is useful for accessing the field via an interface. -func (v *AllPkgTreeNamespacesPackageNamespaceNamesPackageNameVersionsPackageVersion) GetVersion() string { - return v.Version -} - -// GetQualifiers returns AllPkgTreeNamespacesPackageNamespaceNamesPackageNameVersionsPackageVersion.Qualifiers, and is useful for accessing the field via an interface. -func (v *AllPkgTreeNamespacesPackageNamespaceNamesPackageNameVersionsPackageVersion) GetQualifiers() []AllPkgTreeNamespacesPackageNamespaceNamesPackageNameVersionsPackageVersionQualifiersPackageQualifier { - return v.Qualifiers -} - -// GetSubpath returns AllPkgTreeNamespacesPackageNamespaceNamesPackageNameVersionsPackageVersion.Subpath, and is useful for accessing the field via an interface. -func (v *AllPkgTreeNamespacesPackageNamespaceNamesPackageNameVersionsPackageVersion) GetSubpath() string { - return v.Subpath +// This node can be referred to by other parts of GUAC. +type AllCertifyVEXStatementVulnerabilityOSV struct { + Typename *string `json:"__typename"` + AllOSVTree `json:"-"` } -// AllPkgTreeNamespacesPackageNamespaceNamesPackageNameVersionsPackageVersionQualifiersPackageQualifier includes the requested fields of the GraphQL type PackageQualifier. -// The GraphQL type's documentation follows. -// -// PackageQualifier is a qualifier for a package, a key-value pair. -// -// In the pURL representation, it is a part of the part of the -// pkg://@? pURL. -// -// Qualifiers are optional, each Package type defines own rules for handling them, -// and multiple qualifiers could be attached to the same package. -// -// This node cannot be directly referred by other parts of GUAC. -type AllPkgTreeNamespacesPackageNamespaceNamesPackageNameVersionsPackageVersionQualifiersPackageQualifier struct { - Key string `json:"key"` - Value string `json:"value"` -} +// GetTypename returns AllCertifyVEXStatementVulnerabilityOSV.Typename, and is useful for accessing the field via an interface. +func (v *AllCertifyVEXStatementVulnerabilityOSV) GetTypename() *string { return v.Typename } -// GetKey returns AllPkgTreeNamespacesPackageNamespaceNamesPackageNameVersionsPackageVersionQualifiersPackageQualifier.Key, and is useful for accessing the field via an interface. -func (v *AllPkgTreeNamespacesPackageNamespaceNamesPackageNameVersionsPackageVersionQualifiersPackageQualifier) GetKey() string { - return v.Key -} +// GetId returns AllCertifyVEXStatementVulnerabilityOSV.Id, and is useful for accessing the field via an interface. +func (v *AllCertifyVEXStatementVulnerabilityOSV) GetId() string { return v.AllOSVTree.Id } -// GetValue returns AllPkgTreeNamespacesPackageNamespaceNamesPackageNameVersionsPackageVersionQualifiersPackageQualifier.Value, and is useful for accessing the field via an interface. -func (v *AllPkgTreeNamespacesPackageNamespaceNamesPackageNameVersionsPackageVersionQualifiersPackageQualifier) GetValue() string { - return v.Value -} +// GetOsvId returns AllCertifyVEXStatementVulnerabilityOSV.OsvId, and is useful for accessing the field via an interface. +func (v *AllCertifyVEXStatementVulnerabilityOSV) GetOsvId() string { return v.AllOSVTree.OsvId } -// AllSourceTree includes the GraphQL fields of Source requested by the fragment AllSourceTree. -// The GraphQL type's documentation follows. -// -// Source represents the root of the source trie/tree. -// -// We map source information to a trie, as a derivative of the pURL specification: -// each path in the trie represents a type, namespace, name and an optional -// qualifier that stands for tag/commit information. -// -// This node represents the type part of the trie path. It is used to represent -// the version control system that is being used. -// -// Since this node is at the root of the source trie, it is named Source, not -// SourceType. -type AllSourceTree struct { - Id string `json:"id"` - Type string `json:"type"` - Namespaces []AllSourceTreeNamespacesSourceNamespace `json:"namespaces"` -} +func (v *AllCertifyVEXStatementVulnerabilityOSV) UnmarshalJSON(b []byte) error { -// GetId returns AllSourceTree.Id, and is useful for accessing the field via an interface. -func (v *AllSourceTree) GetId() string { return v.Id } + if string(b) == "null" { + return nil + } -// GetType returns AllSourceTree.Type, and is useful for accessing the field via an interface. -func (v *AllSourceTree) GetType() string { return v.Type } + var firstPass struct { + *AllCertifyVEXStatementVulnerabilityOSV + graphql.NoUnmarshalJSON + } + firstPass.AllCertifyVEXStatementVulnerabilityOSV = v -// GetNamespaces returns AllSourceTree.Namespaces, and is useful for accessing the field via an interface. -func (v *AllSourceTree) GetNamespaces() []AllSourceTreeNamespacesSourceNamespace { return v.Namespaces } + err := json.Unmarshal(b, &firstPass) + if err != nil { + return err + } -// AllSourceTreeNamespacesSourceNamespace includes the requested fields of the GraphQL type SourceNamespace. -// The GraphQL type's documentation follows. -// -// SourceNamespace is a namespace for sources. -// -// This is the location of the repository (such as github/gitlab/bitbucket). -// -// The namespace field is mandatory. -type AllSourceTreeNamespacesSourceNamespace struct { - Id string `json:"id"` - Namespace string `json:"namespace"` - Names []AllSourceTreeNamespacesSourceNamespaceNamesSourceName `json:"names"` + err = json.Unmarshal( + b, &v.AllOSVTree) + if err != nil { + return err + } + return nil } -// GetId returns AllSourceTreeNamespacesSourceNamespace.Id, and is useful for accessing the field via an interface. -func (v *AllSourceTreeNamespacesSourceNamespace) GetId() string { return v.Id } - -// GetNamespace returns AllSourceTreeNamespacesSourceNamespace.Namespace, and is useful for accessing the field via an interface. -func (v *AllSourceTreeNamespacesSourceNamespace) GetNamespace() string { return v.Namespace } +type __premarshalAllCertifyVEXStatementVulnerabilityOSV struct { + Typename *string `json:"__typename"` -// GetNames returns AllSourceTreeNamespacesSourceNamespace.Names, and is useful for accessing the field via an interface. -func (v *AllSourceTreeNamespacesSourceNamespace) GetNames() []AllSourceTreeNamespacesSourceNamespaceNamesSourceName { - return v.Names -} + Id string `json:"id"` -// AllSourceTreeNamespacesSourceNamespaceNamesSourceName includes the requested fields of the GraphQL type SourceName. -// The GraphQL type's documentation follows. -// -// SourceName represents the url of the repository. -// -// The name field is mandatory. The tag and commit fields are optional, but it is -// an error to specify both. -// -// This is the only source trie node that can be referenced by other parts of GUAC. -type AllSourceTreeNamespacesSourceNamespaceNamesSourceName struct { - Id string `json:"id"` - Name string `json:"name"` - Tag *string `json:"tag"` - Commit *string `json:"commit"` + OsvId string `json:"osvId"` } -// GetId returns AllSourceTreeNamespacesSourceNamespaceNamesSourceName.Id, and is useful for accessing the field via an interface. -func (v *AllSourceTreeNamespacesSourceNamespaceNamesSourceName) GetId() string { return v.Id } - -// GetName returns AllSourceTreeNamespacesSourceNamespaceNamesSourceName.Name, and is useful for accessing the field via an interface. -func (v *AllSourceTreeNamespacesSourceNamespaceNamesSourceName) GetName() string { return v.Name } - -// GetTag returns AllSourceTreeNamespacesSourceNamespaceNamesSourceName.Tag, and is useful for accessing the field via an interface. -func (v *AllSourceTreeNamespacesSourceNamespaceNamesSourceName) GetTag() *string { return v.Tag } - -// GetCommit returns AllSourceTreeNamespacesSourceNamespaceNamesSourceName.Commit, and is useful for accessing the field via an interface. -func (v *AllSourceTreeNamespacesSourceNamespaceNamesSourceName) GetCommit() *string { return v.Commit } - -// ArtifactInputSpec specifies an artifact for mutations. -// -// The checksum fields are canonicalized to be lowercase. -type ArtifactInputSpec struct { - Algorithm string `json:"algorithm"` - Digest string `json:"digest"` +func (v *AllCertifyVEXStatementVulnerabilityOSV) MarshalJSON() ([]byte, error) { + premarshaled, err := v.__premarshalJSON() + if err != nil { + return nil, err + } + return json.Marshal(premarshaled) } -// GetAlgorithm returns ArtifactInputSpec.Algorithm, and is useful for accessing the field via an interface. -func (v *ArtifactInputSpec) GetAlgorithm() string { return v.Algorithm } - -// GetDigest returns ArtifactInputSpec.Digest, and is useful for accessing the field via an interface. -func (v *ArtifactInputSpec) GetDigest() string { return v.Digest } +func (v *AllCertifyVEXStatementVulnerabilityOSV) __premarshalJSON() (*__premarshalAllCertifyVEXStatementVulnerabilityOSV, error) { + var retval __premarshalAllCertifyVEXStatementVulnerabilityOSV -// ArtifactSpec allows filtering the list of artifacts to return in a query. -// -// The checksum fields are canonicalized to be lowercase. -type ArtifactSpec struct { - Id *string `json:"id"` - Algorithm *string `json:"algorithm"` - Digest *string `json:"digest"` + retval.Typename = v.Typename + retval.Id = v.AllOSVTree.Id + retval.OsvId = v.AllOSVTree.OsvId + return &retval, nil } -// GetId returns ArtifactSpec.Id, and is useful for accessing the field via an interface. -func (v *ArtifactSpec) GetId() *string { return v.Id } - -// GetAlgorithm returns ArtifactSpec.Algorithm, and is useful for accessing the field via an interface. -func (v *ArtifactSpec) GetAlgorithm() *string { return v.Algorithm } - -// GetDigest returns ArtifactSpec.Digest, and is useful for accessing the field via an interface. -func (v *ArtifactSpec) GetDigest() *string { return v.Digest } - -// ArtifactsArtifactsArtifact includes the requested fields of the GraphQL type Artifact. +// AllCertifyVuln includes the GraphQL fields of CertifyVuln requested by the fragment AllCertifyVuln. // The GraphQL type's documentation follows. // -// Artifact represents an artifact identified by a checksum hash. -// -// The checksum is split into the digest value and the algorithm used to generate -// it. Both fields are mandatory and canonicalized to be lowercase. +// CertifyVuln is an attestation to attach vulnerability information to a package. // -// If having a checksum Go object, algorithm can be -// strings.ToLower(string(checksum.Algorithm)) and digest can be checksum.Value. -type ArtifactsArtifactsArtifact struct { - AllArtifactTree `json:"-"` +// This information is obtained via a scanner. If there is no vulnerability +// detected (no OSV, CVE, or GHSA), we attach the special NoVuln node. +type AllCertifyVuln struct { + Id string `json:"id"` + // The package that is attested + Package AllCertifyVulnPackage `json:"package"` + // The vulnerability object. Can be an OSV, CVE, or GHSA or the special NoVuln node. + Vulnerability AllCertifyVulnVulnerability `json:"-"` + // Metadata attached to the certification + Metadata AllCertifyVulnMetadataVulnerabilityMetaData `json:"metadata"` } -// GetId returns ArtifactsArtifactsArtifact.Id, and is useful for accessing the field via an interface. -func (v *ArtifactsArtifactsArtifact) GetId() string { return v.AllArtifactTree.Id } +// GetId returns AllCertifyVuln.Id, and is useful for accessing the field via an interface. +func (v *AllCertifyVuln) GetId() string { return v.Id } -// GetAlgorithm returns ArtifactsArtifactsArtifact.Algorithm, and is useful for accessing the field via an interface. -func (v *ArtifactsArtifactsArtifact) GetAlgorithm() string { return v.AllArtifactTree.Algorithm } +// GetPackage returns AllCertifyVuln.Package, and is useful for accessing the field via an interface. +func (v *AllCertifyVuln) GetPackage() AllCertifyVulnPackage { return v.Package } -// GetDigest returns ArtifactsArtifactsArtifact.Digest, and is useful for accessing the field via an interface. -func (v *ArtifactsArtifactsArtifact) GetDigest() string { return v.AllArtifactTree.Digest } +// GetVulnerability returns AllCertifyVuln.Vulnerability, and is useful for accessing the field via an interface. +func (v *AllCertifyVuln) GetVulnerability() AllCertifyVulnVulnerability { return v.Vulnerability } -func (v *ArtifactsArtifactsArtifact) UnmarshalJSON(b []byte) error { +// GetMetadata returns AllCertifyVuln.Metadata, and is useful for accessing the field via an interface. +func (v *AllCertifyVuln) GetMetadata() AllCertifyVulnMetadataVulnerabilityMetaData { return v.Metadata } + +func (v *AllCertifyVuln) UnmarshalJSON(b []byte) error { if string(b) == "null" { return nil } var firstPass struct { - *ArtifactsArtifactsArtifact + *AllCertifyVuln + Vulnerability json.RawMessage `json:"vulnerability"` graphql.NoUnmarshalJSON } - firstPass.ArtifactsArtifactsArtifact = v + firstPass.AllCertifyVuln = v err := json.Unmarshal(b, &firstPass) if err != nil { return err } - err = json.Unmarshal( - b, &v.AllArtifactTree) - if err != nil { - return err + { + dst := &v.Vulnerability + src := firstPass.Vulnerability + if len(src) != 0 && string(src) != "null" { + err = __unmarshalAllCertifyVulnVulnerability( + src, dst) + if err != nil { + return fmt.Errorf( + "unable to unmarshal AllCertifyVuln.Vulnerability: %w", err) + } + } } return nil } -type __premarshalArtifactsArtifactsArtifact struct { +type __premarshalAllCertifyVuln struct { Id string `json:"id"` - Algorithm string `json:"algorithm"` + Package AllCertifyVulnPackage `json:"package"` - Digest string `json:"digest"` + Vulnerability json.RawMessage `json:"vulnerability"` + + Metadata AllCertifyVulnMetadataVulnerabilityMetaData `json:"metadata"` } -func (v *ArtifactsArtifactsArtifact) MarshalJSON() ([]byte, error) { +func (v *AllCertifyVuln) MarshalJSON() ([]byte, error) { premarshaled, err := v.__premarshalJSON() if err != nil { return nil, err @@ -2134,97 +2039,118 @@ func (v *ArtifactsArtifactsArtifact) MarshalJSON() ([]byte, error) { return json.Marshal(premarshaled) } -func (v *ArtifactsArtifactsArtifact) __premarshalJSON() (*__premarshalArtifactsArtifactsArtifact, error) { - var retval __premarshalArtifactsArtifactsArtifact +func (v *AllCertifyVuln) __premarshalJSON() (*__premarshalAllCertifyVuln, error) { + var retval __premarshalAllCertifyVuln - retval.Id = v.AllArtifactTree.Id - retval.Algorithm = v.AllArtifactTree.Algorithm - retval.Digest = v.AllArtifactTree.Digest + retval.Id = v.Id + retval.Package = v.Package + { + + dst := &retval.Vulnerability + src := v.Vulnerability + var err error + *dst, err = __marshalAllCertifyVulnVulnerability( + &src) + if err != nil { + return nil, fmt.Errorf( + "unable to marshal AllCertifyVuln.Vulnerability: %w", err) + } + } + retval.Metadata = v.Metadata return &retval, nil } -// ArtifactsResponse is returned by Artifacts on success. -type ArtifactsResponse struct { - // Returns all artifacts matching a filter. - Artifacts []ArtifactsArtifactsArtifact `json:"artifacts"` +// AllCertifyVulnMetadataVulnerabilityMetaData includes the requested fields of the GraphQL type VulnerabilityMetaData. +// The GraphQL type's documentation follows. +// +// VulnerabilityMetaData is the metadata attached to vulnerability certification. +// +// It contains metadata about the scanner process that created the certification. +type AllCertifyVulnMetadataVulnerabilityMetaData struct { + // URI of the vulnerability database used by the scanner + DbUri string `json:"dbUri"` + // Version of the vulnerability database used by the scanner + DbVersion string `json:"dbVersion"` + // URI of the scanner + ScannerUri string `json:"scannerUri"` + // Version of the scanner + ScannerVersion string `json:"scannerVersion"` + // Time of scan (in RFC 3339 format) + TimeScanned time.Time `json:"timeScanned"` + // Document from which this attestation is generated from + Origin string `json:"origin"` + // GUAC collector for the document + Collector string `json:"collector"` } -// GetArtifacts returns ArtifactsResponse.Artifacts, and is useful for accessing the field via an interface. -func (v *ArtifactsResponse) GetArtifacts() []ArtifactsArtifactsArtifact { return v.Artifacts } +// GetDbUri returns AllCertifyVulnMetadataVulnerabilityMetaData.DbUri, and is useful for accessing the field via an interface. +func (v *AllCertifyVulnMetadataVulnerabilityMetaData) GetDbUri() string { return v.DbUri } -// BuilderInputSpec specifies a builder for mutations. -type BuilderInputSpec struct { - Uri string `json:"uri"` -} +// GetDbVersion returns AllCertifyVulnMetadataVulnerabilityMetaData.DbVersion, and is useful for accessing the field via an interface. +func (v *AllCertifyVulnMetadataVulnerabilityMetaData) GetDbVersion() string { return v.DbVersion } -// GetUri returns BuilderInputSpec.Uri, and is useful for accessing the field via an interface. -func (v *BuilderInputSpec) GetUri() string { return v.Uri } +// GetScannerUri returns AllCertifyVulnMetadataVulnerabilityMetaData.ScannerUri, and is useful for accessing the field via an interface. +func (v *AllCertifyVulnMetadataVulnerabilityMetaData) GetScannerUri() string { return v.ScannerUri } -// CVEInputSpec specifies a CVE vulnerability for mutations. -type CVEInputSpec struct { - Year int `json:"year"` - CveId string `json:"cveId"` +// GetScannerVersion returns AllCertifyVulnMetadataVulnerabilityMetaData.ScannerVersion, and is useful for accessing the field via an interface. +func (v *AllCertifyVulnMetadataVulnerabilityMetaData) GetScannerVersion() string { + return v.ScannerVersion } -// GetYear returns CVEInputSpec.Year, and is useful for accessing the field via an interface. -func (v *CVEInputSpec) GetYear() int { return v.Year } - -// GetCveId returns CVEInputSpec.CveId, and is useful for accessing the field via an interface. -func (v *CVEInputSpec) GetCveId() string { return v.CveId } - -// CVESpec allows filtering the list of advisories to return in a query. -type CVESpec struct { - Id *string `json:"id"` - Year *int `json:"year"` - CveId *string `json:"cveId"` +// GetTimeScanned returns AllCertifyVulnMetadataVulnerabilityMetaData.TimeScanned, and is useful for accessing the field via an interface. +func (v *AllCertifyVulnMetadataVulnerabilityMetaData) GetTimeScanned() time.Time { + return v.TimeScanned } -// GetId returns CVESpec.Id, and is useful for accessing the field via an interface. -func (v *CVESpec) GetId() *string { return v.Id } - -// GetYear returns CVESpec.Year, and is useful for accessing the field via an interface. -func (v *CVESpec) GetYear() *int { return v.Year } +// GetOrigin returns AllCertifyVulnMetadataVulnerabilityMetaData.Origin, and is useful for accessing the field via an interface. +func (v *AllCertifyVulnMetadataVulnerabilityMetaData) GetOrigin() string { return v.Origin } -// GetCveId returns CVESpec.CveId, and is useful for accessing the field via an interface. -func (v *CVESpec) GetCveId() *string { return v.CveId } +// GetCollector returns AllCertifyVulnMetadataVulnerabilityMetaData.Collector, and is useful for accessing the field via an interface. +func (v *AllCertifyVulnMetadataVulnerabilityMetaData) GetCollector() string { return v.Collector } -// CVEsCveCVE includes the requested fields of the GraphQL type CVE. +// AllCertifyVulnPackage includes the requested fields of the GraphQL type Package. // The GraphQL type's documentation follows. // -// CVE represents a vulnerability in the Common Vulnerabilities and Exposures -// schema. +// Package represents the root of the package trie/tree. // -// The vulnerability identifier contains a year field, so we are extracting that -// to allow matching for vulnerabilities found in a given year. +// We map package information to a trie, closely matching the pURL specification +// (https://github.com/package-url/purl-spec/blob/0dd92f26f8bb11956ffdf5e8acfcee71e8560407/README.rst), +// but deviating from it where GUAC heuristics allow for better representation of +// package information. Each path in the trie fully represents a package; we split +// the trie based on the pURL components. // -// The vulnerability identifier field is mandatory and canonicalized to be -// lowercase. +// This node matches a pkg: partial pURL. The type field matches the +// pURL types but we might also use "guac" for the cases where the pURL +// representation is not complete or when we have custom rules. // -// This node can be referred to by other parts of GUAC. -type CVEsCveCVE struct { - AllCveTree `json:"-"` +// Since this node is at the root of the package trie, it is named Package, not +// PackageType. +type AllCertifyVulnPackage struct { + AllPkgTree `json:"-"` } -// GetId returns CVEsCveCVE.Id, and is useful for accessing the field via an interface. -func (v *CVEsCveCVE) GetId() string { return v.AllCveTree.Id } +// GetId returns AllCertifyVulnPackage.Id, and is useful for accessing the field via an interface. +func (v *AllCertifyVulnPackage) GetId() string { return v.AllPkgTree.Id } -// GetYear returns CVEsCveCVE.Year, and is useful for accessing the field via an interface. -func (v *CVEsCveCVE) GetYear() int { return v.AllCveTree.Year } +// GetType returns AllCertifyVulnPackage.Type, and is useful for accessing the field via an interface. +func (v *AllCertifyVulnPackage) GetType() string { return v.AllPkgTree.Type } -// GetCveId returns CVEsCveCVE.CveId, and is useful for accessing the field via an interface. -func (v *CVEsCveCVE) GetCveId() string { return v.AllCveTree.CveId } +// GetNamespaces returns AllCertifyVulnPackage.Namespaces, and is useful for accessing the field via an interface. +func (v *AllCertifyVulnPackage) GetNamespaces() []AllPkgTreeNamespacesPackageNamespace { + return v.AllPkgTree.Namespaces +} -func (v *CVEsCveCVE) UnmarshalJSON(b []byte) error { +func (v *AllCertifyVulnPackage) UnmarshalJSON(b []byte) error { if string(b) == "null" { return nil } var firstPass struct { - *CVEsCveCVE + *AllCertifyVulnPackage graphql.NoUnmarshalJSON } - firstPass.CVEsCveCVE = v + firstPass.AllCertifyVulnPackage = v err := json.Unmarshal(b, &firstPass) if err != nil { @@ -2232,22 +2158,22 @@ func (v *CVEsCveCVE) UnmarshalJSON(b []byte) error { } err = json.Unmarshal( - b, &v.AllCveTree) + b, &v.AllPkgTree) if err != nil { return err } return nil } -type __premarshalCVEsCveCVE struct { +type __premarshalAllCertifyVulnPackage struct { Id string `json:"id"` - Year int `json:"year"` + Type string `json:"type"` - CveId string `json:"cveId"` + Namespaces []AllPkgTreeNamespacesPackageNamespace `json:"namespaces"` } -func (v *CVEsCveCVE) MarshalJSON() ([]byte, error) { +func (v *AllCertifyVulnPackage) MarshalJSON() ([]byte, error) { premarshaled, err := v.__premarshalJSON() if err != nil { return nil, err @@ -2255,204 +2181,168 @@ func (v *CVEsCveCVE) MarshalJSON() ([]byte, error) { return json.Marshal(premarshaled) } -func (v *CVEsCveCVE) __premarshalJSON() (*__premarshalCVEsCveCVE, error) { - var retval __premarshalCVEsCveCVE +func (v *AllCertifyVulnPackage) __premarshalJSON() (*__premarshalAllCertifyVulnPackage, error) { + var retval __premarshalAllCertifyVulnPackage - retval.Id = v.AllCveTree.Id - retval.Year = v.AllCveTree.Year - retval.CveId = v.AllCveTree.CveId + retval.Id = v.AllPkgTree.Id + retval.Type = v.AllPkgTree.Type + retval.Namespaces = v.AllPkgTree.Namespaces return &retval, nil } -// CVEsResponse is returned by CVEs on success. -type CVEsResponse struct { - // Returns all CVEs matching a filter. - Cve []CVEsCveCVE `json:"cve"` -} - -// GetCve returns CVEsResponse.Cve, and is useful for accessing the field via an interface. -func (v *CVEsResponse) GetCve() []CVEsCveCVE { return v.Cve } - -// CertifyBadArtifactIngestCertifyBad includes the requested fields of the GraphQL type CertifyBad. -// The GraphQL type's documentation follows. -// -// CertifyBad is an attestation that a package, source, or artifact is considered -// bad. +// AllCertifyVulnVulnerability includes the requested fields of the GraphQL interface Vulnerability. // -// All evidence trees record a justification for the property they represent as -// well as the document that contains the attestation (origin) and the collector -// that collected the document (collector). +// AllCertifyVulnVulnerability is implemented by the following types: +// AllCertifyVulnVulnerabilityCVE +// AllCertifyVulnVulnerabilityGHSA +// AllCertifyVulnVulnerabilityNoVuln +// AllCertifyVulnVulnerabilityOSV +// The GraphQL type's documentation follows. // -// The certification applies to a subject which is a package, source, or artifact. -// If the attestation targets a package, it must target a PackageName or a -// PackageVersion. If the attestation targets a source, it must target a -// SourceName. -type CertifyBadArtifactIngestCertifyBad struct { - AllCertifyBad `json:"-"` -} - -// GetId returns CertifyBadArtifactIngestCertifyBad.Id, and is useful for accessing the field via an interface. -func (v *CertifyBadArtifactIngestCertifyBad) GetId() string { return v.AllCertifyBad.Id } - -// GetJustification returns CertifyBadArtifactIngestCertifyBad.Justification, and is useful for accessing the field via an interface. -func (v *CertifyBadArtifactIngestCertifyBad) GetJustification() string { - return v.AllCertifyBad.Justification -} - -// GetSubject returns CertifyBadArtifactIngestCertifyBad.Subject, and is useful for accessing the field via an interface. -func (v *CertifyBadArtifactIngestCertifyBad) GetSubject() AllCertifyBadSubjectPackageSourceOrArtifact { - return v.AllCertifyBad.Subject +// Vulnerability is a union of OSV, CVE, GHSA or the NoVuln node. +type AllCertifyVulnVulnerability interface { + implementsGraphQLInterfaceAllCertifyVulnVulnerability() + // GetTypename returns the receiver's concrete GraphQL type-name (see interface doc for possible values). + GetTypename() *string } -// GetOrigin returns CertifyBadArtifactIngestCertifyBad.Origin, and is useful for accessing the field via an interface. -func (v *CertifyBadArtifactIngestCertifyBad) GetOrigin() string { return v.AllCertifyBad.Origin } - -// GetCollector returns CertifyBadArtifactIngestCertifyBad.Collector, and is useful for accessing the field via an interface. -func (v *CertifyBadArtifactIngestCertifyBad) GetCollector() string { return v.AllCertifyBad.Collector } - -func (v *CertifyBadArtifactIngestCertifyBad) UnmarshalJSON(b []byte) error { +func (v *AllCertifyVulnVulnerabilityCVE) implementsGraphQLInterfaceAllCertifyVulnVulnerability() {} +func (v *AllCertifyVulnVulnerabilityGHSA) implementsGraphQLInterfaceAllCertifyVulnVulnerability() {} +func (v *AllCertifyVulnVulnerabilityNoVuln) implementsGraphQLInterfaceAllCertifyVulnVulnerability() {} +func (v *AllCertifyVulnVulnerabilityOSV) implementsGraphQLInterfaceAllCertifyVulnVulnerability() {} +func __unmarshalAllCertifyVulnVulnerability(b []byte, v *AllCertifyVulnVulnerability) error { if string(b) == "null" { return nil } - var firstPass struct { - *CertifyBadArtifactIngestCertifyBad - graphql.NoUnmarshalJSON + var tn struct { + TypeName string `json:"__typename"` } - firstPass.CertifyBadArtifactIngestCertifyBad = v - - err := json.Unmarshal(b, &firstPass) + err := json.Unmarshal(b, &tn) if err != nil { return err } - err = json.Unmarshal( - b, &v.AllCertifyBad) - if err != nil { - return err + switch tn.TypeName { + case "CVE": + *v = new(AllCertifyVulnVulnerabilityCVE) + return json.Unmarshal(b, *v) + case "GHSA": + *v = new(AllCertifyVulnVulnerabilityGHSA) + return json.Unmarshal(b, *v) + case "NoVuln": + *v = new(AllCertifyVulnVulnerabilityNoVuln) + return json.Unmarshal(b, *v) + case "OSV": + *v = new(AllCertifyVulnVulnerabilityOSV) + return json.Unmarshal(b, *v) + case "": + return fmt.Errorf( + "response was missing Vulnerability.__typename") + default: + return fmt.Errorf( + `unexpected concrete type for AllCertifyVulnVulnerability: "%v"`, tn.TypeName) } - return nil } -type __premarshalCertifyBadArtifactIngestCertifyBad struct { - Id string `json:"id"` - - Justification string `json:"justification"` +func __marshalAllCertifyVulnVulnerability(v *AllCertifyVulnVulnerability) ([]byte, error) { - Subject json.RawMessage `json:"subject"` - - Origin string `json:"origin"` - - Collector string `json:"collector"` -} + var typename string + switch v := (*v).(type) { + case *AllCertifyVulnVulnerabilityCVE: + typename = "CVE" -func (v *CertifyBadArtifactIngestCertifyBad) MarshalJSON() ([]byte, error) { - premarshaled, err := v.__premarshalJSON() - if err != nil { - return nil, err - } - return json.Marshal(premarshaled) -} + premarshaled, err := v.__premarshalJSON() + if err != nil { + return nil, err + } + result := struct { + TypeName string `json:"__typename"` + *__premarshalAllCertifyVulnVulnerabilityCVE + }{typename, premarshaled} + return json.Marshal(result) + case *AllCertifyVulnVulnerabilityGHSA: + typename = "GHSA" -func (v *CertifyBadArtifactIngestCertifyBad) __premarshalJSON() (*__premarshalCertifyBadArtifactIngestCertifyBad, error) { - var retval __premarshalCertifyBadArtifactIngestCertifyBad + premarshaled, err := v.__premarshalJSON() + if err != nil { + return nil, err + } + result := struct { + TypeName string `json:"__typename"` + *__premarshalAllCertifyVulnVulnerabilityGHSA + }{typename, premarshaled} + return json.Marshal(result) + case *AllCertifyVulnVulnerabilityNoVuln: + typename = "NoVuln" - retval.Id = v.AllCertifyBad.Id - retval.Justification = v.AllCertifyBad.Justification - { + result := struct { + TypeName string `json:"__typename"` + *AllCertifyVulnVulnerabilityNoVuln + }{typename, v} + return json.Marshal(result) + case *AllCertifyVulnVulnerabilityOSV: + typename = "OSV" - dst := &retval.Subject - src := v.AllCertifyBad.Subject - var err error - *dst, err = __marshalAllCertifyBadSubjectPackageSourceOrArtifact( - &src) + premarshaled, err := v.__premarshalJSON() if err != nil { - return nil, fmt.Errorf( - "unable to marshal CertifyBadArtifactIngestCertifyBad.AllCertifyBad.Subject: %w", err) + return nil, err } + result := struct { + TypeName string `json:"__typename"` + *__premarshalAllCertifyVulnVulnerabilityOSV + }{typename, premarshaled} + return json.Marshal(result) + case nil: + return []byte("null"), nil + default: + return nil, fmt.Errorf( + `unexpected concrete type for AllCertifyVulnVulnerability: "%T"`, v) } - retval.Origin = v.AllCertifyBad.Origin - retval.Collector = v.AllCertifyBad.Collector - return &retval, nil -} - -// CertifyBadArtifactResponse is returned by CertifyBadArtifact on success. -type CertifyBadArtifactResponse struct { - // Adds a certification that a package, source or artifact is considered bad. - IngestCertifyBad CertifyBadArtifactIngestCertifyBad `json:"ingestCertifyBad"` -} - -// GetIngestCertifyBad returns CertifyBadArtifactResponse.IngestCertifyBad, and is useful for accessing the field via an interface. -func (v *CertifyBadArtifactResponse) GetIngestCertifyBad() CertifyBadArtifactIngestCertifyBad { - return v.IngestCertifyBad -} - -// CertifyBadInputSpec represents the mutation input to ingest a CertifyBad -// evidence. -type CertifyBadInputSpec struct { - Justification string `json:"justification"` - Origin string `json:"origin"` - Collector string `json:"collector"` } -// GetJustification returns CertifyBadInputSpec.Justification, and is useful for accessing the field via an interface. -func (v *CertifyBadInputSpec) GetJustification() string { return v.Justification } - -// GetOrigin returns CertifyBadInputSpec.Origin, and is useful for accessing the field via an interface. -func (v *CertifyBadInputSpec) GetOrigin() string { return v.Origin } - -// GetCollector returns CertifyBadInputSpec.Collector, and is useful for accessing the field via an interface. -func (v *CertifyBadInputSpec) GetCollector() string { return v.Collector } - -// CertifyBadPkgIngestCertifyBad includes the requested fields of the GraphQL type CertifyBad. +// AllCertifyVulnVulnerabilityCVE includes the requested fields of the GraphQL type CVE. // The GraphQL type's documentation follows. // -// CertifyBad is an attestation that a package, source, or artifact is considered -// bad. +// CVE represents a vulnerability in the Common Vulnerabilities and Exposures +// schema. // -// All evidence trees record a justification for the property they represent as -// well as the document that contains the attestation (origin) and the collector -// that collected the document (collector). +// The vulnerability identifier contains a year field, so we are extracting that +// to allow matching for vulnerabilities found in a given year. // -// The certification applies to a subject which is a package, source, or artifact. -// If the attestation targets a package, it must target a PackageName or a -// PackageVersion. If the attestation targets a source, it must target a -// SourceName. -type CertifyBadPkgIngestCertifyBad struct { - AllCertifyBad `json:"-"` +// The vulnerability identifier field is mandatory and canonicalized to be +// lowercase. +// +// This node can be referred to by other parts of GUAC. +type AllCertifyVulnVulnerabilityCVE struct { + Typename *string `json:"__typename"` + AllCveTree `json:"-"` } -// GetId returns CertifyBadPkgIngestCertifyBad.Id, and is useful for accessing the field via an interface. -func (v *CertifyBadPkgIngestCertifyBad) GetId() string { return v.AllCertifyBad.Id } - -// GetJustification returns CertifyBadPkgIngestCertifyBad.Justification, and is useful for accessing the field via an interface. -func (v *CertifyBadPkgIngestCertifyBad) GetJustification() string { - return v.AllCertifyBad.Justification -} +// GetTypename returns AllCertifyVulnVulnerabilityCVE.Typename, and is useful for accessing the field via an interface. +func (v *AllCertifyVulnVulnerabilityCVE) GetTypename() *string { return v.Typename } -// GetSubject returns CertifyBadPkgIngestCertifyBad.Subject, and is useful for accessing the field via an interface. -func (v *CertifyBadPkgIngestCertifyBad) GetSubject() AllCertifyBadSubjectPackageSourceOrArtifact { - return v.AllCertifyBad.Subject -} +// GetId returns AllCertifyVulnVulnerabilityCVE.Id, and is useful for accessing the field via an interface. +func (v *AllCertifyVulnVulnerabilityCVE) GetId() string { return v.AllCveTree.Id } -// GetOrigin returns CertifyBadPkgIngestCertifyBad.Origin, and is useful for accessing the field via an interface. -func (v *CertifyBadPkgIngestCertifyBad) GetOrigin() string { return v.AllCertifyBad.Origin } +// GetYear returns AllCertifyVulnVulnerabilityCVE.Year, and is useful for accessing the field via an interface. +func (v *AllCertifyVulnVulnerabilityCVE) GetYear() int { return v.AllCveTree.Year } -// GetCollector returns CertifyBadPkgIngestCertifyBad.Collector, and is useful for accessing the field via an interface. -func (v *CertifyBadPkgIngestCertifyBad) GetCollector() string { return v.AllCertifyBad.Collector } +// GetCveId returns AllCertifyVulnVulnerabilityCVE.CveId, and is useful for accessing the field via an interface. +func (v *AllCertifyVulnVulnerabilityCVE) GetCveId() string { return v.AllCveTree.CveId } -func (v *CertifyBadPkgIngestCertifyBad) UnmarshalJSON(b []byte) error { +func (v *AllCertifyVulnVulnerabilityCVE) UnmarshalJSON(b []byte) error { if string(b) == "null" { return nil } var firstPass struct { - *CertifyBadPkgIngestCertifyBad + *AllCertifyVulnVulnerabilityCVE graphql.NoUnmarshalJSON } - firstPass.CertifyBadPkgIngestCertifyBad = v + firstPass.AllCertifyVulnVulnerabilityCVE = v err := json.Unmarshal(b, &firstPass) if err != nil { @@ -2460,26 +2350,24 @@ func (v *CertifyBadPkgIngestCertifyBad) UnmarshalJSON(b []byte) error { } err = json.Unmarshal( - b, &v.AllCertifyBad) + b, &v.AllCveTree) if err != nil { return err } return nil } -type __premarshalCertifyBadPkgIngestCertifyBad struct { - Id string `json:"id"` - - Justification string `json:"justification"` +type __premarshalAllCertifyVulnVulnerabilityCVE struct { + Typename *string `json:"__typename"` - Subject json.RawMessage `json:"subject"` + Id string `json:"id"` - Origin string `json:"origin"` + Year int `json:"year"` - Collector string `json:"collector"` + CveId string `json:"cveId"` } -func (v *CertifyBadPkgIngestCertifyBad) MarshalJSON() ([]byte, error) { +func (v *AllCertifyVulnVulnerabilityCVE) MarshalJSON() ([]byte, error) { premarshaled, err := v.__premarshalJSON() if err != nil { return nil, err @@ -2487,119 +2375,49 @@ func (v *CertifyBadPkgIngestCertifyBad) MarshalJSON() ([]byte, error) { return json.Marshal(premarshaled) } -func (v *CertifyBadPkgIngestCertifyBad) __premarshalJSON() (*__premarshalCertifyBadPkgIngestCertifyBad, error) { - var retval __premarshalCertifyBadPkgIngestCertifyBad - - retval.Id = v.AllCertifyBad.Id - retval.Justification = v.AllCertifyBad.Justification - { +func (v *AllCertifyVulnVulnerabilityCVE) __premarshalJSON() (*__premarshalAllCertifyVulnVulnerabilityCVE, error) { + var retval __premarshalAllCertifyVulnVulnerabilityCVE - dst := &retval.Subject - src := v.AllCertifyBad.Subject - var err error - *dst, err = __marshalAllCertifyBadSubjectPackageSourceOrArtifact( - &src) - if err != nil { - return nil, fmt.Errorf( - "unable to marshal CertifyBadPkgIngestCertifyBad.AllCertifyBad.Subject: %w", err) - } - } - retval.Origin = v.AllCertifyBad.Origin - retval.Collector = v.AllCertifyBad.Collector + retval.Typename = v.Typename + retval.Id = v.AllCveTree.Id + retval.Year = v.AllCveTree.Year + retval.CveId = v.AllCveTree.CveId return &retval, nil } -// CertifyBadPkgResponse is returned by CertifyBadPkg on success. -type CertifyBadPkgResponse struct { - // Adds a certification that a package, source or artifact is considered bad. - IngestCertifyBad CertifyBadPkgIngestCertifyBad `json:"ingestCertifyBad"` -} - -// GetIngestCertifyBad returns CertifyBadPkgResponse.IngestCertifyBad, and is useful for accessing the field via an interface. -func (v *CertifyBadPkgResponse) GetIngestCertifyBad() CertifyBadPkgIngestCertifyBad { - return v.IngestCertifyBad -} - -// CertifyBadSpec allows filtering the list of CertifyBad evidence to return in a -// query. +// AllCertifyVulnVulnerabilityGHSA includes the requested fields of the GraphQL type GHSA. +// The GraphQL type's documentation follows. // -// If a package is specified in the subject filter, then it must be specified up -// to PackageName or PackageVersion. That is, user must specify package name, or -// name and one of version, qualifiers, or subpath. +// GHSA represents GitHub security advisories. // -// If a source is specified in the subject filter, then it must specify a name, -// and optionally a tag and a commit. -type CertifyBadSpec struct { - Id *string `json:"id"` - Subject *PackageSourceOrArtifactSpec `json:"subject"` - Justification *string `json:"justification"` - Origin *string `json:"origin"` - Collector *string `json:"collector"` +// The advisory id field is mandatory and canonicalized to be lowercase. +// +// This node can be referred to by other parts of GUAC. +type AllCertifyVulnVulnerabilityGHSA struct { + Typename *string `json:"__typename"` + AllGHSATree `json:"-"` } -// GetId returns CertifyBadSpec.Id, and is useful for accessing the field via an interface. -func (v *CertifyBadSpec) GetId() *string { return v.Id } +// GetTypename returns AllCertifyVulnVulnerabilityGHSA.Typename, and is useful for accessing the field via an interface. +func (v *AllCertifyVulnVulnerabilityGHSA) GetTypename() *string { return v.Typename } -// GetSubject returns CertifyBadSpec.Subject, and is useful for accessing the field via an interface. -func (v *CertifyBadSpec) GetSubject() *PackageSourceOrArtifactSpec { return v.Subject } +// GetId returns AllCertifyVulnVulnerabilityGHSA.Id, and is useful for accessing the field via an interface. +func (v *AllCertifyVulnVulnerabilityGHSA) GetId() string { return v.AllGHSATree.Id } -// GetJustification returns CertifyBadSpec.Justification, and is useful for accessing the field via an interface. -func (v *CertifyBadSpec) GetJustification() *string { return v.Justification } +// GetGhsaId returns AllCertifyVulnVulnerabilityGHSA.GhsaId, and is useful for accessing the field via an interface. +func (v *AllCertifyVulnVulnerabilityGHSA) GetGhsaId() string { return v.AllGHSATree.GhsaId } -// GetOrigin returns CertifyBadSpec.Origin, and is useful for accessing the field via an interface. -func (v *CertifyBadSpec) GetOrigin() *string { return v.Origin } +func (v *AllCertifyVulnVulnerabilityGHSA) UnmarshalJSON(b []byte) error { -// GetCollector returns CertifyBadSpec.Collector, and is useful for accessing the field via an interface. -func (v *CertifyBadSpec) GetCollector() *string { return v.Collector } - -// CertifyBadSrcIngestCertifyBad includes the requested fields of the GraphQL type CertifyBad. -// The GraphQL type's documentation follows. -// -// CertifyBad is an attestation that a package, source, or artifact is considered -// bad. -// -// All evidence trees record a justification for the property they represent as -// well as the document that contains the attestation (origin) and the collector -// that collected the document (collector). -// -// The certification applies to a subject which is a package, source, or artifact. -// If the attestation targets a package, it must target a PackageName or a -// PackageVersion. If the attestation targets a source, it must target a -// SourceName. -type CertifyBadSrcIngestCertifyBad struct { - AllCertifyBad `json:"-"` -} - -// GetId returns CertifyBadSrcIngestCertifyBad.Id, and is useful for accessing the field via an interface. -func (v *CertifyBadSrcIngestCertifyBad) GetId() string { return v.AllCertifyBad.Id } - -// GetJustification returns CertifyBadSrcIngestCertifyBad.Justification, and is useful for accessing the field via an interface. -func (v *CertifyBadSrcIngestCertifyBad) GetJustification() string { - return v.AllCertifyBad.Justification -} - -// GetSubject returns CertifyBadSrcIngestCertifyBad.Subject, and is useful for accessing the field via an interface. -func (v *CertifyBadSrcIngestCertifyBad) GetSubject() AllCertifyBadSubjectPackageSourceOrArtifact { - return v.AllCertifyBad.Subject -} - -// GetOrigin returns CertifyBadSrcIngestCertifyBad.Origin, and is useful for accessing the field via an interface. -func (v *CertifyBadSrcIngestCertifyBad) GetOrigin() string { return v.AllCertifyBad.Origin } - -// GetCollector returns CertifyBadSrcIngestCertifyBad.Collector, and is useful for accessing the field via an interface. -func (v *CertifyBadSrcIngestCertifyBad) GetCollector() string { return v.AllCertifyBad.Collector } - -func (v *CertifyBadSrcIngestCertifyBad) UnmarshalJSON(b []byte) error { - - if string(b) == "null" { - return nil - } + if string(b) == "null" { + return nil + } var firstPass struct { - *CertifyBadSrcIngestCertifyBad + *AllCertifyVulnVulnerabilityGHSA graphql.NoUnmarshalJSON } - firstPass.CertifyBadSrcIngestCertifyBad = v + firstPass.AllCertifyVulnVulnerabilityGHSA = v err := json.Unmarshal(b, &firstPass) if err != nil { @@ -2607,26 +2425,22 @@ func (v *CertifyBadSrcIngestCertifyBad) UnmarshalJSON(b []byte) error { } err = json.Unmarshal( - b, &v.AllCertifyBad) + b, &v.AllGHSATree) if err != nil { return err } return nil } -type __premarshalCertifyBadSrcIngestCertifyBad struct { - Id string `json:"id"` - - Justification string `json:"justification"` - - Subject json.RawMessage `json:"subject"` +type __premarshalAllCertifyVulnVulnerabilityGHSA struct { + Typename *string `json:"__typename"` - Origin string `json:"origin"` + Id string `json:"id"` - Collector string `json:"collector"` + GhsaId string `json:"ghsaId"` } -func (v *CertifyBadSrcIngestCertifyBad) MarshalJSON() ([]byte, error) { +func (v *AllCertifyVulnVulnerabilityGHSA) MarshalJSON() ([]byte, error) { premarshaled, err := v.__premarshalJSON() if err != nil { return nil, err @@ -2634,85 +2448,69 @@ func (v *CertifyBadSrcIngestCertifyBad) MarshalJSON() ([]byte, error) { return json.Marshal(premarshaled) } -func (v *CertifyBadSrcIngestCertifyBad) __premarshalJSON() (*__premarshalCertifyBadSrcIngestCertifyBad, error) { - var retval __premarshalCertifyBadSrcIngestCertifyBad - - retval.Id = v.AllCertifyBad.Id - retval.Justification = v.AllCertifyBad.Justification - { +func (v *AllCertifyVulnVulnerabilityGHSA) __premarshalJSON() (*__premarshalAllCertifyVulnVulnerabilityGHSA, error) { + var retval __premarshalAllCertifyVulnVulnerabilityGHSA - dst := &retval.Subject - src := v.AllCertifyBad.Subject - var err error - *dst, err = __marshalAllCertifyBadSubjectPackageSourceOrArtifact( - &src) - if err != nil { - return nil, fmt.Errorf( - "unable to marshal CertifyBadSrcIngestCertifyBad.AllCertifyBad.Subject: %w", err) - } - } - retval.Origin = v.AllCertifyBad.Origin - retval.Collector = v.AllCertifyBad.Collector + retval.Typename = v.Typename + retval.Id = v.AllGHSATree.Id + retval.GhsaId = v.AllGHSATree.GhsaId return &retval, nil } -// CertifyBadSrcResponse is returned by CertifyBadSrc on success. -type CertifyBadSrcResponse struct { - // Adds a certification that a package, source or artifact is considered bad. - IngestCertifyBad CertifyBadSrcIngestCertifyBad `json:"ingestCertifyBad"` +// AllCertifyVulnVulnerabilityNoVuln includes the requested fields of the GraphQL type NoVuln. +// The GraphQL type's documentation follows. +// +// NoVuln is a special vulnerability node to attest that no vulnerability has been +// found during a vulnerability scan. +// +// Backends guarantee that this is a singleton node. +type AllCertifyVulnVulnerabilityNoVuln struct { + Typename *string `json:"__typename"` + Id string `json:"id"` } -// GetIngestCertifyBad returns CertifyBadSrcResponse.IngestCertifyBad, and is useful for accessing the field via an interface. -func (v *CertifyBadSrcResponse) GetIngestCertifyBad() CertifyBadSrcIngestCertifyBad { - return v.IngestCertifyBad -} +// GetTypename returns AllCertifyVulnVulnerabilityNoVuln.Typename, and is useful for accessing the field via an interface. +func (v *AllCertifyVulnVulnerabilityNoVuln) GetTypename() *string { return v.Typename } -// CertifyBadsCertifyBad includes the requested fields of the GraphQL type CertifyBad. +// GetId returns AllCertifyVulnVulnerabilityNoVuln.Id, and is useful for accessing the field via an interface. +func (v *AllCertifyVulnVulnerabilityNoVuln) GetId() string { return v.Id } + +// AllCertifyVulnVulnerabilityOSV includes the requested fields of the GraphQL type OSV. // The GraphQL type's documentation follows. // -// CertifyBad is an attestation that a package, source, or artifact is considered -// bad. +// OSV represents an Open Source Vulnerability. // -// All evidence trees record a justification for the property they represent as -// well as the document that contains the attestation (origin) and the collector -// that collected the document (collector). +// The osvId field is mandatory and canonicalized to be lowercase. // -// The certification applies to a subject which is a package, source, or artifact. -// If the attestation targets a package, it must target a PackageName or a -// PackageVersion. If the attestation targets a source, it must target a -// SourceName. -type CertifyBadsCertifyBad struct { - AllCertifyBad `json:"-"` +// This maps to a vulnerability ID specific to the environment (e.g., GHSA ID or +// CVE ID). +// +// This node can be referred to by other parts of GUAC. +type AllCertifyVulnVulnerabilityOSV struct { + Typename *string `json:"__typename"` + AllOSVTree `json:"-"` } -// GetId returns CertifyBadsCertifyBad.Id, and is useful for accessing the field via an interface. -func (v *CertifyBadsCertifyBad) GetId() string { return v.AllCertifyBad.Id } - -// GetJustification returns CertifyBadsCertifyBad.Justification, and is useful for accessing the field via an interface. -func (v *CertifyBadsCertifyBad) GetJustification() string { return v.AllCertifyBad.Justification } - -// GetSubject returns CertifyBadsCertifyBad.Subject, and is useful for accessing the field via an interface. -func (v *CertifyBadsCertifyBad) GetSubject() AllCertifyBadSubjectPackageSourceOrArtifact { - return v.AllCertifyBad.Subject -} +// GetTypename returns AllCertifyVulnVulnerabilityOSV.Typename, and is useful for accessing the field via an interface. +func (v *AllCertifyVulnVulnerabilityOSV) GetTypename() *string { return v.Typename } -// GetOrigin returns CertifyBadsCertifyBad.Origin, and is useful for accessing the field via an interface. -func (v *CertifyBadsCertifyBad) GetOrigin() string { return v.AllCertifyBad.Origin } +// GetId returns AllCertifyVulnVulnerabilityOSV.Id, and is useful for accessing the field via an interface. +func (v *AllCertifyVulnVulnerabilityOSV) GetId() string { return v.AllOSVTree.Id } -// GetCollector returns CertifyBadsCertifyBad.Collector, and is useful for accessing the field via an interface. -func (v *CertifyBadsCertifyBad) GetCollector() string { return v.AllCertifyBad.Collector } +// GetOsvId returns AllCertifyVulnVulnerabilityOSV.OsvId, and is useful for accessing the field via an interface. +func (v *AllCertifyVulnVulnerabilityOSV) GetOsvId() string { return v.AllOSVTree.OsvId } -func (v *CertifyBadsCertifyBad) UnmarshalJSON(b []byte) error { +func (v *AllCertifyVulnVulnerabilityOSV) UnmarshalJSON(b []byte) error { if string(b) == "null" { return nil } var firstPass struct { - *CertifyBadsCertifyBad + *AllCertifyVulnVulnerabilityOSV graphql.NoUnmarshalJSON } - firstPass.CertifyBadsCertifyBad = v + firstPass.AllCertifyVulnVulnerabilityOSV = v err := json.Unmarshal(b, &firstPass) if err != nil { @@ -2720,26 +2518,22 @@ func (v *CertifyBadsCertifyBad) UnmarshalJSON(b []byte) error { } err = json.Unmarshal( - b, &v.AllCertifyBad) + b, &v.AllOSVTree) if err != nil { return err } return nil } -type __premarshalCertifyBadsCertifyBad struct { - Id string `json:"id"` - - Justification string `json:"justification"` - - Subject json.RawMessage `json:"subject"` +type __premarshalAllCertifyVulnVulnerabilityOSV struct { + Typename *string `json:"__typename"` - Origin string `json:"origin"` + Id string `json:"id"` - Collector string `json:"collector"` + OsvId string `json:"osvId"` } -func (v *CertifyBadsCertifyBad) MarshalJSON() ([]byte, error) { +func (v *AllCertifyVulnVulnerabilityOSV) MarshalJSON() ([]byte, error) { premarshaled, err := v.__premarshalJSON() if err != nil { return nil, err @@ -2747,102 +2541,166 @@ func (v *CertifyBadsCertifyBad) MarshalJSON() ([]byte, error) { return json.Marshal(premarshaled) } -func (v *CertifyBadsCertifyBad) __premarshalJSON() (*__premarshalCertifyBadsCertifyBad, error) { - var retval __premarshalCertifyBadsCertifyBad - - retval.Id = v.AllCertifyBad.Id - retval.Justification = v.AllCertifyBad.Justification - { +func (v *AllCertifyVulnVulnerabilityOSV) __premarshalJSON() (*__premarshalAllCertifyVulnVulnerabilityOSV, error) { + var retval __premarshalAllCertifyVulnVulnerabilityOSV - dst := &retval.Subject - src := v.AllCertifyBad.Subject - var err error - *dst, err = __marshalAllCertifyBadSubjectPackageSourceOrArtifact( - &src) - if err != nil { - return nil, fmt.Errorf( - "unable to marshal CertifyBadsCertifyBad.AllCertifyBad.Subject: %w", err) - } - } - retval.Origin = v.AllCertifyBad.Origin - retval.Collector = v.AllCertifyBad.Collector + retval.Typename = v.Typename + retval.Id = v.AllOSVTree.Id + retval.OsvId = v.AllOSVTree.OsvId return &retval, nil } -// CertifyBadsResponse is returned by CertifyBads on success. -type CertifyBadsResponse struct { - // Returns all CertifyBad attestations matching a filter. - CertifyBad []CertifyBadsCertifyBad `json:"CertifyBad"` -} - -// GetCertifyBad returns CertifyBadsResponse.CertifyBad, and is useful for accessing the field via an interface. -func (v *CertifyBadsResponse) GetCertifyBad() []CertifyBadsCertifyBad { return v.CertifyBad } - -// CertifyCVEIngestVulnerabilityCertifyVuln includes the requested fields of the GraphQL type CertifyVuln. +// AllCveTree includes the GraphQL fields of CVE requested by the fragment AllCveTree. // The GraphQL type's documentation follows. // -// CertifyVuln is an attestation to attach vulnerability information to a package. +// CVE represents a vulnerability in the Common Vulnerabilities and Exposures +// schema. // -// This information is obtained via a scanner. If there is no vulnerability -// detected (no OSV, CVE, or GHSA), we attach the special NoVuln node. -type CertifyCVEIngestVulnerabilityCertifyVuln struct { - AllCertifyVuln `json:"-"` +// The vulnerability identifier contains a year field, so we are extracting that +// to allow matching for vulnerabilities found in a given year. +// +// The vulnerability identifier field is mandatory and canonicalized to be +// lowercase. +// +// This node can be referred to by other parts of GUAC. +type AllCveTree struct { + Id string `json:"id"` + Year int `json:"year"` + CveId string `json:"cveId"` } -// GetId returns CertifyCVEIngestVulnerabilityCertifyVuln.Id, and is useful for accessing the field via an interface. -func (v *CertifyCVEIngestVulnerabilityCertifyVuln) GetId() string { return v.AllCertifyVuln.Id } +// GetId returns AllCveTree.Id, and is useful for accessing the field via an interface. +func (v *AllCveTree) GetId() string { return v.Id } -// GetPackage returns CertifyCVEIngestVulnerabilityCertifyVuln.Package, and is useful for accessing the field via an interface. -func (v *CertifyCVEIngestVulnerabilityCertifyVuln) GetPackage() AllCertifyVulnPackage { - return v.AllCertifyVuln.Package -} +// GetYear returns AllCveTree.Year, and is useful for accessing the field via an interface. +func (v *AllCveTree) GetYear() int { return v.Year } -// GetVulnerability returns CertifyCVEIngestVulnerabilityCertifyVuln.Vulnerability, and is useful for accessing the field via an interface. -func (v *CertifyCVEIngestVulnerabilityCertifyVuln) GetVulnerability() AllCertifyVulnVulnerability { - return v.AllCertifyVuln.Vulnerability -} +// GetCveId returns AllCveTree.CveId, and is useful for accessing the field via an interface. +func (v *AllCveTree) GetCveId() string { return v.CveId } -// GetMetadata returns CertifyCVEIngestVulnerabilityCertifyVuln.Metadata, and is useful for accessing the field via an interface. -func (v *CertifyCVEIngestVulnerabilityCertifyVuln) GetMetadata() AllCertifyVulnMetadataVulnerabilityMetaData { - return v.AllCertifyVuln.Metadata +// AllGHSATree includes the GraphQL fields of GHSA requested by the fragment AllGHSATree. +// The GraphQL type's documentation follows. +// +// GHSA represents GitHub security advisories. +// +// The advisory id field is mandatory and canonicalized to be lowercase. +// +// This node can be referred to by other parts of GUAC. +type AllGHSATree struct { + Id string `json:"id"` + GhsaId string `json:"ghsaId"` } -func (v *CertifyCVEIngestVulnerabilityCertifyVuln) UnmarshalJSON(b []byte) error { +// GetId returns AllGHSATree.Id, and is useful for accessing the field via an interface. +func (v *AllGHSATree) GetId() string { return v.Id } - if string(b) == "null" { - return nil - } +// GetGhsaId returns AllGHSATree.GhsaId, and is useful for accessing the field via an interface. +func (v *AllGHSATree) GetGhsaId() string { return v.GhsaId } - var firstPass struct { - *CertifyCVEIngestVulnerabilityCertifyVuln +// AllHasMetadata includes the GraphQL fields of HasMetadata requested by the fragment AllHasMetadata. +// The GraphQL type's documentation follows. +// +// HasMetadata is an attestation that a package, source, or artifact has a certain +// attested property (key) with value (value). For example, a source may have +// metadata "SourceRepo2FAEnabled=true". +// +// The intent of this evidence tree predicate is to allow extensibility of metadata +// expressible within the GUAC ontology. Metadata that is commonly used will then +// be promoted to a predicate on its own. +// +// Justification indicates how the metadata was determined. +// +// The metadata applies to a subject which is a package, source, or artifact. +// If the attestation targets a package, it must target a PackageName or a +// PackageVersion. If the attestation targets a source, it must target a +// SourceName. +type AllHasMetadata struct { + Id string `json:"id"` + Subject AllHasMetadataSubjectPackageSourceOrArtifact `json:"-"` + Key string `json:"key"` + Value string `json:"value"` + Timestamp time.Time `json:"timestamp"` + Justification string `json:"justification"` + Origin string `json:"origin"` + Collector string `json:"collector"` +} + +// GetId returns AllHasMetadata.Id, and is useful for accessing the field via an interface. +func (v *AllHasMetadata) GetId() string { return v.Id } + +// GetSubject returns AllHasMetadata.Subject, and is useful for accessing the field via an interface. +func (v *AllHasMetadata) GetSubject() AllHasMetadataSubjectPackageSourceOrArtifact { return v.Subject } + +// GetKey returns AllHasMetadata.Key, and is useful for accessing the field via an interface. +func (v *AllHasMetadata) GetKey() string { return v.Key } + +// GetValue returns AllHasMetadata.Value, and is useful for accessing the field via an interface. +func (v *AllHasMetadata) GetValue() string { return v.Value } + +// GetTimestamp returns AllHasMetadata.Timestamp, and is useful for accessing the field via an interface. +func (v *AllHasMetadata) GetTimestamp() time.Time { return v.Timestamp } + +// GetJustification returns AllHasMetadata.Justification, and is useful for accessing the field via an interface. +func (v *AllHasMetadata) GetJustification() string { return v.Justification } + +// GetOrigin returns AllHasMetadata.Origin, and is useful for accessing the field via an interface. +func (v *AllHasMetadata) GetOrigin() string { return v.Origin } + +// GetCollector returns AllHasMetadata.Collector, and is useful for accessing the field via an interface. +func (v *AllHasMetadata) GetCollector() string { return v.Collector } + +func (v *AllHasMetadata) UnmarshalJSON(b []byte) error { + + if string(b) == "null" { + return nil + } + + var firstPass struct { + *AllHasMetadata + Subject json.RawMessage `json:"subject"` graphql.NoUnmarshalJSON } - firstPass.CertifyCVEIngestVulnerabilityCertifyVuln = v + firstPass.AllHasMetadata = v err := json.Unmarshal(b, &firstPass) if err != nil { return err } - err = json.Unmarshal( - b, &v.AllCertifyVuln) - if err != nil { - return err + { + dst := &v.Subject + src := firstPass.Subject + if len(src) != 0 && string(src) != "null" { + err = __unmarshalAllHasMetadataSubjectPackageSourceOrArtifact( + src, dst) + if err != nil { + return fmt.Errorf( + "unable to unmarshal AllHasMetadata.Subject: %w", err) + } + } } return nil } -type __premarshalCertifyCVEIngestVulnerabilityCertifyVuln struct { +type __premarshalAllHasMetadata struct { Id string `json:"id"` - Package AllCertifyVulnPackage `json:"package"` + Subject json.RawMessage `json:"subject"` - Vulnerability json.RawMessage `json:"vulnerability"` + Key string `json:"key"` - Metadata AllCertifyVulnMetadataVulnerabilityMetaData `json:"metadata"` + Value string `json:"value"` + + Timestamp time.Time `json:"timestamp"` + + Justification string `json:"justification"` + + Origin string `json:"origin"` + + Collector string `json:"collector"` } -func (v *CertifyCVEIngestVulnerabilityCertifyVuln) MarshalJSON() ([]byte, error) { +func (v *AllHasMetadata) MarshalJSON() ([]byte, error) { premarshaled, err := v.__premarshalJSON() if err != nil { return nil, err @@ -2850,78 +2708,69 @@ func (v *CertifyCVEIngestVulnerabilityCertifyVuln) MarshalJSON() ([]byte, error) return json.Marshal(premarshaled) } -func (v *CertifyCVEIngestVulnerabilityCertifyVuln) __premarshalJSON() (*__premarshalCertifyCVEIngestVulnerabilityCertifyVuln, error) { - var retval __premarshalCertifyCVEIngestVulnerabilityCertifyVuln +func (v *AllHasMetadata) __premarshalJSON() (*__premarshalAllHasMetadata, error) { + var retval __premarshalAllHasMetadata - retval.Id = v.AllCertifyVuln.Id - retval.Package = v.AllCertifyVuln.Package + retval.Id = v.Id { - dst := &retval.Vulnerability - src := v.AllCertifyVuln.Vulnerability + dst := &retval.Subject + src := v.Subject var err error - *dst, err = __marshalAllCertifyVulnVulnerability( + *dst, err = __marshalAllHasMetadataSubjectPackageSourceOrArtifact( &src) if err != nil { return nil, fmt.Errorf( - "unable to marshal CertifyCVEIngestVulnerabilityCertifyVuln.AllCertifyVuln.Vulnerability: %w", err) + "unable to marshal AllHasMetadata.Subject: %w", err) } } - retval.Metadata = v.AllCertifyVuln.Metadata + retval.Key = v.Key + retval.Value = v.Value + retval.Timestamp = v.Timestamp + retval.Justification = v.Justification + retval.Origin = v.Origin + retval.Collector = v.Collector return &retval, nil } -// CertifyCVEResponse is returned by CertifyCVE on success. -type CertifyCVEResponse struct { - // Adds a certification that a package has been scanned for vulnerabilities. - IngestVulnerability CertifyCVEIngestVulnerabilityCertifyVuln `json:"ingestVulnerability"` -} - -// GetIngestVulnerability returns CertifyCVEResponse.IngestVulnerability, and is useful for accessing the field via an interface. -func (v *CertifyCVEResponse) GetIngestVulnerability() CertifyCVEIngestVulnerabilityCertifyVuln { - return v.IngestVulnerability -} - -// CertifyGHSAIngestVulnerabilityCertifyVuln includes the requested fields of the GraphQL type CertifyVuln. +// AllHasMetadataSubjectArtifact includes the requested fields of the GraphQL type Artifact. // The GraphQL type's documentation follows. // -// CertifyVuln is an attestation to attach vulnerability information to a package. +// Artifact represents an artifact identified by a checksum hash. // -// This information is obtained via a scanner. If there is no vulnerability -// detected (no OSV, CVE, or GHSA), we attach the special NoVuln node. -type CertifyGHSAIngestVulnerabilityCertifyVuln struct { - AllCertifyVuln `json:"-"` +// The checksum is split into the digest value and the algorithm used to generate +// it. Both fields are mandatory and canonicalized to be lowercase. +// +// If having a checksum Go object, algorithm can be +// strings.ToLower(string(checksum.Algorithm)) and digest can be checksum.Value. +type AllHasMetadataSubjectArtifact struct { + Typename *string `json:"__typename"` + AllArtifactTree `json:"-"` } -// GetId returns CertifyGHSAIngestVulnerabilityCertifyVuln.Id, and is useful for accessing the field via an interface. -func (v *CertifyGHSAIngestVulnerabilityCertifyVuln) GetId() string { return v.AllCertifyVuln.Id } +// GetTypename returns AllHasMetadataSubjectArtifact.Typename, and is useful for accessing the field via an interface. +func (v *AllHasMetadataSubjectArtifact) GetTypename() *string { return v.Typename } -// GetPackage returns CertifyGHSAIngestVulnerabilityCertifyVuln.Package, and is useful for accessing the field via an interface. -func (v *CertifyGHSAIngestVulnerabilityCertifyVuln) GetPackage() AllCertifyVulnPackage { - return v.AllCertifyVuln.Package -} +// GetId returns AllHasMetadataSubjectArtifact.Id, and is useful for accessing the field via an interface. +func (v *AllHasMetadataSubjectArtifact) GetId() string { return v.AllArtifactTree.Id } -// GetVulnerability returns CertifyGHSAIngestVulnerabilityCertifyVuln.Vulnerability, and is useful for accessing the field via an interface. -func (v *CertifyGHSAIngestVulnerabilityCertifyVuln) GetVulnerability() AllCertifyVulnVulnerability { - return v.AllCertifyVuln.Vulnerability -} +// GetAlgorithm returns AllHasMetadataSubjectArtifact.Algorithm, and is useful for accessing the field via an interface. +func (v *AllHasMetadataSubjectArtifact) GetAlgorithm() string { return v.AllArtifactTree.Algorithm } -// GetMetadata returns CertifyGHSAIngestVulnerabilityCertifyVuln.Metadata, and is useful for accessing the field via an interface. -func (v *CertifyGHSAIngestVulnerabilityCertifyVuln) GetMetadata() AllCertifyVulnMetadataVulnerabilityMetaData { - return v.AllCertifyVuln.Metadata -} +// GetDigest returns AllHasMetadataSubjectArtifact.Digest, and is useful for accessing the field via an interface. +func (v *AllHasMetadataSubjectArtifact) GetDigest() string { return v.AllArtifactTree.Digest } -func (v *CertifyGHSAIngestVulnerabilityCertifyVuln) UnmarshalJSON(b []byte) error { +func (v *AllHasMetadataSubjectArtifact) UnmarshalJSON(b []byte) error { if string(b) == "null" { return nil } var firstPass struct { - *CertifyGHSAIngestVulnerabilityCertifyVuln + *AllHasMetadataSubjectArtifact graphql.NoUnmarshalJSON } - firstPass.CertifyGHSAIngestVulnerabilityCertifyVuln = v + firstPass.AllHasMetadataSubjectArtifact = v err := json.Unmarshal(b, &firstPass) if err != nil { @@ -2929,24 +2778,24 @@ func (v *CertifyGHSAIngestVulnerabilityCertifyVuln) UnmarshalJSON(b []byte) erro } err = json.Unmarshal( - b, &v.AllCertifyVuln) + b, &v.AllArtifactTree) if err != nil { return err } return nil } -type __premarshalCertifyGHSAIngestVulnerabilityCertifyVuln struct { - Id string `json:"id"` +type __premarshalAllHasMetadataSubjectArtifact struct { + Typename *string `json:"__typename"` - Package AllCertifyVulnPackage `json:"package"` + Id string `json:"id"` - Vulnerability json.RawMessage `json:"vulnerability"` + Algorithm string `json:"algorithm"` - Metadata AllCertifyVulnMetadataVulnerabilityMetaData `json:"metadata"` + Digest string `json:"digest"` } -func (v *CertifyGHSAIngestVulnerabilityCertifyVuln) MarshalJSON() ([]byte, error) { +func (v *AllHasMetadataSubjectArtifact) MarshalJSON() ([]byte, error) { premarshaled, err := v.__premarshalJSON() if err != nil { return nil, err @@ -2954,88 +2803,63 @@ func (v *CertifyGHSAIngestVulnerabilityCertifyVuln) MarshalJSON() ([]byte, error return json.Marshal(premarshaled) } -func (v *CertifyGHSAIngestVulnerabilityCertifyVuln) __premarshalJSON() (*__premarshalCertifyGHSAIngestVulnerabilityCertifyVuln, error) { - var retval __premarshalCertifyGHSAIngestVulnerabilityCertifyVuln - - retval.Id = v.AllCertifyVuln.Id - retval.Package = v.AllCertifyVuln.Package - { +func (v *AllHasMetadataSubjectArtifact) __premarshalJSON() (*__premarshalAllHasMetadataSubjectArtifact, error) { + var retval __premarshalAllHasMetadataSubjectArtifact - dst := &retval.Vulnerability - src := v.AllCertifyVuln.Vulnerability - var err error - *dst, err = __marshalAllCertifyVulnVulnerability( - &src) - if err != nil { - return nil, fmt.Errorf( - "unable to marshal CertifyGHSAIngestVulnerabilityCertifyVuln.AllCertifyVuln.Vulnerability: %w", err) - } - } - retval.Metadata = v.AllCertifyVuln.Metadata + retval.Typename = v.Typename + retval.Id = v.AllArtifactTree.Id + retval.Algorithm = v.AllArtifactTree.Algorithm + retval.Digest = v.AllArtifactTree.Digest return &retval, nil } -// CertifyGHSAResponse is returned by CertifyGHSA on success. -type CertifyGHSAResponse struct { - // Adds a certification that a package has been scanned for vulnerabilities. - IngestVulnerability CertifyGHSAIngestVulnerabilityCertifyVuln `json:"ingestVulnerability"` -} - -// GetIngestVulnerability returns CertifyGHSAResponse.IngestVulnerability, and is useful for accessing the field via an interface. -func (v *CertifyGHSAResponse) GetIngestVulnerability() CertifyGHSAIngestVulnerabilityCertifyVuln { - return v.IngestVulnerability -} - -// CertifyGoodArtifactIngestCertifyGood includes the requested fields of the GraphQL type CertifyGood. +// AllHasMetadataSubjectPackage includes the requested fields of the GraphQL type Package. // The GraphQL type's documentation follows. // -// CertifyGood is an attestation that a package, source, or artifact is considered -// good. +// Package represents the root of the package trie/tree. // -// All evidence trees record a justification for the property they represent as -// well as the document that contains the attestation (origin) and the collector -// that collected the document (collector). +// We map package information to a trie, closely matching the pURL specification +// (https://github.com/package-url/purl-spec/blob/0dd92f26f8bb11956ffdf5e8acfcee71e8560407/README.rst), +// but deviating from it where GUAC heuristics allow for better representation of +// package information. Each path in the trie fully represents a package; we split +// the trie based on the pURL components. // -// The certification applies to a subject which is a package, source, or artifact. -// If the attestation targets a package, it must target a PackageName or a -// PackageVersion. If the attestation targets a source, it must target a -// SourceName. -type CertifyGoodArtifactIngestCertifyGood struct { - allCertifyGood `json:"-"` +// This node matches a pkg: partial pURL. The type field matches the +// pURL types but we might also use "guac" for the cases where the pURL +// representation is not complete or when we have custom rules. +// +// Since this node is at the root of the package trie, it is named Package, not +// PackageType. +type AllHasMetadataSubjectPackage struct { + Typename *string `json:"__typename"` + AllPkgTree `json:"-"` } -// GetId returns CertifyGoodArtifactIngestCertifyGood.Id, and is useful for accessing the field via an interface. -func (v *CertifyGoodArtifactIngestCertifyGood) GetId() string { return v.allCertifyGood.Id } - -// GetJustification returns CertifyGoodArtifactIngestCertifyGood.Justification, and is useful for accessing the field via an interface. -func (v *CertifyGoodArtifactIngestCertifyGood) GetJustification() string { - return v.allCertifyGood.Justification -} +// GetTypename returns AllHasMetadataSubjectPackage.Typename, and is useful for accessing the field via an interface. +func (v *AllHasMetadataSubjectPackage) GetTypename() *string { return v.Typename } -// GetSubject returns CertifyGoodArtifactIngestCertifyGood.Subject, and is useful for accessing the field via an interface. -func (v *CertifyGoodArtifactIngestCertifyGood) GetSubject() allCertifyGoodSubjectPackageSourceOrArtifact { - return v.allCertifyGood.Subject -} +// GetId returns AllHasMetadataSubjectPackage.Id, and is useful for accessing the field via an interface. +func (v *AllHasMetadataSubjectPackage) GetId() string { return v.AllPkgTree.Id } -// GetOrigin returns CertifyGoodArtifactIngestCertifyGood.Origin, and is useful for accessing the field via an interface. -func (v *CertifyGoodArtifactIngestCertifyGood) GetOrigin() string { return v.allCertifyGood.Origin } +// GetType returns AllHasMetadataSubjectPackage.Type, and is useful for accessing the field via an interface. +func (v *AllHasMetadataSubjectPackage) GetType() string { return v.AllPkgTree.Type } -// GetCollector returns CertifyGoodArtifactIngestCertifyGood.Collector, and is useful for accessing the field via an interface. -func (v *CertifyGoodArtifactIngestCertifyGood) GetCollector() string { - return v.allCertifyGood.Collector +// GetNamespaces returns AllHasMetadataSubjectPackage.Namespaces, and is useful for accessing the field via an interface. +func (v *AllHasMetadataSubjectPackage) GetNamespaces() []AllPkgTreeNamespacesPackageNamespace { + return v.AllPkgTree.Namespaces } -func (v *CertifyGoodArtifactIngestCertifyGood) UnmarshalJSON(b []byte) error { +func (v *AllHasMetadataSubjectPackage) UnmarshalJSON(b []byte) error { if string(b) == "null" { return nil } var firstPass struct { - *CertifyGoodArtifactIngestCertifyGood + *AllHasMetadataSubjectPackage graphql.NoUnmarshalJSON } - firstPass.CertifyGoodArtifactIngestCertifyGood = v + firstPass.AllHasMetadataSubjectPackage = v err := json.Unmarshal(b, &firstPass) if err != nil { @@ -3043,26 +2867,24 @@ func (v *CertifyGoodArtifactIngestCertifyGood) UnmarshalJSON(b []byte) error { } err = json.Unmarshal( - b, &v.allCertifyGood) + b, &v.AllPkgTree) if err != nil { return err } return nil } -type __premarshalCertifyGoodArtifactIngestCertifyGood struct { - Id string `json:"id"` - - Justification string `json:"justification"` +type __premarshalAllHasMetadataSubjectPackage struct { + Typename *string `json:"__typename"` - Subject json.RawMessage `json:"subject"` + Id string `json:"id"` - Origin string `json:"origin"` + Type string `json:"type"` - Collector string `json:"collector"` + Namespaces []AllPkgTreeNamespacesPackageNamespace `json:"namespaces"` } -func (v *CertifyGoodArtifactIngestCertifyGood) MarshalJSON() ([]byte, error) { +func (v *AllHasMetadataSubjectPackage) MarshalJSON() ([]byte, error) { premarshaled, err := v.__premarshalJSON() if err != nil { return nil, err @@ -3070,103 +2892,162 @@ func (v *CertifyGoodArtifactIngestCertifyGood) MarshalJSON() ([]byte, error) { return json.Marshal(premarshaled) } -func (v *CertifyGoodArtifactIngestCertifyGood) __premarshalJSON() (*__premarshalCertifyGoodArtifactIngestCertifyGood, error) { - var retval __premarshalCertifyGoodArtifactIngestCertifyGood - - retval.Id = v.allCertifyGood.Id - retval.Justification = v.allCertifyGood.Justification - { +func (v *AllHasMetadataSubjectPackage) __premarshalJSON() (*__premarshalAllHasMetadataSubjectPackage, error) { + var retval __premarshalAllHasMetadataSubjectPackage - dst := &retval.Subject - src := v.allCertifyGood.Subject - var err error - *dst, err = __marshalallCertifyGoodSubjectPackageSourceOrArtifact( - &src) - if err != nil { - return nil, fmt.Errorf( - "unable to marshal CertifyGoodArtifactIngestCertifyGood.allCertifyGood.Subject: %w", err) - } - } - retval.Origin = v.allCertifyGood.Origin - retval.Collector = v.allCertifyGood.Collector + retval.Typename = v.Typename + retval.Id = v.AllPkgTree.Id + retval.Type = v.AllPkgTree.Type + retval.Namespaces = v.AllPkgTree.Namespaces return &retval, nil } -// CertifyGoodArtifactResponse is returned by CertifyGoodArtifact on success. -type CertifyGoodArtifactResponse struct { - // Adds a certification that a package, source or artifact is considered good. - IngestCertifyGood CertifyGoodArtifactIngestCertifyGood `json:"ingestCertifyGood"` +// AllHasMetadataSubjectPackageSourceOrArtifact includes the requested fields of the GraphQL interface PackageSourceOrArtifact. +// +// AllHasMetadataSubjectPackageSourceOrArtifact is implemented by the following types: +// AllHasMetadataSubjectArtifact +// AllHasMetadataSubjectPackage +// AllHasMetadataSubjectSource +// The GraphQL type's documentation follows. +// +// PackageSourceOrArtifact is a union of Package, Source, and Artifact. +type AllHasMetadataSubjectPackageSourceOrArtifact interface { + implementsGraphQLInterfaceAllHasMetadataSubjectPackageSourceOrArtifact() + // GetTypename returns the receiver's concrete GraphQL type-name (see interface doc for possible values). + GetTypename() *string } -// GetIngestCertifyGood returns CertifyGoodArtifactResponse.IngestCertifyGood, and is useful for accessing the field via an interface. -func (v *CertifyGoodArtifactResponse) GetIngestCertifyGood() CertifyGoodArtifactIngestCertifyGood { - return v.IngestCertifyGood +func (v *AllHasMetadataSubjectArtifact) implementsGraphQLInterfaceAllHasMetadataSubjectPackageSourceOrArtifact() { +} +func (v *AllHasMetadataSubjectPackage) implementsGraphQLInterfaceAllHasMetadataSubjectPackageSourceOrArtifact() { +} +func (v *AllHasMetadataSubjectSource) implementsGraphQLInterfaceAllHasMetadataSubjectPackageSourceOrArtifact() { } -// CertifyGoodInputSpec represents the mutation input to ingest a CertifyGood evidence. -type CertifyGoodInputSpec struct { - Justification string `json:"justification"` - Origin string `json:"origin"` - Collector string `json:"collector"` +func __unmarshalAllHasMetadataSubjectPackageSourceOrArtifact(b []byte, v *AllHasMetadataSubjectPackageSourceOrArtifact) error { + if string(b) == "null" { + return nil + } + + var tn struct { + TypeName string `json:"__typename"` + } + err := json.Unmarshal(b, &tn) + if err != nil { + return err + } + + switch tn.TypeName { + case "Artifact": + *v = new(AllHasMetadataSubjectArtifact) + return json.Unmarshal(b, *v) + case "Package": + *v = new(AllHasMetadataSubjectPackage) + return json.Unmarshal(b, *v) + case "Source": + *v = new(AllHasMetadataSubjectSource) + return json.Unmarshal(b, *v) + case "": + return fmt.Errorf( + "response was missing PackageSourceOrArtifact.__typename") + default: + return fmt.Errorf( + `unexpected concrete type for AllHasMetadataSubjectPackageSourceOrArtifact: "%v"`, tn.TypeName) + } } -// GetJustification returns CertifyGoodInputSpec.Justification, and is useful for accessing the field via an interface. -func (v *CertifyGoodInputSpec) GetJustification() string { return v.Justification } +func __marshalAllHasMetadataSubjectPackageSourceOrArtifact(v *AllHasMetadataSubjectPackageSourceOrArtifact) ([]byte, error) { -// GetOrigin returns CertifyGoodInputSpec.Origin, and is useful for accessing the field via an interface. -func (v *CertifyGoodInputSpec) GetOrigin() string { return v.Origin } + var typename string + switch v := (*v).(type) { + case *AllHasMetadataSubjectArtifact: + typename = "Artifact" -// GetCollector returns CertifyGoodInputSpec.Collector, and is useful for accessing the field via an interface. -func (v *CertifyGoodInputSpec) GetCollector() string { return v.Collector } + premarshaled, err := v.__premarshalJSON() + if err != nil { + return nil, err + } + result := struct { + TypeName string `json:"__typename"` + *__premarshalAllHasMetadataSubjectArtifact + }{typename, premarshaled} + return json.Marshal(result) + case *AllHasMetadataSubjectPackage: + typename = "Package" -// CertifyGoodPkgIngestCertifyGood includes the requested fields of the GraphQL type CertifyGood. + premarshaled, err := v.__premarshalJSON() + if err != nil { + return nil, err + } + result := struct { + TypeName string `json:"__typename"` + *__premarshalAllHasMetadataSubjectPackage + }{typename, premarshaled} + return json.Marshal(result) + case *AllHasMetadataSubjectSource: + typename = "Source" + + premarshaled, err := v.__premarshalJSON() + if err != nil { + return nil, err + } + result := struct { + TypeName string `json:"__typename"` + *__premarshalAllHasMetadataSubjectSource + }{typename, premarshaled} + return json.Marshal(result) + case nil: + return []byte("null"), nil + default: + return nil, fmt.Errorf( + `unexpected concrete type for AllHasMetadataSubjectPackageSourceOrArtifact: "%T"`, v) + } +} + +// AllHasMetadataSubjectSource includes the requested fields of the GraphQL type Source. // The GraphQL type's documentation follows. // -// CertifyGood is an attestation that a package, source, or artifact is considered -// good. +// Source represents the root of the source trie/tree. // -// All evidence trees record a justification for the property they represent as -// well as the document that contains the attestation (origin) and the collector -// that collected the document (collector). +// We map source information to a trie, as a derivative of the pURL specification: +// each path in the trie represents a type, namespace, name and an optional +// qualifier that stands for tag/commit information. // -// The certification applies to a subject which is a package, source, or artifact. -// If the attestation targets a package, it must target a PackageName or a -// PackageVersion. If the attestation targets a source, it must target a -// SourceName. -type CertifyGoodPkgIngestCertifyGood struct { - allCertifyGood `json:"-"` +// This node represents the type part of the trie path. It is used to represent +// the version control system that is being used. +// +// Since this node is at the root of the source trie, it is named Source, not +// SourceType. +type AllHasMetadataSubjectSource struct { + Typename *string `json:"__typename"` + AllSourceTree `json:"-"` } -// GetId returns CertifyGoodPkgIngestCertifyGood.Id, and is useful for accessing the field via an interface. -func (v *CertifyGoodPkgIngestCertifyGood) GetId() string { return v.allCertifyGood.Id } - -// GetJustification returns CertifyGoodPkgIngestCertifyGood.Justification, and is useful for accessing the field via an interface. -func (v *CertifyGoodPkgIngestCertifyGood) GetJustification() string { - return v.allCertifyGood.Justification -} +// GetTypename returns AllHasMetadataSubjectSource.Typename, and is useful for accessing the field via an interface. +func (v *AllHasMetadataSubjectSource) GetTypename() *string { return v.Typename } -// GetSubject returns CertifyGoodPkgIngestCertifyGood.Subject, and is useful for accessing the field via an interface. -func (v *CertifyGoodPkgIngestCertifyGood) GetSubject() allCertifyGoodSubjectPackageSourceOrArtifact { - return v.allCertifyGood.Subject -} +// GetId returns AllHasMetadataSubjectSource.Id, and is useful for accessing the field via an interface. +func (v *AllHasMetadataSubjectSource) GetId() string { return v.AllSourceTree.Id } -// GetOrigin returns CertifyGoodPkgIngestCertifyGood.Origin, and is useful for accessing the field via an interface. -func (v *CertifyGoodPkgIngestCertifyGood) GetOrigin() string { return v.allCertifyGood.Origin } +// GetType returns AllHasMetadataSubjectSource.Type, and is useful for accessing the field via an interface. +func (v *AllHasMetadataSubjectSource) GetType() string { return v.AllSourceTree.Type } -// GetCollector returns CertifyGoodPkgIngestCertifyGood.Collector, and is useful for accessing the field via an interface. -func (v *CertifyGoodPkgIngestCertifyGood) GetCollector() string { return v.allCertifyGood.Collector } +// GetNamespaces returns AllHasMetadataSubjectSource.Namespaces, and is useful for accessing the field via an interface. +func (v *AllHasMetadataSubjectSource) GetNamespaces() []AllSourceTreeNamespacesSourceNamespace { + return v.AllSourceTree.Namespaces +} -func (v *CertifyGoodPkgIngestCertifyGood) UnmarshalJSON(b []byte) error { +func (v *AllHasMetadataSubjectSource) UnmarshalJSON(b []byte) error { if string(b) == "null" { return nil } var firstPass struct { - *CertifyGoodPkgIngestCertifyGood + *AllHasMetadataSubjectSource graphql.NoUnmarshalJSON } - firstPass.CertifyGoodPkgIngestCertifyGood = v + firstPass.AllHasMetadataSubjectSource = v err := json.Unmarshal(b, &firstPass) if err != nil { @@ -3174,26 +3055,24 @@ func (v *CertifyGoodPkgIngestCertifyGood) UnmarshalJSON(b []byte) error { } err = json.Unmarshal( - b, &v.allCertifyGood) + b, &v.AllSourceTree) if err != nil { return err } return nil } -type __premarshalCertifyGoodPkgIngestCertifyGood struct { - Id string `json:"id"` - - Justification string `json:"justification"` +type __premarshalAllHasMetadataSubjectSource struct { + Typename *string `json:"__typename"` - Subject json.RawMessage `json:"subject"` + Id string `json:"id"` - Origin string `json:"origin"` + Type string `json:"type"` - Collector string `json:"collector"` + Namespaces []AllSourceTreeNamespacesSourceNamespace `json:"namespaces"` } -func (v *CertifyGoodPkgIngestCertifyGood) MarshalJSON() ([]byte, error) { +func (v *AllHasMetadataSubjectSource) MarshalJSON() ([]byte, error) { premarshaled, err := v.__premarshalJSON() if err != nil { return nil, err @@ -3201,114 +3080,111 @@ func (v *CertifyGoodPkgIngestCertifyGood) MarshalJSON() ([]byte, error) { return json.Marshal(premarshaled) } -func (v *CertifyGoodPkgIngestCertifyGood) __premarshalJSON() (*__premarshalCertifyGoodPkgIngestCertifyGood, error) { - var retval __premarshalCertifyGoodPkgIngestCertifyGood - - retval.Id = v.allCertifyGood.Id - retval.Justification = v.allCertifyGood.Justification - { +func (v *AllHasMetadataSubjectSource) __premarshalJSON() (*__premarshalAllHasMetadataSubjectSource, error) { + var retval __premarshalAllHasMetadataSubjectSource - dst := &retval.Subject - src := v.allCertifyGood.Subject - var err error - *dst, err = __marshalallCertifyGoodSubjectPackageSourceOrArtifact( - &src) - if err != nil { - return nil, fmt.Errorf( - "unable to marshal CertifyGoodPkgIngestCertifyGood.allCertifyGood.Subject: %w", err) - } - } - retval.Origin = v.allCertifyGood.Origin - retval.Collector = v.allCertifyGood.Collector + retval.Typename = v.Typename + retval.Id = v.AllSourceTree.Id + retval.Type = v.AllSourceTree.Type + retval.Namespaces = v.AllSourceTree.Namespaces return &retval, nil } -// CertifyGoodPkgResponse is returned by CertifyGoodPkg on success. -type CertifyGoodPkgResponse struct { - // Adds a certification that a package, source or artifact is considered good. - IngestCertifyGood CertifyGoodPkgIngestCertifyGood `json:"ingestCertifyGood"` +// AllHasSBOMTree includes the GraphQL fields of HasSBOM requested by the fragment AllHasSBOMTree. +type AllHasSBOMTree struct { + Id string `json:"id"` + // SBOM subject + Subject AllHasSBOMTreeSubjectPackageOrArtifact `json:"-"` + // Identifier for the SBOM document + Uri string `json:"uri"` + // Algorithm by which SBOMs digest was computed + Algorithm string `json:"algorithm"` + // Digest of SBOM + Digest string `json:"digest"` + // Location from which the SBOM can be downloaded + DownloadLocation string `json:"downloadLocation"` + // Document from which this attestation is generated from + Origin string `json:"origin"` + // GUAC collector for the document + Collector string `json:"collector"` } -// GetIngestCertifyGood returns CertifyGoodPkgResponse.IngestCertifyGood, and is useful for accessing the field via an interface. -func (v *CertifyGoodPkgResponse) GetIngestCertifyGood() CertifyGoodPkgIngestCertifyGood { - return v.IngestCertifyGood -} +// GetId returns AllHasSBOMTree.Id, and is useful for accessing the field via an interface. +func (v *AllHasSBOMTree) GetId() string { return v.Id } -// CertifyGoodSrcIngestCertifyGood includes the requested fields of the GraphQL type CertifyGood. -// The GraphQL type's documentation follows. -// -// CertifyGood is an attestation that a package, source, or artifact is considered -// good. -// -// All evidence trees record a justification for the property they represent as -// well as the document that contains the attestation (origin) and the collector -// that collected the document (collector). -// -// The certification applies to a subject which is a package, source, or artifact. -// If the attestation targets a package, it must target a PackageName or a -// PackageVersion. If the attestation targets a source, it must target a -// SourceName. -type CertifyGoodSrcIngestCertifyGood struct { - allCertifyGood `json:"-"` -} +// GetSubject returns AllHasSBOMTree.Subject, and is useful for accessing the field via an interface. +func (v *AllHasSBOMTree) GetSubject() AllHasSBOMTreeSubjectPackageOrArtifact { return v.Subject } -// GetId returns CertifyGoodSrcIngestCertifyGood.Id, and is useful for accessing the field via an interface. -func (v *CertifyGoodSrcIngestCertifyGood) GetId() string { return v.allCertifyGood.Id } +// GetUri returns AllHasSBOMTree.Uri, and is useful for accessing the field via an interface. +func (v *AllHasSBOMTree) GetUri() string { return v.Uri } -// GetJustification returns CertifyGoodSrcIngestCertifyGood.Justification, and is useful for accessing the field via an interface. -func (v *CertifyGoodSrcIngestCertifyGood) GetJustification() string { - return v.allCertifyGood.Justification -} +// GetAlgorithm returns AllHasSBOMTree.Algorithm, and is useful for accessing the field via an interface. +func (v *AllHasSBOMTree) GetAlgorithm() string { return v.Algorithm } -// GetSubject returns CertifyGoodSrcIngestCertifyGood.Subject, and is useful for accessing the field via an interface. -func (v *CertifyGoodSrcIngestCertifyGood) GetSubject() allCertifyGoodSubjectPackageSourceOrArtifact { - return v.allCertifyGood.Subject -} +// GetDigest returns AllHasSBOMTree.Digest, and is useful for accessing the field via an interface. +func (v *AllHasSBOMTree) GetDigest() string { return v.Digest } -// GetOrigin returns CertifyGoodSrcIngestCertifyGood.Origin, and is useful for accessing the field via an interface. -func (v *CertifyGoodSrcIngestCertifyGood) GetOrigin() string { return v.allCertifyGood.Origin } +// GetDownloadLocation returns AllHasSBOMTree.DownloadLocation, and is useful for accessing the field via an interface. +func (v *AllHasSBOMTree) GetDownloadLocation() string { return v.DownloadLocation } -// GetCollector returns CertifyGoodSrcIngestCertifyGood.Collector, and is useful for accessing the field via an interface. -func (v *CertifyGoodSrcIngestCertifyGood) GetCollector() string { return v.allCertifyGood.Collector } +// GetOrigin returns AllHasSBOMTree.Origin, and is useful for accessing the field via an interface. +func (v *AllHasSBOMTree) GetOrigin() string { return v.Origin } -func (v *CertifyGoodSrcIngestCertifyGood) UnmarshalJSON(b []byte) error { +// GetCollector returns AllHasSBOMTree.Collector, and is useful for accessing the field via an interface. +func (v *AllHasSBOMTree) GetCollector() string { return v.Collector } + +func (v *AllHasSBOMTree) UnmarshalJSON(b []byte) error { if string(b) == "null" { return nil } var firstPass struct { - *CertifyGoodSrcIngestCertifyGood + *AllHasSBOMTree + Subject json.RawMessage `json:"subject"` graphql.NoUnmarshalJSON } - firstPass.CertifyGoodSrcIngestCertifyGood = v + firstPass.AllHasSBOMTree = v err := json.Unmarshal(b, &firstPass) if err != nil { return err } - err = json.Unmarshal( - b, &v.allCertifyGood) - if err != nil { - return err + { + dst := &v.Subject + src := firstPass.Subject + if len(src) != 0 && string(src) != "null" { + err = __unmarshalAllHasSBOMTreeSubjectPackageOrArtifact( + src, dst) + if err != nil { + return fmt.Errorf( + "unable to unmarshal AllHasSBOMTree.Subject: %w", err) + } + } } return nil } -type __premarshalCertifyGoodSrcIngestCertifyGood struct { +type __premarshalAllHasSBOMTree struct { Id string `json:"id"` - Justification string `json:"justification"` - Subject json.RawMessage `json:"subject"` + Uri string `json:"uri"` + + Algorithm string `json:"algorithm"` + + Digest string `json:"digest"` + + DownloadLocation string `json:"downloadLocation"` + Origin string `json:"origin"` Collector string `json:"collector"` } -func (v *CertifyGoodSrcIngestCertifyGood) MarshalJSON() ([]byte, error) { +func (v *AllHasSBOMTree) MarshalJSON() ([]byte, error) { premarshaled, err := v.__premarshalJSON() if err != nil { return nil, err @@ -3316,79 +3192,69 @@ func (v *CertifyGoodSrcIngestCertifyGood) MarshalJSON() ([]byte, error) { return json.Marshal(premarshaled) } -func (v *CertifyGoodSrcIngestCertifyGood) __premarshalJSON() (*__premarshalCertifyGoodSrcIngestCertifyGood, error) { - var retval __premarshalCertifyGoodSrcIngestCertifyGood +func (v *AllHasSBOMTree) __premarshalJSON() (*__premarshalAllHasSBOMTree, error) { + var retval __premarshalAllHasSBOMTree - retval.Id = v.allCertifyGood.Id - retval.Justification = v.allCertifyGood.Justification + retval.Id = v.Id { dst := &retval.Subject - src := v.allCertifyGood.Subject + src := v.Subject var err error - *dst, err = __marshalallCertifyGoodSubjectPackageSourceOrArtifact( + *dst, err = __marshalAllHasSBOMTreeSubjectPackageOrArtifact( &src) if err != nil { return nil, fmt.Errorf( - "unable to marshal CertifyGoodSrcIngestCertifyGood.allCertifyGood.Subject: %w", err) + "unable to marshal AllHasSBOMTree.Subject: %w", err) } } - retval.Origin = v.allCertifyGood.Origin - retval.Collector = v.allCertifyGood.Collector + retval.Uri = v.Uri + retval.Algorithm = v.Algorithm + retval.Digest = v.Digest + retval.DownloadLocation = v.DownloadLocation + retval.Origin = v.Origin + retval.Collector = v.Collector return &retval, nil } -// CertifyGoodSrcResponse is returned by CertifyGoodSrc on success. -type CertifyGoodSrcResponse struct { - // Adds a certification that a package, source or artifact is considered good. - IngestCertifyGood CertifyGoodSrcIngestCertifyGood `json:"ingestCertifyGood"` -} - -// GetIngestCertifyGood returns CertifyGoodSrcResponse.IngestCertifyGood, and is useful for accessing the field via an interface. -func (v *CertifyGoodSrcResponse) GetIngestCertifyGood() CertifyGoodSrcIngestCertifyGood { - return v.IngestCertifyGood -} - -// CertifyNoKnownVulnIngestVulnerabilityCertifyVuln includes the requested fields of the GraphQL type CertifyVuln. +// AllHasSBOMTreeSubjectArtifact includes the requested fields of the GraphQL type Artifact. // The GraphQL type's documentation follows. // -// CertifyVuln is an attestation to attach vulnerability information to a package. +// Artifact represents an artifact identified by a checksum hash. // -// This information is obtained via a scanner. If there is no vulnerability -// detected (no OSV, CVE, or GHSA), we attach the special NoVuln node. -type CertifyNoKnownVulnIngestVulnerabilityCertifyVuln struct { - AllCertifyVuln `json:"-"` +// The checksum is split into the digest value and the algorithm used to generate +// it. Both fields are mandatory and canonicalized to be lowercase. +// +// If having a checksum Go object, algorithm can be +// strings.ToLower(string(checksum.Algorithm)) and digest can be checksum.Value. +type AllHasSBOMTreeSubjectArtifact struct { + Typename *string `json:"__typename"` + AllArtifactTree `json:"-"` } -// GetId returns CertifyNoKnownVulnIngestVulnerabilityCertifyVuln.Id, and is useful for accessing the field via an interface. -func (v *CertifyNoKnownVulnIngestVulnerabilityCertifyVuln) GetId() string { return v.AllCertifyVuln.Id } +// GetTypename returns AllHasSBOMTreeSubjectArtifact.Typename, and is useful for accessing the field via an interface. +func (v *AllHasSBOMTreeSubjectArtifact) GetTypename() *string { return v.Typename } -// GetPackage returns CertifyNoKnownVulnIngestVulnerabilityCertifyVuln.Package, and is useful for accessing the field via an interface. -func (v *CertifyNoKnownVulnIngestVulnerabilityCertifyVuln) GetPackage() AllCertifyVulnPackage { - return v.AllCertifyVuln.Package -} +// GetId returns AllHasSBOMTreeSubjectArtifact.Id, and is useful for accessing the field via an interface. +func (v *AllHasSBOMTreeSubjectArtifact) GetId() string { return v.AllArtifactTree.Id } -// GetVulnerability returns CertifyNoKnownVulnIngestVulnerabilityCertifyVuln.Vulnerability, and is useful for accessing the field via an interface. -func (v *CertifyNoKnownVulnIngestVulnerabilityCertifyVuln) GetVulnerability() AllCertifyVulnVulnerability { - return v.AllCertifyVuln.Vulnerability -} +// GetAlgorithm returns AllHasSBOMTreeSubjectArtifact.Algorithm, and is useful for accessing the field via an interface. +func (v *AllHasSBOMTreeSubjectArtifact) GetAlgorithm() string { return v.AllArtifactTree.Algorithm } -// GetMetadata returns CertifyNoKnownVulnIngestVulnerabilityCertifyVuln.Metadata, and is useful for accessing the field via an interface. -func (v *CertifyNoKnownVulnIngestVulnerabilityCertifyVuln) GetMetadata() AllCertifyVulnMetadataVulnerabilityMetaData { - return v.AllCertifyVuln.Metadata -} +// GetDigest returns AllHasSBOMTreeSubjectArtifact.Digest, and is useful for accessing the field via an interface. +func (v *AllHasSBOMTreeSubjectArtifact) GetDigest() string { return v.AllArtifactTree.Digest } -func (v *CertifyNoKnownVulnIngestVulnerabilityCertifyVuln) UnmarshalJSON(b []byte) error { +func (v *AllHasSBOMTreeSubjectArtifact) UnmarshalJSON(b []byte) error { if string(b) == "null" { return nil } var firstPass struct { - *CertifyNoKnownVulnIngestVulnerabilityCertifyVuln + *AllHasSBOMTreeSubjectArtifact graphql.NoUnmarshalJSON } - firstPass.CertifyNoKnownVulnIngestVulnerabilityCertifyVuln = v + firstPass.AllHasSBOMTreeSubjectArtifact = v err := json.Unmarshal(b, &firstPass) if err != nil { @@ -3396,24 +3262,24 @@ func (v *CertifyNoKnownVulnIngestVulnerabilityCertifyVuln) UnmarshalJSON(b []byt } err = json.Unmarshal( - b, &v.AllCertifyVuln) + b, &v.AllArtifactTree) if err != nil { return err } return nil } -type __premarshalCertifyNoKnownVulnIngestVulnerabilityCertifyVuln struct { - Id string `json:"id"` +type __premarshalAllHasSBOMTreeSubjectArtifact struct { + Typename *string `json:"__typename"` - Package AllCertifyVulnPackage `json:"package"` + Id string `json:"id"` - Vulnerability json.RawMessage `json:"vulnerability"` + Algorithm string `json:"algorithm"` - Metadata AllCertifyVulnMetadataVulnerabilityMetaData `json:"metadata"` + Digest string `json:"digest"` } -func (v *CertifyNoKnownVulnIngestVulnerabilityCertifyVuln) MarshalJSON() ([]byte, error) { +func (v *AllHasSBOMTreeSubjectArtifact) MarshalJSON() ([]byte, error) { premarshaled, err := v.__premarshalJSON() if err != nil { return nil, err @@ -3421,78 +3287,63 @@ func (v *CertifyNoKnownVulnIngestVulnerabilityCertifyVuln) MarshalJSON() ([]byte return json.Marshal(premarshaled) } -func (v *CertifyNoKnownVulnIngestVulnerabilityCertifyVuln) __premarshalJSON() (*__premarshalCertifyNoKnownVulnIngestVulnerabilityCertifyVuln, error) { - var retval __premarshalCertifyNoKnownVulnIngestVulnerabilityCertifyVuln - - retval.Id = v.AllCertifyVuln.Id - retval.Package = v.AllCertifyVuln.Package - { +func (v *AllHasSBOMTreeSubjectArtifact) __premarshalJSON() (*__premarshalAllHasSBOMTreeSubjectArtifact, error) { + var retval __premarshalAllHasSBOMTreeSubjectArtifact - dst := &retval.Vulnerability - src := v.AllCertifyVuln.Vulnerability - var err error - *dst, err = __marshalAllCertifyVulnVulnerability( - &src) - if err != nil { - return nil, fmt.Errorf( - "unable to marshal CertifyNoKnownVulnIngestVulnerabilityCertifyVuln.AllCertifyVuln.Vulnerability: %w", err) - } - } - retval.Metadata = v.AllCertifyVuln.Metadata + retval.Typename = v.Typename + retval.Id = v.AllArtifactTree.Id + retval.Algorithm = v.AllArtifactTree.Algorithm + retval.Digest = v.AllArtifactTree.Digest return &retval, nil } -// CertifyNoKnownVulnResponse is returned by CertifyNoKnownVuln on success. -type CertifyNoKnownVulnResponse struct { - // Adds a certification that a package has been scanned for vulnerabilities. - IngestVulnerability CertifyNoKnownVulnIngestVulnerabilityCertifyVuln `json:"ingestVulnerability"` -} - -// GetIngestVulnerability returns CertifyNoKnownVulnResponse.IngestVulnerability, and is useful for accessing the field via an interface. -func (v *CertifyNoKnownVulnResponse) GetIngestVulnerability() CertifyNoKnownVulnIngestVulnerabilityCertifyVuln { - return v.IngestVulnerability -} - -// CertifyOSVIngestVulnerabilityCertifyVuln includes the requested fields of the GraphQL type CertifyVuln. +// AllHasSBOMTreeSubjectPackage includes the requested fields of the GraphQL type Package. // The GraphQL type's documentation follows. // -// CertifyVuln is an attestation to attach vulnerability information to a package. +// Package represents the root of the package trie/tree. // -// This information is obtained via a scanner. If there is no vulnerability -// detected (no OSV, CVE, or GHSA), we attach the special NoVuln node. -type CertifyOSVIngestVulnerabilityCertifyVuln struct { - AllCertifyVuln `json:"-"` +// We map package information to a trie, closely matching the pURL specification +// (https://github.com/package-url/purl-spec/blob/0dd92f26f8bb11956ffdf5e8acfcee71e8560407/README.rst), +// but deviating from it where GUAC heuristics allow for better representation of +// package information. Each path in the trie fully represents a package; we split +// the trie based on the pURL components. +// +// This node matches a pkg: partial pURL. The type field matches the +// pURL types but we might also use "guac" for the cases where the pURL +// representation is not complete or when we have custom rules. +// +// Since this node is at the root of the package trie, it is named Package, not +// PackageType. +type AllHasSBOMTreeSubjectPackage struct { + Typename *string `json:"__typename"` + AllPkgTree `json:"-"` } -// GetId returns CertifyOSVIngestVulnerabilityCertifyVuln.Id, and is useful for accessing the field via an interface. -func (v *CertifyOSVIngestVulnerabilityCertifyVuln) GetId() string { return v.AllCertifyVuln.Id } +// GetTypename returns AllHasSBOMTreeSubjectPackage.Typename, and is useful for accessing the field via an interface. +func (v *AllHasSBOMTreeSubjectPackage) GetTypename() *string { return v.Typename } -// GetPackage returns CertifyOSVIngestVulnerabilityCertifyVuln.Package, and is useful for accessing the field via an interface. -func (v *CertifyOSVIngestVulnerabilityCertifyVuln) GetPackage() AllCertifyVulnPackage { - return v.AllCertifyVuln.Package -} +// GetId returns AllHasSBOMTreeSubjectPackage.Id, and is useful for accessing the field via an interface. +func (v *AllHasSBOMTreeSubjectPackage) GetId() string { return v.AllPkgTree.Id } -// GetVulnerability returns CertifyOSVIngestVulnerabilityCertifyVuln.Vulnerability, and is useful for accessing the field via an interface. -func (v *CertifyOSVIngestVulnerabilityCertifyVuln) GetVulnerability() AllCertifyVulnVulnerability { - return v.AllCertifyVuln.Vulnerability -} +// GetType returns AllHasSBOMTreeSubjectPackage.Type, and is useful for accessing the field via an interface. +func (v *AllHasSBOMTreeSubjectPackage) GetType() string { return v.AllPkgTree.Type } -// GetMetadata returns CertifyOSVIngestVulnerabilityCertifyVuln.Metadata, and is useful for accessing the field via an interface. -func (v *CertifyOSVIngestVulnerabilityCertifyVuln) GetMetadata() AllCertifyVulnMetadataVulnerabilityMetaData { - return v.AllCertifyVuln.Metadata +// GetNamespaces returns AllHasSBOMTreeSubjectPackage.Namespaces, and is useful for accessing the field via an interface. +func (v *AllHasSBOMTreeSubjectPackage) GetNamespaces() []AllPkgTreeNamespacesPackageNamespace { + return v.AllPkgTree.Namespaces } -func (v *CertifyOSVIngestVulnerabilityCertifyVuln) UnmarshalJSON(b []byte) error { +func (v *AllHasSBOMTreeSubjectPackage) UnmarshalJSON(b []byte) error { if string(b) == "null" { return nil } var firstPass struct { - *CertifyOSVIngestVulnerabilityCertifyVuln + *AllHasSBOMTreeSubjectPackage graphql.NoUnmarshalJSON } - firstPass.CertifyOSVIngestVulnerabilityCertifyVuln = v + firstPass.AllHasSBOMTreeSubjectPackage = v err := json.Unmarshal(b, &firstPass) if err != nil { @@ -3500,24 +3351,24 @@ func (v *CertifyOSVIngestVulnerabilityCertifyVuln) UnmarshalJSON(b []byte) error } err = json.Unmarshal( - b, &v.AllCertifyVuln) + b, &v.AllPkgTree) if err != nil { return err } return nil } -type __premarshalCertifyOSVIngestVulnerabilityCertifyVuln struct { - Id string `json:"id"` +type __premarshalAllHasSBOMTreeSubjectPackage struct { + Typename *string `json:"__typename"` - Package AllCertifyVulnPackage `json:"package"` + Id string `json:"id"` - Vulnerability json.RawMessage `json:"vulnerability"` + Type string `json:"type"` - Metadata AllCertifyVulnMetadataVulnerabilityMetaData `json:"metadata"` + Namespaces []AllPkgTreeNamespacesPackageNamespace `json:"namespaces"` } -func (v *CertifyOSVIngestVulnerabilityCertifyVuln) MarshalJSON() ([]byte, error) { +func (v *AllHasSBOMTreeSubjectPackage) MarshalJSON() ([]byte, error) { premarshaled, err := v.__premarshalJSON() if err != nil { return nil, err @@ -3525,73 +3376,184 @@ func (v *CertifyOSVIngestVulnerabilityCertifyVuln) MarshalJSON() ([]byte, error) return json.Marshal(premarshaled) } -func (v *CertifyOSVIngestVulnerabilityCertifyVuln) __premarshalJSON() (*__premarshalCertifyOSVIngestVulnerabilityCertifyVuln, error) { - var retval __premarshalCertifyOSVIngestVulnerabilityCertifyVuln +func (v *AllHasSBOMTreeSubjectPackage) __premarshalJSON() (*__premarshalAllHasSBOMTreeSubjectPackage, error) { + var retval __premarshalAllHasSBOMTreeSubjectPackage - retval.Id = v.AllCertifyVuln.Id - retval.Package = v.AllCertifyVuln.Package - { + retval.Typename = v.Typename + retval.Id = v.AllPkgTree.Id + retval.Type = v.AllPkgTree.Type + retval.Namespaces = v.AllPkgTree.Namespaces + return &retval, nil +} - dst := &retval.Vulnerability - src := v.AllCertifyVuln.Vulnerability - var err error - *dst, err = __marshalAllCertifyVulnVulnerability( - &src) +// AllHasSBOMTreeSubjectPackageOrArtifact includes the requested fields of the GraphQL interface PackageOrArtifact. +// +// AllHasSBOMTreeSubjectPackageOrArtifact is implemented by the following types: +// AllHasSBOMTreeSubjectArtifact +// AllHasSBOMTreeSubjectPackage +// The GraphQL type's documentation follows. +// +// PackageOrArtifact is a union of Package and Artifact. +type AllHasSBOMTreeSubjectPackageOrArtifact interface { + implementsGraphQLInterfaceAllHasSBOMTreeSubjectPackageOrArtifact() + // GetTypename returns the receiver's concrete GraphQL type-name (see interface doc for possible values). + GetTypename() *string +} + +func (v *AllHasSBOMTreeSubjectArtifact) implementsGraphQLInterfaceAllHasSBOMTreeSubjectPackageOrArtifact() { +} +func (v *AllHasSBOMTreeSubjectPackage) implementsGraphQLInterfaceAllHasSBOMTreeSubjectPackageOrArtifact() { +} + +func __unmarshalAllHasSBOMTreeSubjectPackageOrArtifact(b []byte, v *AllHasSBOMTreeSubjectPackageOrArtifact) error { + if string(b) == "null" { + return nil + } + + var tn struct { + TypeName string `json:"__typename"` + } + err := json.Unmarshal(b, &tn) + if err != nil { + return err + } + + switch tn.TypeName { + case "Artifact": + *v = new(AllHasSBOMTreeSubjectArtifact) + return json.Unmarshal(b, *v) + case "Package": + *v = new(AllHasSBOMTreeSubjectPackage) + return json.Unmarshal(b, *v) + case "": + return fmt.Errorf( + "response was missing PackageOrArtifact.__typename") + default: + return fmt.Errorf( + `unexpected concrete type for AllHasSBOMTreeSubjectPackageOrArtifact: "%v"`, tn.TypeName) + } +} + +func __marshalAllHasSBOMTreeSubjectPackageOrArtifact(v *AllHasSBOMTreeSubjectPackageOrArtifact) ([]byte, error) { + + var typename string + switch v := (*v).(type) { + case *AllHasSBOMTreeSubjectArtifact: + typename = "Artifact" + + premarshaled, err := v.__premarshalJSON() if err != nil { - return nil, fmt.Errorf( - "unable to marshal CertifyOSVIngestVulnerabilityCertifyVuln.AllCertifyVuln.Vulnerability: %w", err) + return nil, err + } + result := struct { + TypeName string `json:"__typename"` + *__premarshalAllHasSBOMTreeSubjectArtifact + }{typename, premarshaled} + return json.Marshal(result) + case *AllHasSBOMTreeSubjectPackage: + typename = "Package" + + premarshaled, err := v.__premarshalJSON() + if err != nil { + return nil, err } + result := struct { + TypeName string `json:"__typename"` + *__premarshalAllHasSBOMTreeSubjectPackage + }{typename, premarshaled} + return json.Marshal(result) + case nil: + return []byte("null"), nil + default: + return nil, fmt.Errorf( + `unexpected concrete type for AllHasSBOMTreeSubjectPackageOrArtifact: "%T"`, v) } - retval.Metadata = v.AllCertifyVuln.Metadata - return &retval, nil } -// CertifyOSVResponse is returned by CertifyOSV on success. -type CertifyOSVResponse struct { - // Adds a certification that a package has been scanned for vulnerabilities. - IngestVulnerability CertifyOSVIngestVulnerabilityCertifyVuln `json:"ingestVulnerability"` +// AllHasSourceAt includes the GraphQL fields of HasSourceAt requested by the fragment AllHasSourceAt. +// The GraphQL type's documentation follows. +// +// HasSourceAt records that a package's repository is a given source. +type AllHasSourceAt struct { + Id string `json:"id"` + // Justification for the attested relationship + Justification string `json:"justification"` + // Timestamp since this link between package and source was certified + KnownSince time.Time `json:"knownSince"` + // The subject of the attestation: can be a PackageName or a PackageVersion + Package AllHasSourceAtPackage `json:"package"` + // Source repository from which the package is built + Source AllHasSourceAtSource `json:"source"` + // Document from which this attestation is generated from + Origin string `json:"origin"` + // GUAC collector for the document + Collector string `json:"collector"` } -// GetIngestVulnerability returns CertifyOSVResponse.IngestVulnerability, and is useful for accessing the field via an interface. -func (v *CertifyOSVResponse) GetIngestVulnerability() CertifyOSVIngestVulnerabilityCertifyVuln { - return v.IngestVulnerability -} +// GetId returns AllHasSourceAt.Id, and is useful for accessing the field via an interface. +func (v *AllHasSourceAt) GetId() string { return v.Id } -// CertifyScorecardIngestScorecardCertifyScorecard includes the requested fields of the GraphQL type CertifyScorecard. +// GetJustification returns AllHasSourceAt.Justification, and is useful for accessing the field via an interface. +func (v *AllHasSourceAt) GetJustification() string { return v.Justification } + +// GetKnownSince returns AllHasSourceAt.KnownSince, and is useful for accessing the field via an interface. +func (v *AllHasSourceAt) GetKnownSince() time.Time { return v.KnownSince } + +// GetPackage returns AllHasSourceAt.Package, and is useful for accessing the field via an interface. +func (v *AllHasSourceAt) GetPackage() AllHasSourceAtPackage { return v.Package } + +// GetSource returns AllHasSourceAt.Source, and is useful for accessing the field via an interface. +func (v *AllHasSourceAt) GetSource() AllHasSourceAtSource { return v.Source } + +// GetOrigin returns AllHasSourceAt.Origin, and is useful for accessing the field via an interface. +func (v *AllHasSourceAt) GetOrigin() string { return v.Origin } + +// GetCollector returns AllHasSourceAt.Collector, and is useful for accessing the field via an interface. +func (v *AllHasSourceAt) GetCollector() string { return v.Collector } + +// AllHasSourceAtPackage includes the requested fields of the GraphQL type Package. // The GraphQL type's documentation follows. // -// CertifyScorecard is an attestation to attach a Scorecard analysis to a -// particular source repository. -type CertifyScorecardIngestScorecardCertifyScorecard struct { - AllCertifyScorecard `json:"-"` +// Package represents the root of the package trie/tree. +// +// We map package information to a trie, closely matching the pURL specification +// (https://github.com/package-url/purl-spec/blob/0dd92f26f8bb11956ffdf5e8acfcee71e8560407/README.rst), +// but deviating from it where GUAC heuristics allow for better representation of +// package information. Each path in the trie fully represents a package; we split +// the trie based on the pURL components. +// +// This node matches a pkg: partial pURL. The type field matches the +// pURL types but we might also use "guac" for the cases where the pURL +// representation is not complete or when we have custom rules. +// +// Since this node is at the root of the package trie, it is named Package, not +// PackageType. +type AllHasSourceAtPackage struct { + AllPkgTree `json:"-"` } -// GetId returns CertifyScorecardIngestScorecardCertifyScorecard.Id, and is useful for accessing the field via an interface. -func (v *CertifyScorecardIngestScorecardCertifyScorecard) GetId() string { - return v.AllCertifyScorecard.Id -} +// GetId returns AllHasSourceAtPackage.Id, and is useful for accessing the field via an interface. +func (v *AllHasSourceAtPackage) GetId() string { return v.AllPkgTree.Id } -// GetSource returns CertifyScorecardIngestScorecardCertifyScorecard.Source, and is useful for accessing the field via an interface. -func (v *CertifyScorecardIngestScorecardCertifyScorecard) GetSource() AllCertifyScorecardSource { - return v.AllCertifyScorecard.Source -} +// GetType returns AllHasSourceAtPackage.Type, and is useful for accessing the field via an interface. +func (v *AllHasSourceAtPackage) GetType() string { return v.AllPkgTree.Type } -// GetScorecard returns CertifyScorecardIngestScorecardCertifyScorecard.Scorecard, and is useful for accessing the field via an interface. -func (v *CertifyScorecardIngestScorecardCertifyScorecard) GetScorecard() AllCertifyScorecardScorecard { - return v.AllCertifyScorecard.Scorecard +// GetNamespaces returns AllHasSourceAtPackage.Namespaces, and is useful for accessing the field via an interface. +func (v *AllHasSourceAtPackage) GetNamespaces() []AllPkgTreeNamespacesPackageNamespace { + return v.AllPkgTree.Namespaces } -func (v *CertifyScorecardIngestScorecardCertifyScorecard) UnmarshalJSON(b []byte) error { +func (v *AllHasSourceAtPackage) UnmarshalJSON(b []byte) error { if string(b) == "null" { return nil } var firstPass struct { - *CertifyScorecardIngestScorecardCertifyScorecard + *AllHasSourceAtPackage graphql.NoUnmarshalJSON } - firstPass.CertifyScorecardIngestScorecardCertifyScorecard = v + firstPass.AllHasSourceAtPackage = v err := json.Unmarshal(b, &firstPass) if err != nil { @@ -3599,22 +3561,22 @@ func (v *CertifyScorecardIngestScorecardCertifyScorecard) UnmarshalJSON(b []byte } err = json.Unmarshal( - b, &v.AllCertifyScorecard) + b, &v.AllPkgTree) if err != nil { return err } return nil } -type __premarshalCertifyScorecardIngestScorecardCertifyScorecard struct { +type __premarshalAllHasSourceAtPackage struct { Id string `json:"id"` - Source AllCertifyScorecardSource `json:"source"` + Type string `json:"type"` - Scorecard AllCertifyScorecardScorecard `json:"scorecard"` + Namespaces []AllPkgTreeNamespacesPackageNamespace `json:"namespaces"` } -func (v *CertifyScorecardIngestScorecardCertifyScorecard) MarshalJSON() ([]byte, error) { +func (v *AllHasSourceAtPackage) MarshalJSON() ([]byte, error) { premarshaled, err := v.__premarshalJSON() if err != nil { return nil, err @@ -3622,61 +3584,55 @@ func (v *CertifyScorecardIngestScorecardCertifyScorecard) MarshalJSON() ([]byte, return json.Marshal(premarshaled) } -func (v *CertifyScorecardIngestScorecardCertifyScorecard) __premarshalJSON() (*__premarshalCertifyScorecardIngestScorecardCertifyScorecard, error) { - var retval __premarshalCertifyScorecardIngestScorecardCertifyScorecard +func (v *AllHasSourceAtPackage) __premarshalJSON() (*__premarshalAllHasSourceAtPackage, error) { + var retval __premarshalAllHasSourceAtPackage - retval.Id = v.AllCertifyScorecard.Id - retval.Source = v.AllCertifyScorecard.Source - retval.Scorecard = v.AllCertifyScorecard.Scorecard + retval.Id = v.AllPkgTree.Id + retval.Type = v.AllPkgTree.Type + retval.Namespaces = v.AllPkgTree.Namespaces return &retval, nil } -// CertifyScorecardResponse is returned by CertifyScorecard on success. -type CertifyScorecardResponse struct { - // Adds a certification that a source repository has a Scorecard. - IngestScorecard CertifyScorecardIngestScorecardCertifyScorecard `json:"ingestScorecard"` -} - -// GetIngestScorecard returns CertifyScorecardResponse.IngestScorecard, and is useful for accessing the field via an interface. -func (v *CertifyScorecardResponse) GetIngestScorecard() CertifyScorecardIngestScorecardCertifyScorecard { - return v.IngestScorecard -} - -// CertifyScorecardsIngestScorecardsCertifyScorecard includes the requested fields of the GraphQL type CertifyScorecard. +// AllHasSourceAtSource includes the requested fields of the GraphQL type Source. // The GraphQL type's documentation follows. // -// CertifyScorecard is an attestation to attach a Scorecard analysis to a -// particular source repository. -type CertifyScorecardsIngestScorecardsCertifyScorecard struct { - AllCertifyScorecard `json:"-"` +// Source represents the root of the source trie/tree. +// +// We map source information to a trie, as a derivative of the pURL specification: +// each path in the trie represents a type, namespace, name and an optional +// qualifier that stands for tag/commit information. +// +// This node represents the type part of the trie path. It is used to represent +// the version control system that is being used. +// +// Since this node is at the root of the source trie, it is named Source, not +// SourceType. +type AllHasSourceAtSource struct { + AllSourceTree `json:"-"` } -// GetId returns CertifyScorecardsIngestScorecardsCertifyScorecard.Id, and is useful for accessing the field via an interface. -func (v *CertifyScorecardsIngestScorecardsCertifyScorecard) GetId() string { - return v.AllCertifyScorecard.Id -} +// GetId returns AllHasSourceAtSource.Id, and is useful for accessing the field via an interface. +func (v *AllHasSourceAtSource) GetId() string { return v.AllSourceTree.Id } -// GetSource returns CertifyScorecardsIngestScorecardsCertifyScorecard.Source, and is useful for accessing the field via an interface. -func (v *CertifyScorecardsIngestScorecardsCertifyScorecard) GetSource() AllCertifyScorecardSource { - return v.AllCertifyScorecard.Source -} +// GetType returns AllHasSourceAtSource.Type, and is useful for accessing the field via an interface. +func (v *AllHasSourceAtSource) GetType() string { return v.AllSourceTree.Type } -// GetScorecard returns CertifyScorecardsIngestScorecardsCertifyScorecard.Scorecard, and is useful for accessing the field via an interface. -func (v *CertifyScorecardsIngestScorecardsCertifyScorecard) GetScorecard() AllCertifyScorecardScorecard { - return v.AllCertifyScorecard.Scorecard +// GetNamespaces returns AllHasSourceAtSource.Namespaces, and is useful for accessing the field via an interface. +func (v *AllHasSourceAtSource) GetNamespaces() []AllSourceTreeNamespacesSourceNamespace { + return v.AllSourceTree.Namespaces } -func (v *CertifyScorecardsIngestScorecardsCertifyScorecard) UnmarshalJSON(b []byte) error { +func (v *AllHasSourceAtSource) UnmarshalJSON(b []byte) error { if string(b) == "null" { return nil } var firstPass struct { - *CertifyScorecardsIngestScorecardsCertifyScorecard + *AllHasSourceAtSource graphql.NoUnmarshalJSON } - firstPass.CertifyScorecardsIngestScorecardsCertifyScorecard = v + firstPass.AllHasSourceAtSource = v err := json.Unmarshal(b, &firstPass) if err != nil { @@ -3684,22 +3640,22 @@ func (v *CertifyScorecardsIngestScorecardsCertifyScorecard) UnmarshalJSON(b []by } err = json.Unmarshal( - b, &v.AllCertifyScorecard) + b, &v.AllSourceTree) if err != nil { return err } return nil } -type __premarshalCertifyScorecardsIngestScorecardsCertifyScorecard struct { +type __premarshalAllHasSourceAtSource struct { Id string `json:"id"` - Source AllCertifyScorecardSource `json:"source"` + Type string `json:"type"` - Scorecard AllCertifyScorecardScorecard `json:"scorecard"` + Namespaces []AllSourceTreeNamespacesSourceNamespace `json:"namespaces"` } -func (v *CertifyScorecardsIngestScorecardsCertifyScorecard) MarshalJSON() ([]byte, error) { +func (v *AllHasSourceAtSource) MarshalJSON() ([]byte, error) { premarshaled, err := v.__premarshalJSON() if err != nil { return nil, err @@ -3707,131 +3663,47 @@ func (v *CertifyScorecardsIngestScorecardsCertifyScorecard) MarshalJSON() ([]byt return json.Marshal(premarshaled) } -func (v *CertifyScorecardsIngestScorecardsCertifyScorecard) __premarshalJSON() (*__premarshalCertifyScorecardsIngestScorecardsCertifyScorecard, error) { - var retval __premarshalCertifyScorecardsIngestScorecardsCertifyScorecard +func (v *AllHasSourceAtSource) __premarshalJSON() (*__premarshalAllHasSourceAtSource, error) { + var retval __premarshalAllHasSourceAtSource - retval.Id = v.AllCertifyScorecard.Id - retval.Source = v.AllCertifyScorecard.Source - retval.Scorecard = v.AllCertifyScorecard.Scorecard + retval.Id = v.AllSourceTree.Id + retval.Type = v.AllSourceTree.Type + retval.Namespaces = v.AllSourceTree.Namespaces return &retval, nil } -// CertifyScorecardsResponse is returned by CertifyScorecards on success. -type CertifyScorecardsResponse struct { - // Adds bulk certifications that a source repository has a Scorecard. - IngestScorecards []CertifyScorecardsIngestScorecardsCertifyScorecard `json:"ingestScorecards"` +// AllHashEqualTree includes the GraphQL fields of HashEqual requested by the fragment AllHashEqualTree. +// The GraphQL type's documentation follows. +// +// HashEqual is an attestation that a set of artifacts are identical. +type AllHashEqualTree struct { + Id string `json:"id"` + // Justification for the claim that the artifacts are similar + Justification string `json:"justification"` + // Collection of artifacts that are similar + Artifacts []AllHashEqualTreeArtifactsArtifact `json:"artifacts"` + // Document from which this attestation is generated from + Origin string `json:"origin"` + // GUAC collector for the document + Collector string `json:"collector"` } -// GetIngestScorecards returns CertifyScorecardsResponse.IngestScorecards, and is useful for accessing the field via an interface. -func (v *CertifyScorecardsResponse) GetIngestScorecards() []CertifyScorecardsIngestScorecardsCertifyScorecard { - return v.IngestScorecards -} +// GetId returns AllHashEqualTree.Id, and is useful for accessing the field via an interface. +func (v *AllHashEqualTree) GetId() string { return v.Id } -// DependencyType determines the type of the dependency. -type DependencyType string +// GetJustification returns AllHashEqualTree.Justification, and is useful for accessing the field via an interface. +func (v *AllHashEqualTree) GetJustification() string { return v.Justification } -const ( - // direct dependency - DependencyTypeDirect DependencyType = "DIRECT" - // indirect dependency - DependencyTypeIndirect DependencyType = "INDIRECT" - // type not known/not specified - DependencyTypeUnknown DependencyType = "UNKNOWN" -) +// GetArtifacts returns AllHashEqualTree.Artifacts, and is useful for accessing the field via an interface. +func (v *AllHashEqualTree) GetArtifacts() []AllHashEqualTreeArtifactsArtifact { return v.Artifacts } -// Edge allows filtering path/neighbors output to only contain a subset of all -// possible GUAC links. -// -// Each member of the enum is formed by merging two Node names with _. Each name -// is converted from CamelCase to CAPITALS_WITH_UNDERSCORES. Only valid edges -// (pairs from Node to Node) are included. -// -// The only exception to the above rule is for links out of HasSLSA. The names are -// HAS_SLSA_SUBJECT, HAS_SLSA_BUILT_BY, and HAS_SLSA_MATERIALS. This is because -// ARTIFACT_HAS_SLSA is only from subject Artifact to HasSLSA. -type Edge string +// GetOrigin returns AllHashEqualTree.Origin, and is useful for accessing the field via an interface. +func (v *AllHashEqualTree) GetOrigin() string { return v.Origin } -const ( - EdgeArtifactCertifyBad Edge = "ARTIFACT_CERTIFY_BAD" - EdgeArtifactCertifyGood Edge = "ARTIFACT_CERTIFY_GOOD" - EdgeArtifactCertifyVexStatement Edge = "ARTIFACT_CERTIFY_VEX_STATEMENT" - EdgeArtifactHashEqual Edge = "ARTIFACT_HASH_EQUAL" - EdgeArtifactHasSbom Edge = "ARTIFACT_HAS_SBOM" - EdgeArtifactHasSlsa Edge = "ARTIFACT_HAS_SLSA" - EdgeArtifactIsOccurrence Edge = "ARTIFACT_IS_OCCURRENCE" - EdgeArtifactHasMetadata Edge = "ARTIFACT_HAS_METADATA" - EdgeArtifactPointOfContact Edge = "ARTIFACT_POINT_OF_CONTACT" - EdgeBuilderHasSlsa Edge = "BUILDER_HAS_SLSA" - EdgeCveCertifyVexStatement Edge = "CVE_CERTIFY_VEX_STATEMENT" - EdgeCveCertifyVuln Edge = "CVE_CERTIFY_VULN" - EdgeCveIsVulnerability Edge = "CVE_IS_VULNERABILITY" - EdgeGhsaCertifyVexStatement Edge = "GHSA_CERTIFY_VEX_STATEMENT" - EdgeGhsaCertifyVuln Edge = "GHSA_CERTIFY_VULN" - EdgeGhsaIsVulnerability Edge = "GHSA_IS_VULNERABILITY" - EdgeNoVulnCertifyVuln Edge = "NO_VULN_CERTIFY_VULN" - EdgeOsvCertifyVexStatement Edge = "OSV_CERTIFY_VEX_STATEMENT" - EdgeOsvCertifyVuln Edge = "OSV_CERTIFY_VULN" - EdgeOsvIsVulnerability Edge = "OSV_IS_VULNERABILITY" - EdgePackageCertifyBad Edge = "PACKAGE_CERTIFY_BAD" - EdgePackageCertifyGood Edge = "PACKAGE_CERTIFY_GOOD" - EdgePackageCertifyVexStatement Edge = "PACKAGE_CERTIFY_VEX_STATEMENT" - EdgePackageCertifyVuln Edge = "PACKAGE_CERTIFY_VULN" - EdgePackageHasSbom Edge = "PACKAGE_HAS_SBOM" - EdgePackageHasSourceAt Edge = "PACKAGE_HAS_SOURCE_AT" - EdgePackageIsDependency Edge = "PACKAGE_IS_DEPENDENCY" - EdgePackageIsOccurrence Edge = "PACKAGE_IS_OCCURRENCE" - EdgePackagePkgEqual Edge = "PACKAGE_PKG_EQUAL" - EdgePackageHasMetadata Edge = "PACKAGE_HAS_METADATA" - EdgePackagePointOfContact Edge = "PACKAGE_POINT_OF_CONTACT" - EdgeSourceCertifyBad Edge = "SOURCE_CERTIFY_BAD" - EdgeSourceCertifyGood Edge = "SOURCE_CERTIFY_GOOD" - EdgeSourceCertifyScorecard Edge = "SOURCE_CERTIFY_SCORECARD" - EdgeSourceHasSourceAt Edge = "SOURCE_HAS_SOURCE_AT" - EdgeSourceIsOccurrence Edge = "SOURCE_IS_OCCURRENCE" - EdgeSourceHasMetadata Edge = "SOURCE_HAS_METADATA" - EdgeSourcePointOfContact Edge = "SOURCE_POINT_OF_CONTACT" - EdgeCertifyBadArtifact Edge = "CERTIFY_BAD_ARTIFACT" - EdgeCertifyBadPackage Edge = "CERTIFY_BAD_PACKAGE" - EdgeCertifyBadSource Edge = "CERTIFY_BAD_SOURCE" - EdgeCertifyGoodArtifact Edge = "CERTIFY_GOOD_ARTIFACT" - EdgeCertifyGoodPackage Edge = "CERTIFY_GOOD_PACKAGE" - EdgeCertifyGoodSource Edge = "CERTIFY_GOOD_SOURCE" - EdgeCertifyScorecardSource Edge = "CERTIFY_SCORECARD_SOURCE" - EdgeCertifyVexStatementArtifact Edge = "CERTIFY_VEX_STATEMENT_ARTIFACT" - EdgeCertifyVexStatementCve Edge = "CERTIFY_VEX_STATEMENT_CVE" - EdgeCertifyVexStatementGhsa Edge = "CERTIFY_VEX_STATEMENT_GHSA" - EdgeCertifyVexStatementOsv Edge = "CERTIFY_VEX_STATEMENT_OSV" - EdgeCertifyVexStatementPackage Edge = "CERTIFY_VEX_STATEMENT_PACKAGE" - EdgeCertifyVulnCve Edge = "CERTIFY_VULN_CVE" - EdgeCertifyVulnGhsa Edge = "CERTIFY_VULN_GHSA" - EdgeCertifyVulnNoVuln Edge = "CERTIFY_VULN_NO_VULN" - EdgeCertifyVulnOsv Edge = "CERTIFY_VULN_OSV" - EdgeCertifyVulnPackage Edge = "CERTIFY_VULN_PACKAGE" - EdgeHashEqualArtifact Edge = "HASH_EQUAL_ARTIFACT" - EdgeHasSbomArtifact Edge = "HAS_SBOM_ARTIFACT" - EdgeHasSbomPackage Edge = "HAS_SBOM_PACKAGE" - EdgeHasSlsaBuiltBy Edge = "HAS_SLSA_BUILT_BY" - EdgeHasSlsaMaterials Edge = "HAS_SLSA_MATERIALS" - EdgeHasSlsaSubject Edge = "HAS_SLSA_SUBJECT" - EdgeHasSourceAtPackage Edge = "HAS_SOURCE_AT_PACKAGE" - EdgeHasSourceAtSource Edge = "HAS_SOURCE_AT_SOURCE" - EdgeIsDependencyPackage Edge = "IS_DEPENDENCY_PACKAGE" - EdgeIsOccurrenceArtifact Edge = "IS_OCCURRENCE_ARTIFACT" - EdgeIsOccurrencePackage Edge = "IS_OCCURRENCE_PACKAGE" - EdgeIsOccurrenceSource Edge = "IS_OCCURRENCE_SOURCE" - EdgeIsVulnerabilityCve Edge = "IS_VULNERABILITY_CVE" - EdgeIsVulnerabilityGhsa Edge = "IS_VULNERABILITY_GHSA" - EdgeIsVulnerabilityOsv Edge = "IS_VULNERABILITY_OSV" - EdgePkgEqualPackage Edge = "PKG_EQUAL_PACKAGE" - EdgeHasMetadataPackage Edge = "HAS_METADATA_PACKAGE" - EdgeHasMetadataArtifact Edge = "HAS_METADATA_ARTIFACT" - EdgeHasMetadataSource Edge = "HAS_METADATA_SOURCE" - EdgePointOfContactPackage Edge = "POINT_OF_CONTACT_PACKAGE" - EdgePointOfContactArtifact Edge = "POINT_OF_CONTACT_ARTIFACT" - EdgePointOfContactSource Edge = "POINT_OF_CONTACT_SOURCE" -) +// GetCollector returns AllHashEqualTree.Collector, and is useful for accessing the field via an interface. +func (v *AllHashEqualTree) GetCollector() string { return v.Collector } -// FindSoftwareFindSoftwareArtifact includes the requested fields of the GraphQL type Artifact. +// AllHashEqualTreeArtifactsArtifact includes the requested fields of the GraphQL type Artifact. // The GraphQL type's documentation follows. // // Artifact represents an artifact identified by a checksum hash. @@ -3841,34 +3713,30 @@ const ( // // If having a checksum Go object, algorithm can be // strings.ToLower(string(checksum.Algorithm)) and digest can be checksum.Value. -type FindSoftwareFindSoftwareArtifact struct { - Typename *string `json:"__typename"` +type AllHashEqualTreeArtifactsArtifact struct { AllArtifactTree `json:"-"` } -// GetTypename returns FindSoftwareFindSoftwareArtifact.Typename, and is useful for accessing the field via an interface. -func (v *FindSoftwareFindSoftwareArtifact) GetTypename() *string { return v.Typename } - -// GetId returns FindSoftwareFindSoftwareArtifact.Id, and is useful for accessing the field via an interface. -func (v *FindSoftwareFindSoftwareArtifact) GetId() string { return v.AllArtifactTree.Id } +// GetId returns AllHashEqualTreeArtifactsArtifact.Id, and is useful for accessing the field via an interface. +func (v *AllHashEqualTreeArtifactsArtifact) GetId() string { return v.AllArtifactTree.Id } -// GetAlgorithm returns FindSoftwareFindSoftwareArtifact.Algorithm, and is useful for accessing the field via an interface. -func (v *FindSoftwareFindSoftwareArtifact) GetAlgorithm() string { return v.AllArtifactTree.Algorithm } +// GetAlgorithm returns AllHashEqualTreeArtifactsArtifact.Algorithm, and is useful for accessing the field via an interface. +func (v *AllHashEqualTreeArtifactsArtifact) GetAlgorithm() string { return v.AllArtifactTree.Algorithm } -// GetDigest returns FindSoftwareFindSoftwareArtifact.Digest, and is useful for accessing the field via an interface. -func (v *FindSoftwareFindSoftwareArtifact) GetDigest() string { return v.AllArtifactTree.Digest } +// GetDigest returns AllHashEqualTreeArtifactsArtifact.Digest, and is useful for accessing the field via an interface. +func (v *AllHashEqualTreeArtifactsArtifact) GetDigest() string { return v.AllArtifactTree.Digest } -func (v *FindSoftwareFindSoftwareArtifact) UnmarshalJSON(b []byte) error { +func (v *AllHashEqualTreeArtifactsArtifact) UnmarshalJSON(b []byte) error { if string(b) == "null" { return nil } var firstPass struct { - *FindSoftwareFindSoftwareArtifact + *AllHashEqualTreeArtifactsArtifact graphql.NoUnmarshalJSON } - firstPass.FindSoftwareFindSoftwareArtifact = v + firstPass.AllHashEqualTreeArtifactsArtifact = v err := json.Unmarshal(b, &firstPass) if err != nil { @@ -3883,9 +3751,7 @@ func (v *FindSoftwareFindSoftwareArtifact) UnmarshalJSON(b []byte) error { return nil } -type __premarshalFindSoftwareFindSoftwareArtifact struct { - Typename *string `json:"__typename"` - +type __premarshalAllHashEqualTreeArtifactsArtifact struct { Id string `json:"id"` Algorithm string `json:"algorithm"` @@ -3893,7 +3759,7 @@ type __premarshalFindSoftwareFindSoftwareArtifact struct { Digest string `json:"digest"` } -func (v *FindSoftwareFindSoftwareArtifact) MarshalJSON() ([]byte, error) { +func (v *AllHashEqualTreeArtifactsArtifact) MarshalJSON() ([]byte, error) { premarshaled, err := v.__premarshalJSON() if err != nil { return nil, err @@ -3901,17 +3767,64 @@ func (v *FindSoftwareFindSoftwareArtifact) MarshalJSON() ([]byte, error) { return json.Marshal(premarshaled) } -func (v *FindSoftwareFindSoftwareArtifact) __premarshalJSON() (*__premarshalFindSoftwareFindSoftwareArtifact, error) { - var retval __premarshalFindSoftwareFindSoftwareArtifact +func (v *AllHashEqualTreeArtifactsArtifact) __premarshalJSON() (*__premarshalAllHashEqualTreeArtifactsArtifact, error) { + var retval __premarshalAllHashEqualTreeArtifactsArtifact - retval.Typename = v.Typename retval.Id = v.AllArtifactTree.Id retval.Algorithm = v.AllArtifactTree.Algorithm retval.Digest = v.AllArtifactTree.Digest return &retval, nil } -// FindSoftwareFindSoftwarePackage includes the requested fields of the GraphQL type Package. +// AllIsDependencyTree includes the GraphQL fields of IsDependency requested by the fragment AllIsDependencyTree. +// The GraphQL type's documentation follows. +// +// IsDependency is an attestation to record that a package depends on another. +type AllIsDependencyTree struct { + Id string `json:"id"` + // Justification for the attested relationship + Justification string `json:"justification"` + // Package that has the dependency + Package AllIsDependencyTreePackage `json:"package"` + // Package for the dependency; MUST BE PackageName, not PackageVersion + DependentPackage AllIsDependencyTreeDependentPackage `json:"dependentPackage"` + // Type of dependency + DependencyType DependencyType `json:"dependencyType"` + // Version range for the dependency link + VersionRange string `json:"versionRange"` + // Document from which this attestation is generated from + Origin string `json:"origin"` + // GUAC collector for the document + Collector string `json:"collector"` +} + +// GetId returns AllIsDependencyTree.Id, and is useful for accessing the field via an interface. +func (v *AllIsDependencyTree) GetId() string { return v.Id } + +// GetJustification returns AllIsDependencyTree.Justification, and is useful for accessing the field via an interface. +func (v *AllIsDependencyTree) GetJustification() string { return v.Justification } + +// GetPackage returns AllIsDependencyTree.Package, and is useful for accessing the field via an interface. +func (v *AllIsDependencyTree) GetPackage() AllIsDependencyTreePackage { return v.Package } + +// GetDependentPackage returns AllIsDependencyTree.DependentPackage, and is useful for accessing the field via an interface. +func (v *AllIsDependencyTree) GetDependentPackage() AllIsDependencyTreeDependentPackage { + return v.DependentPackage +} + +// GetDependencyType returns AllIsDependencyTree.DependencyType, and is useful for accessing the field via an interface. +func (v *AllIsDependencyTree) GetDependencyType() DependencyType { return v.DependencyType } + +// GetVersionRange returns AllIsDependencyTree.VersionRange, and is useful for accessing the field via an interface. +func (v *AllIsDependencyTree) GetVersionRange() string { return v.VersionRange } + +// GetOrigin returns AllIsDependencyTree.Origin, and is useful for accessing the field via an interface. +func (v *AllIsDependencyTree) GetOrigin() string { return v.Origin } + +// GetCollector returns AllIsDependencyTree.Collector, and is useful for accessing the field via an interface. +func (v *AllIsDependencyTree) GetCollector() string { return v.Collector } + +// AllIsDependencyTreeDependentPackage includes the requested fields of the GraphQL type Package. // The GraphQL type's documentation follows. // // Package represents the root of the package trie/tree. @@ -3928,36 +3841,32 @@ func (v *FindSoftwareFindSoftwareArtifact) __premarshalJSON() (*__premarshalFind // // Since this node is at the root of the package trie, it is named Package, not // PackageType. -type FindSoftwareFindSoftwarePackage struct { - Typename *string `json:"__typename"` +type AllIsDependencyTreeDependentPackage struct { AllPkgTree `json:"-"` } -// GetTypename returns FindSoftwareFindSoftwarePackage.Typename, and is useful for accessing the field via an interface. -func (v *FindSoftwareFindSoftwarePackage) GetTypename() *string { return v.Typename } - -// GetId returns FindSoftwareFindSoftwarePackage.Id, and is useful for accessing the field via an interface. -func (v *FindSoftwareFindSoftwarePackage) GetId() string { return v.AllPkgTree.Id } +// GetId returns AllIsDependencyTreeDependentPackage.Id, and is useful for accessing the field via an interface. +func (v *AllIsDependencyTreeDependentPackage) GetId() string { return v.AllPkgTree.Id } -// GetType returns FindSoftwareFindSoftwarePackage.Type, and is useful for accessing the field via an interface. -func (v *FindSoftwareFindSoftwarePackage) GetType() string { return v.AllPkgTree.Type } +// GetType returns AllIsDependencyTreeDependentPackage.Type, and is useful for accessing the field via an interface. +func (v *AllIsDependencyTreeDependentPackage) GetType() string { return v.AllPkgTree.Type } -// GetNamespaces returns FindSoftwareFindSoftwarePackage.Namespaces, and is useful for accessing the field via an interface. -func (v *FindSoftwareFindSoftwarePackage) GetNamespaces() []AllPkgTreeNamespacesPackageNamespace { +// GetNamespaces returns AllIsDependencyTreeDependentPackage.Namespaces, and is useful for accessing the field via an interface. +func (v *AllIsDependencyTreeDependentPackage) GetNamespaces() []AllPkgTreeNamespacesPackageNamespace { return v.AllPkgTree.Namespaces } -func (v *FindSoftwareFindSoftwarePackage) UnmarshalJSON(b []byte) error { +func (v *AllIsDependencyTreeDependentPackage) UnmarshalJSON(b []byte) error { if string(b) == "null" { return nil } var firstPass struct { - *FindSoftwareFindSoftwarePackage + *AllIsDependencyTreeDependentPackage graphql.NoUnmarshalJSON } - firstPass.FindSoftwareFindSoftwarePackage = v + firstPass.AllIsDependencyTreeDependentPackage = v err := json.Unmarshal(b, &firstPass) if err != nil { @@ -3972,9 +3881,7 @@ func (v *FindSoftwareFindSoftwarePackage) UnmarshalJSON(b []byte) error { return nil } -type __premarshalFindSoftwareFindSoftwarePackage struct { - Typename *string `json:"__typename"` - +type __premarshalAllIsDependencyTreeDependentPackage struct { Id string `json:"id"` Type string `json:"type"` @@ -3982,7 +3889,7 @@ type __premarshalFindSoftwareFindSoftwarePackage struct { Namespaces []AllPkgTreeNamespacesPackageNamespace `json:"namespaces"` } -func (v *FindSoftwareFindSoftwarePackage) MarshalJSON() ([]byte, error) { +func (v *AllIsDependencyTreeDependentPackage) MarshalJSON() ([]byte, error) { premarshaled, err := v.__premarshalJSON() if err != nil { return nil, err @@ -3990,162 +3897,58 @@ func (v *FindSoftwareFindSoftwarePackage) MarshalJSON() ([]byte, error) { return json.Marshal(premarshaled) } -func (v *FindSoftwareFindSoftwarePackage) __premarshalJSON() (*__premarshalFindSoftwareFindSoftwarePackage, error) { - var retval __premarshalFindSoftwareFindSoftwarePackage +func (v *AllIsDependencyTreeDependentPackage) __premarshalJSON() (*__premarshalAllIsDependencyTreeDependentPackage, error) { + var retval __premarshalAllIsDependencyTreeDependentPackage - retval.Typename = v.Typename retval.Id = v.AllPkgTree.Id retval.Type = v.AllPkgTree.Type retval.Namespaces = v.AllPkgTree.Namespaces return &retval, nil } -// FindSoftwareFindSoftwarePackageSourceOrArtifact includes the requested fields of the GraphQL interface PackageSourceOrArtifact. -// -// FindSoftwareFindSoftwarePackageSourceOrArtifact is implemented by the following types: -// FindSoftwareFindSoftwareArtifact -// FindSoftwareFindSoftwarePackage -// FindSoftwareFindSoftwareSource -// The GraphQL type's documentation follows. -// -// PackageSourceOrArtifact is a union of Package, Source, and Artifact. -type FindSoftwareFindSoftwarePackageSourceOrArtifact interface { - implementsGraphQLInterfaceFindSoftwareFindSoftwarePackageSourceOrArtifact() - // GetTypename returns the receiver's concrete GraphQL type-name (see interface doc for possible values). - GetTypename() *string -} - -func (v *FindSoftwareFindSoftwareArtifact) implementsGraphQLInterfaceFindSoftwareFindSoftwarePackageSourceOrArtifact() { -} -func (v *FindSoftwareFindSoftwarePackage) implementsGraphQLInterfaceFindSoftwareFindSoftwarePackageSourceOrArtifact() { -} -func (v *FindSoftwareFindSoftwareSource) implementsGraphQLInterfaceFindSoftwareFindSoftwarePackageSourceOrArtifact() { -} - -func __unmarshalFindSoftwareFindSoftwarePackageSourceOrArtifact(b []byte, v *FindSoftwareFindSoftwarePackageSourceOrArtifact) error { - if string(b) == "null" { - return nil - } - - var tn struct { - TypeName string `json:"__typename"` - } - err := json.Unmarshal(b, &tn) - if err != nil { - return err - } - - switch tn.TypeName { - case "Artifact": - *v = new(FindSoftwareFindSoftwareArtifact) - return json.Unmarshal(b, *v) - case "Package": - *v = new(FindSoftwareFindSoftwarePackage) - return json.Unmarshal(b, *v) - case "Source": - *v = new(FindSoftwareFindSoftwareSource) - return json.Unmarshal(b, *v) - case "": - return fmt.Errorf( - "response was missing PackageSourceOrArtifact.__typename") - default: - return fmt.Errorf( - `unexpected concrete type for FindSoftwareFindSoftwarePackageSourceOrArtifact: "%v"`, tn.TypeName) - } -} - -func __marshalFindSoftwareFindSoftwarePackageSourceOrArtifact(v *FindSoftwareFindSoftwarePackageSourceOrArtifact) ([]byte, error) { - - var typename string - switch v := (*v).(type) { - case *FindSoftwareFindSoftwareArtifact: - typename = "Artifact" - - premarshaled, err := v.__premarshalJSON() - if err != nil { - return nil, err - } - result := struct { - TypeName string `json:"__typename"` - *__premarshalFindSoftwareFindSoftwareArtifact - }{typename, premarshaled} - return json.Marshal(result) - case *FindSoftwareFindSoftwarePackage: - typename = "Package" - - premarshaled, err := v.__premarshalJSON() - if err != nil { - return nil, err - } - result := struct { - TypeName string `json:"__typename"` - *__premarshalFindSoftwareFindSoftwarePackage - }{typename, premarshaled} - return json.Marshal(result) - case *FindSoftwareFindSoftwareSource: - typename = "Source" - - premarshaled, err := v.__premarshalJSON() - if err != nil { - return nil, err - } - result := struct { - TypeName string `json:"__typename"` - *__premarshalFindSoftwareFindSoftwareSource - }{typename, premarshaled} - return json.Marshal(result) - case nil: - return []byte("null"), nil - default: - return nil, fmt.Errorf( - `unexpected concrete type for FindSoftwareFindSoftwarePackageSourceOrArtifact: "%T"`, v) - } -} - -// FindSoftwareFindSoftwareSource includes the requested fields of the GraphQL type Source. +// AllIsDependencyTreePackage includes the requested fields of the GraphQL type Package. // The GraphQL type's documentation follows. // -// Source represents the root of the source trie/tree. +// Package represents the root of the package trie/tree. // -// We map source information to a trie, as a derivative of the pURL specification: -// each path in the trie represents a type, namespace, name and an optional -// qualifier that stands for tag/commit information. +// We map package information to a trie, closely matching the pURL specification +// (https://github.com/package-url/purl-spec/blob/0dd92f26f8bb11956ffdf5e8acfcee71e8560407/README.rst), +// but deviating from it where GUAC heuristics allow for better representation of +// package information. Each path in the trie fully represents a package; we split +// the trie based on the pURL components. // -// This node represents the type part of the trie path. It is used to represent -// the version control system that is being used. +// This node matches a pkg: partial pURL. The type field matches the +// pURL types but we might also use "guac" for the cases where the pURL +// representation is not complete or when we have custom rules. // -// Since this node is at the root of the source trie, it is named Source, not -// SourceType. -type FindSoftwareFindSoftwareSource struct { - Typename *string `json:"__typename"` - AllSourceTree `json:"-"` +// Since this node is at the root of the package trie, it is named Package, not +// PackageType. +type AllIsDependencyTreePackage struct { + AllPkgTree `json:"-"` } -// GetTypename returns FindSoftwareFindSoftwareSource.Typename, and is useful for accessing the field via an interface. -func (v *FindSoftwareFindSoftwareSource) GetTypename() *string { return v.Typename } - -// GetId returns FindSoftwareFindSoftwareSource.Id, and is useful for accessing the field via an interface. -func (v *FindSoftwareFindSoftwareSource) GetId() string { return v.AllSourceTree.Id } +// GetId returns AllIsDependencyTreePackage.Id, and is useful for accessing the field via an interface. +func (v *AllIsDependencyTreePackage) GetId() string { return v.AllPkgTree.Id } -// GetType returns FindSoftwareFindSoftwareSource.Type, and is useful for accessing the field via an interface. -func (v *FindSoftwareFindSoftwareSource) GetType() string { return v.AllSourceTree.Type } +// GetType returns AllIsDependencyTreePackage.Type, and is useful for accessing the field via an interface. +func (v *AllIsDependencyTreePackage) GetType() string { return v.AllPkgTree.Type } -// GetNamespaces returns FindSoftwareFindSoftwareSource.Namespaces, and is useful for accessing the field via an interface. -func (v *FindSoftwareFindSoftwareSource) GetNamespaces() []AllSourceTreeNamespacesSourceNamespace { - return v.AllSourceTree.Namespaces +// GetNamespaces returns AllIsDependencyTreePackage.Namespaces, and is useful for accessing the field via an interface. +func (v *AllIsDependencyTreePackage) GetNamespaces() []AllPkgTreeNamespacesPackageNamespace { + return v.AllPkgTree.Namespaces } -func (v *FindSoftwareFindSoftwareSource) UnmarshalJSON(b []byte) error { +func (v *AllIsDependencyTreePackage) UnmarshalJSON(b []byte) error { if string(b) == "null" { return nil } var firstPass struct { - *FindSoftwareFindSoftwareSource + *AllIsDependencyTreePackage graphql.NoUnmarshalJSON } - firstPass.FindSoftwareFindSoftwareSource = v + firstPass.AllIsDependencyTreePackage = v err := json.Unmarshal(b, &firstPass) if err != nil { @@ -4153,24 +3956,22 @@ func (v *FindSoftwareFindSoftwareSource) UnmarshalJSON(b []byte) error { } err = json.Unmarshal( - b, &v.AllSourceTree) + b, &v.AllPkgTree) if err != nil { return err } return nil } -type __premarshalFindSoftwareFindSoftwareSource struct { - Typename *string `json:"__typename"` - +type __premarshalAllIsDependencyTreePackage struct { Id string `json:"id"` Type string `json:"type"` - Namespaces []AllSourceTreeNamespacesSourceNamespace `json:"namespaces"` + Namespaces []AllPkgTreeNamespacesPackageNamespace `json:"namespaces"` } -func (v *FindSoftwareFindSoftwareSource) MarshalJSON() ([]byte, error) { +func (v *AllIsDependencyTreePackage) MarshalJSON() ([]byte, error) { premarshaled, err := v.__premarshalJSON() if err != nil { return nil, err @@ -4178,55 +3979,67 @@ func (v *FindSoftwareFindSoftwareSource) MarshalJSON() ([]byte, error) { return json.Marshal(premarshaled) } -func (v *FindSoftwareFindSoftwareSource) __premarshalJSON() (*__premarshalFindSoftwareFindSoftwareSource, error) { - var retval __premarshalFindSoftwareFindSoftwareSource +func (v *AllIsDependencyTreePackage) __premarshalJSON() (*__premarshalAllIsDependencyTreePackage, error) { + var retval __premarshalAllIsDependencyTreePackage - retval.Typename = v.Typename - retval.Id = v.AllSourceTree.Id - retval.Type = v.AllSourceTree.Type - retval.Namespaces = v.AllSourceTree.Namespaces + retval.Id = v.AllPkgTree.Id + retval.Type = v.AllPkgTree.Type + retval.Namespaces = v.AllPkgTree.Namespaces return &retval, nil } -// FindSoftwareResponse is returned by FindSoftware on success. -type FindSoftwareResponse struct { - // findSoftware takes in a searchText string and looks for software - // that may be relevant for the input text. This can be seen as fuzzy search - // function for Packages, Sources and Artifacts. findSoftware returns a list - // of Packages, Sources and Artifacts that it determines to be relevant to - // the input searchText. - // - // Due to the nature of full text search being implemented differently on - // different db platforms, the behavior of findSoftware is not guaranteed - // to be the same. In addition, their statistical nature may result in - // results being different per call and not reproducible. - // - // All that is asked in the implementation of this API is that it follows - // the spirit of helping to retrieve the right nodes with best effort. - // - // Warning: This is an EXPERIMENTAL feature. This is subject to change. - // Warning: This is an OPTIONAL feature. Backends are not required to - // implement this API. - FindSoftware []FindSoftwareFindSoftwarePackageSourceOrArtifact `json:"-"` +// AllIsOccurrencesTree includes the GraphQL fields of IsOccurrence requested by the fragment AllIsOccurrencesTree. +// The GraphQL type's documentation follows. +// +// IsOccurrence is an attestation to link an artifact to a package or source. +// +// Attestation must occur at the PackageVersion or at the SourceName. +type AllIsOccurrencesTree struct { + Id string `json:"id"` + // Package or source from which the artifact originates + Subject AllIsOccurrencesTreeSubjectPackageOrSource `json:"-"` + // The artifact in the relationship + Artifact AllIsOccurrencesTreeArtifact `json:"artifact"` + // Justification for the attested relationship + Justification string `json:"justification"` + // Document from which this attestation is generated from + Origin string `json:"origin"` + // GUAC collector for the document + Collector string `json:"collector"` } -// GetFindSoftware returns FindSoftwareResponse.FindSoftware, and is useful for accessing the field via an interface. -func (v *FindSoftwareResponse) GetFindSoftware() []FindSoftwareFindSoftwarePackageSourceOrArtifact { - return v.FindSoftware +// GetId returns AllIsOccurrencesTree.Id, and is useful for accessing the field via an interface. +func (v *AllIsOccurrencesTree) GetId() string { return v.Id } + +// GetSubject returns AllIsOccurrencesTree.Subject, and is useful for accessing the field via an interface. +func (v *AllIsOccurrencesTree) GetSubject() AllIsOccurrencesTreeSubjectPackageOrSource { + return v.Subject } -func (v *FindSoftwareResponse) UnmarshalJSON(b []byte) error { +// GetArtifact returns AllIsOccurrencesTree.Artifact, and is useful for accessing the field via an interface. +func (v *AllIsOccurrencesTree) GetArtifact() AllIsOccurrencesTreeArtifact { return v.Artifact } + +// GetJustification returns AllIsOccurrencesTree.Justification, and is useful for accessing the field via an interface. +func (v *AllIsOccurrencesTree) GetJustification() string { return v.Justification } + +// GetOrigin returns AllIsOccurrencesTree.Origin, and is useful for accessing the field via an interface. +func (v *AllIsOccurrencesTree) GetOrigin() string { return v.Origin } + +// GetCollector returns AllIsOccurrencesTree.Collector, and is useful for accessing the field via an interface. +func (v *AllIsOccurrencesTree) GetCollector() string { return v.Collector } + +func (v *AllIsOccurrencesTree) UnmarshalJSON(b []byte) error { if string(b) == "null" { return nil } var firstPass struct { - *FindSoftwareResponse - FindSoftware []json.RawMessage `json:"findSoftware"` + *AllIsOccurrencesTree + Subject json.RawMessage `json:"subject"` graphql.NoUnmarshalJSON } - firstPass.FindSoftwareResponse = v + firstPass.AllIsOccurrencesTree = v err := json.Unmarshal(b, &firstPass) if err != nil { @@ -4234,111 +4047,99 @@ func (v *FindSoftwareResponse) UnmarshalJSON(b []byte) error { } { - dst := &v.FindSoftware - src := firstPass.FindSoftware - *dst = make( - []FindSoftwareFindSoftwarePackageSourceOrArtifact, - len(src)) - for i, src := range src { - dst := &(*dst)[i] - if len(src) != 0 && string(src) != "null" { - err = __unmarshalFindSoftwareFindSoftwarePackageSourceOrArtifact( - src, dst) - if err != nil { - return fmt.Errorf( - "unable to unmarshal FindSoftwareResponse.FindSoftware: %w", err) - } + dst := &v.Subject + src := firstPass.Subject + if len(src) != 0 && string(src) != "null" { + err = __unmarshalAllIsOccurrencesTreeSubjectPackageOrSource( + src, dst) + if err != nil { + return fmt.Errorf( + "unable to unmarshal AllIsOccurrencesTree.Subject: %w", err) } } } return nil } -type __premarshalFindSoftwareResponse struct { - FindSoftware []json.RawMessage `json:"findSoftware"` -} +type __premarshalAllIsOccurrencesTree struct { + Id string `json:"id"` -func (v *FindSoftwareResponse) MarshalJSON() ([]byte, error) { - premarshaled, err := v.__premarshalJSON() - if err != nil { - return nil, err - } + Subject json.RawMessage `json:"subject"` + + Artifact AllIsOccurrencesTreeArtifact `json:"artifact"` + + Justification string `json:"justification"` + + Origin string `json:"origin"` + + Collector string `json:"collector"` +} + +func (v *AllIsOccurrencesTree) MarshalJSON() ([]byte, error) { + premarshaled, err := v.__premarshalJSON() + if err != nil { + return nil, err + } return json.Marshal(premarshaled) } -func (v *FindSoftwareResponse) __premarshalJSON() (*__premarshalFindSoftwareResponse, error) { - var retval __premarshalFindSoftwareResponse +func (v *AllIsOccurrencesTree) __premarshalJSON() (*__premarshalAllIsOccurrencesTree, error) { + var retval __premarshalAllIsOccurrencesTree + retval.Id = v.Id { - dst := &retval.FindSoftware - src := v.FindSoftware - *dst = make( - []json.RawMessage, - len(src)) - for i, src := range src { - dst := &(*dst)[i] - var err error - *dst, err = __marshalFindSoftwareFindSoftwarePackageSourceOrArtifact( - &src) - if err != nil { - return nil, fmt.Errorf( - "unable to marshal FindSoftwareResponse.FindSoftware: %w", err) - } + dst := &retval.Subject + src := v.Subject + var err error + *dst, err = __marshalAllIsOccurrencesTreeSubjectPackageOrSource( + &src) + if err != nil { + return nil, fmt.Errorf( + "unable to marshal AllIsOccurrencesTree.Subject: %w", err) } } + retval.Artifact = v.Artifact + retval.Justification = v.Justification + retval.Origin = v.Origin + retval.Collector = v.Collector return &retval, nil } -// GHSAInputSpec specifies a GitHub Security Advisory for mutations. -type GHSAInputSpec struct { - GhsaId string `json:"ghsaId"` -} - -// GetGhsaId returns GHSAInputSpec.GhsaId, and is useful for accessing the field via an interface. -func (v *GHSAInputSpec) GetGhsaId() string { return v.GhsaId } - -// GHSASpec allows filtering the list of advisories to return in a query. -type GHSASpec struct { - Id *string `json:"id"` - GhsaId *string `json:"ghsaId"` -} - -// GetId returns GHSASpec.Id, and is useful for accessing the field via an interface. -func (v *GHSASpec) GetId() *string { return v.Id } - -// GetGhsaId returns GHSASpec.GhsaId, and is useful for accessing the field via an interface. -func (v *GHSASpec) GetGhsaId() *string { return v.GhsaId } - -// GHSAsGhsaGHSA includes the requested fields of the GraphQL type GHSA. +// AllIsOccurrencesTreeArtifact includes the requested fields of the GraphQL type Artifact. // The GraphQL type's documentation follows. // -// GHSA represents GitHub security advisories. +// Artifact represents an artifact identified by a checksum hash. // -// The advisory id field is mandatory and canonicalized to be lowercase. +// The checksum is split into the digest value and the algorithm used to generate +// it. Both fields are mandatory and canonicalized to be lowercase. // -// This node can be referred to by other parts of GUAC. -type GHSAsGhsaGHSA struct { - AllGHSATree `json:"-"` +// If having a checksum Go object, algorithm can be +// strings.ToLower(string(checksum.Algorithm)) and digest can be checksum.Value. +type AllIsOccurrencesTreeArtifact struct { + AllArtifactTree `json:"-"` } -// GetId returns GHSAsGhsaGHSA.Id, and is useful for accessing the field via an interface. -func (v *GHSAsGhsaGHSA) GetId() string { return v.AllGHSATree.Id } +// GetId returns AllIsOccurrencesTreeArtifact.Id, and is useful for accessing the field via an interface. +func (v *AllIsOccurrencesTreeArtifact) GetId() string { return v.AllArtifactTree.Id } -// GetGhsaId returns GHSAsGhsaGHSA.GhsaId, and is useful for accessing the field via an interface. -func (v *GHSAsGhsaGHSA) GetGhsaId() string { return v.AllGHSATree.GhsaId } +// GetAlgorithm returns AllIsOccurrencesTreeArtifact.Algorithm, and is useful for accessing the field via an interface. +func (v *AllIsOccurrencesTreeArtifact) GetAlgorithm() string { return v.AllArtifactTree.Algorithm } -func (v *GHSAsGhsaGHSA) UnmarshalJSON(b []byte) error { +// GetDigest returns AllIsOccurrencesTreeArtifact.Digest, and is useful for accessing the field via an interface. +func (v *AllIsOccurrencesTreeArtifact) GetDigest() string { return v.AllArtifactTree.Digest } + +func (v *AllIsOccurrencesTreeArtifact) UnmarshalJSON(b []byte) error { if string(b) == "null" { return nil } var firstPass struct { - *GHSAsGhsaGHSA + *AllIsOccurrencesTreeArtifact graphql.NoUnmarshalJSON } - firstPass.GHSAsGhsaGHSA = v + firstPass.AllIsOccurrencesTreeArtifact = v err := json.Unmarshal(b, &firstPass) if err != nil { @@ -4346,20 +4147,22 @@ func (v *GHSAsGhsaGHSA) UnmarshalJSON(b []byte) error { } err = json.Unmarshal( - b, &v.AllGHSATree) + b, &v.AllArtifactTree) if err != nil { return err } return nil } -type __premarshalGHSAsGhsaGHSA struct { +type __premarshalAllIsOccurrencesTreeArtifact struct { Id string `json:"id"` - GhsaId string `json:"ghsaId"` + Algorithm string `json:"algorithm"` + + Digest string `json:"digest"` } -func (v *GHSAsGhsaGHSA) MarshalJSON() ([]byte, error) { +func (v *AllIsOccurrencesTreeArtifact) MarshalJSON() ([]byte, error) { premarshaled, err := v.__premarshalJSON() if err != nil { return nil, err @@ -4367,87 +4170,62 @@ func (v *GHSAsGhsaGHSA) MarshalJSON() ([]byte, error) { return json.Marshal(premarshaled) } -func (v *GHSAsGhsaGHSA) __premarshalJSON() (*__premarshalGHSAsGhsaGHSA, error) { - var retval __premarshalGHSAsGhsaGHSA +func (v *AllIsOccurrencesTreeArtifact) __premarshalJSON() (*__premarshalAllIsOccurrencesTreeArtifact, error) { + var retval __premarshalAllIsOccurrencesTreeArtifact - retval.Id = v.AllGHSATree.Id - retval.GhsaId = v.AllGHSATree.GhsaId + retval.Id = v.AllArtifactTree.Id + retval.Algorithm = v.AllArtifactTree.Algorithm + retval.Digest = v.AllArtifactTree.Digest return &retval, nil } -// GHSAsResponse is returned by GHSAs on success. -type GHSAsResponse struct { - // Returns all GitHub Security Advisories matching a filter. - Ghsa []GHSAsGhsaGHSA `json:"ghsa"` -} - -// GetGhsa returns GHSAsResponse.Ghsa, and is useful for accessing the field via an interface. -func (v *GHSAsResponse) GetGhsa() []GHSAsGhsaGHSA { return v.Ghsa } - -// HasMetadataArtifactIngestHasMetadata includes the requested fields of the GraphQL type HasMetadata. +// AllIsOccurrencesTreeSubjectPackage includes the requested fields of the GraphQL type Package. // The GraphQL type's documentation follows. // -// HasMetadata is an attestation that a package, source, or artifact has a certain -// attested property (key) with value (value). For example, a source may have -// metadata "SourceRepo2FAEnabled=true". +// Package represents the root of the package trie/tree. // -// The intent of this evidence tree predicate is to allow extensibility of metadata -// expressible within the GUAC ontology. Metadata that is commonly used will then -// be promoted to a predicate on its own. +// We map package information to a trie, closely matching the pURL specification +// (https://github.com/package-url/purl-spec/blob/0dd92f26f8bb11956ffdf5e8acfcee71e8560407/README.rst), +// but deviating from it where GUAC heuristics allow for better representation of +// package information. Each path in the trie fully represents a package; we split +// the trie based on the pURL components. // -// Justification indicates how the metadata was determined. +// This node matches a pkg: partial pURL. The type field matches the +// pURL types but we might also use "guac" for the cases where the pURL +// representation is not complete or when we have custom rules. // -// The metadata applies to a subject which is a package, source, or artifact. -// If the attestation targets a package, it must target a PackageName or a -// PackageVersion. If the attestation targets a source, it must target a -// SourceName. -type HasMetadataArtifactIngestHasMetadata struct { - allHasMetadata `json:"-"` -} - -// GetId returns HasMetadataArtifactIngestHasMetadata.Id, and is useful for accessing the field via an interface. -func (v *HasMetadataArtifactIngestHasMetadata) GetId() string { return v.allHasMetadata.Id } - -// GetSubject returns HasMetadataArtifactIngestHasMetadata.Subject, and is useful for accessing the field via an interface. -func (v *HasMetadataArtifactIngestHasMetadata) GetSubject() allHasMetadataSubjectPackageSourceOrArtifact { - return v.allHasMetadata.Subject +// Since this node is at the root of the package trie, it is named Package, not +// PackageType. +type AllIsOccurrencesTreeSubjectPackage struct { + Typename *string `json:"__typename"` + AllPkgTree `json:"-"` } -// GetKey returns HasMetadataArtifactIngestHasMetadata.Key, and is useful for accessing the field via an interface. -func (v *HasMetadataArtifactIngestHasMetadata) GetKey() string { return v.allHasMetadata.Key } - -// GetValue returns HasMetadataArtifactIngestHasMetadata.Value, and is useful for accessing the field via an interface. -func (v *HasMetadataArtifactIngestHasMetadata) GetValue() string { return v.allHasMetadata.Value } - -// GetTimestamp returns HasMetadataArtifactIngestHasMetadata.Timestamp, and is useful for accessing the field via an interface. -func (v *HasMetadataArtifactIngestHasMetadata) GetTimestamp() time.Time { - return v.allHasMetadata.Timestamp -} +// GetTypename returns AllIsOccurrencesTreeSubjectPackage.Typename, and is useful for accessing the field via an interface. +func (v *AllIsOccurrencesTreeSubjectPackage) GetTypename() *string { return v.Typename } -// GetJustification returns HasMetadataArtifactIngestHasMetadata.Justification, and is useful for accessing the field via an interface. -func (v *HasMetadataArtifactIngestHasMetadata) GetJustification() string { - return v.allHasMetadata.Justification -} +// GetId returns AllIsOccurrencesTreeSubjectPackage.Id, and is useful for accessing the field via an interface. +func (v *AllIsOccurrencesTreeSubjectPackage) GetId() string { return v.AllPkgTree.Id } -// GetOrigin returns HasMetadataArtifactIngestHasMetadata.Origin, and is useful for accessing the field via an interface. -func (v *HasMetadataArtifactIngestHasMetadata) GetOrigin() string { return v.allHasMetadata.Origin } +// GetType returns AllIsOccurrencesTreeSubjectPackage.Type, and is useful for accessing the field via an interface. +func (v *AllIsOccurrencesTreeSubjectPackage) GetType() string { return v.AllPkgTree.Type } -// GetCollector returns HasMetadataArtifactIngestHasMetadata.Collector, and is useful for accessing the field via an interface. -func (v *HasMetadataArtifactIngestHasMetadata) GetCollector() string { - return v.allHasMetadata.Collector +// GetNamespaces returns AllIsOccurrencesTreeSubjectPackage.Namespaces, and is useful for accessing the field via an interface. +func (v *AllIsOccurrencesTreeSubjectPackage) GetNamespaces() []AllPkgTreeNamespacesPackageNamespace { + return v.AllPkgTree.Namespaces } -func (v *HasMetadataArtifactIngestHasMetadata) UnmarshalJSON(b []byte) error { +func (v *AllIsOccurrencesTreeSubjectPackage) UnmarshalJSON(b []byte) error { if string(b) == "null" { return nil } var firstPass struct { - *HasMetadataArtifactIngestHasMetadata + *AllIsOccurrencesTreeSubjectPackage graphql.NoUnmarshalJSON } - firstPass.HasMetadataArtifactIngestHasMetadata = v + firstPass.AllIsOccurrencesTreeSubjectPackage = v err := json.Unmarshal(b, &firstPass) if err != nil { @@ -4455,32 +4233,24 @@ func (v *HasMetadataArtifactIngestHasMetadata) UnmarshalJSON(b []byte) error { } err = json.Unmarshal( - b, &v.allHasMetadata) + b, &v.AllPkgTree) if err != nil { return err } return nil } -type __premarshalHasMetadataArtifactIngestHasMetadata struct { - Id string `json:"id"` - - Subject json.RawMessage `json:"subject"` - - Key string `json:"key"` - - Value string `json:"value"` - - Timestamp time.Time `json:"timestamp"` +type __premarshalAllIsOccurrencesTreeSubjectPackage struct { + Typename *string `json:"__typename"` - Justification string `json:"justification"` + Id string `json:"id"` - Origin string `json:"origin"` + Type string `json:"type"` - Collector string `json:"collector"` + Namespaces []AllPkgTreeNamespacesPackageNamespace `json:"namespaces"` } -func (v *HasMetadataArtifactIngestHasMetadata) MarshalJSON() ([]byte, error) { +func (v *AllIsOccurrencesTreeSubjectPackage) MarshalJSON() ([]byte, error) { premarshaled, err := v.__premarshalJSON() if err != nil { return nil, err @@ -4488,130 +4258,144 @@ func (v *HasMetadataArtifactIngestHasMetadata) MarshalJSON() ([]byte, error) { return json.Marshal(premarshaled) } -func (v *HasMetadataArtifactIngestHasMetadata) __premarshalJSON() (*__premarshalHasMetadataArtifactIngestHasMetadata, error) { - var retval __premarshalHasMetadataArtifactIngestHasMetadata - - retval.Id = v.allHasMetadata.Id - { +func (v *AllIsOccurrencesTreeSubjectPackage) __premarshalJSON() (*__premarshalAllIsOccurrencesTreeSubjectPackage, error) { + var retval __premarshalAllIsOccurrencesTreeSubjectPackage - dst := &retval.Subject - src := v.allHasMetadata.Subject - var err error - *dst, err = __marshalallHasMetadataSubjectPackageSourceOrArtifact( - &src) - if err != nil { - return nil, fmt.Errorf( - "unable to marshal HasMetadataArtifactIngestHasMetadata.allHasMetadata.Subject: %w", err) - } - } - retval.Key = v.allHasMetadata.Key - retval.Value = v.allHasMetadata.Value - retval.Timestamp = v.allHasMetadata.Timestamp - retval.Justification = v.allHasMetadata.Justification - retval.Origin = v.allHasMetadata.Origin - retval.Collector = v.allHasMetadata.Collector + retval.Typename = v.Typename + retval.Id = v.AllPkgTree.Id + retval.Type = v.AllPkgTree.Type + retval.Namespaces = v.AllPkgTree.Namespaces return &retval, nil } -// HasMetadataArtifactResponse is returned by HasMetadataArtifact on success. -type HasMetadataArtifactResponse struct { - // Adds metadata about a package, source or artifact. - IngestHasMetadata HasMetadataArtifactIngestHasMetadata `json:"ingestHasMetadata"` +// AllIsOccurrencesTreeSubjectPackageOrSource includes the requested fields of the GraphQL interface PackageOrSource. +// +// AllIsOccurrencesTreeSubjectPackageOrSource is implemented by the following types: +// AllIsOccurrencesTreeSubjectPackage +// AllIsOccurrencesTreeSubjectSource +// The GraphQL type's documentation follows. +// +// PackageOrSource is a union of Package and Source. +type AllIsOccurrencesTreeSubjectPackageOrSource interface { + implementsGraphQLInterfaceAllIsOccurrencesTreeSubjectPackageOrSource() + // GetTypename returns the receiver's concrete GraphQL type-name (see interface doc for possible values). + GetTypename() *string } -// GetIngestHasMetadata returns HasMetadataArtifactResponse.IngestHasMetadata, and is useful for accessing the field via an interface. -func (v *HasMetadataArtifactResponse) GetIngestHasMetadata() HasMetadataArtifactIngestHasMetadata { - return v.IngestHasMetadata +func (v *AllIsOccurrencesTreeSubjectPackage) implementsGraphQLInterfaceAllIsOccurrencesTreeSubjectPackageOrSource() { } - -// HasMetadataInputSpec represents the mutation input to ingest a CertifyGood evidence. -type HasMetadataInputSpec struct { - Key string `json:"key"` - Value string `json:"value"` - Timestamp time.Time `json:"timestamp"` - Justification string `json:"justification"` - Origin string `json:"origin"` - Collector string `json:"collector"` +func (v *AllIsOccurrencesTreeSubjectSource) implementsGraphQLInterfaceAllIsOccurrencesTreeSubjectPackageOrSource() { } -// GetKey returns HasMetadataInputSpec.Key, and is useful for accessing the field via an interface. -func (v *HasMetadataInputSpec) GetKey() string { return v.Key } +func __unmarshalAllIsOccurrencesTreeSubjectPackageOrSource(b []byte, v *AllIsOccurrencesTreeSubjectPackageOrSource) error { + if string(b) == "null" { + return nil + } -// GetValue returns HasMetadataInputSpec.Value, and is useful for accessing the field via an interface. -func (v *HasMetadataInputSpec) GetValue() string { return v.Value } + var tn struct { + TypeName string `json:"__typename"` + } + err := json.Unmarshal(b, &tn) + if err != nil { + return err + } -// GetTimestamp returns HasMetadataInputSpec.Timestamp, and is useful for accessing the field via an interface. -func (v *HasMetadataInputSpec) GetTimestamp() time.Time { return v.Timestamp } + switch tn.TypeName { + case "Package": + *v = new(AllIsOccurrencesTreeSubjectPackage) + return json.Unmarshal(b, *v) + case "Source": + *v = new(AllIsOccurrencesTreeSubjectSource) + return json.Unmarshal(b, *v) + case "": + return fmt.Errorf( + "response was missing PackageOrSource.__typename") + default: + return fmt.Errorf( + `unexpected concrete type for AllIsOccurrencesTreeSubjectPackageOrSource: "%v"`, tn.TypeName) + } +} -// GetJustification returns HasMetadataInputSpec.Justification, and is useful for accessing the field via an interface. -func (v *HasMetadataInputSpec) GetJustification() string { return v.Justification } +func __marshalAllIsOccurrencesTreeSubjectPackageOrSource(v *AllIsOccurrencesTreeSubjectPackageOrSource) ([]byte, error) { -// GetOrigin returns HasMetadataInputSpec.Origin, and is useful for accessing the field via an interface. -func (v *HasMetadataInputSpec) GetOrigin() string { return v.Origin } + var typename string + switch v := (*v).(type) { + case *AllIsOccurrencesTreeSubjectPackage: + typename = "Package" -// GetCollector returns HasMetadataInputSpec.Collector, and is useful for accessing the field via an interface. -func (v *HasMetadataInputSpec) GetCollector() string { return v.Collector } + premarshaled, err := v.__premarshalJSON() + if err != nil { + return nil, err + } + result := struct { + TypeName string `json:"__typename"` + *__premarshalAllIsOccurrencesTreeSubjectPackage + }{typename, premarshaled} + return json.Marshal(result) + case *AllIsOccurrencesTreeSubjectSource: + typename = "Source" -// HasMetadataPkgIngestHasMetadata includes the requested fields of the GraphQL type HasMetadata. + premarshaled, err := v.__premarshalJSON() + if err != nil { + return nil, err + } + result := struct { + TypeName string `json:"__typename"` + *__premarshalAllIsOccurrencesTreeSubjectSource + }{typename, premarshaled} + return json.Marshal(result) + case nil: + return []byte("null"), nil + default: + return nil, fmt.Errorf( + `unexpected concrete type for AllIsOccurrencesTreeSubjectPackageOrSource: "%T"`, v) + } +} + +// AllIsOccurrencesTreeSubjectSource includes the requested fields of the GraphQL type Source. // The GraphQL type's documentation follows. // -// HasMetadata is an attestation that a package, source, or artifact has a certain -// attested property (key) with value (value). For example, a source may have -// metadata "SourceRepo2FAEnabled=true". +// Source represents the root of the source trie/tree. // -// The intent of this evidence tree predicate is to allow extensibility of metadata -// expressible within the GUAC ontology. Metadata that is commonly used will then -// be promoted to a predicate on its own. +// We map source information to a trie, as a derivative of the pURL specification: +// each path in the trie represents a type, namespace, name and an optional +// qualifier that stands for tag/commit information. // -// Justification indicates how the metadata was determined. +// This node represents the type part of the trie path. It is used to represent +// the version control system that is being used. // -// The metadata applies to a subject which is a package, source, or artifact. -// If the attestation targets a package, it must target a PackageName or a -// PackageVersion. If the attestation targets a source, it must target a -// SourceName. -type HasMetadataPkgIngestHasMetadata struct { - allHasMetadata `json:"-"` -} - -// GetId returns HasMetadataPkgIngestHasMetadata.Id, and is useful for accessing the field via an interface. -func (v *HasMetadataPkgIngestHasMetadata) GetId() string { return v.allHasMetadata.Id } - -// GetSubject returns HasMetadataPkgIngestHasMetadata.Subject, and is useful for accessing the field via an interface. -func (v *HasMetadataPkgIngestHasMetadata) GetSubject() allHasMetadataSubjectPackageSourceOrArtifact { - return v.allHasMetadata.Subject +// Since this node is at the root of the source trie, it is named Source, not +// SourceType. +type AllIsOccurrencesTreeSubjectSource struct { + Typename *string `json:"__typename"` + AllSourceTree `json:"-"` } -// GetKey returns HasMetadataPkgIngestHasMetadata.Key, and is useful for accessing the field via an interface. -func (v *HasMetadataPkgIngestHasMetadata) GetKey() string { return v.allHasMetadata.Key } +// GetTypename returns AllIsOccurrencesTreeSubjectSource.Typename, and is useful for accessing the field via an interface. +func (v *AllIsOccurrencesTreeSubjectSource) GetTypename() *string { return v.Typename } -// GetValue returns HasMetadataPkgIngestHasMetadata.Value, and is useful for accessing the field via an interface. -func (v *HasMetadataPkgIngestHasMetadata) GetValue() string { return v.allHasMetadata.Value } +// GetId returns AllIsOccurrencesTreeSubjectSource.Id, and is useful for accessing the field via an interface. +func (v *AllIsOccurrencesTreeSubjectSource) GetId() string { return v.AllSourceTree.Id } -// GetTimestamp returns HasMetadataPkgIngestHasMetadata.Timestamp, and is useful for accessing the field via an interface. -func (v *HasMetadataPkgIngestHasMetadata) GetTimestamp() time.Time { return v.allHasMetadata.Timestamp } +// GetType returns AllIsOccurrencesTreeSubjectSource.Type, and is useful for accessing the field via an interface. +func (v *AllIsOccurrencesTreeSubjectSource) GetType() string { return v.AllSourceTree.Type } -// GetJustification returns HasMetadataPkgIngestHasMetadata.Justification, and is useful for accessing the field via an interface. -func (v *HasMetadataPkgIngestHasMetadata) GetJustification() string { - return v.allHasMetadata.Justification +// GetNamespaces returns AllIsOccurrencesTreeSubjectSource.Namespaces, and is useful for accessing the field via an interface. +func (v *AllIsOccurrencesTreeSubjectSource) GetNamespaces() []AllSourceTreeNamespacesSourceNamespace { + return v.AllSourceTree.Namespaces } -// GetOrigin returns HasMetadataPkgIngestHasMetadata.Origin, and is useful for accessing the field via an interface. -func (v *HasMetadataPkgIngestHasMetadata) GetOrigin() string { return v.allHasMetadata.Origin } - -// GetCollector returns HasMetadataPkgIngestHasMetadata.Collector, and is useful for accessing the field via an interface. -func (v *HasMetadataPkgIngestHasMetadata) GetCollector() string { return v.allHasMetadata.Collector } - -func (v *HasMetadataPkgIngestHasMetadata) UnmarshalJSON(b []byte) error { +func (v *AllIsOccurrencesTreeSubjectSource) UnmarshalJSON(b []byte) error { if string(b) == "null" { return nil } var firstPass struct { - *HasMetadataPkgIngestHasMetadata + *AllIsOccurrencesTreeSubjectSource graphql.NoUnmarshalJSON } - firstPass.HasMetadataPkgIngestHasMetadata = v + firstPass.AllIsOccurrencesTreeSubjectSource = v err := json.Unmarshal(b, &firstPass) if err != nil { @@ -4619,32 +4403,24 @@ func (v *HasMetadataPkgIngestHasMetadata) UnmarshalJSON(b []byte) error { } err = json.Unmarshal( - b, &v.allHasMetadata) + b, &v.AllSourceTree) if err != nil { return err } return nil } -type __premarshalHasMetadataPkgIngestHasMetadata struct { - Id string `json:"id"` - - Subject json.RawMessage `json:"subject"` - - Key string `json:"key"` - - Value string `json:"value"` - - Timestamp time.Time `json:"timestamp"` +type __premarshalAllIsOccurrencesTreeSubjectSource struct { + Typename *string `json:"__typename"` - Justification string `json:"justification"` + Id string `json:"id"` - Origin string `json:"origin"` + Type string `json:"type"` - Collector string `json:"collector"` + Namespaces []AllSourceTreeNamespacesSourceNamespace `json:"namespaces"` } -func (v *HasMetadataPkgIngestHasMetadata) MarshalJSON() ([]byte, error) { +func (v *AllIsOccurrencesTreeSubjectSource) MarshalJSON() ([]byte, error) { premarshaled, err := v.__premarshalJSON() if err != nil { return nil, err @@ -4652,126 +4428,93 @@ func (v *HasMetadataPkgIngestHasMetadata) MarshalJSON() ([]byte, error) { return json.Marshal(premarshaled) } -func (v *HasMetadataPkgIngestHasMetadata) __premarshalJSON() (*__premarshalHasMetadataPkgIngestHasMetadata, error) { - var retval __premarshalHasMetadataPkgIngestHasMetadata - - retval.Id = v.allHasMetadata.Id - { +func (v *AllIsOccurrencesTreeSubjectSource) __premarshalJSON() (*__premarshalAllIsOccurrencesTreeSubjectSource, error) { + var retval __premarshalAllIsOccurrencesTreeSubjectSource - dst := &retval.Subject - src := v.allHasMetadata.Subject - var err error - *dst, err = __marshalallHasMetadataSubjectPackageSourceOrArtifact( - &src) - if err != nil { - return nil, fmt.Errorf( - "unable to marshal HasMetadataPkgIngestHasMetadata.allHasMetadata.Subject: %w", err) - } - } - retval.Key = v.allHasMetadata.Key - retval.Value = v.allHasMetadata.Value - retval.Timestamp = v.allHasMetadata.Timestamp - retval.Justification = v.allHasMetadata.Justification - retval.Origin = v.allHasMetadata.Origin - retval.Collector = v.allHasMetadata.Collector + retval.Typename = v.Typename + retval.Id = v.AllSourceTree.Id + retval.Type = v.AllSourceTree.Type + retval.Namespaces = v.AllSourceTree.Namespaces return &retval, nil } -// HasMetadataPkgResponse is returned by HasMetadataPkg on success. -type HasMetadataPkgResponse struct { - // Adds metadata about a package, source or artifact. - IngestHasMetadata HasMetadataPkgIngestHasMetadata `json:"ingestHasMetadata"` -} - -// GetIngestHasMetadata returns HasMetadataPkgResponse.IngestHasMetadata, and is useful for accessing the field via an interface. -func (v *HasMetadataPkgResponse) GetIngestHasMetadata() HasMetadataPkgIngestHasMetadata { - return v.IngestHasMetadata -} - -// HasMetadataSrcIngestHasMetadata includes the requested fields of the GraphQL type HasMetadata. +// AllIsVulnerability includes the GraphQL fields of IsVulnerability requested by the fragment AllIsVulnerability. // The GraphQL type's documentation follows. // -// HasMetadata is an attestation that a package, source, or artifact has a certain -// attested property (key) with value (value). For example, a source may have -// metadata "SourceRepo2FAEnabled=true". -// -// The intent of this evidence tree predicate is to allow extensibility of metadata -// expressible within the GUAC ontology. Metadata that is commonly used will then -// be promoted to a predicate on its own. -// -// Justification indicates how the metadata was determined. -// -// The metadata applies to a subject which is a package, source, or artifact. -// If the attestation targets a package, it must target a PackageName or a -// PackageVersion. If the attestation targets a source, it must target a -// SourceName. -type HasMetadataSrcIngestHasMetadata struct { - allHasMetadata `json:"-"` -} - -// GetId returns HasMetadataSrcIngestHasMetadata.Id, and is useful for accessing the field via an interface. -func (v *HasMetadataSrcIngestHasMetadata) GetId() string { return v.allHasMetadata.Id } - -// GetSubject returns HasMetadataSrcIngestHasMetadata.Subject, and is useful for accessing the field via an interface. -func (v *HasMetadataSrcIngestHasMetadata) GetSubject() allHasMetadataSubjectPackageSourceOrArtifact { - return v.allHasMetadata.Subject +// IsVulnerability is an attestation to link CVE/GHSA with data in OSV. +type AllIsVulnerability struct { + Id string `json:"id"` + // The OSV that encapsulates the vulnerability + Osv AllIsVulnerabilityOsvOSV `json:"osv"` + // The upstream vulnerability information + Vulnerability AllIsVulnerabilityVulnerabilityCveOrGhsa `json:"-"` + // Justification for the attested relationship + Justification string `json:"justification"` + // Document from which this attestation is generated from + Origin string `json:"origin"` + // GUAC collector for the document + Collector string `json:"collector"` } -// GetKey returns HasMetadataSrcIngestHasMetadata.Key, and is useful for accessing the field via an interface. -func (v *HasMetadataSrcIngestHasMetadata) GetKey() string { return v.allHasMetadata.Key } - -// GetValue returns HasMetadataSrcIngestHasMetadata.Value, and is useful for accessing the field via an interface. -func (v *HasMetadataSrcIngestHasMetadata) GetValue() string { return v.allHasMetadata.Value } +// GetId returns AllIsVulnerability.Id, and is useful for accessing the field via an interface. +func (v *AllIsVulnerability) GetId() string { return v.Id } -// GetTimestamp returns HasMetadataSrcIngestHasMetadata.Timestamp, and is useful for accessing the field via an interface. -func (v *HasMetadataSrcIngestHasMetadata) GetTimestamp() time.Time { return v.allHasMetadata.Timestamp } +// GetOsv returns AllIsVulnerability.Osv, and is useful for accessing the field via an interface. +func (v *AllIsVulnerability) GetOsv() AllIsVulnerabilityOsvOSV { return v.Osv } -// GetJustification returns HasMetadataSrcIngestHasMetadata.Justification, and is useful for accessing the field via an interface. -func (v *HasMetadataSrcIngestHasMetadata) GetJustification() string { - return v.allHasMetadata.Justification +// GetVulnerability returns AllIsVulnerability.Vulnerability, and is useful for accessing the field via an interface. +func (v *AllIsVulnerability) GetVulnerability() AllIsVulnerabilityVulnerabilityCveOrGhsa { + return v.Vulnerability } -// GetOrigin returns HasMetadataSrcIngestHasMetadata.Origin, and is useful for accessing the field via an interface. -func (v *HasMetadataSrcIngestHasMetadata) GetOrigin() string { return v.allHasMetadata.Origin } +// GetJustification returns AllIsVulnerability.Justification, and is useful for accessing the field via an interface. +func (v *AllIsVulnerability) GetJustification() string { return v.Justification } -// GetCollector returns HasMetadataSrcIngestHasMetadata.Collector, and is useful for accessing the field via an interface. -func (v *HasMetadataSrcIngestHasMetadata) GetCollector() string { return v.allHasMetadata.Collector } +// GetOrigin returns AllIsVulnerability.Origin, and is useful for accessing the field via an interface. +func (v *AllIsVulnerability) GetOrigin() string { return v.Origin } -func (v *HasMetadataSrcIngestHasMetadata) UnmarshalJSON(b []byte) error { +// GetCollector returns AllIsVulnerability.Collector, and is useful for accessing the field via an interface. +func (v *AllIsVulnerability) GetCollector() string { return v.Collector } + +func (v *AllIsVulnerability) UnmarshalJSON(b []byte) error { if string(b) == "null" { return nil } var firstPass struct { - *HasMetadataSrcIngestHasMetadata + *AllIsVulnerability + Vulnerability json.RawMessage `json:"vulnerability"` graphql.NoUnmarshalJSON } - firstPass.HasMetadataSrcIngestHasMetadata = v + firstPass.AllIsVulnerability = v err := json.Unmarshal(b, &firstPass) if err != nil { return err } - err = json.Unmarshal( - b, &v.allHasMetadata) - if err != nil { - return err + { + dst := &v.Vulnerability + src := firstPass.Vulnerability + if len(src) != 0 && string(src) != "null" { + err = __unmarshalAllIsVulnerabilityVulnerabilityCveOrGhsa( + src, dst) + if err != nil { + return fmt.Errorf( + "unable to unmarshal AllIsVulnerability.Vulnerability: %w", err) + } + } } return nil } -type __premarshalHasMetadataSrcIngestHasMetadata struct { +type __premarshalAllIsVulnerability struct { Id string `json:"id"` - Subject json.RawMessage `json:"subject"` - - Key string `json:"key"` - - Value string `json:"value"` + Osv AllIsVulnerabilityOsvOSV `json:"osv"` - Timestamp time.Time `json:"timestamp"` + Vulnerability json.RawMessage `json:"vulnerability"` Justification string `json:"justification"` @@ -4780,7 +4523,7 @@ type __premarshalHasMetadataSrcIngestHasMetadata struct { Collector string `json:"collector"` } -func (v *HasMetadataSrcIngestHasMetadata) MarshalJSON() ([]byte, error) { +func (v *AllIsVulnerability) MarshalJSON() ([]byte, error) { premarshaled, err := v.__premarshalJSON() if err != nil { return nil, err @@ -4788,86 +4531,61 @@ func (v *HasMetadataSrcIngestHasMetadata) MarshalJSON() ([]byte, error) { return json.Marshal(premarshaled) } -func (v *HasMetadataSrcIngestHasMetadata) __premarshalJSON() (*__premarshalHasMetadataSrcIngestHasMetadata, error) { - var retval __premarshalHasMetadataSrcIngestHasMetadata +func (v *AllIsVulnerability) __premarshalJSON() (*__premarshalAllIsVulnerability, error) { + var retval __premarshalAllIsVulnerability - retval.Id = v.allHasMetadata.Id + retval.Id = v.Id + retval.Osv = v.Osv { - dst := &retval.Subject - src := v.allHasMetadata.Subject + dst := &retval.Vulnerability + src := v.Vulnerability var err error - *dst, err = __marshalallHasMetadataSubjectPackageSourceOrArtifact( + *dst, err = __marshalAllIsVulnerabilityVulnerabilityCveOrGhsa( &src) if err != nil { return nil, fmt.Errorf( - "unable to marshal HasMetadataSrcIngestHasMetadata.allHasMetadata.Subject: %w", err) + "unable to marshal AllIsVulnerability.Vulnerability: %w", err) } } - retval.Key = v.allHasMetadata.Key - retval.Value = v.allHasMetadata.Value - retval.Timestamp = v.allHasMetadata.Timestamp - retval.Justification = v.allHasMetadata.Justification - retval.Origin = v.allHasMetadata.Origin - retval.Collector = v.allHasMetadata.Collector + retval.Justification = v.Justification + retval.Origin = v.Origin + retval.Collector = v.Collector return &retval, nil } -// HasMetadataSrcResponse is returned by HasMetadataSrc on success. -type HasMetadataSrcResponse struct { - // Adds metadata about a package, source or artifact. - IngestHasMetadata HasMetadataSrcIngestHasMetadata `json:"ingestHasMetadata"` -} - -// GetIngestHasMetadata returns HasMetadataSrcResponse.IngestHasMetadata, and is useful for accessing the field via an interface. -func (v *HasMetadataSrcResponse) GetIngestHasMetadata() HasMetadataSrcIngestHasMetadata { - return v.IngestHasMetadata -} - -// HasSBOMArtifactIngestHasSBOM includes the requested fields of the GraphQL type HasSBOM. -type HasSBOMArtifactIngestHasSBOM struct { - allHasSBOMTree `json:"-"` -} - -// GetId returns HasSBOMArtifactIngestHasSBOM.Id, and is useful for accessing the field via an interface. -func (v *HasSBOMArtifactIngestHasSBOM) GetId() string { return v.allHasSBOMTree.Id } - -// GetSubject returns HasSBOMArtifactIngestHasSBOM.Subject, and is useful for accessing the field via an interface. -func (v *HasSBOMArtifactIngestHasSBOM) GetSubject() allHasSBOMTreeSubjectPackageOrArtifact { - return v.allHasSBOMTree.Subject -} - -// GetUri returns HasSBOMArtifactIngestHasSBOM.Uri, and is useful for accessing the field via an interface. -func (v *HasSBOMArtifactIngestHasSBOM) GetUri() string { return v.allHasSBOMTree.Uri } - -// GetAlgorithm returns HasSBOMArtifactIngestHasSBOM.Algorithm, and is useful for accessing the field via an interface. -func (v *HasSBOMArtifactIngestHasSBOM) GetAlgorithm() string { return v.allHasSBOMTree.Algorithm } - -// GetDigest returns HasSBOMArtifactIngestHasSBOM.Digest, and is useful for accessing the field via an interface. -func (v *HasSBOMArtifactIngestHasSBOM) GetDigest() string { return v.allHasSBOMTree.Digest } - -// GetDownloadLocation returns HasSBOMArtifactIngestHasSBOM.DownloadLocation, and is useful for accessing the field via an interface. -func (v *HasSBOMArtifactIngestHasSBOM) GetDownloadLocation() string { - return v.allHasSBOMTree.DownloadLocation +// AllIsVulnerabilityOsvOSV includes the requested fields of the GraphQL type OSV. +// The GraphQL type's documentation follows. +// +// OSV represents an Open Source Vulnerability. +// +// The osvId field is mandatory and canonicalized to be lowercase. +// +// This maps to a vulnerability ID specific to the environment (e.g., GHSA ID or +// CVE ID). +// +// This node can be referred to by other parts of GUAC. +type AllIsVulnerabilityOsvOSV struct { + AllOSVTree `json:"-"` } -// GetOrigin returns HasSBOMArtifactIngestHasSBOM.Origin, and is useful for accessing the field via an interface. -func (v *HasSBOMArtifactIngestHasSBOM) GetOrigin() string { return v.allHasSBOMTree.Origin } +// GetId returns AllIsVulnerabilityOsvOSV.Id, and is useful for accessing the field via an interface. +func (v *AllIsVulnerabilityOsvOSV) GetId() string { return v.AllOSVTree.Id } -// GetCollector returns HasSBOMArtifactIngestHasSBOM.Collector, and is useful for accessing the field via an interface. -func (v *HasSBOMArtifactIngestHasSBOM) GetCollector() string { return v.allHasSBOMTree.Collector } +// GetOsvId returns AllIsVulnerabilityOsvOSV.OsvId, and is useful for accessing the field via an interface. +func (v *AllIsVulnerabilityOsvOSV) GetOsvId() string { return v.AllOSVTree.OsvId } -func (v *HasSBOMArtifactIngestHasSBOM) UnmarshalJSON(b []byte) error { +func (v *AllIsVulnerabilityOsvOSV) UnmarshalJSON(b []byte) error { if string(b) == "null" { return nil } var firstPass struct { - *HasSBOMArtifactIngestHasSBOM + *AllIsVulnerabilityOsvOSV graphql.NoUnmarshalJSON } - firstPass.HasSBOMArtifactIngestHasSBOM = v + firstPass.AllIsVulnerabilityOsvOSV = v err := json.Unmarshal(b, &firstPass) if err != nil { @@ -4875,32 +4593,20 @@ func (v *HasSBOMArtifactIngestHasSBOM) UnmarshalJSON(b []byte) error { } err = json.Unmarshal( - b, &v.allHasSBOMTree) + b, &v.AllOSVTree) if err != nil { return err } return nil } -type __premarshalHasSBOMArtifactIngestHasSBOM struct { +type __premarshalAllIsVulnerabilityOsvOSV struct { Id string `json:"id"` - Subject json.RawMessage `json:"subject"` - - Uri string `json:"uri"` - - Algorithm string `json:"algorithm"` - - Digest string `json:"digest"` - - DownloadLocation string `json:"downloadLocation"` - - Origin string `json:"origin"` - - Collector string `json:"collector"` + OsvId string `json:"osvId"` } -func (v *HasSBOMArtifactIngestHasSBOM) MarshalJSON() ([]byte, error) { +func (v *AllIsVulnerabilityOsvOSV) MarshalJSON() ([]byte, error) { premarshaled, err := v.__premarshalJSON() if err != nil { return nil, err @@ -4908,114 +4614,55 @@ func (v *HasSBOMArtifactIngestHasSBOM) MarshalJSON() ([]byte, error) { return json.Marshal(premarshaled) } -func (v *HasSBOMArtifactIngestHasSBOM) __premarshalJSON() (*__premarshalHasSBOMArtifactIngestHasSBOM, error) { - var retval __premarshalHasSBOMArtifactIngestHasSBOM - - retval.Id = v.allHasSBOMTree.Id - { +func (v *AllIsVulnerabilityOsvOSV) __premarshalJSON() (*__premarshalAllIsVulnerabilityOsvOSV, error) { + var retval __premarshalAllIsVulnerabilityOsvOSV - dst := &retval.Subject - src := v.allHasSBOMTree.Subject - var err error - *dst, err = __marshalallHasSBOMTreeSubjectPackageOrArtifact( - &src) - if err != nil { - return nil, fmt.Errorf( - "unable to marshal HasSBOMArtifactIngestHasSBOM.allHasSBOMTree.Subject: %w", err) - } - } - retval.Uri = v.allHasSBOMTree.Uri - retval.Algorithm = v.allHasSBOMTree.Algorithm - retval.Digest = v.allHasSBOMTree.Digest - retval.DownloadLocation = v.allHasSBOMTree.DownloadLocation - retval.Origin = v.allHasSBOMTree.Origin - retval.Collector = v.allHasSBOMTree.Collector + retval.Id = v.AllOSVTree.Id + retval.OsvId = v.AllOSVTree.OsvId return &retval, nil } -// HasSBOMArtifactResponse is returned by HasSBOMArtifact on success. -type HasSBOMArtifactResponse struct { - // Certifies that a package or artifact has an SBOM. - IngestHasSBOM HasSBOMArtifactIngestHasSBOM `json:"ingestHasSBOM"` -} - -// GetIngestHasSBOM returns HasSBOMArtifactResponse.IngestHasSBOM, and is useful for accessing the field via an interface. -func (v *HasSBOMArtifactResponse) GetIngestHasSBOM() HasSBOMArtifactIngestHasSBOM { - return v.IngestHasSBOM -} - -// HasSBOMInputSpec is the same as HasSBOM but for mutation input. -type HasSBOMInputSpec struct { - Uri string `json:"uri"` - Algorithm string `json:"algorithm"` - Digest string `json:"digest"` - DownloadLocation string `json:"downloadLocation"` - Origin string `json:"origin"` - Collector string `json:"collector"` -} - -// GetUri returns HasSBOMInputSpec.Uri, and is useful for accessing the field via an interface. -func (v *HasSBOMInputSpec) GetUri() string { return v.Uri } - -// GetAlgorithm returns HasSBOMInputSpec.Algorithm, and is useful for accessing the field via an interface. -func (v *HasSBOMInputSpec) GetAlgorithm() string { return v.Algorithm } - -// GetDigest returns HasSBOMInputSpec.Digest, and is useful for accessing the field via an interface. -func (v *HasSBOMInputSpec) GetDigest() string { return v.Digest } - -// GetDownloadLocation returns HasSBOMInputSpec.DownloadLocation, and is useful for accessing the field via an interface. -func (v *HasSBOMInputSpec) GetDownloadLocation() string { return v.DownloadLocation } - -// GetOrigin returns HasSBOMInputSpec.Origin, and is useful for accessing the field via an interface. -func (v *HasSBOMInputSpec) GetOrigin() string { return v.Origin } - -// GetCollector returns HasSBOMInputSpec.Collector, and is useful for accessing the field via an interface. -func (v *HasSBOMInputSpec) GetCollector() string { return v.Collector } - -// HasSBOMPkgIngestHasSBOM includes the requested fields of the GraphQL type HasSBOM. -type HasSBOMPkgIngestHasSBOM struct { - allHasSBOMTree `json:"-"` -} - -// GetId returns HasSBOMPkgIngestHasSBOM.Id, and is useful for accessing the field via an interface. -func (v *HasSBOMPkgIngestHasSBOM) GetId() string { return v.allHasSBOMTree.Id } - -// GetSubject returns HasSBOMPkgIngestHasSBOM.Subject, and is useful for accessing the field via an interface. -func (v *HasSBOMPkgIngestHasSBOM) GetSubject() allHasSBOMTreeSubjectPackageOrArtifact { - return v.allHasSBOMTree.Subject +// AllIsVulnerabilityVulnerabilityCVE includes the requested fields of the GraphQL type CVE. +// The GraphQL type's documentation follows. +// +// CVE represents a vulnerability in the Common Vulnerabilities and Exposures +// schema. +// +// The vulnerability identifier contains a year field, so we are extracting that +// to allow matching for vulnerabilities found in a given year. +// +// The vulnerability identifier field is mandatory and canonicalized to be +// lowercase. +// +// This node can be referred to by other parts of GUAC. +type AllIsVulnerabilityVulnerabilityCVE struct { + Typename *string `json:"__typename"` + AllCveTree `json:"-"` } -// GetUri returns HasSBOMPkgIngestHasSBOM.Uri, and is useful for accessing the field via an interface. -func (v *HasSBOMPkgIngestHasSBOM) GetUri() string { return v.allHasSBOMTree.Uri } - -// GetAlgorithm returns HasSBOMPkgIngestHasSBOM.Algorithm, and is useful for accessing the field via an interface. -func (v *HasSBOMPkgIngestHasSBOM) GetAlgorithm() string { return v.allHasSBOMTree.Algorithm } - -// GetDigest returns HasSBOMPkgIngestHasSBOM.Digest, and is useful for accessing the field via an interface. -func (v *HasSBOMPkgIngestHasSBOM) GetDigest() string { return v.allHasSBOMTree.Digest } +// GetTypename returns AllIsVulnerabilityVulnerabilityCVE.Typename, and is useful for accessing the field via an interface. +func (v *AllIsVulnerabilityVulnerabilityCVE) GetTypename() *string { return v.Typename } -// GetDownloadLocation returns HasSBOMPkgIngestHasSBOM.DownloadLocation, and is useful for accessing the field via an interface. -func (v *HasSBOMPkgIngestHasSBOM) GetDownloadLocation() string { - return v.allHasSBOMTree.DownloadLocation -} +// GetId returns AllIsVulnerabilityVulnerabilityCVE.Id, and is useful for accessing the field via an interface. +func (v *AllIsVulnerabilityVulnerabilityCVE) GetId() string { return v.AllCveTree.Id } -// GetOrigin returns HasSBOMPkgIngestHasSBOM.Origin, and is useful for accessing the field via an interface. -func (v *HasSBOMPkgIngestHasSBOM) GetOrigin() string { return v.allHasSBOMTree.Origin } +// GetYear returns AllIsVulnerabilityVulnerabilityCVE.Year, and is useful for accessing the field via an interface. +func (v *AllIsVulnerabilityVulnerabilityCVE) GetYear() int { return v.AllCveTree.Year } -// GetCollector returns HasSBOMPkgIngestHasSBOM.Collector, and is useful for accessing the field via an interface. -func (v *HasSBOMPkgIngestHasSBOM) GetCollector() string { return v.allHasSBOMTree.Collector } +// GetCveId returns AllIsVulnerabilityVulnerabilityCVE.CveId, and is useful for accessing the field via an interface. +func (v *AllIsVulnerabilityVulnerabilityCVE) GetCveId() string { return v.AllCveTree.CveId } -func (v *HasSBOMPkgIngestHasSBOM) UnmarshalJSON(b []byte) error { +func (v *AllIsVulnerabilityVulnerabilityCVE) UnmarshalJSON(b []byte) error { if string(b) == "null" { return nil } var firstPass struct { - *HasSBOMPkgIngestHasSBOM + *AllIsVulnerabilityVulnerabilityCVE graphql.NoUnmarshalJSON } - firstPass.HasSBOMPkgIngestHasSBOM = v + firstPass.AllIsVulnerabilityVulnerabilityCVE = v err := json.Unmarshal(b, &firstPass) if err != nil { @@ -5023,32 +4670,24 @@ func (v *HasSBOMPkgIngestHasSBOM) UnmarshalJSON(b []byte) error { } err = json.Unmarshal( - b, &v.allHasSBOMTree) + b, &v.AllCveTree) if err != nil { return err } return nil } -type __premarshalHasSBOMPkgIngestHasSBOM struct { - Id string `json:"id"` - - Subject json.RawMessage `json:"subject"` - - Uri string `json:"uri"` - - Algorithm string `json:"algorithm"` - - Digest string `json:"digest"` +type __premarshalAllIsVulnerabilityVulnerabilityCVE struct { + Typename *string `json:"__typename"` - DownloadLocation string `json:"downloadLocation"` + Id string `json:"id"` - Origin string `json:"origin"` + Year int `json:"year"` - Collector string `json:"collector"` + CveId string `json:"cveId"` } -func (v *HasSBOMPkgIngestHasSBOM) MarshalJSON() ([]byte, error) { +func (v *AllIsVulnerabilityVulnerabilityCVE) MarshalJSON() ([]byte, error) { premarshaled, err := v.__premarshalJSON() if err != nil { return nil, err @@ -5056,204 +4695,133 @@ func (v *HasSBOMPkgIngestHasSBOM) MarshalJSON() ([]byte, error) { return json.Marshal(premarshaled) } -func (v *HasSBOMPkgIngestHasSBOM) __premarshalJSON() (*__premarshalHasSBOMPkgIngestHasSBOM, error) { - var retval __premarshalHasSBOMPkgIngestHasSBOM - - retval.Id = v.allHasSBOMTree.Id - { +func (v *AllIsVulnerabilityVulnerabilityCVE) __premarshalJSON() (*__premarshalAllIsVulnerabilityVulnerabilityCVE, error) { + var retval __premarshalAllIsVulnerabilityVulnerabilityCVE - dst := &retval.Subject - src := v.allHasSBOMTree.Subject - var err error - *dst, err = __marshalallHasSBOMTreeSubjectPackageOrArtifact( - &src) - if err != nil { - return nil, fmt.Errorf( - "unable to marshal HasSBOMPkgIngestHasSBOM.allHasSBOMTree.Subject: %w", err) - } - } - retval.Uri = v.allHasSBOMTree.Uri - retval.Algorithm = v.allHasSBOMTree.Algorithm - retval.Digest = v.allHasSBOMTree.Digest - retval.DownloadLocation = v.allHasSBOMTree.DownloadLocation - retval.Origin = v.allHasSBOMTree.Origin - retval.Collector = v.allHasSBOMTree.Collector + retval.Typename = v.Typename + retval.Id = v.AllCveTree.Id + retval.Year = v.AllCveTree.Year + retval.CveId = v.AllCveTree.CveId return &retval, nil } -// HasSBOMPkgResponse is returned by HasSBOMPkg on success. -type HasSBOMPkgResponse struct { - // Certifies that a package or artifact has an SBOM. - IngestHasSBOM HasSBOMPkgIngestHasSBOM `json:"ingestHasSBOM"` -} - -// GetIngestHasSBOM returns HasSBOMPkgResponse.IngestHasSBOM, and is useful for accessing the field via an interface. -func (v *HasSBOMPkgResponse) GetIngestHasSBOM() HasSBOMPkgIngestHasSBOM { return v.IngestHasSBOM } - -// HasSourceAtIngestHasSourceAt includes the requested fields of the GraphQL type HasSourceAt. +// AllIsVulnerabilityVulnerabilityCveOrGhsa includes the requested fields of the GraphQL interface CveOrGhsa. +// +// AllIsVulnerabilityVulnerabilityCveOrGhsa is implemented by the following types: +// AllIsVulnerabilityVulnerabilityCVE +// AllIsVulnerabilityVulnerabilityGHSA // The GraphQL type's documentation follows. // -// HasSourceAt records that a package's repository is a given source. -type HasSourceAtIngestHasSourceAt struct { - allHasSourceAt `json:"-"` -} - -// GetId returns HasSourceAtIngestHasSourceAt.Id, and is useful for accessing the field via an interface. -func (v *HasSourceAtIngestHasSourceAt) GetId() string { return v.allHasSourceAt.Id } - -// GetJustification returns HasSourceAtIngestHasSourceAt.Justification, and is useful for accessing the field via an interface. -func (v *HasSourceAtIngestHasSourceAt) GetJustification() string { - return v.allHasSourceAt.Justification +// CveOrGhsa is a union of CVE and GHSA. +type AllIsVulnerabilityVulnerabilityCveOrGhsa interface { + implementsGraphQLInterfaceAllIsVulnerabilityVulnerabilityCveOrGhsa() + // GetTypename returns the receiver's concrete GraphQL type-name (see interface doc for possible values). + GetTypename() *string } -// GetKnownSince returns HasSourceAtIngestHasSourceAt.KnownSince, and is useful for accessing the field via an interface. -func (v *HasSourceAtIngestHasSourceAt) GetKnownSince() time.Time { return v.allHasSourceAt.KnownSince } - -// GetPackage returns HasSourceAtIngestHasSourceAt.Package, and is useful for accessing the field via an interface. -func (v *HasSourceAtIngestHasSourceAt) GetPackage() allHasSourceAtPackage { - return v.allHasSourceAt.Package +func (v *AllIsVulnerabilityVulnerabilityCVE) implementsGraphQLInterfaceAllIsVulnerabilityVulnerabilityCveOrGhsa() { } - -// GetSource returns HasSourceAtIngestHasSourceAt.Source, and is useful for accessing the field via an interface. -func (v *HasSourceAtIngestHasSourceAt) GetSource() allHasSourceAtSource { - return v.allHasSourceAt.Source +func (v *AllIsVulnerabilityVulnerabilityGHSA) implementsGraphQLInterfaceAllIsVulnerabilityVulnerabilityCveOrGhsa() { } -// GetOrigin returns HasSourceAtIngestHasSourceAt.Origin, and is useful for accessing the field via an interface. -func (v *HasSourceAtIngestHasSourceAt) GetOrigin() string { return v.allHasSourceAt.Origin } - -// GetCollector returns HasSourceAtIngestHasSourceAt.Collector, and is useful for accessing the field via an interface. -func (v *HasSourceAtIngestHasSourceAt) GetCollector() string { return v.allHasSourceAt.Collector } - -func (v *HasSourceAtIngestHasSourceAt) UnmarshalJSON(b []byte) error { - +func __unmarshalAllIsVulnerabilityVulnerabilityCveOrGhsa(b []byte, v *AllIsVulnerabilityVulnerabilityCveOrGhsa) error { if string(b) == "null" { return nil } - var firstPass struct { - *HasSourceAtIngestHasSourceAt - graphql.NoUnmarshalJSON + var tn struct { + TypeName string `json:"__typename"` } - firstPass.HasSourceAtIngestHasSourceAt = v - - err := json.Unmarshal(b, &firstPass) + err := json.Unmarshal(b, &tn) if err != nil { return err } - err = json.Unmarshal( - b, &v.allHasSourceAt) - if err != nil { - return err + switch tn.TypeName { + case "CVE": + *v = new(AllIsVulnerabilityVulnerabilityCVE) + return json.Unmarshal(b, *v) + case "GHSA": + *v = new(AllIsVulnerabilityVulnerabilityGHSA) + return json.Unmarshal(b, *v) + case "": + return fmt.Errorf( + "response was missing CveOrGhsa.__typename") + default: + return fmt.Errorf( + `unexpected concrete type for AllIsVulnerabilityVulnerabilityCveOrGhsa: "%v"`, tn.TypeName) } - return nil } -type __premarshalHasSourceAtIngestHasSourceAt struct { - Id string `json:"id"` - - Justification string `json:"justification"` - - KnownSince time.Time `json:"knownSince"` - - Package allHasSourceAtPackage `json:"package"` - - Source allHasSourceAtSource `json:"source"` +func __marshalAllIsVulnerabilityVulnerabilityCveOrGhsa(v *AllIsVulnerabilityVulnerabilityCveOrGhsa) ([]byte, error) { - Origin string `json:"origin"` + var typename string + switch v := (*v).(type) { + case *AllIsVulnerabilityVulnerabilityCVE: + typename = "CVE" - Collector string `json:"collector"` -} + premarshaled, err := v.__premarshalJSON() + if err != nil { + return nil, err + } + result := struct { + TypeName string `json:"__typename"` + *__premarshalAllIsVulnerabilityVulnerabilityCVE + }{typename, premarshaled} + return json.Marshal(result) + case *AllIsVulnerabilityVulnerabilityGHSA: + typename = "GHSA" -func (v *HasSourceAtIngestHasSourceAt) MarshalJSON() ([]byte, error) { - premarshaled, err := v.__premarshalJSON() - if err != nil { - return nil, err + premarshaled, err := v.__premarshalJSON() + if err != nil { + return nil, err + } + result := struct { + TypeName string `json:"__typename"` + *__premarshalAllIsVulnerabilityVulnerabilityGHSA + }{typename, premarshaled} + return json.Marshal(result) + case nil: + return []byte("null"), nil + default: + return nil, fmt.Errorf( + `unexpected concrete type for AllIsVulnerabilityVulnerabilityCveOrGhsa: "%T"`, v) } - return json.Marshal(premarshaled) -} - -func (v *HasSourceAtIngestHasSourceAt) __premarshalJSON() (*__premarshalHasSourceAtIngestHasSourceAt, error) { - var retval __premarshalHasSourceAtIngestHasSourceAt - - retval.Id = v.allHasSourceAt.Id - retval.Justification = v.allHasSourceAt.Justification - retval.KnownSince = v.allHasSourceAt.KnownSince - retval.Package = v.allHasSourceAt.Package - retval.Source = v.allHasSourceAt.Source - retval.Origin = v.allHasSourceAt.Origin - retval.Collector = v.allHasSourceAt.Collector - return &retval, nil -} - -// HasSourceAtInputSpec is the same as HasSourceAt but for mutation input. -type HasSourceAtInputSpec struct { - KnownSince time.Time `json:"knownSince"` - Justification string `json:"justification"` - Origin string `json:"origin"` - Collector string `json:"collector"` -} - -// GetKnownSince returns HasSourceAtInputSpec.KnownSince, and is useful for accessing the field via an interface. -func (v *HasSourceAtInputSpec) GetKnownSince() time.Time { return v.KnownSince } - -// GetJustification returns HasSourceAtInputSpec.Justification, and is useful for accessing the field via an interface. -func (v *HasSourceAtInputSpec) GetJustification() string { return v.Justification } - -// GetOrigin returns HasSourceAtInputSpec.Origin, and is useful for accessing the field via an interface. -func (v *HasSourceAtInputSpec) GetOrigin() string { return v.Origin } - -// GetCollector returns HasSourceAtInputSpec.Collector, and is useful for accessing the field via an interface. -func (v *HasSourceAtInputSpec) GetCollector() string { return v.Collector } - -// HasSourceAtResponse is returned by HasSourceAt on success. -type HasSourceAtResponse struct { - // Adds a certification that a package (PackageName or PackageVersion) is built from the source. - IngestHasSourceAt HasSourceAtIngestHasSourceAt `json:"ingestHasSourceAt"` -} - -// GetIngestHasSourceAt returns HasSourceAtResponse.IngestHasSourceAt, and is useful for accessing the field via an interface. -func (v *HasSourceAtResponse) GetIngestHasSourceAt() HasSourceAtIngestHasSourceAt { - return v.IngestHasSourceAt } -// HashEqualIngestHashEqual includes the requested fields of the GraphQL type HashEqual. +// AllIsVulnerabilityVulnerabilityGHSA includes the requested fields of the GraphQL type GHSA. // The GraphQL type's documentation follows. // -// HashEqual is an attestation that a set of artifacts are identical. -type HashEqualIngestHashEqual struct { - allHashEqualTree `json:"-"` +// GHSA represents GitHub security advisories. +// +// The advisory id field is mandatory and canonicalized to be lowercase. +// +// This node can be referred to by other parts of GUAC. +type AllIsVulnerabilityVulnerabilityGHSA struct { + Typename *string `json:"__typename"` + AllGHSATree `json:"-"` } -// GetId returns HashEqualIngestHashEqual.Id, and is useful for accessing the field via an interface. -func (v *HashEqualIngestHashEqual) GetId() string { return v.allHashEqualTree.Id } - -// GetJustification returns HashEqualIngestHashEqual.Justification, and is useful for accessing the field via an interface. -func (v *HashEqualIngestHashEqual) GetJustification() string { return v.allHashEqualTree.Justification } - -// GetArtifacts returns HashEqualIngestHashEqual.Artifacts, and is useful for accessing the field via an interface. -func (v *HashEqualIngestHashEqual) GetArtifacts() []allHashEqualTreeArtifactsArtifact { - return v.allHashEqualTree.Artifacts -} +// GetTypename returns AllIsVulnerabilityVulnerabilityGHSA.Typename, and is useful for accessing the field via an interface. +func (v *AllIsVulnerabilityVulnerabilityGHSA) GetTypename() *string { return v.Typename } -// GetOrigin returns HashEqualIngestHashEqual.Origin, and is useful for accessing the field via an interface. -func (v *HashEqualIngestHashEqual) GetOrigin() string { return v.allHashEqualTree.Origin } +// GetId returns AllIsVulnerabilityVulnerabilityGHSA.Id, and is useful for accessing the field via an interface. +func (v *AllIsVulnerabilityVulnerabilityGHSA) GetId() string { return v.AllGHSATree.Id } -// GetCollector returns HashEqualIngestHashEqual.Collector, and is useful for accessing the field via an interface. -func (v *HashEqualIngestHashEqual) GetCollector() string { return v.allHashEqualTree.Collector } +// GetGhsaId returns AllIsVulnerabilityVulnerabilityGHSA.GhsaId, and is useful for accessing the field via an interface. +func (v *AllIsVulnerabilityVulnerabilityGHSA) GetGhsaId() string { return v.AllGHSATree.GhsaId } -func (v *HashEqualIngestHashEqual) UnmarshalJSON(b []byte) error { +func (v *AllIsVulnerabilityVulnerabilityGHSA) UnmarshalJSON(b []byte) error { if string(b) == "null" { return nil } var firstPass struct { - *HashEqualIngestHashEqual + *AllIsVulnerabilityVulnerabilityGHSA graphql.NoUnmarshalJSON } - firstPass.HashEqualIngestHashEqual = v + firstPass.AllIsVulnerabilityVulnerabilityGHSA = v err := json.Unmarshal(b, &firstPass) if err != nil { @@ -5261,26 +4829,22 @@ func (v *HashEqualIngestHashEqual) UnmarshalJSON(b []byte) error { } err = json.Unmarshal( - b, &v.allHashEqualTree) + b, &v.AllGHSATree) if err != nil { return err } return nil } -type __premarshalHashEqualIngestHashEqual struct { - Id string `json:"id"` - - Justification string `json:"justification"` - - Artifacts []allHashEqualTreeArtifactsArtifact `json:"artifacts"` +type __premarshalAllIsVulnerabilityVulnerabilityGHSA struct { + Typename *string `json:"__typename"` - Origin string `json:"origin"` + Id string `json:"id"` - Collector string `json:"collector"` + GhsaId string `json:"ghsaId"` } -func (v *HashEqualIngestHashEqual) MarshalJSON() ([]byte, error) { +func (v *AllIsVulnerabilityVulnerabilityGHSA) MarshalJSON() ([]byte, error) { premarshaled, err := v.__premarshalJSON() if err != nil { return nil, err @@ -5288,76 +4852,111 @@ func (v *HashEqualIngestHashEqual) MarshalJSON() ([]byte, error) { return json.Marshal(premarshaled) } -func (v *HashEqualIngestHashEqual) __premarshalJSON() (*__premarshalHashEqualIngestHashEqual, error) { - var retval __premarshalHashEqualIngestHashEqual +func (v *AllIsVulnerabilityVulnerabilityGHSA) __premarshalJSON() (*__premarshalAllIsVulnerabilityVulnerabilityGHSA, error) { + var retval __premarshalAllIsVulnerabilityVulnerabilityGHSA - retval.Id = v.allHashEqualTree.Id - retval.Justification = v.allHashEqualTree.Justification - retval.Artifacts = v.allHashEqualTree.Artifacts - retval.Origin = v.allHashEqualTree.Origin - retval.Collector = v.allHashEqualTree.Collector + retval.Typename = v.Typename + retval.Id = v.AllGHSATree.Id + retval.GhsaId = v.AllGHSATree.GhsaId return &retval, nil } -// HashEqualInputSpec represents the input to certify that packages are similar. -type HashEqualInputSpec struct { +// AllOSVTree includes the GraphQL fields of OSV requested by the fragment AllOSVTree. +// The GraphQL type's documentation follows. +// +// OSV represents an Open Source Vulnerability. +// +// The osvId field is mandatory and canonicalized to be lowercase. +// +// This maps to a vulnerability ID specific to the environment (e.g., GHSA ID or +// CVE ID). +// +// This node can be referred to by other parts of GUAC. +type AllOSVTree struct { + Id string `json:"id"` + OsvId string `json:"osvId"` +} + +// GetId returns AllOSVTree.Id, and is useful for accessing the field via an interface. +func (v *AllOSVTree) GetId() string { return v.Id } + +// GetOsvId returns AllOSVTree.OsvId, and is useful for accessing the field via an interface. +func (v *AllOSVTree) GetOsvId() string { return v.OsvId } + +// AllPkgEqual includes the GraphQL fields of PkgEqual requested by the fragment AllPkgEqual. +// The GraphQL type's documentation follows. +// +// PkgEqual is an attestation that a set of packages are similar. +type AllPkgEqual struct { + Id string `json:"id"` + // Justification for the claim that the packages are similar Justification string `json:"justification"` - Origin string `json:"origin"` - Collector string `json:"collector"` + // Collection of packages that are similar + Packages []AllPkgEqualPackagesPackage `json:"packages"` + // Document from which this attestation is generated from + Origin string `json:"origin"` + // GUAC collector for the document + Collector string `json:"collector"` } -// GetJustification returns HashEqualInputSpec.Justification, and is useful for accessing the field via an interface. -func (v *HashEqualInputSpec) GetJustification() string { return v.Justification } +// GetId returns AllPkgEqual.Id, and is useful for accessing the field via an interface. +func (v *AllPkgEqual) GetId() string { return v.Id } -// GetOrigin returns HashEqualInputSpec.Origin, and is useful for accessing the field via an interface. -func (v *HashEqualInputSpec) GetOrigin() string { return v.Origin } +// GetJustification returns AllPkgEqual.Justification, and is useful for accessing the field via an interface. +func (v *AllPkgEqual) GetJustification() string { return v.Justification } -// GetCollector returns HashEqualInputSpec.Collector, and is useful for accessing the field via an interface. -func (v *HashEqualInputSpec) GetCollector() string { return v.Collector } +// GetPackages returns AllPkgEqual.Packages, and is useful for accessing the field via an interface. +func (v *AllPkgEqual) GetPackages() []AllPkgEqualPackagesPackage { return v.Packages } -// HashEqualResponse is returned by HashEqual on success. -type HashEqualResponse struct { - // Adds a certification that two artifacts are similar. - IngestHashEqual HashEqualIngestHashEqual `json:"ingestHashEqual"` -} +// GetOrigin returns AllPkgEqual.Origin, and is useful for accessing the field via an interface. +func (v *AllPkgEqual) GetOrigin() string { return v.Origin } -// GetIngestHashEqual returns HashEqualResponse.IngestHashEqual, and is useful for accessing the field via an interface. -func (v *HashEqualResponse) GetIngestHashEqual() HashEqualIngestHashEqual { return v.IngestHashEqual } +// GetCollector returns AllPkgEqual.Collector, and is useful for accessing the field via an interface. +func (v *AllPkgEqual) GetCollector() string { return v.Collector } -// IngestArtifactIngestArtifact includes the requested fields of the GraphQL type Artifact. +// AllPkgEqualPackagesPackage includes the requested fields of the GraphQL type Package. // The GraphQL type's documentation follows. // -// Artifact represents an artifact identified by a checksum hash. +// Package represents the root of the package trie/tree. // -// The checksum is split into the digest value and the algorithm used to generate -// it. Both fields are mandatory and canonicalized to be lowercase. +// We map package information to a trie, closely matching the pURL specification +// (https://github.com/package-url/purl-spec/blob/0dd92f26f8bb11956ffdf5e8acfcee71e8560407/README.rst), +// but deviating from it where GUAC heuristics allow for better representation of +// package information. Each path in the trie fully represents a package; we split +// the trie based on the pURL components. // -// If having a checksum Go object, algorithm can be -// strings.ToLower(string(checksum.Algorithm)) and digest can be checksum.Value. -type IngestArtifactIngestArtifact struct { - AllArtifactTree `json:"-"` +// This node matches a pkg: partial pURL. The type field matches the +// pURL types but we might also use "guac" for the cases where the pURL +// representation is not complete or when we have custom rules. +// +// Since this node is at the root of the package trie, it is named Package, not +// PackageType. +type AllPkgEqualPackagesPackage struct { + AllPkgTree `json:"-"` } -// GetId returns IngestArtifactIngestArtifact.Id, and is useful for accessing the field via an interface. -func (v *IngestArtifactIngestArtifact) GetId() string { return v.AllArtifactTree.Id } +// GetId returns AllPkgEqualPackagesPackage.Id, and is useful for accessing the field via an interface. +func (v *AllPkgEqualPackagesPackage) GetId() string { return v.AllPkgTree.Id } -// GetAlgorithm returns IngestArtifactIngestArtifact.Algorithm, and is useful for accessing the field via an interface. -func (v *IngestArtifactIngestArtifact) GetAlgorithm() string { return v.AllArtifactTree.Algorithm } +// GetType returns AllPkgEqualPackagesPackage.Type, and is useful for accessing the field via an interface. +func (v *AllPkgEqualPackagesPackage) GetType() string { return v.AllPkgTree.Type } -// GetDigest returns IngestArtifactIngestArtifact.Digest, and is useful for accessing the field via an interface. -func (v *IngestArtifactIngestArtifact) GetDigest() string { return v.AllArtifactTree.Digest } +// GetNamespaces returns AllPkgEqualPackagesPackage.Namespaces, and is useful for accessing the field via an interface. +func (v *AllPkgEqualPackagesPackage) GetNamespaces() []AllPkgTreeNamespacesPackageNamespace { + return v.AllPkgTree.Namespaces +} -func (v *IngestArtifactIngestArtifact) UnmarshalJSON(b []byte) error { +func (v *AllPkgEqualPackagesPackage) UnmarshalJSON(b []byte) error { if string(b) == "null" { return nil } var firstPass struct { - *IngestArtifactIngestArtifact + *AllPkgEqualPackagesPackage graphql.NoUnmarshalJSON } - firstPass.IngestArtifactIngestArtifact = v + firstPass.AllPkgEqualPackagesPackage = v err := json.Unmarshal(b, &firstPass) if err != nil { @@ -5365,22 +4964,22 @@ func (v *IngestArtifactIngestArtifact) UnmarshalJSON(b []byte) error { } err = json.Unmarshal( - b, &v.AllArtifactTree) + b, &v.AllPkgTree) if err != nil { return err } return nil } -type __premarshalIngestArtifactIngestArtifact struct { +type __premarshalAllPkgEqualPackagesPackage struct { Id string `json:"id"` - Algorithm string `json:"algorithm"` + Type string `json:"type"` - Digest string `json:"digest"` + Namespaces []AllPkgTreeNamespacesPackageNamespace `json:"namespaces"` } -func (v *IngestArtifactIngestArtifact) MarshalJSON() ([]byte, error) { +func (v *AllPkgEqualPackagesPackage) MarshalJSON() ([]byte, error) { premarshaled, err := v.__premarshalJSON() if err != nil { return nil, err @@ -5388,218 +4987,292 @@ func (v *IngestArtifactIngestArtifact) MarshalJSON() ([]byte, error) { return json.Marshal(premarshaled) } -func (v *IngestArtifactIngestArtifact) __premarshalJSON() (*__premarshalIngestArtifactIngestArtifact, error) { - var retval __premarshalIngestArtifactIngestArtifact +func (v *AllPkgEqualPackagesPackage) __premarshalJSON() (*__premarshalAllPkgEqualPackagesPackage, error) { + var retval __premarshalAllPkgEqualPackagesPackage - retval.Id = v.AllArtifactTree.Id - retval.Algorithm = v.AllArtifactTree.Algorithm - retval.Digest = v.AllArtifactTree.Digest + retval.Id = v.AllPkgTree.Id + retval.Type = v.AllPkgTree.Type + retval.Namespaces = v.AllPkgTree.Namespaces return &retval, nil } -// IngestArtifactResponse is returned by IngestArtifact on success. -type IngestArtifactResponse struct { - // Ingests a new artifact and returns it. - IngestArtifact IngestArtifactIngestArtifact `json:"ingestArtifact"` +// AllPkgTree includes the GraphQL fields of Package requested by the fragment AllPkgTree. +// The GraphQL type's documentation follows. +// +// Package represents the root of the package trie/tree. +// +// We map package information to a trie, closely matching the pURL specification +// (https://github.com/package-url/purl-spec/blob/0dd92f26f8bb11956ffdf5e8acfcee71e8560407/README.rst), +// but deviating from it where GUAC heuristics allow for better representation of +// package information. Each path in the trie fully represents a package; we split +// the trie based on the pURL components. +// +// This node matches a pkg: partial pURL. The type field matches the +// pURL types but we might also use "guac" for the cases where the pURL +// representation is not complete or when we have custom rules. +// +// Since this node is at the root of the package trie, it is named Package, not +// PackageType. +type AllPkgTree struct { + Id string `json:"id"` + Type string `json:"type"` + Namespaces []AllPkgTreeNamespacesPackageNamespace `json:"namespaces"` } -// GetIngestArtifact returns IngestArtifactResponse.IngestArtifact, and is useful for accessing the field via an interface. -func (v *IngestArtifactResponse) GetIngestArtifact() IngestArtifactIngestArtifact { - return v.IngestArtifact -} +// GetId returns AllPkgTree.Id, and is useful for accessing the field via an interface. +func (v *AllPkgTree) GetId() string { return v.Id } -// IngestArtifactsIngestArtifactsArtifact includes the requested fields of the GraphQL type Artifact. +// GetType returns AllPkgTree.Type, and is useful for accessing the field via an interface. +func (v *AllPkgTree) GetType() string { return v.Type } + +// GetNamespaces returns AllPkgTree.Namespaces, and is useful for accessing the field via an interface. +func (v *AllPkgTree) GetNamespaces() []AllPkgTreeNamespacesPackageNamespace { return v.Namespaces } + +// AllPkgTreeNamespacesPackageNamespace includes the requested fields of the GraphQL type PackageNamespace. // The GraphQL type's documentation follows. // -// Artifact represents an artifact identified by a checksum hash. +// PackageNamespace is a namespace for packages. // -// The checksum is split into the digest value and the algorithm used to generate -// it. Both fields are mandatory and canonicalized to be lowercase. +// In the pURL representation, each PackageNamespace matches the +// pkg:// partial pURL. // -// If having a checksum Go object, algorithm can be -// strings.ToLower(string(checksum.Algorithm)) and digest can be checksum.Value. -type IngestArtifactsIngestArtifactsArtifact struct { - AllArtifactTree `json:"-"` +// Namespaces are optional and type specific. Because they are optional, we use +// empty string to denote missing namespaces. +type AllPkgTreeNamespacesPackageNamespace struct { + Id string `json:"id"` + Namespace string `json:"namespace"` + Names []AllPkgTreeNamespacesPackageNamespaceNamesPackageName `json:"names"` } -// GetId returns IngestArtifactsIngestArtifactsArtifact.Id, and is useful for accessing the field via an interface. -func (v *IngestArtifactsIngestArtifactsArtifact) GetId() string { return v.AllArtifactTree.Id } +// GetId returns AllPkgTreeNamespacesPackageNamespace.Id, and is useful for accessing the field via an interface. +func (v *AllPkgTreeNamespacesPackageNamespace) GetId() string { return v.Id } -// GetAlgorithm returns IngestArtifactsIngestArtifactsArtifact.Algorithm, and is useful for accessing the field via an interface. -func (v *IngestArtifactsIngestArtifactsArtifact) GetAlgorithm() string { - return v.AllArtifactTree.Algorithm +// GetNamespace returns AllPkgTreeNamespacesPackageNamespace.Namespace, and is useful for accessing the field via an interface. +func (v *AllPkgTreeNamespacesPackageNamespace) GetNamespace() string { return v.Namespace } + +// GetNames returns AllPkgTreeNamespacesPackageNamespace.Names, and is useful for accessing the field via an interface. +func (v *AllPkgTreeNamespacesPackageNamespace) GetNames() []AllPkgTreeNamespacesPackageNamespaceNamesPackageName { + return v.Names } -// GetDigest returns IngestArtifactsIngestArtifactsArtifact.Digest, and is useful for accessing the field via an interface. -func (v *IngestArtifactsIngestArtifactsArtifact) GetDigest() string { return v.AllArtifactTree.Digest } - -func (v *IngestArtifactsIngestArtifactsArtifact) UnmarshalJSON(b []byte) error { - - if string(b) == "null" { - return nil - } - - var firstPass struct { - *IngestArtifactsIngestArtifactsArtifact - graphql.NoUnmarshalJSON - } - firstPass.IngestArtifactsIngestArtifactsArtifact = v - - err := json.Unmarshal(b, &firstPass) - if err != nil { - return err - } - - err = json.Unmarshal( - b, &v.AllArtifactTree) - if err != nil { - return err - } - return nil +// AllPkgTreeNamespacesPackageNamespaceNamesPackageName includes the requested fields of the GraphQL type PackageName. +// The GraphQL type's documentation follows. +// +// PackageName is a name for packages. +// +// In the pURL representation, each PackageName matches the +// pkg:// pURL. +// +// Names are always mandatory. +// +// This is the first node in the trie that can be referred to by other parts of +// GUAC. +type AllPkgTreeNamespacesPackageNamespaceNamesPackageName struct { + Id string `json:"id"` + Name string `json:"name"` + Versions []AllPkgTreeNamespacesPackageNamespaceNamesPackageNameVersionsPackageVersion `json:"versions"` } -type __premarshalIngestArtifactsIngestArtifactsArtifact struct { - Id string `json:"id"` +// GetId returns AllPkgTreeNamespacesPackageNamespaceNamesPackageName.Id, and is useful for accessing the field via an interface. +func (v *AllPkgTreeNamespacesPackageNamespaceNamesPackageName) GetId() string { return v.Id } - Algorithm string `json:"algorithm"` +// GetName returns AllPkgTreeNamespacesPackageNamespaceNamesPackageName.Name, and is useful for accessing the field via an interface. +func (v *AllPkgTreeNamespacesPackageNamespaceNamesPackageName) GetName() string { return v.Name } - Digest string `json:"digest"` +// GetVersions returns AllPkgTreeNamespacesPackageNamespaceNamesPackageName.Versions, and is useful for accessing the field via an interface. +func (v *AllPkgTreeNamespacesPackageNamespaceNamesPackageName) GetVersions() []AllPkgTreeNamespacesPackageNamespaceNamesPackageNameVersionsPackageVersion { + return v.Versions } -func (v *IngestArtifactsIngestArtifactsArtifact) MarshalJSON() ([]byte, error) { - premarshaled, err := v.__premarshalJSON() - if err != nil { - return nil, err - } - return json.Marshal(premarshaled) +// AllPkgTreeNamespacesPackageNamespaceNamesPackageNameVersionsPackageVersion includes the requested fields of the GraphQL type PackageVersion. +// The GraphQL type's documentation follows. +// +// PackageVersion is a package version. +// +// In the pURL representation, each PackageName matches the +// pkg://@ pURL. +// +// Versions are optional and each Package type defines own rules for handling +// them. For this level of GUAC, these are just opaque strings. +// +// NOTE: The handling of versions might change before this schema becomes stable. +// +// This node can be referred to by other parts of GUAC. +// +// Subpath and qualifiers are optional. Lack of qualifiers is represented by an +// empty list and lack of subpath by empty string (to be consistent with +// optionality of namespace and version). Two nodes that have different qualifiers +// and/or subpath but the same version mean two different packages in the trie +// (they are different). Two nodes that have same version but qualifiers of one +// are a subset of the qualifier of the other also mean two different packages in +// the trie. +type AllPkgTreeNamespacesPackageNamespaceNamesPackageNameVersionsPackageVersion struct { + Id string `json:"id"` + Version string `json:"version"` + Qualifiers []AllPkgTreeNamespacesPackageNamespaceNamesPackageNameVersionsPackageVersionQualifiersPackageQualifier `json:"qualifiers"` + Subpath string `json:"subpath"` } -func (v *IngestArtifactsIngestArtifactsArtifact) __premarshalJSON() (*__premarshalIngestArtifactsIngestArtifactsArtifact, error) { - var retval __premarshalIngestArtifactsIngestArtifactsArtifact +// GetId returns AllPkgTreeNamespacesPackageNamespaceNamesPackageNameVersionsPackageVersion.Id, and is useful for accessing the field via an interface. +func (v *AllPkgTreeNamespacesPackageNamespaceNamesPackageNameVersionsPackageVersion) GetId() string { + return v.Id +} - retval.Id = v.AllArtifactTree.Id - retval.Algorithm = v.AllArtifactTree.Algorithm - retval.Digest = v.AllArtifactTree.Digest - return &retval, nil +// GetVersion returns AllPkgTreeNamespacesPackageNamespaceNamesPackageNameVersionsPackageVersion.Version, and is useful for accessing the field via an interface. +func (v *AllPkgTreeNamespacesPackageNamespaceNamesPackageNameVersionsPackageVersion) GetVersion() string { + return v.Version } -// IngestArtifactsResponse is returned by IngestArtifacts on success. -type IngestArtifactsResponse struct { - // Bulk ingests new artifacts and returns a list of them. - IngestArtifacts []IngestArtifactsIngestArtifactsArtifact `json:"ingestArtifacts"` +// GetQualifiers returns AllPkgTreeNamespacesPackageNamespaceNamesPackageNameVersionsPackageVersion.Qualifiers, and is useful for accessing the field via an interface. +func (v *AllPkgTreeNamespacesPackageNamespaceNamesPackageNameVersionsPackageVersion) GetQualifiers() []AllPkgTreeNamespacesPackageNamespaceNamesPackageNameVersionsPackageVersionQualifiersPackageQualifier { + return v.Qualifiers } -// GetIngestArtifacts returns IngestArtifactsResponse.IngestArtifacts, and is useful for accessing the field via an interface. -func (v *IngestArtifactsResponse) GetIngestArtifacts() []IngestArtifactsIngestArtifactsArtifact { - return v.IngestArtifacts +// GetSubpath returns AllPkgTreeNamespacesPackageNamespaceNamesPackageNameVersionsPackageVersion.Subpath, and is useful for accessing the field via an interface. +func (v *AllPkgTreeNamespacesPackageNamespaceNamesPackageNameVersionsPackageVersion) GetSubpath() string { + return v.Subpath } -// IngestBuilderIngestBuilder includes the requested fields of the GraphQL type Builder. +// AllPkgTreeNamespacesPackageNamespaceNamesPackageNameVersionsPackageVersionQualifiersPackageQualifier includes the requested fields of the GraphQL type PackageQualifier. // The GraphQL type's documentation follows. // -// Builder represents the builder (e.g., FRSCA or GitHub Actions). +// PackageQualifier is a qualifier for a package, a key-value pair. // -// Currently builders are identified by the uri field. -type IngestBuilderIngestBuilder struct { - Uri string `json:"uri"` -} - -// GetUri returns IngestBuilderIngestBuilder.Uri, and is useful for accessing the field via an interface. -func (v *IngestBuilderIngestBuilder) GetUri() string { return v.Uri } - -// IngestBuilderResponse is returned by IngestBuilder on success. -type IngestBuilderResponse struct { - // Ingests a new builder and returns it. - IngestBuilder IngestBuilderIngestBuilder `json:"ingestBuilder"` -} - -// GetIngestBuilder returns IngestBuilderResponse.IngestBuilder, and is useful for accessing the field via an interface. -func (v *IngestBuilderResponse) GetIngestBuilder() IngestBuilderIngestBuilder { return v.IngestBuilder } - -// IngestBuildersIngestBuildersBuilder includes the requested fields of the GraphQL type Builder. -// The GraphQL type's documentation follows. +// In the pURL representation, it is a part of the part of the +// pkg://@? pURL. // -// Builder represents the builder (e.g., FRSCA or GitHub Actions). +// Qualifiers are optional, each Package type defines own rules for handling them, +// and multiple qualifiers could be attached to the same package. // -// Currently builders are identified by the uri field. -type IngestBuildersIngestBuildersBuilder struct { - Uri string `json:"uri"` +// This node cannot be directly referred by other parts of GUAC. +type AllPkgTreeNamespacesPackageNamespaceNamesPackageNameVersionsPackageVersionQualifiersPackageQualifier struct { + Key string `json:"key"` + Value string `json:"value"` } -// GetUri returns IngestBuildersIngestBuildersBuilder.Uri, and is useful for accessing the field via an interface. -func (v *IngestBuildersIngestBuildersBuilder) GetUri() string { return v.Uri } - -// IngestBuildersResponse is returned by IngestBuilders on success. -type IngestBuildersResponse struct { - // Bulk ingests new builders and returns a list of them. - IngestBuilders []IngestBuildersIngestBuildersBuilder `json:"ingestBuilders"` +// GetKey returns AllPkgTreeNamespacesPackageNamespaceNamesPackageNameVersionsPackageVersionQualifiersPackageQualifier.Key, and is useful for accessing the field via an interface. +func (v *AllPkgTreeNamespacesPackageNamespaceNamesPackageNameVersionsPackageVersionQualifiersPackageQualifier) GetKey() string { + return v.Key } -// GetIngestBuilders returns IngestBuildersResponse.IngestBuilders, and is useful for accessing the field via an interface. -func (v *IngestBuildersResponse) GetIngestBuilders() []IngestBuildersIngestBuildersBuilder { - return v.IngestBuilders +// GetValue returns AllPkgTreeNamespacesPackageNamespaceNamesPackageNameVersionsPackageVersionQualifiersPackageQualifier.Value, and is useful for accessing the field via an interface. +func (v *AllPkgTreeNamespacesPackageNamespaceNamesPackageNameVersionsPackageVersionQualifiersPackageQualifier) GetValue() string { + return v.Value } -// IngestCVEIngestCVE includes the requested fields of the GraphQL type CVE. +// AllPointOfContact includes the GraphQL fields of PointOfContact requested by the fragment AllPointOfContact. // The GraphQL type's documentation follows. // -// CVE represents a vulnerability in the Common Vulnerabilities and Exposures -// schema. +// PointOfContact is an attestation of how to get in touch with the person(s) responsible +// for a package, source, or artifact. // -// The vulnerability identifier contains a year field, so we are extracting that -// to allow matching for vulnerabilities found in a given year. +// All evidence trees record a justification for the property they represent as +// well as the document that contains the attestation (origin) and the collector +// that collected the document (collector). // -// The vulnerability identifier field is mandatory and canonicalized to be -// lowercase. +// The attestation applies to a subject which is a package, source, or artifact. +// If the attestation targets a package, it must target a PackageName or a +// PackageVersion. If the attestation targets a source, it must target a +// SourceName. // -// This node can be referred to by other parts of GUAC. -type IngestCVEIngestCVE struct { - AllCveTree `json:"-"` +// email is the email address (singular) of the point of contact. +// +// info is additional contact information other than email address. This is free +// form. +// +// NOTE: the identifiers for point of contact should be part of software trees. +// This will benefit from identifier look up and traversal as well as organization +// hierarchy. However, until the use case arises, PointOfContact will be a flat +// reference to the contact details. +type AllPointOfContact struct { + Id string `json:"id"` + Subject AllPointOfContactSubjectPackageSourceOrArtifact `json:"-"` + Email string `json:"email"` + Info string `json:"info"` + Since time.Time `json:"since"` + Justification string `json:"justification"` + Origin string `json:"origin"` + Collector string `json:"collector"` } -// GetId returns IngestCVEIngestCVE.Id, and is useful for accessing the field via an interface. -func (v *IngestCVEIngestCVE) GetId() string { return v.AllCveTree.Id } +// GetId returns AllPointOfContact.Id, and is useful for accessing the field via an interface. +func (v *AllPointOfContact) GetId() string { return v.Id } -// GetYear returns IngestCVEIngestCVE.Year, and is useful for accessing the field via an interface. -func (v *IngestCVEIngestCVE) GetYear() int { return v.AllCveTree.Year } +// GetSubject returns AllPointOfContact.Subject, and is useful for accessing the field via an interface. +func (v *AllPointOfContact) GetSubject() AllPointOfContactSubjectPackageSourceOrArtifact { + return v.Subject +} -// GetCveId returns IngestCVEIngestCVE.CveId, and is useful for accessing the field via an interface. -func (v *IngestCVEIngestCVE) GetCveId() string { return v.AllCveTree.CveId } +// GetEmail returns AllPointOfContact.Email, and is useful for accessing the field via an interface. +func (v *AllPointOfContact) GetEmail() string { return v.Email } -func (v *IngestCVEIngestCVE) UnmarshalJSON(b []byte) error { +// GetInfo returns AllPointOfContact.Info, and is useful for accessing the field via an interface. +func (v *AllPointOfContact) GetInfo() string { return v.Info } + +// GetSince returns AllPointOfContact.Since, and is useful for accessing the field via an interface. +func (v *AllPointOfContact) GetSince() time.Time { return v.Since } + +// GetJustification returns AllPointOfContact.Justification, and is useful for accessing the field via an interface. +func (v *AllPointOfContact) GetJustification() string { return v.Justification } + +// GetOrigin returns AllPointOfContact.Origin, and is useful for accessing the field via an interface. +func (v *AllPointOfContact) GetOrigin() string { return v.Origin } + +// GetCollector returns AllPointOfContact.Collector, and is useful for accessing the field via an interface. +func (v *AllPointOfContact) GetCollector() string { return v.Collector } + +func (v *AllPointOfContact) UnmarshalJSON(b []byte) error { if string(b) == "null" { return nil } var firstPass struct { - *IngestCVEIngestCVE + *AllPointOfContact + Subject json.RawMessage `json:"subject"` graphql.NoUnmarshalJSON } - firstPass.IngestCVEIngestCVE = v + firstPass.AllPointOfContact = v err := json.Unmarshal(b, &firstPass) if err != nil { return err } - err = json.Unmarshal( - b, &v.AllCveTree) - if err != nil { - return err + { + dst := &v.Subject + src := firstPass.Subject + if len(src) != 0 && string(src) != "null" { + err = __unmarshalAllPointOfContactSubjectPackageSourceOrArtifact( + src, dst) + if err != nil { + return fmt.Errorf( + "unable to unmarshal AllPointOfContact.Subject: %w", err) + } + } } return nil } -type __premarshalIngestCVEIngestCVE struct { +type __premarshalAllPointOfContact struct { Id string `json:"id"` - Year int `json:"year"` + Subject json.RawMessage `json:"subject"` - CveId string `json:"cveId"` + Email string `json:"email"` + + Info string `json:"info"` + + Since time.Time `json:"since"` + + Justification string `json:"justification"` + + Origin string `json:"origin"` + + Collector string `json:"collector"` } -func (v *IngestCVEIngestCVE) MarshalJSON() ([]byte, error) { +func (v *AllPointOfContact) MarshalJSON() ([]byte, error) { premarshaled, err := v.__premarshalJSON() if err != nil { return nil, err @@ -5607,61 +5280,69 @@ func (v *IngestCVEIngestCVE) MarshalJSON() ([]byte, error) { return json.Marshal(premarshaled) } -func (v *IngestCVEIngestCVE) __premarshalJSON() (*__premarshalIngestCVEIngestCVE, error) { - var retval __premarshalIngestCVEIngestCVE +func (v *AllPointOfContact) __premarshalJSON() (*__premarshalAllPointOfContact, error) { + var retval __premarshalAllPointOfContact - retval.Id = v.AllCveTree.Id - retval.Year = v.AllCveTree.Year - retval.CveId = v.AllCveTree.CveId - return &retval, nil -} + retval.Id = v.Id + { -// IngestCVEResponse is returned by IngestCVE on success. -type IngestCVEResponse struct { - // Ingests new CVE and returns it. - IngestCVE IngestCVEIngestCVE `json:"ingestCVE"` -} - -// GetIngestCVE returns IngestCVEResponse.IngestCVE, and is useful for accessing the field via an interface. -func (v *IngestCVEResponse) GetIngestCVE() IngestCVEIngestCVE { return v.IngestCVE } + dst := &retval.Subject + src := v.Subject + var err error + *dst, err = __marshalAllPointOfContactSubjectPackageSourceOrArtifact( + &src) + if err != nil { + return nil, fmt.Errorf( + "unable to marshal AllPointOfContact.Subject: %w", err) + } + } + retval.Email = v.Email + retval.Info = v.Info + retval.Since = v.Since + retval.Justification = v.Justification + retval.Origin = v.Origin + retval.Collector = v.Collector + return &retval, nil +} -// IngestCVEsIngestCVEsCVE includes the requested fields of the GraphQL type CVE. +// AllPointOfContactSubjectArtifact includes the requested fields of the GraphQL type Artifact. // The GraphQL type's documentation follows. // -// CVE represents a vulnerability in the Common Vulnerabilities and Exposures -// schema. -// -// The vulnerability identifier contains a year field, so we are extracting that -// to allow matching for vulnerabilities found in a given year. +// Artifact represents an artifact identified by a checksum hash. // -// The vulnerability identifier field is mandatory and canonicalized to be -// lowercase. +// The checksum is split into the digest value and the algorithm used to generate +// it. Both fields are mandatory and canonicalized to be lowercase. // -// This node can be referred to by other parts of GUAC. -type IngestCVEsIngestCVEsCVE struct { - AllCveTree `json:"-"` +// If having a checksum Go object, algorithm can be +// strings.ToLower(string(checksum.Algorithm)) and digest can be checksum.Value. +type AllPointOfContactSubjectArtifact struct { + Typename *string `json:"__typename"` + AllArtifactTree `json:"-"` } -// GetId returns IngestCVEsIngestCVEsCVE.Id, and is useful for accessing the field via an interface. -func (v *IngestCVEsIngestCVEsCVE) GetId() string { return v.AllCveTree.Id } +// GetTypename returns AllPointOfContactSubjectArtifact.Typename, and is useful for accessing the field via an interface. +func (v *AllPointOfContactSubjectArtifact) GetTypename() *string { return v.Typename } -// GetYear returns IngestCVEsIngestCVEsCVE.Year, and is useful for accessing the field via an interface. -func (v *IngestCVEsIngestCVEsCVE) GetYear() int { return v.AllCveTree.Year } +// GetId returns AllPointOfContactSubjectArtifact.Id, and is useful for accessing the field via an interface. +func (v *AllPointOfContactSubjectArtifact) GetId() string { return v.AllArtifactTree.Id } -// GetCveId returns IngestCVEsIngestCVEsCVE.CveId, and is useful for accessing the field via an interface. -func (v *IngestCVEsIngestCVEsCVE) GetCveId() string { return v.AllCveTree.CveId } +// GetAlgorithm returns AllPointOfContactSubjectArtifact.Algorithm, and is useful for accessing the field via an interface. +func (v *AllPointOfContactSubjectArtifact) GetAlgorithm() string { return v.AllArtifactTree.Algorithm } -func (v *IngestCVEsIngestCVEsCVE) UnmarshalJSON(b []byte) error { +// GetDigest returns AllPointOfContactSubjectArtifact.Digest, and is useful for accessing the field via an interface. +func (v *AllPointOfContactSubjectArtifact) GetDigest() string { return v.AllArtifactTree.Digest } + +func (v *AllPointOfContactSubjectArtifact) UnmarshalJSON(b []byte) error { if string(b) == "null" { return nil } var firstPass struct { - *IngestCVEsIngestCVEsCVE + *AllPointOfContactSubjectArtifact graphql.NoUnmarshalJSON } - firstPass.IngestCVEsIngestCVEsCVE = v + firstPass.AllPointOfContactSubjectArtifact = v err := json.Unmarshal(b, &firstPass) if err != nil { @@ -5669,22 +5350,24 @@ func (v *IngestCVEsIngestCVEsCVE) UnmarshalJSON(b []byte) error { } err = json.Unmarshal( - b, &v.AllCveTree) + b, &v.AllArtifactTree) if err != nil { return err } return nil } -type __premarshalIngestCVEsIngestCVEsCVE struct { +type __premarshalAllPointOfContactSubjectArtifact struct { + Typename *string `json:"__typename"` + Id string `json:"id"` - Year int `json:"year"` + Algorithm string `json:"algorithm"` - CveId string `json:"cveId"` + Digest string `json:"digest"` } -func (v *IngestCVEsIngestCVEsCVE) MarshalJSON() ([]byte, error) { +func (v *AllPointOfContactSubjectArtifact) MarshalJSON() ([]byte, error) { premarshaled, err := v.__premarshalJSON() if err != nil { return nil, err @@ -5692,53 +5375,63 @@ func (v *IngestCVEsIngestCVEsCVE) MarshalJSON() ([]byte, error) { return json.Marshal(premarshaled) } -func (v *IngestCVEsIngestCVEsCVE) __premarshalJSON() (*__premarshalIngestCVEsIngestCVEsCVE, error) { - var retval __premarshalIngestCVEsIngestCVEsCVE +func (v *AllPointOfContactSubjectArtifact) __premarshalJSON() (*__premarshalAllPointOfContactSubjectArtifact, error) { + var retval __premarshalAllPointOfContactSubjectArtifact - retval.Id = v.AllCveTree.Id - retval.Year = v.AllCveTree.Year - retval.CveId = v.AllCveTree.CveId + retval.Typename = v.Typename + retval.Id = v.AllArtifactTree.Id + retval.Algorithm = v.AllArtifactTree.Algorithm + retval.Digest = v.AllArtifactTree.Digest return &retval, nil } -// IngestCVEsResponse is returned by IngestCVEs on success. -type IngestCVEsResponse struct { - // Bulk ingests new CVEs and returns a list of them. - IngestCVEs []IngestCVEsIngestCVEsCVE `json:"ingestCVEs"` -} - -// GetIngestCVEs returns IngestCVEsResponse.IngestCVEs, and is useful for accessing the field via an interface. -func (v *IngestCVEsResponse) GetIngestCVEs() []IngestCVEsIngestCVEsCVE { return v.IngestCVEs } - -// IngestGHSAIngestGHSA includes the requested fields of the GraphQL type GHSA. +// AllPointOfContactSubjectPackage includes the requested fields of the GraphQL type Package. // The GraphQL type's documentation follows. // -// GHSA represents GitHub security advisories. +// Package represents the root of the package trie/tree. // -// The advisory id field is mandatory and canonicalized to be lowercase. +// We map package information to a trie, closely matching the pURL specification +// (https://github.com/package-url/purl-spec/blob/0dd92f26f8bb11956ffdf5e8acfcee71e8560407/README.rst), +// but deviating from it where GUAC heuristics allow for better representation of +// package information. Each path in the trie fully represents a package; we split +// the trie based on the pURL components. // -// This node can be referred to by other parts of GUAC. -type IngestGHSAIngestGHSA struct { - AllGHSATree `json:"-"` +// This node matches a pkg: partial pURL. The type field matches the +// pURL types but we might also use "guac" for the cases where the pURL +// representation is not complete or when we have custom rules. +// +// Since this node is at the root of the package trie, it is named Package, not +// PackageType. +type AllPointOfContactSubjectPackage struct { + Typename *string `json:"__typename"` + AllPkgTree `json:"-"` } -// GetId returns IngestGHSAIngestGHSA.Id, and is useful for accessing the field via an interface. -func (v *IngestGHSAIngestGHSA) GetId() string { return v.AllGHSATree.Id } +// GetTypename returns AllPointOfContactSubjectPackage.Typename, and is useful for accessing the field via an interface. +func (v *AllPointOfContactSubjectPackage) GetTypename() *string { return v.Typename } -// GetGhsaId returns IngestGHSAIngestGHSA.GhsaId, and is useful for accessing the field via an interface. -func (v *IngestGHSAIngestGHSA) GetGhsaId() string { return v.AllGHSATree.GhsaId } +// GetId returns AllPointOfContactSubjectPackage.Id, and is useful for accessing the field via an interface. +func (v *AllPointOfContactSubjectPackage) GetId() string { return v.AllPkgTree.Id } -func (v *IngestGHSAIngestGHSA) UnmarshalJSON(b []byte) error { +// GetType returns AllPointOfContactSubjectPackage.Type, and is useful for accessing the field via an interface. +func (v *AllPointOfContactSubjectPackage) GetType() string { return v.AllPkgTree.Type } + +// GetNamespaces returns AllPointOfContactSubjectPackage.Namespaces, and is useful for accessing the field via an interface. +func (v *AllPointOfContactSubjectPackage) GetNamespaces() []AllPkgTreeNamespacesPackageNamespace { + return v.AllPkgTree.Namespaces +} + +func (v *AllPointOfContactSubjectPackage) UnmarshalJSON(b []byte) error { if string(b) == "null" { return nil } var firstPass struct { - *IngestGHSAIngestGHSA + *AllPointOfContactSubjectPackage graphql.NoUnmarshalJSON } - firstPass.IngestGHSAIngestGHSA = v + firstPass.AllPointOfContactSubjectPackage = v err := json.Unmarshal(b, &firstPass) if err != nil { @@ -5746,20 +5439,24 @@ func (v *IngestGHSAIngestGHSA) UnmarshalJSON(b []byte) error { } err = json.Unmarshal( - b, &v.AllGHSATree) + b, &v.AllPkgTree) if err != nil { return err } return nil } -type __premarshalIngestGHSAIngestGHSA struct { +type __premarshalAllPointOfContactSubjectPackage struct { + Typename *string `json:"__typename"` + Id string `json:"id"` - GhsaId string `json:"ghsaId"` + Type string `json:"type"` + + Namespaces []AllPkgTreeNamespacesPackageNamespace `json:"namespaces"` } -func (v *IngestGHSAIngestGHSA) MarshalJSON() ([]byte, error) { +func (v *AllPointOfContactSubjectPackage) MarshalJSON() ([]byte, error) { premarshaled, err := v.__premarshalJSON() if err != nil { return nil, err @@ -5767,52 +5464,162 @@ func (v *IngestGHSAIngestGHSA) MarshalJSON() ([]byte, error) { return json.Marshal(premarshaled) } -func (v *IngestGHSAIngestGHSA) __premarshalJSON() (*__premarshalIngestGHSAIngestGHSA, error) { - var retval __premarshalIngestGHSAIngestGHSA +func (v *AllPointOfContactSubjectPackage) __premarshalJSON() (*__premarshalAllPointOfContactSubjectPackage, error) { + var retval __premarshalAllPointOfContactSubjectPackage - retval.Id = v.AllGHSATree.Id - retval.GhsaId = v.AllGHSATree.GhsaId + retval.Typename = v.Typename + retval.Id = v.AllPkgTree.Id + retval.Type = v.AllPkgTree.Type + retval.Namespaces = v.AllPkgTree.Namespaces return &retval, nil } -// IngestGHSAResponse is returned by IngestGHSA on success. -type IngestGHSAResponse struct { - // Ingests a new GitHub Security Advisory and returns it. - IngestGHSA IngestGHSAIngestGHSA `json:"ingestGHSA"` +// AllPointOfContactSubjectPackageSourceOrArtifact includes the requested fields of the GraphQL interface PackageSourceOrArtifact. +// +// AllPointOfContactSubjectPackageSourceOrArtifact is implemented by the following types: +// AllPointOfContactSubjectArtifact +// AllPointOfContactSubjectPackage +// AllPointOfContactSubjectSource +// The GraphQL type's documentation follows. +// +// PackageSourceOrArtifact is a union of Package, Source, and Artifact. +type AllPointOfContactSubjectPackageSourceOrArtifact interface { + implementsGraphQLInterfaceAllPointOfContactSubjectPackageSourceOrArtifact() + // GetTypename returns the receiver's concrete GraphQL type-name (see interface doc for possible values). + GetTypename() *string } -// GetIngestGHSA returns IngestGHSAResponse.IngestGHSA, and is useful for accessing the field via an interface. -func (v *IngestGHSAResponse) GetIngestGHSA() IngestGHSAIngestGHSA { return v.IngestGHSA } +func (v *AllPointOfContactSubjectArtifact) implementsGraphQLInterfaceAllPointOfContactSubjectPackageSourceOrArtifact() { +} +func (v *AllPointOfContactSubjectPackage) implementsGraphQLInterfaceAllPointOfContactSubjectPackageSourceOrArtifact() { +} +func (v *AllPointOfContactSubjectSource) implementsGraphQLInterfaceAllPointOfContactSubjectPackageSourceOrArtifact() { +} -// IngestGHSAsIngestGHSAsGHSA includes the requested fields of the GraphQL type GHSA. +func __unmarshalAllPointOfContactSubjectPackageSourceOrArtifact(b []byte, v *AllPointOfContactSubjectPackageSourceOrArtifact) error { + if string(b) == "null" { + return nil + } + + var tn struct { + TypeName string `json:"__typename"` + } + err := json.Unmarshal(b, &tn) + if err != nil { + return err + } + + switch tn.TypeName { + case "Artifact": + *v = new(AllPointOfContactSubjectArtifact) + return json.Unmarshal(b, *v) + case "Package": + *v = new(AllPointOfContactSubjectPackage) + return json.Unmarshal(b, *v) + case "Source": + *v = new(AllPointOfContactSubjectSource) + return json.Unmarshal(b, *v) + case "": + return fmt.Errorf( + "response was missing PackageSourceOrArtifact.__typename") + default: + return fmt.Errorf( + `unexpected concrete type for AllPointOfContactSubjectPackageSourceOrArtifact: "%v"`, tn.TypeName) + } +} + +func __marshalAllPointOfContactSubjectPackageSourceOrArtifact(v *AllPointOfContactSubjectPackageSourceOrArtifact) ([]byte, error) { + + var typename string + switch v := (*v).(type) { + case *AllPointOfContactSubjectArtifact: + typename = "Artifact" + + premarshaled, err := v.__premarshalJSON() + if err != nil { + return nil, err + } + result := struct { + TypeName string `json:"__typename"` + *__premarshalAllPointOfContactSubjectArtifact + }{typename, premarshaled} + return json.Marshal(result) + case *AllPointOfContactSubjectPackage: + typename = "Package" + + premarshaled, err := v.__premarshalJSON() + if err != nil { + return nil, err + } + result := struct { + TypeName string `json:"__typename"` + *__premarshalAllPointOfContactSubjectPackage + }{typename, premarshaled} + return json.Marshal(result) + case *AllPointOfContactSubjectSource: + typename = "Source" + + premarshaled, err := v.__premarshalJSON() + if err != nil { + return nil, err + } + result := struct { + TypeName string `json:"__typename"` + *__premarshalAllPointOfContactSubjectSource + }{typename, premarshaled} + return json.Marshal(result) + case nil: + return []byte("null"), nil + default: + return nil, fmt.Errorf( + `unexpected concrete type for AllPointOfContactSubjectPackageSourceOrArtifact: "%T"`, v) + } +} + +// AllPointOfContactSubjectSource includes the requested fields of the GraphQL type Source. // The GraphQL type's documentation follows. // -// GHSA represents GitHub security advisories. +// Source represents the root of the source trie/tree. // -// The advisory id field is mandatory and canonicalized to be lowercase. +// We map source information to a trie, as a derivative of the pURL specification: +// each path in the trie represents a type, namespace, name and an optional +// qualifier that stands for tag/commit information. // -// This node can be referred to by other parts of GUAC. -type IngestGHSAsIngestGHSAsGHSA struct { - AllGHSATree `json:"-"` +// This node represents the type part of the trie path. It is used to represent +// the version control system that is being used. +// +// Since this node is at the root of the source trie, it is named Source, not +// SourceType. +type AllPointOfContactSubjectSource struct { + Typename *string `json:"__typename"` + AllSourceTree `json:"-"` } -// GetId returns IngestGHSAsIngestGHSAsGHSA.Id, and is useful for accessing the field via an interface. -func (v *IngestGHSAsIngestGHSAsGHSA) GetId() string { return v.AllGHSATree.Id } +// GetTypename returns AllPointOfContactSubjectSource.Typename, and is useful for accessing the field via an interface. +func (v *AllPointOfContactSubjectSource) GetTypename() *string { return v.Typename } -// GetGhsaId returns IngestGHSAsIngestGHSAsGHSA.GhsaId, and is useful for accessing the field via an interface. -func (v *IngestGHSAsIngestGHSAsGHSA) GetGhsaId() string { return v.AllGHSATree.GhsaId } +// GetId returns AllPointOfContactSubjectSource.Id, and is useful for accessing the field via an interface. +func (v *AllPointOfContactSubjectSource) GetId() string { return v.AllSourceTree.Id } -func (v *IngestGHSAsIngestGHSAsGHSA) UnmarshalJSON(b []byte) error { +// GetType returns AllPointOfContactSubjectSource.Type, and is useful for accessing the field via an interface. +func (v *AllPointOfContactSubjectSource) GetType() string { return v.AllSourceTree.Type } + +// GetNamespaces returns AllPointOfContactSubjectSource.Namespaces, and is useful for accessing the field via an interface. +func (v *AllPointOfContactSubjectSource) GetNamespaces() []AllSourceTreeNamespacesSourceNamespace { + return v.AllSourceTree.Namespaces +} + +func (v *AllPointOfContactSubjectSource) UnmarshalJSON(b []byte) error { if string(b) == "null" { return nil } var firstPass struct { - *IngestGHSAsIngestGHSAsGHSA + *AllPointOfContactSubjectSource graphql.NoUnmarshalJSON } - firstPass.IngestGHSAsIngestGHSAsGHSA = v + firstPass.AllPointOfContactSubjectSource = v err := json.Unmarshal(b, &firstPass) if err != nil { @@ -5820,20 +5627,24 @@ func (v *IngestGHSAsIngestGHSAsGHSA) UnmarshalJSON(b []byte) error { } err = json.Unmarshal( - b, &v.AllGHSATree) + b, &v.AllSourceTree) if err != nil { return err } return nil } -type __premarshalIngestGHSAsIngestGHSAsGHSA struct { +type __premarshalAllPointOfContactSubjectSource struct { + Typename *string `json:"__typename"` + Id string `json:"id"` - GhsaId string `json:"ghsaId"` + Type string `json:"type"` + + Namespaces []AllSourceTreeNamespacesSourceNamespace `json:"namespaces"` } -func (v *IngestGHSAsIngestGHSAsGHSA) MarshalJSON() ([]byte, error) { +func (v *AllPointOfContactSubjectSource) MarshalJSON() ([]byte, error) { premarshaled, err := v.__premarshalJSON() if err != nil { return nil, err @@ -5841,132 +5652,153 @@ func (v *IngestGHSAsIngestGHSAsGHSA) MarshalJSON() ([]byte, error) { return json.Marshal(premarshaled) } -func (v *IngestGHSAsIngestGHSAsGHSA) __premarshalJSON() (*__premarshalIngestGHSAsIngestGHSAsGHSA, error) { - var retval __premarshalIngestGHSAsIngestGHSAsGHSA +func (v *AllPointOfContactSubjectSource) __premarshalJSON() (*__premarshalAllPointOfContactSubjectSource, error) { + var retval __premarshalAllPointOfContactSubjectSource - retval.Id = v.AllGHSATree.Id - retval.GhsaId = v.AllGHSATree.GhsaId + retval.Typename = v.Typename + retval.Id = v.AllSourceTree.Id + retval.Type = v.AllSourceTree.Type + retval.Namespaces = v.AllSourceTree.Namespaces return &retval, nil } -// IngestGHSAsResponse is returned by IngestGHSAs on success. -type IngestGHSAsResponse struct { - // Bulk ingests new GHSAs and returns a list of them. - IngestGHSAs []IngestGHSAsIngestGHSAsGHSA `json:"ingestGHSAs"` +// AllSLSATree includes the GraphQL fields of HasSLSA requested by the fragment AllSLSATree. +// The GraphQL type's documentation follows. +// +// HasSLSA records that a subject node has a SLSA attestation. +type AllSLSATree struct { + Id string `json:"id"` + // The subject of SLSA attestation + Subject AllSLSATreeSubjectArtifact `json:"subject"` + // The SLSA attestation + Slsa AllSLSATreeSlsaSLSA `json:"slsa"` } -// GetIngestGHSAs returns IngestGHSAsResponse.IngestGHSAs, and is useful for accessing the field via an interface. -func (v *IngestGHSAsResponse) GetIngestGHSAs() []IngestGHSAsIngestGHSAsGHSA { return v.IngestGHSAs } +// GetId returns AllSLSATree.Id, and is useful for accessing the field via an interface. +func (v *AllSLSATree) GetId() string { return v.Id } -// IngestOSVIngestOSV includes the requested fields of the GraphQL type OSV. +// GetSubject returns AllSLSATree.Subject, and is useful for accessing the field via an interface. +func (v *AllSLSATree) GetSubject() AllSLSATreeSubjectArtifact { return v.Subject } + +// GetSlsa returns AllSLSATree.Slsa, and is useful for accessing the field via an interface. +func (v *AllSLSATree) GetSlsa() AllSLSATreeSlsaSLSA { return v.Slsa } + +// AllSLSATreeSlsaSLSA includes the requested fields of the GraphQL type SLSA. // The GraphQL type's documentation follows. // -// OSV represents an Open Source Vulnerability. -// -// The osvId field is mandatory and canonicalized to be lowercase. +// SLSA contains all of the fields present in a SLSA attestation. // -// This maps to a vulnerability ID specific to the environment (e.g., GHSA ID or -// CVE ID). +// The materials and builders are objects of the HasSLSA predicate, everything +// else are properties extracted from the attestation. // -// This node can be referred to by other parts of GUAC. -type IngestOSVIngestOSV struct { - AllOSVTree `json:"-"` +// We also include fields to specify under what conditions the check was performed +// (time of scan, version of scanners, etc.) as well as how this information got +// included into GUAC (origin document and the collector for that document). +type AllSLSATreeSlsaSLSA struct { + // Materials of the build resulting in subject + BuiltFrom []AllSLSATreeSlsaSLSABuiltFromArtifact `json:"builtFrom"` + // Builder performing the build + BuiltBy AllSLSATreeSlsaSLSABuiltByBuilder `json:"builtBy"` + // Type of the builder + BuildType string `json:"buildType"` + // Individual predicates found in the attestation + SlsaPredicate []AllSLSATreeSlsaSLSASlsaPredicateSLSAPredicate `json:"slsaPredicate"` + // Version of the SLSA predicate + SlsaVersion string `json:"slsaVersion"` + // Timestamp (RFC3339Nano format) of build start time + StartedOn *time.Time `json:"startedOn"` + // Timestamp (RFC3339Nano format) of build end time + FinishedOn *time.Time `json:"finishedOn"` + // Document from which this attestation is generated from + Origin string `json:"origin"` + // GUAC collector for the document + Collector string `json:"collector"` } -// GetId returns IngestOSVIngestOSV.Id, and is useful for accessing the field via an interface. -func (v *IngestOSVIngestOSV) GetId() string { return v.AllOSVTree.Id } - -// GetOsvId returns IngestOSVIngestOSV.OsvId, and is useful for accessing the field via an interface. -func (v *IngestOSVIngestOSV) GetOsvId() string { return v.AllOSVTree.OsvId } - -func (v *IngestOSVIngestOSV) UnmarshalJSON(b []byte) error { - - if string(b) == "null" { - return nil - } +// GetBuiltFrom returns AllSLSATreeSlsaSLSA.BuiltFrom, and is useful for accessing the field via an interface. +func (v *AllSLSATreeSlsaSLSA) GetBuiltFrom() []AllSLSATreeSlsaSLSABuiltFromArtifact { + return v.BuiltFrom +} - var firstPass struct { - *IngestOSVIngestOSV - graphql.NoUnmarshalJSON - } - firstPass.IngestOSVIngestOSV = v +// GetBuiltBy returns AllSLSATreeSlsaSLSA.BuiltBy, and is useful for accessing the field via an interface. +func (v *AllSLSATreeSlsaSLSA) GetBuiltBy() AllSLSATreeSlsaSLSABuiltByBuilder { return v.BuiltBy } - err := json.Unmarshal(b, &firstPass) - if err != nil { - return err - } +// GetBuildType returns AllSLSATreeSlsaSLSA.BuildType, and is useful for accessing the field via an interface. +func (v *AllSLSATreeSlsaSLSA) GetBuildType() string { return v.BuildType } - err = json.Unmarshal( - b, &v.AllOSVTree) - if err != nil { - return err - } - return nil +// GetSlsaPredicate returns AllSLSATreeSlsaSLSA.SlsaPredicate, and is useful for accessing the field via an interface. +func (v *AllSLSATreeSlsaSLSA) GetSlsaPredicate() []AllSLSATreeSlsaSLSASlsaPredicateSLSAPredicate { + return v.SlsaPredicate } -type __premarshalIngestOSVIngestOSV struct { - Id string `json:"id"` +// GetSlsaVersion returns AllSLSATreeSlsaSLSA.SlsaVersion, and is useful for accessing the field via an interface. +func (v *AllSLSATreeSlsaSLSA) GetSlsaVersion() string { return v.SlsaVersion } - OsvId string `json:"osvId"` -} +// GetStartedOn returns AllSLSATreeSlsaSLSA.StartedOn, and is useful for accessing the field via an interface. +func (v *AllSLSATreeSlsaSLSA) GetStartedOn() *time.Time { return v.StartedOn } -func (v *IngestOSVIngestOSV) MarshalJSON() ([]byte, error) { - premarshaled, err := v.__premarshalJSON() - if err != nil { - return nil, err - } - return json.Marshal(premarshaled) -} +// GetFinishedOn returns AllSLSATreeSlsaSLSA.FinishedOn, and is useful for accessing the field via an interface. +func (v *AllSLSATreeSlsaSLSA) GetFinishedOn() *time.Time { return v.FinishedOn } -func (v *IngestOSVIngestOSV) __premarshalJSON() (*__premarshalIngestOSVIngestOSV, error) { - var retval __premarshalIngestOSVIngestOSV +// GetOrigin returns AllSLSATreeSlsaSLSA.Origin, and is useful for accessing the field via an interface. +func (v *AllSLSATreeSlsaSLSA) GetOrigin() string { return v.Origin } - retval.Id = v.AllOSVTree.Id - retval.OsvId = v.AllOSVTree.OsvId - return &retval, nil -} +// GetCollector returns AllSLSATreeSlsaSLSA.Collector, and is useful for accessing the field via an interface. +func (v *AllSLSATreeSlsaSLSA) GetCollector() string { return v.Collector } -// IngestOSVResponse is returned by IngestOSV on success. -type IngestOSVResponse struct { - // Ingests a new OSV vulnerability and returns it. - IngestOSV IngestOSVIngestOSV `json:"ingestOSV"` +// AllSLSATreeSlsaSLSABuiltByBuilder includes the requested fields of the GraphQL type Builder. +// The GraphQL type's documentation follows. +// +// Builder represents the builder (e.g., FRSCA or GitHub Actions). +// +// Currently builders are identified by the uri field. +type AllSLSATreeSlsaSLSABuiltByBuilder struct { + Id string `json:"id"` + Uri string `json:"uri"` } -// GetIngestOSV returns IngestOSVResponse.IngestOSV, and is useful for accessing the field via an interface. -func (v *IngestOSVResponse) GetIngestOSV() IngestOSVIngestOSV { return v.IngestOSV } +// GetId returns AllSLSATreeSlsaSLSABuiltByBuilder.Id, and is useful for accessing the field via an interface. +func (v *AllSLSATreeSlsaSLSABuiltByBuilder) GetId() string { return v.Id } -// IngestOSVsIngestOSVsOSV includes the requested fields of the GraphQL type OSV. +// GetUri returns AllSLSATreeSlsaSLSABuiltByBuilder.Uri, and is useful for accessing the field via an interface. +func (v *AllSLSATreeSlsaSLSABuiltByBuilder) GetUri() string { return v.Uri } + +// AllSLSATreeSlsaSLSABuiltFromArtifact includes the requested fields of the GraphQL type Artifact. // The GraphQL type's documentation follows. // -// OSV represents an Open Source Vulnerability. -// -// The osvId field is mandatory and canonicalized to be lowercase. +// Artifact represents an artifact identified by a checksum hash. // -// This maps to a vulnerability ID specific to the environment (e.g., GHSA ID or -// CVE ID). +// The checksum is split into the digest value and the algorithm used to generate +// it. Both fields are mandatory and canonicalized to be lowercase. // -// This node can be referred to by other parts of GUAC. -type IngestOSVsIngestOSVsOSV struct { - AllOSVTree `json:"-"` +// If having a checksum Go object, algorithm can be +// strings.ToLower(string(checksum.Algorithm)) and digest can be checksum.Value. +type AllSLSATreeSlsaSLSABuiltFromArtifact struct { + AllArtifactTree `json:"-"` } -// GetId returns IngestOSVsIngestOSVsOSV.Id, and is useful for accessing the field via an interface. -func (v *IngestOSVsIngestOSVsOSV) GetId() string { return v.AllOSVTree.Id } +// GetId returns AllSLSATreeSlsaSLSABuiltFromArtifact.Id, and is useful for accessing the field via an interface. +func (v *AllSLSATreeSlsaSLSABuiltFromArtifact) GetId() string { return v.AllArtifactTree.Id } -// GetOsvId returns IngestOSVsIngestOSVsOSV.OsvId, and is useful for accessing the field via an interface. -func (v *IngestOSVsIngestOSVsOSV) GetOsvId() string { return v.AllOSVTree.OsvId } +// GetAlgorithm returns AllSLSATreeSlsaSLSABuiltFromArtifact.Algorithm, and is useful for accessing the field via an interface. +func (v *AllSLSATreeSlsaSLSABuiltFromArtifact) GetAlgorithm() string { + return v.AllArtifactTree.Algorithm +} -func (v *IngestOSVsIngestOSVsOSV) UnmarshalJSON(b []byte) error { +// GetDigest returns AllSLSATreeSlsaSLSABuiltFromArtifact.Digest, and is useful for accessing the field via an interface. +func (v *AllSLSATreeSlsaSLSABuiltFromArtifact) GetDigest() string { return v.AllArtifactTree.Digest } + +func (v *AllSLSATreeSlsaSLSABuiltFromArtifact) UnmarshalJSON(b []byte) error { if string(b) == "null" { return nil } var firstPass struct { - *IngestOSVsIngestOSVsOSV + *AllSLSATreeSlsaSLSABuiltFromArtifact graphql.NoUnmarshalJSON } - firstPass.IngestOSVsIngestOSVsOSV = v + firstPass.AllSLSATreeSlsaSLSABuiltFromArtifact = v err := json.Unmarshal(b, &firstPass) if err != nil { @@ -5974,20 +5806,22 @@ func (v *IngestOSVsIngestOSVsOSV) UnmarshalJSON(b []byte) error { } err = json.Unmarshal( - b, &v.AllOSVTree) + b, &v.AllArtifactTree) if err != nil { return err } return nil } -type __premarshalIngestOSVsIngestOSVsOSV struct { +type __premarshalAllSLSATreeSlsaSLSABuiltFromArtifact struct { Id string `json:"id"` - OsvId string `json:"osvId"` + Algorithm string `json:"algorithm"` + + Digest string `json:"digest"` } -func (v *IngestOSVsIngestOSVsOSV) MarshalJSON() ([]byte, error) { +func (v *AllSLSATreeSlsaSLSABuiltFromArtifact) MarshalJSON() ([]byte, error) { premarshaled, err := v.__premarshalJSON() if err != nil { return nil, err @@ -5995,66 +5829,88 @@ func (v *IngestOSVsIngestOSVsOSV) MarshalJSON() ([]byte, error) { return json.Marshal(premarshaled) } -func (v *IngestOSVsIngestOSVsOSV) __premarshalJSON() (*__premarshalIngestOSVsIngestOSVsOSV, error) { - var retval __premarshalIngestOSVsIngestOSVsOSV +func (v *AllSLSATreeSlsaSLSABuiltFromArtifact) __premarshalJSON() (*__premarshalAllSLSATreeSlsaSLSABuiltFromArtifact, error) { + var retval __premarshalAllSLSATreeSlsaSLSABuiltFromArtifact - retval.Id = v.AllOSVTree.Id - retval.OsvId = v.AllOSVTree.OsvId + retval.Id = v.AllArtifactTree.Id + retval.Algorithm = v.AllArtifactTree.Algorithm + retval.Digest = v.AllArtifactTree.Digest return &retval, nil } -// IngestOSVsResponse is returned by IngestOSVs on success. -type IngestOSVsResponse struct { - // Bulk ingests new OSVs and returns a list of them. - IngestOSVs []IngestOSVsIngestOSVsOSV `json:"ingestOSVs"` +// AllSLSATreeSlsaSLSASlsaPredicateSLSAPredicate includes the requested fields of the GraphQL type SLSAPredicate. +// The GraphQL type's documentation follows. +// +// SLSAPredicate are the values from the SLSA predicate in key-value pair form. +// +// # For example, given the following predicate +// +// ``` +// "predicate": { +// "buildDefinition": { +// "externalParameters": { +// "repository": "https://github.com/octocat/hello-world", +// ... +// }, +// ... +// }, +// ... +// } +// ``` +// +// we have +// +// ``` +// key = "buildDefinition.externalParameters.repository" +// value = "https://github.com/octocat/hello-world" +// ``` +// +// This node cannot be directly referred by other parts of GUAC. +type AllSLSATreeSlsaSLSASlsaPredicateSLSAPredicate struct { + Key string `json:"key"` + Value string `json:"value"` } -// GetIngestOSVs returns IngestOSVsResponse.IngestOSVs, and is useful for accessing the field via an interface. -func (v *IngestOSVsResponse) GetIngestOSVs() []IngestOSVsIngestOSVsOSV { return v.IngestOSVs } +// GetKey returns AllSLSATreeSlsaSLSASlsaPredicateSLSAPredicate.Key, and is useful for accessing the field via an interface. +func (v *AllSLSATreeSlsaSLSASlsaPredicateSLSAPredicate) GetKey() string { return v.Key } -// IngestPackageIngestPackage includes the requested fields of the GraphQL type Package. +// GetValue returns AllSLSATreeSlsaSLSASlsaPredicateSLSAPredicate.Value, and is useful for accessing the field via an interface. +func (v *AllSLSATreeSlsaSLSASlsaPredicateSLSAPredicate) GetValue() string { return v.Value } + +// AllSLSATreeSubjectArtifact includes the requested fields of the GraphQL type Artifact. // The GraphQL type's documentation follows. // -// Package represents the root of the package trie/tree. -// -// We map package information to a trie, closely matching the pURL specification -// (https://github.com/package-url/purl-spec/blob/0dd92f26f8bb11956ffdf5e8acfcee71e8560407/README.rst), -// but deviating from it where GUAC heuristics allow for better representation of -// package information. Each path in the trie fully represents a package; we split -// the trie based on the pURL components. +// Artifact represents an artifact identified by a checksum hash. // -// This node matches a pkg: partial pURL. The type field matches the -// pURL types but we might also use "guac" for the cases where the pURL -// representation is not complete or when we have custom rules. +// The checksum is split into the digest value and the algorithm used to generate +// it. Both fields are mandatory and canonicalized to be lowercase. // -// Since this node is at the root of the package trie, it is named Package, not -// PackageType. -type IngestPackageIngestPackage struct { - AllPkgTree `json:"-"` +// If having a checksum Go object, algorithm can be +// strings.ToLower(string(checksum.Algorithm)) and digest can be checksum.Value. +type AllSLSATreeSubjectArtifact struct { + AllArtifactTree `json:"-"` } -// GetId returns IngestPackageIngestPackage.Id, and is useful for accessing the field via an interface. -func (v *IngestPackageIngestPackage) GetId() string { return v.AllPkgTree.Id } +// GetId returns AllSLSATreeSubjectArtifact.Id, and is useful for accessing the field via an interface. +func (v *AllSLSATreeSubjectArtifact) GetId() string { return v.AllArtifactTree.Id } -// GetType returns IngestPackageIngestPackage.Type, and is useful for accessing the field via an interface. -func (v *IngestPackageIngestPackage) GetType() string { return v.AllPkgTree.Type } +// GetAlgorithm returns AllSLSATreeSubjectArtifact.Algorithm, and is useful for accessing the field via an interface. +func (v *AllSLSATreeSubjectArtifact) GetAlgorithm() string { return v.AllArtifactTree.Algorithm } -// GetNamespaces returns IngestPackageIngestPackage.Namespaces, and is useful for accessing the field via an interface. -func (v *IngestPackageIngestPackage) GetNamespaces() []AllPkgTreeNamespacesPackageNamespace { - return v.AllPkgTree.Namespaces -} +// GetDigest returns AllSLSATreeSubjectArtifact.Digest, and is useful for accessing the field via an interface. +func (v *AllSLSATreeSubjectArtifact) GetDigest() string { return v.AllArtifactTree.Digest } -func (v *IngestPackageIngestPackage) UnmarshalJSON(b []byte) error { +func (v *AllSLSATreeSubjectArtifact) UnmarshalJSON(b []byte) error { if string(b) == "null" { return nil } var firstPass struct { - *IngestPackageIngestPackage + *AllSLSATreeSubjectArtifact graphql.NoUnmarshalJSON } - firstPass.IngestPackageIngestPackage = v + firstPass.AllSLSATreeSubjectArtifact = v err := json.Unmarshal(b, &firstPass) if err != nil { @@ -6062,22 +5918,22 @@ func (v *IngestPackageIngestPackage) UnmarshalJSON(b []byte) error { } err = json.Unmarshal( - b, &v.AllPkgTree) + b, &v.AllArtifactTree) if err != nil { return err } return nil } -type __premarshalIngestPackageIngestPackage struct { +type __premarshalAllSLSATreeSubjectArtifact struct { Id string `json:"id"` - Type string `json:"type"` + Algorithm string `json:"algorithm"` - Namespaces []AllPkgTreeNamespacesPackageNamespace `json:"namespaces"` + Digest string `json:"digest"` } -func (v *IngestPackageIngestPackage) MarshalJSON() ([]byte, error) { +func (v *AllSLSATreeSubjectArtifact) MarshalJSON() ([]byte, error) { premarshaled, err := v.__premarshalJSON() if err != nil { return nil, err @@ -6085,67 +5941,163 @@ func (v *IngestPackageIngestPackage) MarshalJSON() ([]byte, error) { return json.Marshal(premarshaled) } -func (v *IngestPackageIngestPackage) __premarshalJSON() (*__premarshalIngestPackageIngestPackage, error) { - var retval __premarshalIngestPackageIngestPackage +func (v *AllSLSATreeSubjectArtifact) __premarshalJSON() (*__premarshalAllSLSATreeSubjectArtifact, error) { + var retval __premarshalAllSLSATreeSubjectArtifact - retval.Id = v.AllPkgTree.Id - retval.Type = v.AllPkgTree.Type - retval.Namespaces = v.AllPkgTree.Namespaces + retval.Id = v.AllArtifactTree.Id + retval.Algorithm = v.AllArtifactTree.Algorithm + retval.Digest = v.AllArtifactTree.Digest return &retval, nil } -// IngestPackageResponse is returned by IngestPackage on success. -type IngestPackageResponse struct { - // Ingests a new package and returns the corresponding package trie path. - IngestPackage IngestPackageIngestPackage `json:"ingestPackage"` -} - -// GetIngestPackage returns IngestPackageResponse.IngestPackage, and is useful for accessing the field via an interface. -func (v *IngestPackageResponse) GetIngestPackage() IngestPackageIngestPackage { return v.IngestPackage } - -// IngestPackagesIngestPackagesPackage includes the requested fields of the GraphQL type Package. +// AllSourceTree includes the GraphQL fields of Source requested by the fragment AllSourceTree. // The GraphQL type's documentation follows. // -// Package represents the root of the package trie/tree. +// Source represents the root of the source trie/tree. // -// We map package information to a trie, closely matching the pURL specification -// (https://github.com/package-url/purl-spec/blob/0dd92f26f8bb11956ffdf5e8acfcee71e8560407/README.rst), -// but deviating from it where GUAC heuristics allow for better representation of -// package information. Each path in the trie fully represents a package; we split -// the trie based on the pURL components. +// We map source information to a trie, as a derivative of the pURL specification: +// each path in the trie represents a type, namespace, name and an optional +// qualifier that stands for tag/commit information. // -// This node matches a pkg: partial pURL. The type field matches the -// pURL types but we might also use "guac" for the cases where the pURL -// representation is not complete or when we have custom rules. +// This node represents the type part of the trie path. It is used to represent +// the version control system that is being used. // -// Since this node is at the root of the package trie, it is named Package, not -// PackageType. -type IngestPackagesIngestPackagesPackage struct { - AllPkgTree `json:"-"` -} - -// GetId returns IngestPackagesIngestPackagesPackage.Id, and is useful for accessing the field via an interface. -func (v *IngestPackagesIngestPackagesPackage) GetId() string { return v.AllPkgTree.Id } +// Since this node is at the root of the source trie, it is named Source, not +// SourceType. +type AllSourceTree struct { + Id string `json:"id"` + Type string `json:"type"` + Namespaces []AllSourceTreeNamespacesSourceNamespace `json:"namespaces"` +} -// GetType returns IngestPackagesIngestPackagesPackage.Type, and is useful for accessing the field via an interface. -func (v *IngestPackagesIngestPackagesPackage) GetType() string { return v.AllPkgTree.Type } +// GetId returns AllSourceTree.Id, and is useful for accessing the field via an interface. +func (v *AllSourceTree) GetId() string { return v.Id } -// GetNamespaces returns IngestPackagesIngestPackagesPackage.Namespaces, and is useful for accessing the field via an interface. -func (v *IngestPackagesIngestPackagesPackage) GetNamespaces() []AllPkgTreeNamespacesPackageNamespace { - return v.AllPkgTree.Namespaces +// GetType returns AllSourceTree.Type, and is useful for accessing the field via an interface. +func (v *AllSourceTree) GetType() string { return v.Type } + +// GetNamespaces returns AllSourceTree.Namespaces, and is useful for accessing the field via an interface. +func (v *AllSourceTree) GetNamespaces() []AllSourceTreeNamespacesSourceNamespace { return v.Namespaces } + +// AllSourceTreeNamespacesSourceNamespace includes the requested fields of the GraphQL type SourceNamespace. +// The GraphQL type's documentation follows. +// +// SourceNamespace is a namespace for sources. +// +// This is the location of the repository (such as github/gitlab/bitbucket). +// +// The namespace field is mandatory. +type AllSourceTreeNamespacesSourceNamespace struct { + Id string `json:"id"` + Namespace string `json:"namespace"` + Names []AllSourceTreeNamespacesSourceNamespaceNamesSourceName `json:"names"` } -func (v *IngestPackagesIngestPackagesPackage) UnmarshalJSON(b []byte) error { +// GetId returns AllSourceTreeNamespacesSourceNamespace.Id, and is useful for accessing the field via an interface. +func (v *AllSourceTreeNamespacesSourceNamespace) GetId() string { return v.Id } + +// GetNamespace returns AllSourceTreeNamespacesSourceNamespace.Namespace, and is useful for accessing the field via an interface. +func (v *AllSourceTreeNamespacesSourceNamespace) GetNamespace() string { return v.Namespace } + +// GetNames returns AllSourceTreeNamespacesSourceNamespace.Names, and is useful for accessing the field via an interface. +func (v *AllSourceTreeNamespacesSourceNamespace) GetNames() []AllSourceTreeNamespacesSourceNamespaceNamesSourceName { + return v.Names +} + +// AllSourceTreeNamespacesSourceNamespaceNamesSourceName includes the requested fields of the GraphQL type SourceName. +// The GraphQL type's documentation follows. +// +// SourceName represents the url of the repository. +// +// The name field is mandatory. The tag and commit fields are optional, but it is +// an error to specify both. +// +// This is the only source trie node that can be referenced by other parts of GUAC. +type AllSourceTreeNamespacesSourceNamespaceNamesSourceName struct { + Id string `json:"id"` + Name string `json:"name"` + Tag *string `json:"tag"` + Commit *string `json:"commit"` +} + +// GetId returns AllSourceTreeNamespacesSourceNamespaceNamesSourceName.Id, and is useful for accessing the field via an interface. +func (v *AllSourceTreeNamespacesSourceNamespaceNamesSourceName) GetId() string { return v.Id } + +// GetName returns AllSourceTreeNamespacesSourceNamespaceNamesSourceName.Name, and is useful for accessing the field via an interface. +func (v *AllSourceTreeNamespacesSourceNamespaceNamesSourceName) GetName() string { return v.Name } + +// GetTag returns AllSourceTreeNamespacesSourceNamespaceNamesSourceName.Tag, and is useful for accessing the field via an interface. +func (v *AllSourceTreeNamespacesSourceNamespaceNamesSourceName) GetTag() *string { return v.Tag } + +// GetCommit returns AllSourceTreeNamespacesSourceNamespaceNamesSourceName.Commit, and is useful for accessing the field via an interface. +func (v *AllSourceTreeNamespacesSourceNamespaceNamesSourceName) GetCommit() *string { return v.Commit } + +// ArtifactInputSpec specifies an artifact for mutations. +// +// The checksum fields are canonicalized to be lowercase. +type ArtifactInputSpec struct { + Algorithm string `json:"algorithm"` + Digest string `json:"digest"` +} + +// GetAlgorithm returns ArtifactInputSpec.Algorithm, and is useful for accessing the field via an interface. +func (v *ArtifactInputSpec) GetAlgorithm() string { return v.Algorithm } + +// GetDigest returns ArtifactInputSpec.Digest, and is useful for accessing the field via an interface. +func (v *ArtifactInputSpec) GetDigest() string { return v.Digest } + +// ArtifactSpec allows filtering the list of artifacts to return in a query. +// +// The checksum fields are canonicalized to be lowercase. +type ArtifactSpec struct { + Id *string `json:"id"` + Algorithm *string `json:"algorithm"` + Digest *string `json:"digest"` +} + +// GetId returns ArtifactSpec.Id, and is useful for accessing the field via an interface. +func (v *ArtifactSpec) GetId() *string { return v.Id } + +// GetAlgorithm returns ArtifactSpec.Algorithm, and is useful for accessing the field via an interface. +func (v *ArtifactSpec) GetAlgorithm() *string { return v.Algorithm } + +// GetDigest returns ArtifactSpec.Digest, and is useful for accessing the field via an interface. +func (v *ArtifactSpec) GetDigest() *string { return v.Digest } + +// ArtifactsArtifactsArtifact includes the requested fields of the GraphQL type Artifact. +// The GraphQL type's documentation follows. +// +// Artifact represents an artifact identified by a checksum hash. +// +// The checksum is split into the digest value and the algorithm used to generate +// it. Both fields are mandatory and canonicalized to be lowercase. +// +// If having a checksum Go object, algorithm can be +// strings.ToLower(string(checksum.Algorithm)) and digest can be checksum.Value. +type ArtifactsArtifactsArtifact struct { + AllArtifactTree `json:"-"` +} + +// GetId returns ArtifactsArtifactsArtifact.Id, and is useful for accessing the field via an interface. +func (v *ArtifactsArtifactsArtifact) GetId() string { return v.AllArtifactTree.Id } + +// GetAlgorithm returns ArtifactsArtifactsArtifact.Algorithm, and is useful for accessing the field via an interface. +func (v *ArtifactsArtifactsArtifact) GetAlgorithm() string { return v.AllArtifactTree.Algorithm } + +// GetDigest returns ArtifactsArtifactsArtifact.Digest, and is useful for accessing the field via an interface. +func (v *ArtifactsArtifactsArtifact) GetDigest() string { return v.AllArtifactTree.Digest } + +func (v *ArtifactsArtifactsArtifact) UnmarshalJSON(b []byte) error { if string(b) == "null" { return nil } var firstPass struct { - *IngestPackagesIngestPackagesPackage + *ArtifactsArtifactsArtifact graphql.NoUnmarshalJSON } - firstPass.IngestPackagesIngestPackagesPackage = v + firstPass.ArtifactsArtifactsArtifact = v err := json.Unmarshal(b, &firstPass) if err != nil { @@ -6153,22 +6105,22 @@ func (v *IngestPackagesIngestPackagesPackage) UnmarshalJSON(b []byte) error { } err = json.Unmarshal( - b, &v.AllPkgTree) + b, &v.AllArtifactTree) if err != nil { return err } return nil } -type __premarshalIngestPackagesIngestPackagesPackage struct { +type __premarshalArtifactsArtifactsArtifact struct { Id string `json:"id"` - Type string `json:"type"` + Algorithm string `json:"algorithm"` - Namespaces []AllPkgTreeNamespacesPackageNamespace `json:"namespaces"` + Digest string `json:"digest"` } -func (v *IngestPackagesIngestPackagesPackage) MarshalJSON() ([]byte, error) { +func (v *ArtifactsArtifactsArtifact) MarshalJSON() ([]byte, error) { premarshaled, err := v.__premarshalJSON() if err != nil { return nil, err @@ -6176,66 +6128,97 @@ func (v *IngestPackagesIngestPackagesPackage) MarshalJSON() ([]byte, error) { return json.Marshal(premarshaled) } -func (v *IngestPackagesIngestPackagesPackage) __premarshalJSON() (*__premarshalIngestPackagesIngestPackagesPackage, error) { - var retval __premarshalIngestPackagesIngestPackagesPackage +func (v *ArtifactsArtifactsArtifact) __premarshalJSON() (*__premarshalArtifactsArtifactsArtifact, error) { + var retval __premarshalArtifactsArtifactsArtifact - retval.Id = v.AllPkgTree.Id - retval.Type = v.AllPkgTree.Type - retval.Namespaces = v.AllPkgTree.Namespaces + retval.Id = v.AllArtifactTree.Id + retval.Algorithm = v.AllArtifactTree.Algorithm + retval.Digest = v.AllArtifactTree.Digest return &retval, nil } -// IngestPackagesResponse is returned by IngestPackages on success. -type IngestPackagesResponse struct { - // Bulk ingests packages and returns the list of corresponding package trie path. - IngestPackages []IngestPackagesIngestPackagesPackage `json:"ingestPackages"` +// ArtifactsResponse is returned by Artifacts on success. +type ArtifactsResponse struct { + // Returns all artifacts matching a filter. + Artifacts []ArtifactsArtifactsArtifact `json:"artifacts"` } -// GetIngestPackages returns IngestPackagesResponse.IngestPackages, and is useful for accessing the field via an interface. -func (v *IngestPackagesResponse) GetIngestPackages() []IngestPackagesIngestPackagesPackage { - return v.IngestPackages +// GetArtifacts returns ArtifactsResponse.Artifacts, and is useful for accessing the field via an interface. +func (v *ArtifactsResponse) GetArtifacts() []ArtifactsArtifactsArtifact { return v.Artifacts } + +// BuilderInputSpec specifies a builder for mutations. +type BuilderInputSpec struct { + Uri string `json:"uri"` } -// IngestSourceIngestSource includes the requested fields of the GraphQL type Source. +// GetUri returns BuilderInputSpec.Uri, and is useful for accessing the field via an interface. +func (v *BuilderInputSpec) GetUri() string { return v.Uri } + +// CVEInputSpec specifies a CVE vulnerability for mutations. +type CVEInputSpec struct { + Year int `json:"year"` + CveId string `json:"cveId"` +} + +// GetYear returns CVEInputSpec.Year, and is useful for accessing the field via an interface. +func (v *CVEInputSpec) GetYear() int { return v.Year } + +// GetCveId returns CVEInputSpec.CveId, and is useful for accessing the field via an interface. +func (v *CVEInputSpec) GetCveId() string { return v.CveId } + +// CVESpec allows filtering the list of advisories to return in a query. +type CVESpec struct { + Id *string `json:"id"` + Year *int `json:"year"` + CveId *string `json:"cveId"` +} + +// GetId returns CVESpec.Id, and is useful for accessing the field via an interface. +func (v *CVESpec) GetId() *string { return v.Id } + +// GetYear returns CVESpec.Year, and is useful for accessing the field via an interface. +func (v *CVESpec) GetYear() *int { return v.Year } + +// GetCveId returns CVESpec.CveId, and is useful for accessing the field via an interface. +func (v *CVESpec) GetCveId() *string { return v.CveId } + +// CVEsCveCVE includes the requested fields of the GraphQL type CVE. // The GraphQL type's documentation follows. // -// Source represents the root of the source trie/tree. +// CVE represents a vulnerability in the Common Vulnerabilities and Exposures +// schema. // -// We map source information to a trie, as a derivative of the pURL specification: -// each path in the trie represents a type, namespace, name and an optional -// qualifier that stands for tag/commit information. +// The vulnerability identifier contains a year field, so we are extracting that +// to allow matching for vulnerabilities found in a given year. // -// This node represents the type part of the trie path. It is used to represent -// the version control system that is being used. +// The vulnerability identifier field is mandatory and canonicalized to be +// lowercase. // -// Since this node is at the root of the source trie, it is named Source, not -// SourceType. -type IngestSourceIngestSource struct { - AllSourceTree `json:"-"` +// This node can be referred to by other parts of GUAC. +type CVEsCveCVE struct { + AllCveTree `json:"-"` } -// GetId returns IngestSourceIngestSource.Id, and is useful for accessing the field via an interface. -func (v *IngestSourceIngestSource) GetId() string { return v.AllSourceTree.Id } +// GetId returns CVEsCveCVE.Id, and is useful for accessing the field via an interface. +func (v *CVEsCveCVE) GetId() string { return v.AllCveTree.Id } -// GetType returns IngestSourceIngestSource.Type, and is useful for accessing the field via an interface. -func (v *IngestSourceIngestSource) GetType() string { return v.AllSourceTree.Type } +// GetYear returns CVEsCveCVE.Year, and is useful for accessing the field via an interface. +func (v *CVEsCveCVE) GetYear() int { return v.AllCveTree.Year } -// GetNamespaces returns IngestSourceIngestSource.Namespaces, and is useful for accessing the field via an interface. -func (v *IngestSourceIngestSource) GetNamespaces() []AllSourceTreeNamespacesSourceNamespace { - return v.AllSourceTree.Namespaces -} +// GetCveId returns CVEsCveCVE.CveId, and is useful for accessing the field via an interface. +func (v *CVEsCveCVE) GetCveId() string { return v.AllCveTree.CveId } -func (v *IngestSourceIngestSource) UnmarshalJSON(b []byte) error { +func (v *CVEsCveCVE) UnmarshalJSON(b []byte) error { if string(b) == "null" { return nil } var firstPass struct { - *IngestSourceIngestSource + *CVEsCveCVE graphql.NoUnmarshalJSON } - firstPass.IngestSourceIngestSource = v + firstPass.CVEsCveCVE = v err := json.Unmarshal(b, &firstPass) if err != nil { @@ -6243,22 +6226,22 @@ func (v *IngestSourceIngestSource) UnmarshalJSON(b []byte) error { } err = json.Unmarshal( - b, &v.AllSourceTree) + b, &v.AllCveTree) if err != nil { return err } return nil } -type __premarshalIngestSourceIngestSource struct { +type __premarshalCVEsCveCVE struct { Id string `json:"id"` - Type string `json:"type"` + Year int `json:"year"` - Namespaces []AllSourceTreeNamespacesSourceNamespace `json:"namespaces"` + CveId string `json:"cveId"` } -func (v *IngestSourceIngestSource) MarshalJSON() ([]byte, error) { +func (v *CVEsCveCVE) MarshalJSON() ([]byte, error) { premarshaled, err := v.__premarshalJSON() if err != nil { return nil, err @@ -6266,64 +6249,72 @@ func (v *IngestSourceIngestSource) MarshalJSON() ([]byte, error) { return json.Marshal(premarshaled) } -func (v *IngestSourceIngestSource) __premarshalJSON() (*__premarshalIngestSourceIngestSource, error) { - var retval __premarshalIngestSourceIngestSource - - retval.Id = v.AllSourceTree.Id - retval.Type = v.AllSourceTree.Type - retval.Namespaces = v.AllSourceTree.Namespaces +func (v *CVEsCveCVE) __premarshalJSON() (*__premarshalCVEsCveCVE, error) { + var retval __premarshalCVEsCveCVE + + retval.Id = v.AllCveTree.Id + retval.Year = v.AllCveTree.Year + retval.CveId = v.AllCveTree.CveId return &retval, nil } -// IngestSourceResponse is returned by IngestSource on success. -type IngestSourceResponse struct { - // Ingests a new source and returns the corresponding source trie path. - IngestSource IngestSourceIngestSource `json:"ingestSource"` +// CVEsResponse is returned by CVEs on success. +type CVEsResponse struct { + // Returns all CVEs matching a filter. + Cve []CVEsCveCVE `json:"cve"` } -// GetIngestSource returns IngestSourceResponse.IngestSource, and is useful for accessing the field via an interface. -func (v *IngestSourceResponse) GetIngestSource() IngestSourceIngestSource { return v.IngestSource } +// GetCve returns CVEsResponse.Cve, and is useful for accessing the field via an interface. +func (v *CVEsResponse) GetCve() []CVEsCveCVE { return v.Cve } -// IngestSourcesIngestSourcesSource includes the requested fields of the GraphQL type Source. +// CertifyBadArtifactIngestCertifyBad includes the requested fields of the GraphQL type CertifyBad. // The GraphQL type's documentation follows. // -// Source represents the root of the source trie/tree. -// -// We map source information to a trie, as a derivative of the pURL specification: -// each path in the trie represents a type, namespace, name and an optional -// qualifier that stands for tag/commit information. +// CertifyBad is an attestation that a package, source, or artifact is considered +// bad. // -// This node represents the type part of the trie path. It is used to represent -// the version control system that is being used. +// All evidence trees record a justification for the property they represent as +// well as the document that contains the attestation (origin) and the collector +// that collected the document (collector). // -// Since this node is at the root of the source trie, it is named Source, not -// SourceType. -type IngestSourcesIngestSourcesSource struct { - AllSourceTree `json:"-"` +// The certification applies to a subject which is a package, source, or artifact. +// If the attestation targets a package, it must target a PackageName or a +// PackageVersion. If the attestation targets a source, it must target a +// SourceName. +type CertifyBadArtifactIngestCertifyBad struct { + AllCertifyBad `json:"-"` } -// GetId returns IngestSourcesIngestSourcesSource.Id, and is useful for accessing the field via an interface. -func (v *IngestSourcesIngestSourcesSource) GetId() string { return v.AllSourceTree.Id } +// GetId returns CertifyBadArtifactIngestCertifyBad.Id, and is useful for accessing the field via an interface. +func (v *CertifyBadArtifactIngestCertifyBad) GetId() string { return v.AllCertifyBad.Id } -// GetType returns IngestSourcesIngestSourcesSource.Type, and is useful for accessing the field via an interface. -func (v *IngestSourcesIngestSourcesSource) GetType() string { return v.AllSourceTree.Type } +// GetJustification returns CertifyBadArtifactIngestCertifyBad.Justification, and is useful for accessing the field via an interface. +func (v *CertifyBadArtifactIngestCertifyBad) GetJustification() string { + return v.AllCertifyBad.Justification +} -// GetNamespaces returns IngestSourcesIngestSourcesSource.Namespaces, and is useful for accessing the field via an interface. -func (v *IngestSourcesIngestSourcesSource) GetNamespaces() []AllSourceTreeNamespacesSourceNamespace { - return v.AllSourceTree.Namespaces +// GetSubject returns CertifyBadArtifactIngestCertifyBad.Subject, and is useful for accessing the field via an interface. +func (v *CertifyBadArtifactIngestCertifyBad) GetSubject() AllCertifyBadSubjectPackageSourceOrArtifact { + return v.AllCertifyBad.Subject } -func (v *IngestSourcesIngestSourcesSource) UnmarshalJSON(b []byte) error { +// GetOrigin returns CertifyBadArtifactIngestCertifyBad.Origin, and is useful for accessing the field via an interface. +func (v *CertifyBadArtifactIngestCertifyBad) GetOrigin() string { return v.AllCertifyBad.Origin } + +// GetCollector returns CertifyBadArtifactIngestCertifyBad.Collector, and is useful for accessing the field via an interface. +func (v *CertifyBadArtifactIngestCertifyBad) GetCollector() string { return v.AllCertifyBad.Collector } + +func (v *CertifyBadArtifactIngestCertifyBad) UnmarshalJSON(b []byte) error { if string(b) == "null" { return nil } var firstPass struct { - *IngestSourcesIngestSourcesSource + *CertifyBadArtifactIngestCertifyBad graphql.NoUnmarshalJSON } - firstPass.IngestSourcesIngestSourcesSource = v + firstPass.CertifyBadArtifactIngestCertifyBad = v err := json.Unmarshal(b, &firstPass) if err != nil { @@ -6331,22 +6322,26 @@ func (v *IngestSourcesIngestSourcesSource) UnmarshalJSON(b []byte) error { } err = json.Unmarshal( - b, &v.AllSourceTree) + b, &v.AllCertifyBad) if err != nil { return err } return nil } -type __premarshalIngestSourcesIngestSourcesSource struct { +type __premarshalCertifyBadArtifactIngestCertifyBad struct { Id string `json:"id"` - Type string `json:"type"` + Justification string `json:"justification"` - Namespaces []AllSourceTreeNamespacesSourceNamespace `json:"namespaces"` + Subject json.RawMessage `json:"subject"` + + Origin string `json:"origin"` + + Collector string `json:"collector"` } -func (v *IngestSourcesIngestSourcesSource) MarshalJSON() ([]byte, error) { +func (v *CertifyBadArtifactIngestCertifyBad) MarshalJSON() ([]byte, error) { premarshaled, err := v.__premarshalJSON() if err != nil { return nil, err @@ -6354,85 +6349,104 @@ func (v *IngestSourcesIngestSourcesSource) MarshalJSON() ([]byte, error) { return json.Marshal(premarshaled) } -func (v *IngestSourcesIngestSourcesSource) __premarshalJSON() (*__premarshalIngestSourcesIngestSourcesSource, error) { - var retval __premarshalIngestSourcesIngestSourcesSource +func (v *CertifyBadArtifactIngestCertifyBad) __premarshalJSON() (*__premarshalCertifyBadArtifactIngestCertifyBad, error) { + var retval __premarshalCertifyBadArtifactIngestCertifyBad - retval.Id = v.AllSourceTree.Id - retval.Type = v.AllSourceTree.Type - retval.Namespaces = v.AllSourceTree.Namespaces + retval.Id = v.AllCertifyBad.Id + retval.Justification = v.AllCertifyBad.Justification + { + + dst := &retval.Subject + src := v.AllCertifyBad.Subject + var err error + *dst, err = __marshalAllCertifyBadSubjectPackageSourceOrArtifact( + &src) + if err != nil { + return nil, fmt.Errorf( + "unable to marshal CertifyBadArtifactIngestCertifyBad.AllCertifyBad.Subject: %w", err) + } + } + retval.Origin = v.AllCertifyBad.Origin + retval.Collector = v.AllCertifyBad.Collector return &retval, nil } -// IngestSourcesResponse is returned by IngestSources on success. -type IngestSourcesResponse struct { - // Bulk ingests sources and returns the list of corresponding source trie path. - IngestSources []IngestSourcesIngestSourcesSource `json:"ingestSources"` +// CertifyBadArtifactResponse is returned by CertifyBadArtifact on success. +type CertifyBadArtifactResponse struct { + // Adds a certification that a package, source or artifact is considered bad. + IngestCertifyBad CertifyBadArtifactIngestCertifyBad `json:"ingestCertifyBad"` } -// GetIngestSources returns IngestSourcesResponse.IngestSources, and is useful for accessing the field via an interface. -func (v *IngestSourcesResponse) GetIngestSources() []IngestSourcesIngestSourcesSource { - return v.IngestSources +// GetIngestCertifyBad returns CertifyBadArtifactResponse.IngestCertifyBad, and is useful for accessing the field via an interface. +func (v *CertifyBadArtifactResponse) GetIngestCertifyBad() CertifyBadArtifactIngestCertifyBad { + return v.IngestCertifyBad } -// IsDependenciesIngestDependenciesIsDependency includes the requested fields of the GraphQL type IsDependency. -// The GraphQL type's documentation follows. -// -// IsDependency is an attestation to record that a package depends on another. -type IsDependenciesIngestDependenciesIsDependency struct { - allIsDependencyTree `json:"-"` +// CertifyBadInputSpec represents the mutation input to ingest a CertifyBad +// evidence. +type CertifyBadInputSpec struct { + Justification string `json:"justification"` + Origin string `json:"origin"` + Collector string `json:"collector"` } -// GetId returns IsDependenciesIngestDependenciesIsDependency.Id, and is useful for accessing the field via an interface. -func (v *IsDependenciesIngestDependenciesIsDependency) GetId() string { - return v.allIsDependencyTree.Id -} +// GetJustification returns CertifyBadInputSpec.Justification, and is useful for accessing the field via an interface. +func (v *CertifyBadInputSpec) GetJustification() string { return v.Justification } -// GetJustification returns IsDependenciesIngestDependenciesIsDependency.Justification, and is useful for accessing the field via an interface. -func (v *IsDependenciesIngestDependenciesIsDependency) GetJustification() string { - return v.allIsDependencyTree.Justification -} +// GetOrigin returns CertifyBadInputSpec.Origin, and is useful for accessing the field via an interface. +func (v *CertifyBadInputSpec) GetOrigin() string { return v.Origin } -// GetPackage returns IsDependenciesIngestDependenciesIsDependency.Package, and is useful for accessing the field via an interface. -func (v *IsDependenciesIngestDependenciesIsDependency) GetPackage() allIsDependencyTreePackage { - return v.allIsDependencyTree.Package -} +// GetCollector returns CertifyBadInputSpec.Collector, and is useful for accessing the field via an interface. +func (v *CertifyBadInputSpec) GetCollector() string { return v.Collector } -// GetDependentPackage returns IsDependenciesIngestDependenciesIsDependency.DependentPackage, and is useful for accessing the field via an interface. -func (v *IsDependenciesIngestDependenciesIsDependency) GetDependentPackage() allIsDependencyTreeDependentPackage { - return v.allIsDependencyTree.DependentPackage +// CertifyBadPkgIngestCertifyBad includes the requested fields of the GraphQL type CertifyBad. +// The GraphQL type's documentation follows. +// +// CertifyBad is an attestation that a package, source, or artifact is considered +// bad. +// +// All evidence trees record a justification for the property they represent as +// well as the document that contains the attestation (origin) and the collector +// that collected the document (collector). +// +// The certification applies to a subject which is a package, source, or artifact. +// If the attestation targets a package, it must target a PackageName or a +// PackageVersion. If the attestation targets a source, it must target a +// SourceName. +type CertifyBadPkgIngestCertifyBad struct { + AllCertifyBad `json:"-"` } -// GetDependencyType returns IsDependenciesIngestDependenciesIsDependency.DependencyType, and is useful for accessing the field via an interface. -func (v *IsDependenciesIngestDependenciesIsDependency) GetDependencyType() DependencyType { - return v.allIsDependencyTree.DependencyType -} +// GetId returns CertifyBadPkgIngestCertifyBad.Id, and is useful for accessing the field via an interface. +func (v *CertifyBadPkgIngestCertifyBad) GetId() string { return v.AllCertifyBad.Id } -// GetVersionRange returns IsDependenciesIngestDependenciesIsDependency.VersionRange, and is useful for accessing the field via an interface. -func (v *IsDependenciesIngestDependenciesIsDependency) GetVersionRange() string { - return v.allIsDependencyTree.VersionRange +// GetJustification returns CertifyBadPkgIngestCertifyBad.Justification, and is useful for accessing the field via an interface. +func (v *CertifyBadPkgIngestCertifyBad) GetJustification() string { + return v.AllCertifyBad.Justification } -// GetOrigin returns IsDependenciesIngestDependenciesIsDependency.Origin, and is useful for accessing the field via an interface. -func (v *IsDependenciesIngestDependenciesIsDependency) GetOrigin() string { - return v.allIsDependencyTree.Origin +// GetSubject returns CertifyBadPkgIngestCertifyBad.Subject, and is useful for accessing the field via an interface. +func (v *CertifyBadPkgIngestCertifyBad) GetSubject() AllCertifyBadSubjectPackageSourceOrArtifact { + return v.AllCertifyBad.Subject } -// GetCollector returns IsDependenciesIngestDependenciesIsDependency.Collector, and is useful for accessing the field via an interface. -func (v *IsDependenciesIngestDependenciesIsDependency) GetCollector() string { - return v.allIsDependencyTree.Collector -} +// GetOrigin returns CertifyBadPkgIngestCertifyBad.Origin, and is useful for accessing the field via an interface. +func (v *CertifyBadPkgIngestCertifyBad) GetOrigin() string { return v.AllCertifyBad.Origin } -func (v *IsDependenciesIngestDependenciesIsDependency) UnmarshalJSON(b []byte) error { +// GetCollector returns CertifyBadPkgIngestCertifyBad.Collector, and is useful for accessing the field via an interface. +func (v *CertifyBadPkgIngestCertifyBad) GetCollector() string { return v.AllCertifyBad.Collector } + +func (v *CertifyBadPkgIngestCertifyBad) UnmarshalJSON(b []byte) error { if string(b) == "null" { return nil } var firstPass struct { - *IsDependenciesIngestDependenciesIsDependency + *CertifyBadPkgIngestCertifyBad graphql.NoUnmarshalJSON } - firstPass.IsDependenciesIngestDependenciesIsDependency = v + firstPass.CertifyBadPkgIngestCertifyBad = v err := json.Unmarshal(b, &firstPass) if err != nil { @@ -6440,32 +6454,26 @@ func (v *IsDependenciesIngestDependenciesIsDependency) UnmarshalJSON(b []byte) e } err = json.Unmarshal( - b, &v.allIsDependencyTree) + b, &v.AllCertifyBad) if err != nil { return err } return nil } -type __premarshalIsDependenciesIngestDependenciesIsDependency struct { +type __premarshalCertifyBadPkgIngestCertifyBad struct { Id string `json:"id"` Justification string `json:"justification"` - Package allIsDependencyTreePackage `json:"package"` - - DependentPackage allIsDependencyTreeDependentPackage `json:"dependentPackage"` - - DependencyType DependencyType `json:"dependencyType"` - - VersionRange string `json:"versionRange"` + Subject json.RawMessage `json:"subject"` Origin string `json:"origin"` Collector string `json:"collector"` } -func (v *IsDependenciesIngestDependenciesIsDependency) MarshalJSON() ([]byte, error) { +func (v *CertifyBadPkgIngestCertifyBad) MarshalJSON() ([]byte, error) { premarshaled, err := v.__premarshalJSON() if err != nil { return nil, err @@ -6473,88 +6481,119 @@ func (v *IsDependenciesIngestDependenciesIsDependency) MarshalJSON() ([]byte, er return json.Marshal(premarshaled) } -func (v *IsDependenciesIngestDependenciesIsDependency) __premarshalJSON() (*__premarshalIsDependenciesIngestDependenciesIsDependency, error) { - var retval __premarshalIsDependenciesIngestDependenciesIsDependency +func (v *CertifyBadPkgIngestCertifyBad) __premarshalJSON() (*__premarshalCertifyBadPkgIngestCertifyBad, error) { + var retval __premarshalCertifyBadPkgIngestCertifyBad + + retval.Id = v.AllCertifyBad.Id + retval.Justification = v.AllCertifyBad.Justification + { - retval.Id = v.allIsDependencyTree.Id - retval.Justification = v.allIsDependencyTree.Justification - retval.Package = v.allIsDependencyTree.Package - retval.DependentPackage = v.allIsDependencyTree.DependentPackage - retval.DependencyType = v.allIsDependencyTree.DependencyType - retval.VersionRange = v.allIsDependencyTree.VersionRange - retval.Origin = v.allIsDependencyTree.Origin - retval.Collector = v.allIsDependencyTree.Collector + dst := &retval.Subject + src := v.AllCertifyBad.Subject + var err error + *dst, err = __marshalAllCertifyBadSubjectPackageSourceOrArtifact( + &src) + if err != nil { + return nil, fmt.Errorf( + "unable to marshal CertifyBadPkgIngestCertifyBad.AllCertifyBad.Subject: %w", err) + } + } + retval.Origin = v.AllCertifyBad.Origin + retval.Collector = v.AllCertifyBad.Collector return &retval, nil } -// IsDependenciesResponse is returned by IsDependencies on success. -type IsDependenciesResponse struct { - // Bulk adds a dependency between two packages - IngestDependencies []IsDependenciesIngestDependenciesIsDependency `json:"ingestDependencies"` +// CertifyBadPkgResponse is returned by CertifyBadPkg on success. +type CertifyBadPkgResponse struct { + // Adds a certification that a package, source or artifact is considered bad. + IngestCertifyBad CertifyBadPkgIngestCertifyBad `json:"ingestCertifyBad"` } -// GetIngestDependencies returns IsDependenciesResponse.IngestDependencies, and is useful for accessing the field via an interface. -func (v *IsDependenciesResponse) GetIngestDependencies() []IsDependenciesIngestDependenciesIsDependency { - return v.IngestDependencies +// GetIngestCertifyBad returns CertifyBadPkgResponse.IngestCertifyBad, and is useful for accessing the field via an interface. +func (v *CertifyBadPkgResponse) GetIngestCertifyBad() CertifyBadPkgIngestCertifyBad { + return v.IngestCertifyBad } -// IsDependencyIngestDependencyIsDependency includes the requested fields of the GraphQL type IsDependency. -// The GraphQL type's documentation follows. +// CertifyBadSpec allows filtering the list of CertifyBad evidence to return in a +// query. // -// IsDependency is an attestation to record that a package depends on another. -type IsDependencyIngestDependencyIsDependency struct { - allIsDependencyTree `json:"-"` -} - -// GetId returns IsDependencyIngestDependencyIsDependency.Id, and is useful for accessing the field via an interface. -func (v *IsDependencyIngestDependencyIsDependency) GetId() string { return v.allIsDependencyTree.Id } - -// GetJustification returns IsDependencyIngestDependencyIsDependency.Justification, and is useful for accessing the field via an interface. -func (v *IsDependencyIngestDependencyIsDependency) GetJustification() string { - return v.allIsDependencyTree.Justification -} - -// GetPackage returns IsDependencyIngestDependencyIsDependency.Package, and is useful for accessing the field via an interface. -func (v *IsDependencyIngestDependencyIsDependency) GetPackage() allIsDependencyTreePackage { - return v.allIsDependencyTree.Package -} - -// GetDependentPackage returns IsDependencyIngestDependencyIsDependency.DependentPackage, and is useful for accessing the field via an interface. -func (v *IsDependencyIngestDependencyIsDependency) GetDependentPackage() allIsDependencyTreeDependentPackage { - return v.allIsDependencyTree.DependentPackage +// If a package is specified in the subject filter, then it must be specified up +// to PackageName or PackageVersion. That is, user must specify package name, or +// name and one of version, qualifiers, or subpath. +// +// If a source is specified in the subject filter, then it must specify a name, +// and optionally a tag and a commit. +type CertifyBadSpec struct { + Id *string `json:"id"` + Subject *PackageSourceOrArtifactSpec `json:"subject"` + Justification *string `json:"justification"` + Origin *string `json:"origin"` + Collector *string `json:"collector"` } -// GetDependencyType returns IsDependencyIngestDependencyIsDependency.DependencyType, and is useful for accessing the field via an interface. -func (v *IsDependencyIngestDependencyIsDependency) GetDependencyType() DependencyType { - return v.allIsDependencyTree.DependencyType -} +// GetId returns CertifyBadSpec.Id, and is useful for accessing the field via an interface. +func (v *CertifyBadSpec) GetId() *string { return v.Id } -// GetVersionRange returns IsDependencyIngestDependencyIsDependency.VersionRange, and is useful for accessing the field via an interface. -func (v *IsDependencyIngestDependencyIsDependency) GetVersionRange() string { - return v.allIsDependencyTree.VersionRange +// GetSubject returns CertifyBadSpec.Subject, and is useful for accessing the field via an interface. +func (v *CertifyBadSpec) GetSubject() *PackageSourceOrArtifactSpec { return v.Subject } + +// GetJustification returns CertifyBadSpec.Justification, and is useful for accessing the field via an interface. +func (v *CertifyBadSpec) GetJustification() *string { return v.Justification } + +// GetOrigin returns CertifyBadSpec.Origin, and is useful for accessing the field via an interface. +func (v *CertifyBadSpec) GetOrigin() *string { return v.Origin } + +// GetCollector returns CertifyBadSpec.Collector, and is useful for accessing the field via an interface. +func (v *CertifyBadSpec) GetCollector() *string { return v.Collector } + +// CertifyBadSrcIngestCertifyBad includes the requested fields of the GraphQL type CertifyBad. +// The GraphQL type's documentation follows. +// +// CertifyBad is an attestation that a package, source, or artifact is considered +// bad. +// +// All evidence trees record a justification for the property they represent as +// well as the document that contains the attestation (origin) and the collector +// that collected the document (collector). +// +// The certification applies to a subject which is a package, source, or artifact. +// If the attestation targets a package, it must target a PackageName or a +// PackageVersion. If the attestation targets a source, it must target a +// SourceName. +type CertifyBadSrcIngestCertifyBad struct { + AllCertifyBad `json:"-"` } -// GetOrigin returns IsDependencyIngestDependencyIsDependency.Origin, and is useful for accessing the field via an interface. -func (v *IsDependencyIngestDependencyIsDependency) GetOrigin() string { - return v.allIsDependencyTree.Origin +// GetId returns CertifyBadSrcIngestCertifyBad.Id, and is useful for accessing the field via an interface. +func (v *CertifyBadSrcIngestCertifyBad) GetId() string { return v.AllCertifyBad.Id } + +// GetJustification returns CertifyBadSrcIngestCertifyBad.Justification, and is useful for accessing the field via an interface. +func (v *CertifyBadSrcIngestCertifyBad) GetJustification() string { + return v.AllCertifyBad.Justification } -// GetCollector returns IsDependencyIngestDependencyIsDependency.Collector, and is useful for accessing the field via an interface. -func (v *IsDependencyIngestDependencyIsDependency) GetCollector() string { - return v.allIsDependencyTree.Collector +// GetSubject returns CertifyBadSrcIngestCertifyBad.Subject, and is useful for accessing the field via an interface. +func (v *CertifyBadSrcIngestCertifyBad) GetSubject() AllCertifyBadSubjectPackageSourceOrArtifact { + return v.AllCertifyBad.Subject } -func (v *IsDependencyIngestDependencyIsDependency) UnmarshalJSON(b []byte) error { +// GetOrigin returns CertifyBadSrcIngestCertifyBad.Origin, and is useful for accessing the field via an interface. +func (v *CertifyBadSrcIngestCertifyBad) GetOrigin() string { return v.AllCertifyBad.Origin } + +// GetCollector returns CertifyBadSrcIngestCertifyBad.Collector, and is useful for accessing the field via an interface. +func (v *CertifyBadSrcIngestCertifyBad) GetCollector() string { return v.AllCertifyBad.Collector } + +func (v *CertifyBadSrcIngestCertifyBad) UnmarshalJSON(b []byte) error { if string(b) == "null" { return nil } var firstPass struct { - *IsDependencyIngestDependencyIsDependency + *CertifyBadSrcIngestCertifyBad graphql.NoUnmarshalJSON } - firstPass.IsDependencyIngestDependencyIsDependency = v + firstPass.CertifyBadSrcIngestCertifyBad = v err := json.Unmarshal(b, &firstPass) if err != nil { @@ -6562,32 +6601,26 @@ func (v *IsDependencyIngestDependencyIsDependency) UnmarshalJSON(b []byte) error } err = json.Unmarshal( - b, &v.allIsDependencyTree) + b, &v.AllCertifyBad) if err != nil { return err } return nil } -type __premarshalIsDependencyIngestDependencyIsDependency struct { +type __premarshalCertifyBadSrcIngestCertifyBad struct { Id string `json:"id"` Justification string `json:"justification"` - Package allIsDependencyTreePackage `json:"package"` - - DependentPackage allIsDependencyTreeDependentPackage `json:"dependentPackage"` - - DependencyType DependencyType `json:"dependencyType"` - - VersionRange string `json:"versionRange"` + Subject json.RawMessage `json:"subject"` Origin string `json:"origin"` Collector string `json:"collector"` } -func (v *IsDependencyIngestDependencyIsDependency) MarshalJSON() ([]byte, error) { +func (v *CertifyBadSrcIngestCertifyBad) MarshalJSON() ([]byte, error) { premarshaled, err := v.__premarshalJSON() if err != nil { return nil, err @@ -6595,122 +6628,85 @@ func (v *IsDependencyIngestDependencyIsDependency) MarshalJSON() ([]byte, error) return json.Marshal(premarshaled) } -func (v *IsDependencyIngestDependencyIsDependency) __premarshalJSON() (*__premarshalIsDependencyIngestDependencyIsDependency, error) { - var retval __premarshalIsDependencyIngestDependencyIsDependency - - retval.Id = v.allIsDependencyTree.Id - retval.Justification = v.allIsDependencyTree.Justification - retval.Package = v.allIsDependencyTree.Package - retval.DependentPackage = v.allIsDependencyTree.DependentPackage - retval.DependencyType = v.allIsDependencyTree.DependencyType - retval.VersionRange = v.allIsDependencyTree.VersionRange - retval.Origin = v.allIsDependencyTree.Origin - retval.Collector = v.allIsDependencyTree.Collector - return &retval, nil -} - -// IsDependencyInputSpec is the input to record a new dependency. -type IsDependencyInputSpec struct { - VersionRange string `json:"versionRange"` - DependencyType DependencyType `json:"dependencyType"` - Justification string `json:"justification"` - Origin string `json:"origin"` - Collector string `json:"collector"` -} - -// GetVersionRange returns IsDependencyInputSpec.VersionRange, and is useful for accessing the field via an interface. -func (v *IsDependencyInputSpec) GetVersionRange() string { return v.VersionRange } - -// GetDependencyType returns IsDependencyInputSpec.DependencyType, and is useful for accessing the field via an interface. -func (v *IsDependencyInputSpec) GetDependencyType() DependencyType { return v.DependencyType } - -// GetJustification returns IsDependencyInputSpec.Justification, and is useful for accessing the field via an interface. -func (v *IsDependencyInputSpec) GetJustification() string { return v.Justification } - -// GetOrigin returns IsDependencyInputSpec.Origin, and is useful for accessing the field via an interface. -func (v *IsDependencyInputSpec) GetOrigin() string { return v.Origin } +func (v *CertifyBadSrcIngestCertifyBad) __premarshalJSON() (*__premarshalCertifyBadSrcIngestCertifyBad, error) { + var retval __premarshalCertifyBadSrcIngestCertifyBad -// GetCollector returns IsDependencyInputSpec.Collector, and is useful for accessing the field via an interface. -func (v *IsDependencyInputSpec) GetCollector() string { return v.Collector } + retval.Id = v.AllCertifyBad.Id + retval.Justification = v.AllCertifyBad.Justification + { -// IsDependencyResponse is returned by IsDependency on success. -type IsDependencyResponse struct { - // Adds a dependency between two packages - IngestDependency IsDependencyIngestDependencyIsDependency `json:"ingestDependency"` + dst := &retval.Subject + src := v.AllCertifyBad.Subject + var err error + *dst, err = __marshalAllCertifyBadSubjectPackageSourceOrArtifact( + &src) + if err != nil { + return nil, fmt.Errorf( + "unable to marshal CertifyBadSrcIngestCertifyBad.AllCertifyBad.Subject: %w", err) + } + } + retval.Origin = v.AllCertifyBad.Origin + retval.Collector = v.AllCertifyBad.Collector + return &retval, nil } -// GetIngestDependency returns IsDependencyResponse.IngestDependency, and is useful for accessing the field via an interface. -func (v *IsDependencyResponse) GetIngestDependency() IsDependencyIngestDependencyIsDependency { - return v.IngestDependency +// CertifyBadSrcResponse is returned by CertifyBadSrc on success. +type CertifyBadSrcResponse struct { + // Adds a certification that a package, source or artifact is considered bad. + IngestCertifyBad CertifyBadSrcIngestCertifyBad `json:"ingestCertifyBad"` } -// IsOccurrenceInputSpec represents the input to record an artifact's origin. -type IsOccurrenceInputSpec struct { - Justification string `json:"justification"` - Origin string `json:"origin"` - Collector string `json:"collector"` +// GetIngestCertifyBad returns CertifyBadSrcResponse.IngestCertifyBad, and is useful for accessing the field via an interface. +func (v *CertifyBadSrcResponse) GetIngestCertifyBad() CertifyBadSrcIngestCertifyBad { + return v.IngestCertifyBad } -// GetJustification returns IsOccurrenceInputSpec.Justification, and is useful for accessing the field via an interface. -func (v *IsOccurrenceInputSpec) GetJustification() string { return v.Justification } - -// GetOrigin returns IsOccurrenceInputSpec.Origin, and is useful for accessing the field via an interface. -func (v *IsOccurrenceInputSpec) GetOrigin() string { return v.Origin } - -// GetCollector returns IsOccurrenceInputSpec.Collector, and is useful for accessing the field via an interface. -func (v *IsOccurrenceInputSpec) GetCollector() string { return v.Collector } - -// IsOccurrencePkgIngestOccurrenceIsOccurrence includes the requested fields of the GraphQL type IsOccurrence. +// CertifyBadsCertifyBad includes the requested fields of the GraphQL type CertifyBad. // The GraphQL type's documentation follows. // -// IsOccurrence is an attestation to link an artifact to a package or source. +// CertifyBad is an attestation that a package, source, or artifact is considered +// bad. // -// Attestation must occur at the PackageVersion or at the SourceName. -type IsOccurrencePkgIngestOccurrenceIsOccurrence struct { - AllIsOccurrencesTree `json:"-"` -} - -// GetId returns IsOccurrencePkgIngestOccurrenceIsOccurrence.Id, and is useful for accessing the field via an interface. -func (v *IsOccurrencePkgIngestOccurrenceIsOccurrence) GetId() string { - return v.AllIsOccurrencesTree.Id +// All evidence trees record a justification for the property they represent as +// well as the document that contains the attestation (origin) and the collector +// that collected the document (collector). +// +// The certification applies to a subject which is a package, source, or artifact. +// If the attestation targets a package, it must target a PackageName or a +// PackageVersion. If the attestation targets a source, it must target a +// SourceName. +type CertifyBadsCertifyBad struct { + AllCertifyBad `json:"-"` } -// GetSubject returns IsOccurrencePkgIngestOccurrenceIsOccurrence.Subject, and is useful for accessing the field via an interface. -func (v *IsOccurrencePkgIngestOccurrenceIsOccurrence) GetSubject() AllIsOccurrencesTreeSubjectPackageOrSource { - return v.AllIsOccurrencesTree.Subject -} +// GetId returns CertifyBadsCertifyBad.Id, and is useful for accessing the field via an interface. +func (v *CertifyBadsCertifyBad) GetId() string { return v.AllCertifyBad.Id } -// GetArtifact returns IsOccurrencePkgIngestOccurrenceIsOccurrence.Artifact, and is useful for accessing the field via an interface. -func (v *IsOccurrencePkgIngestOccurrenceIsOccurrence) GetArtifact() AllIsOccurrencesTreeArtifact { - return v.AllIsOccurrencesTree.Artifact -} +// GetJustification returns CertifyBadsCertifyBad.Justification, and is useful for accessing the field via an interface. +func (v *CertifyBadsCertifyBad) GetJustification() string { return v.AllCertifyBad.Justification } -// GetJustification returns IsOccurrencePkgIngestOccurrenceIsOccurrence.Justification, and is useful for accessing the field via an interface. -func (v *IsOccurrencePkgIngestOccurrenceIsOccurrence) GetJustification() string { - return v.AllIsOccurrencesTree.Justification +// GetSubject returns CertifyBadsCertifyBad.Subject, and is useful for accessing the field via an interface. +func (v *CertifyBadsCertifyBad) GetSubject() AllCertifyBadSubjectPackageSourceOrArtifact { + return v.AllCertifyBad.Subject } -// GetOrigin returns IsOccurrencePkgIngestOccurrenceIsOccurrence.Origin, and is useful for accessing the field via an interface. -func (v *IsOccurrencePkgIngestOccurrenceIsOccurrence) GetOrigin() string { - return v.AllIsOccurrencesTree.Origin -} +// GetOrigin returns CertifyBadsCertifyBad.Origin, and is useful for accessing the field via an interface. +func (v *CertifyBadsCertifyBad) GetOrigin() string { return v.AllCertifyBad.Origin } -// GetCollector returns IsOccurrencePkgIngestOccurrenceIsOccurrence.Collector, and is useful for accessing the field via an interface. -func (v *IsOccurrencePkgIngestOccurrenceIsOccurrence) GetCollector() string { - return v.AllIsOccurrencesTree.Collector -} +// GetCollector returns CertifyBadsCertifyBad.Collector, and is useful for accessing the field via an interface. +func (v *CertifyBadsCertifyBad) GetCollector() string { return v.AllCertifyBad.Collector } -func (v *IsOccurrencePkgIngestOccurrenceIsOccurrence) UnmarshalJSON(b []byte) error { +func (v *CertifyBadsCertifyBad) UnmarshalJSON(b []byte) error { if string(b) == "null" { return nil } var firstPass struct { - *IsOccurrencePkgIngestOccurrenceIsOccurrence + *CertifyBadsCertifyBad graphql.NoUnmarshalJSON } - firstPass.IsOccurrencePkgIngestOccurrenceIsOccurrence = v + firstPass.CertifyBadsCertifyBad = v err := json.Unmarshal(b, &firstPass) if err != nil { @@ -6718,28 +6714,26 @@ func (v *IsOccurrencePkgIngestOccurrenceIsOccurrence) UnmarshalJSON(b []byte) er } err = json.Unmarshal( - b, &v.AllIsOccurrencesTree) + b, &v.AllCertifyBad) if err != nil { return err } return nil } -type __premarshalIsOccurrencePkgIngestOccurrenceIsOccurrence struct { +type __premarshalCertifyBadsCertifyBad struct { Id string `json:"id"` - Subject json.RawMessage `json:"subject"` - - Artifact AllIsOccurrencesTreeArtifact `json:"artifact"` - Justification string `json:"justification"` + Subject json.RawMessage `json:"subject"` + Origin string `json:"origin"` Collector string `json:"collector"` } -func (v *IsOccurrencePkgIngestOccurrenceIsOccurrence) MarshalJSON() ([]byte, error) { +func (v *CertifyBadsCertifyBad) MarshalJSON() ([]byte, error) { premarshaled, err := v.__premarshalJSON() if err != nil { return nil, err @@ -6747,91 +6741,77 @@ func (v *IsOccurrencePkgIngestOccurrenceIsOccurrence) MarshalJSON() ([]byte, err return json.Marshal(premarshaled) } -func (v *IsOccurrencePkgIngestOccurrenceIsOccurrence) __premarshalJSON() (*__premarshalIsOccurrencePkgIngestOccurrenceIsOccurrence, error) { - var retval __premarshalIsOccurrencePkgIngestOccurrenceIsOccurrence +func (v *CertifyBadsCertifyBad) __premarshalJSON() (*__premarshalCertifyBadsCertifyBad, error) { + var retval __premarshalCertifyBadsCertifyBad - retval.Id = v.AllIsOccurrencesTree.Id + retval.Id = v.AllCertifyBad.Id + retval.Justification = v.AllCertifyBad.Justification { dst := &retval.Subject - src := v.AllIsOccurrencesTree.Subject + src := v.AllCertifyBad.Subject var err error - *dst, err = __marshalAllIsOccurrencesTreeSubjectPackageOrSource( + *dst, err = __marshalAllCertifyBadSubjectPackageSourceOrArtifact( &src) if err != nil { return nil, fmt.Errorf( - "unable to marshal IsOccurrencePkgIngestOccurrenceIsOccurrence.AllIsOccurrencesTree.Subject: %w", err) + "unable to marshal CertifyBadsCertifyBad.AllCertifyBad.Subject: %w", err) } } - retval.Artifact = v.AllIsOccurrencesTree.Artifact - retval.Justification = v.AllIsOccurrencesTree.Justification - retval.Origin = v.AllIsOccurrencesTree.Origin - retval.Collector = v.AllIsOccurrencesTree.Collector + retval.Origin = v.AllCertifyBad.Origin + retval.Collector = v.AllCertifyBad.Collector return &retval, nil } -// IsOccurrencePkgResponse is returned by IsOccurrencePkg on success. -type IsOccurrencePkgResponse struct { - // Ingest that an artifact is produced from a package or source. - IngestOccurrence IsOccurrencePkgIngestOccurrenceIsOccurrence `json:"ingestOccurrence"` -} - -// GetIngestOccurrence returns IsOccurrencePkgResponse.IngestOccurrence, and is useful for accessing the field via an interface. -func (v *IsOccurrencePkgResponse) GetIngestOccurrence() IsOccurrencePkgIngestOccurrenceIsOccurrence { - return v.IngestOccurrence +// CertifyBadsResponse is returned by CertifyBads on success. +type CertifyBadsResponse struct { + // Returns all CertifyBad attestations matching a filter. + CertifyBad []CertifyBadsCertifyBad `json:"CertifyBad"` } -// IsOccurrenceSrcIngestOccurrenceIsOccurrence includes the requested fields of the GraphQL type IsOccurrence. +// GetCertifyBad returns CertifyBadsResponse.CertifyBad, and is useful for accessing the field via an interface. +func (v *CertifyBadsResponse) GetCertifyBad() []CertifyBadsCertifyBad { return v.CertifyBad } + +// CertifyCVEIngestVulnerabilityCertifyVuln includes the requested fields of the GraphQL type CertifyVuln. // The GraphQL type's documentation follows. // -// IsOccurrence is an attestation to link an artifact to a package or source. +// CertifyVuln is an attestation to attach vulnerability information to a package. // -// Attestation must occur at the PackageVersion or at the SourceName. -type IsOccurrenceSrcIngestOccurrenceIsOccurrence struct { - AllIsOccurrencesTree `json:"-"` -} - -// GetId returns IsOccurrenceSrcIngestOccurrenceIsOccurrence.Id, and is useful for accessing the field via an interface. -func (v *IsOccurrenceSrcIngestOccurrenceIsOccurrence) GetId() string { - return v.AllIsOccurrencesTree.Id -} - -// GetSubject returns IsOccurrenceSrcIngestOccurrenceIsOccurrence.Subject, and is useful for accessing the field via an interface. -func (v *IsOccurrenceSrcIngestOccurrenceIsOccurrence) GetSubject() AllIsOccurrencesTreeSubjectPackageOrSource { - return v.AllIsOccurrencesTree.Subject +// This information is obtained via a scanner. If there is no vulnerability +// detected (no OSV, CVE, or GHSA), we attach the special NoVuln node. +type CertifyCVEIngestVulnerabilityCertifyVuln struct { + AllCertifyVuln `json:"-"` } -// GetArtifact returns IsOccurrenceSrcIngestOccurrenceIsOccurrence.Artifact, and is useful for accessing the field via an interface. -func (v *IsOccurrenceSrcIngestOccurrenceIsOccurrence) GetArtifact() AllIsOccurrencesTreeArtifact { - return v.AllIsOccurrencesTree.Artifact -} +// GetId returns CertifyCVEIngestVulnerabilityCertifyVuln.Id, and is useful for accessing the field via an interface. +func (v *CertifyCVEIngestVulnerabilityCertifyVuln) GetId() string { return v.AllCertifyVuln.Id } -// GetJustification returns IsOccurrenceSrcIngestOccurrenceIsOccurrence.Justification, and is useful for accessing the field via an interface. -func (v *IsOccurrenceSrcIngestOccurrenceIsOccurrence) GetJustification() string { - return v.AllIsOccurrencesTree.Justification +// GetPackage returns CertifyCVEIngestVulnerabilityCertifyVuln.Package, and is useful for accessing the field via an interface. +func (v *CertifyCVEIngestVulnerabilityCertifyVuln) GetPackage() AllCertifyVulnPackage { + return v.AllCertifyVuln.Package } -// GetOrigin returns IsOccurrenceSrcIngestOccurrenceIsOccurrence.Origin, and is useful for accessing the field via an interface. -func (v *IsOccurrenceSrcIngestOccurrenceIsOccurrence) GetOrigin() string { - return v.AllIsOccurrencesTree.Origin +// GetVulnerability returns CertifyCVEIngestVulnerabilityCertifyVuln.Vulnerability, and is useful for accessing the field via an interface. +func (v *CertifyCVEIngestVulnerabilityCertifyVuln) GetVulnerability() AllCertifyVulnVulnerability { + return v.AllCertifyVuln.Vulnerability } -// GetCollector returns IsOccurrenceSrcIngestOccurrenceIsOccurrence.Collector, and is useful for accessing the field via an interface. -func (v *IsOccurrenceSrcIngestOccurrenceIsOccurrence) GetCollector() string { - return v.AllIsOccurrencesTree.Collector +// GetMetadata returns CertifyCVEIngestVulnerabilityCertifyVuln.Metadata, and is useful for accessing the field via an interface. +func (v *CertifyCVEIngestVulnerabilityCertifyVuln) GetMetadata() AllCertifyVulnMetadataVulnerabilityMetaData { + return v.AllCertifyVuln.Metadata } -func (v *IsOccurrenceSrcIngestOccurrenceIsOccurrence) UnmarshalJSON(b []byte) error { +func (v *CertifyCVEIngestVulnerabilityCertifyVuln) UnmarshalJSON(b []byte) error { if string(b) == "null" { return nil } var firstPass struct { - *IsOccurrenceSrcIngestOccurrenceIsOccurrence + *CertifyCVEIngestVulnerabilityCertifyVuln graphql.NoUnmarshalJSON } - firstPass.IsOccurrenceSrcIngestOccurrenceIsOccurrence = v + firstPass.CertifyCVEIngestVulnerabilityCertifyVuln = v err := json.Unmarshal(b, &firstPass) if err != nil { @@ -6839,28 +6819,24 @@ func (v *IsOccurrenceSrcIngestOccurrenceIsOccurrence) UnmarshalJSON(b []byte) er } err = json.Unmarshal( - b, &v.AllIsOccurrencesTree) + b, &v.AllCertifyVuln) if err != nil { return err } return nil } -type __premarshalIsOccurrenceSrcIngestOccurrenceIsOccurrence struct { +type __premarshalCertifyCVEIngestVulnerabilityCertifyVuln struct { Id string `json:"id"` - Subject json.RawMessage `json:"subject"` - - Artifact AllIsOccurrencesTreeArtifact `json:"artifact"` - - Justification string `json:"justification"` + Package AllCertifyVulnPackage `json:"package"` - Origin string `json:"origin"` + Vulnerability json.RawMessage `json:"vulnerability"` - Collector string `json:"collector"` + Metadata AllCertifyVulnMetadataVulnerabilityMetaData `json:"metadata"` } -func (v *IsOccurrenceSrcIngestOccurrenceIsOccurrence) MarshalJSON() ([]byte, error) { +func (v *CertifyCVEIngestVulnerabilityCertifyVuln) MarshalJSON() ([]byte, error) { premarshaled, err := v.__premarshalJSON() if err != nil { return nil, err @@ -6868,91 +6844,78 @@ func (v *IsOccurrenceSrcIngestOccurrenceIsOccurrence) MarshalJSON() ([]byte, err return json.Marshal(premarshaled) } -func (v *IsOccurrenceSrcIngestOccurrenceIsOccurrence) __premarshalJSON() (*__premarshalIsOccurrenceSrcIngestOccurrenceIsOccurrence, error) { - var retval __premarshalIsOccurrenceSrcIngestOccurrenceIsOccurrence +func (v *CertifyCVEIngestVulnerabilityCertifyVuln) __premarshalJSON() (*__premarshalCertifyCVEIngestVulnerabilityCertifyVuln, error) { + var retval __premarshalCertifyCVEIngestVulnerabilityCertifyVuln - retval.Id = v.AllIsOccurrencesTree.Id + retval.Id = v.AllCertifyVuln.Id + retval.Package = v.AllCertifyVuln.Package { - dst := &retval.Subject - src := v.AllIsOccurrencesTree.Subject + dst := &retval.Vulnerability + src := v.AllCertifyVuln.Vulnerability var err error - *dst, err = __marshalAllIsOccurrencesTreeSubjectPackageOrSource( + *dst, err = __marshalAllCertifyVulnVulnerability( &src) if err != nil { return nil, fmt.Errorf( - "unable to marshal IsOccurrenceSrcIngestOccurrenceIsOccurrence.AllIsOccurrencesTree.Subject: %w", err) + "unable to marshal CertifyCVEIngestVulnerabilityCertifyVuln.AllCertifyVuln.Vulnerability: %w", err) } } - retval.Artifact = v.AllIsOccurrencesTree.Artifact - retval.Justification = v.AllIsOccurrencesTree.Justification - retval.Origin = v.AllIsOccurrencesTree.Origin - retval.Collector = v.AllIsOccurrencesTree.Collector + retval.Metadata = v.AllCertifyVuln.Metadata return &retval, nil } -// IsOccurrenceSrcResponse is returned by IsOccurrenceSrc on success. -type IsOccurrenceSrcResponse struct { - // Ingest that an artifact is produced from a package or source. - IngestOccurrence IsOccurrenceSrcIngestOccurrenceIsOccurrence `json:"ingestOccurrence"` +// CertifyCVEResponse is returned by CertifyCVE on success. +type CertifyCVEResponse struct { + // Adds a certification that a package has been scanned for vulnerabilities. + IngestVulnerability CertifyCVEIngestVulnerabilityCertifyVuln `json:"ingestVulnerability"` } -// GetIngestOccurrence returns IsOccurrenceSrcResponse.IngestOccurrence, and is useful for accessing the field via an interface. -func (v *IsOccurrenceSrcResponse) GetIngestOccurrence() IsOccurrenceSrcIngestOccurrenceIsOccurrence { - return v.IngestOccurrence +// GetIngestVulnerability returns CertifyCVEResponse.IngestVulnerability, and is useful for accessing the field via an interface. +func (v *CertifyCVEResponse) GetIngestVulnerability() CertifyCVEIngestVulnerabilityCertifyVuln { + return v.IngestVulnerability } -// IsOccurrencesPkgIngestOccurrencesIsOccurrence includes the requested fields of the GraphQL type IsOccurrence. +// CertifyGHSAIngestVulnerabilityCertifyVuln includes the requested fields of the GraphQL type CertifyVuln. // The GraphQL type's documentation follows. // -// IsOccurrence is an attestation to link an artifact to a package or source. +// CertifyVuln is an attestation to attach vulnerability information to a package. // -// Attestation must occur at the PackageVersion or at the SourceName. -type IsOccurrencesPkgIngestOccurrencesIsOccurrence struct { - AllIsOccurrencesTree `json:"-"` -} - -// GetId returns IsOccurrencesPkgIngestOccurrencesIsOccurrence.Id, and is useful for accessing the field via an interface. -func (v *IsOccurrencesPkgIngestOccurrencesIsOccurrence) GetId() string { - return v.AllIsOccurrencesTree.Id -} - -// GetSubject returns IsOccurrencesPkgIngestOccurrencesIsOccurrence.Subject, and is useful for accessing the field via an interface. -func (v *IsOccurrencesPkgIngestOccurrencesIsOccurrence) GetSubject() AllIsOccurrencesTreeSubjectPackageOrSource { - return v.AllIsOccurrencesTree.Subject +// This information is obtained via a scanner. If there is no vulnerability +// detected (no OSV, CVE, or GHSA), we attach the special NoVuln node. +type CertifyGHSAIngestVulnerabilityCertifyVuln struct { + AllCertifyVuln `json:"-"` } -// GetArtifact returns IsOccurrencesPkgIngestOccurrencesIsOccurrence.Artifact, and is useful for accessing the field via an interface. -func (v *IsOccurrencesPkgIngestOccurrencesIsOccurrence) GetArtifact() AllIsOccurrencesTreeArtifact { - return v.AllIsOccurrencesTree.Artifact -} +// GetId returns CertifyGHSAIngestVulnerabilityCertifyVuln.Id, and is useful for accessing the field via an interface. +func (v *CertifyGHSAIngestVulnerabilityCertifyVuln) GetId() string { return v.AllCertifyVuln.Id } -// GetJustification returns IsOccurrencesPkgIngestOccurrencesIsOccurrence.Justification, and is useful for accessing the field via an interface. -func (v *IsOccurrencesPkgIngestOccurrencesIsOccurrence) GetJustification() string { - return v.AllIsOccurrencesTree.Justification +// GetPackage returns CertifyGHSAIngestVulnerabilityCertifyVuln.Package, and is useful for accessing the field via an interface. +func (v *CertifyGHSAIngestVulnerabilityCertifyVuln) GetPackage() AllCertifyVulnPackage { + return v.AllCertifyVuln.Package } -// GetOrigin returns IsOccurrencesPkgIngestOccurrencesIsOccurrence.Origin, and is useful for accessing the field via an interface. -func (v *IsOccurrencesPkgIngestOccurrencesIsOccurrence) GetOrigin() string { - return v.AllIsOccurrencesTree.Origin +// GetVulnerability returns CertifyGHSAIngestVulnerabilityCertifyVuln.Vulnerability, and is useful for accessing the field via an interface. +func (v *CertifyGHSAIngestVulnerabilityCertifyVuln) GetVulnerability() AllCertifyVulnVulnerability { + return v.AllCertifyVuln.Vulnerability } -// GetCollector returns IsOccurrencesPkgIngestOccurrencesIsOccurrence.Collector, and is useful for accessing the field via an interface. -func (v *IsOccurrencesPkgIngestOccurrencesIsOccurrence) GetCollector() string { - return v.AllIsOccurrencesTree.Collector +// GetMetadata returns CertifyGHSAIngestVulnerabilityCertifyVuln.Metadata, and is useful for accessing the field via an interface. +func (v *CertifyGHSAIngestVulnerabilityCertifyVuln) GetMetadata() AllCertifyVulnMetadataVulnerabilityMetaData { + return v.AllCertifyVuln.Metadata } -func (v *IsOccurrencesPkgIngestOccurrencesIsOccurrence) UnmarshalJSON(b []byte) error { +func (v *CertifyGHSAIngestVulnerabilityCertifyVuln) UnmarshalJSON(b []byte) error { if string(b) == "null" { return nil } var firstPass struct { - *IsOccurrencesPkgIngestOccurrencesIsOccurrence + *CertifyGHSAIngestVulnerabilityCertifyVuln graphql.NoUnmarshalJSON } - firstPass.IsOccurrencesPkgIngestOccurrencesIsOccurrence = v + firstPass.CertifyGHSAIngestVulnerabilityCertifyVuln = v err := json.Unmarshal(b, &firstPass) if err != nil { @@ -6960,28 +6923,24 @@ func (v *IsOccurrencesPkgIngestOccurrencesIsOccurrence) UnmarshalJSON(b []byte) } err = json.Unmarshal( - b, &v.AllIsOccurrencesTree) + b, &v.AllCertifyVuln) if err != nil { return err } return nil } -type __premarshalIsOccurrencesPkgIngestOccurrencesIsOccurrence struct { +type __premarshalCertifyGHSAIngestVulnerabilityCertifyVuln struct { Id string `json:"id"` - Subject json.RawMessage `json:"subject"` - - Artifact AllIsOccurrencesTreeArtifact `json:"artifact"` - - Justification string `json:"justification"` + Package AllCertifyVulnPackage `json:"package"` - Origin string `json:"origin"` + Vulnerability json.RawMessage `json:"vulnerability"` - Collector string `json:"collector"` + Metadata AllCertifyVulnMetadataVulnerabilityMetaData `json:"metadata"` } -func (v *IsOccurrencesPkgIngestOccurrencesIsOccurrence) MarshalJSON() ([]byte, error) { +func (v *CertifyGHSAIngestVulnerabilityCertifyVuln) MarshalJSON() ([]byte, error) { premarshaled, err := v.__premarshalJSON() if err != nil { return nil, err @@ -6989,91 +6948,88 @@ func (v *IsOccurrencesPkgIngestOccurrencesIsOccurrence) MarshalJSON() ([]byte, e return json.Marshal(premarshaled) } -func (v *IsOccurrencesPkgIngestOccurrencesIsOccurrence) __premarshalJSON() (*__premarshalIsOccurrencesPkgIngestOccurrencesIsOccurrence, error) { - var retval __premarshalIsOccurrencesPkgIngestOccurrencesIsOccurrence +func (v *CertifyGHSAIngestVulnerabilityCertifyVuln) __premarshalJSON() (*__premarshalCertifyGHSAIngestVulnerabilityCertifyVuln, error) { + var retval __premarshalCertifyGHSAIngestVulnerabilityCertifyVuln - retval.Id = v.AllIsOccurrencesTree.Id + retval.Id = v.AllCertifyVuln.Id + retval.Package = v.AllCertifyVuln.Package { - dst := &retval.Subject - src := v.AllIsOccurrencesTree.Subject + dst := &retval.Vulnerability + src := v.AllCertifyVuln.Vulnerability var err error - *dst, err = __marshalAllIsOccurrencesTreeSubjectPackageOrSource( + *dst, err = __marshalAllCertifyVulnVulnerability( &src) if err != nil { return nil, fmt.Errorf( - "unable to marshal IsOccurrencesPkgIngestOccurrencesIsOccurrence.AllIsOccurrencesTree.Subject: %w", err) + "unable to marshal CertifyGHSAIngestVulnerabilityCertifyVuln.AllCertifyVuln.Vulnerability: %w", err) } } - retval.Artifact = v.AllIsOccurrencesTree.Artifact - retval.Justification = v.AllIsOccurrencesTree.Justification - retval.Origin = v.AllIsOccurrencesTree.Origin - retval.Collector = v.AllIsOccurrencesTree.Collector + retval.Metadata = v.AllCertifyVuln.Metadata return &retval, nil } -// IsOccurrencesPkgResponse is returned by IsOccurrencesPkg on success. -type IsOccurrencesPkgResponse struct { - // Bulk ingest that an artifact is produced from a package or source. - IngestOccurrences []IsOccurrencesPkgIngestOccurrencesIsOccurrence `json:"ingestOccurrences"` +// CertifyGHSAResponse is returned by CertifyGHSA on success. +type CertifyGHSAResponse struct { + // Adds a certification that a package has been scanned for vulnerabilities. + IngestVulnerability CertifyGHSAIngestVulnerabilityCertifyVuln `json:"ingestVulnerability"` } -// GetIngestOccurrences returns IsOccurrencesPkgResponse.IngestOccurrences, and is useful for accessing the field via an interface. -func (v *IsOccurrencesPkgResponse) GetIngestOccurrences() []IsOccurrencesPkgIngestOccurrencesIsOccurrence { - return v.IngestOccurrences +// GetIngestVulnerability returns CertifyGHSAResponse.IngestVulnerability, and is useful for accessing the field via an interface. +func (v *CertifyGHSAResponse) GetIngestVulnerability() CertifyGHSAIngestVulnerabilityCertifyVuln { + return v.IngestVulnerability } -// IsOccurrencesSrcIngestOccurrencesIsOccurrence includes the requested fields of the GraphQL type IsOccurrence. +// CertifyGoodArtifactIngestCertifyGood includes the requested fields of the GraphQL type CertifyGood. // The GraphQL type's documentation follows. // -// IsOccurrence is an attestation to link an artifact to a package or source. +// CertifyGood is an attestation that a package, source, or artifact is considered +// good. // -// Attestation must occur at the PackageVersion or at the SourceName. -type IsOccurrencesSrcIngestOccurrencesIsOccurrence struct { - AllIsOccurrencesTree `json:"-"` +// All evidence trees record a justification for the property they represent as +// well as the document that contains the attestation (origin) and the collector +// that collected the document (collector). +// +// The certification applies to a subject which is a package, source, or artifact. +// If the attestation targets a package, it must target a PackageName or a +// PackageVersion. If the attestation targets a source, it must target a +// SourceName. +type CertifyGoodArtifactIngestCertifyGood struct { + AllCertifyGood `json:"-"` } -// GetId returns IsOccurrencesSrcIngestOccurrencesIsOccurrence.Id, and is useful for accessing the field via an interface. -func (v *IsOccurrencesSrcIngestOccurrencesIsOccurrence) GetId() string { - return v.AllIsOccurrencesTree.Id -} +// GetId returns CertifyGoodArtifactIngestCertifyGood.Id, and is useful for accessing the field via an interface. +func (v *CertifyGoodArtifactIngestCertifyGood) GetId() string { return v.AllCertifyGood.Id } -// GetSubject returns IsOccurrencesSrcIngestOccurrencesIsOccurrence.Subject, and is useful for accessing the field via an interface. -func (v *IsOccurrencesSrcIngestOccurrencesIsOccurrence) GetSubject() AllIsOccurrencesTreeSubjectPackageOrSource { - return v.AllIsOccurrencesTree.Subject +// GetJustification returns CertifyGoodArtifactIngestCertifyGood.Justification, and is useful for accessing the field via an interface. +func (v *CertifyGoodArtifactIngestCertifyGood) GetJustification() string { + return v.AllCertifyGood.Justification } -// GetArtifact returns IsOccurrencesSrcIngestOccurrencesIsOccurrence.Artifact, and is useful for accessing the field via an interface. -func (v *IsOccurrencesSrcIngestOccurrencesIsOccurrence) GetArtifact() AllIsOccurrencesTreeArtifact { - return v.AllIsOccurrencesTree.Artifact +// GetSubject returns CertifyGoodArtifactIngestCertifyGood.Subject, and is useful for accessing the field via an interface. +func (v *CertifyGoodArtifactIngestCertifyGood) GetSubject() AllCertifyGoodSubjectPackageSourceOrArtifact { + return v.AllCertifyGood.Subject } -// GetJustification returns IsOccurrencesSrcIngestOccurrencesIsOccurrence.Justification, and is useful for accessing the field via an interface. -func (v *IsOccurrencesSrcIngestOccurrencesIsOccurrence) GetJustification() string { - return v.AllIsOccurrencesTree.Justification -} +// GetOrigin returns CertifyGoodArtifactIngestCertifyGood.Origin, and is useful for accessing the field via an interface. +func (v *CertifyGoodArtifactIngestCertifyGood) GetOrigin() string { return v.AllCertifyGood.Origin } -// GetOrigin returns IsOccurrencesSrcIngestOccurrencesIsOccurrence.Origin, and is useful for accessing the field via an interface. -func (v *IsOccurrencesSrcIngestOccurrencesIsOccurrence) GetOrigin() string { - return v.AllIsOccurrencesTree.Origin +// GetCollector returns CertifyGoodArtifactIngestCertifyGood.Collector, and is useful for accessing the field via an interface. +func (v *CertifyGoodArtifactIngestCertifyGood) GetCollector() string { + return v.AllCertifyGood.Collector } -// GetCollector returns IsOccurrencesSrcIngestOccurrencesIsOccurrence.Collector, and is useful for accessing the field via an interface. -func (v *IsOccurrencesSrcIngestOccurrencesIsOccurrence) GetCollector() string { - return v.AllIsOccurrencesTree.Collector -} - -func (v *IsOccurrencesSrcIngestOccurrencesIsOccurrence) UnmarshalJSON(b []byte) error { +func (v *CertifyGoodArtifactIngestCertifyGood) UnmarshalJSON(b []byte) error { if string(b) == "null" { return nil } var firstPass struct { - *IsOccurrencesSrcIngestOccurrencesIsOccurrence + *CertifyGoodArtifactIngestCertifyGood graphql.NoUnmarshalJSON } - firstPass.IsOccurrencesSrcIngestOccurrencesIsOccurrence = v + firstPass.CertifyGoodArtifactIngestCertifyGood = v err := json.Unmarshal(b, &firstPass) if err != nil { @@ -7081,28 +7037,26 @@ func (v *IsOccurrencesSrcIngestOccurrencesIsOccurrence) UnmarshalJSON(b []byte) } err = json.Unmarshal( - b, &v.AllIsOccurrencesTree) + b, &v.AllCertifyGood) if err != nil { return err } return nil } -type __premarshalIsOccurrencesSrcIngestOccurrencesIsOccurrence struct { +type __premarshalCertifyGoodArtifactIngestCertifyGood struct { Id string `json:"id"` - Subject json.RawMessage `json:"subject"` - - Artifact AllIsOccurrencesTreeArtifact `json:"artifact"` - Justification string `json:"justification"` + Subject json.RawMessage `json:"subject"` + Origin string `json:"origin"` Collector string `json:"collector"` } -func (v *IsOccurrencesSrcIngestOccurrencesIsOccurrence) MarshalJSON() ([]byte, error) { +func (v *CertifyGoodArtifactIngestCertifyGood) MarshalJSON() ([]byte, error) { premarshaled, err := v.__premarshalJSON() if err != nil { return nil, err @@ -7110,87 +7064,103 @@ func (v *IsOccurrencesSrcIngestOccurrencesIsOccurrence) MarshalJSON() ([]byte, e return json.Marshal(premarshaled) } -func (v *IsOccurrencesSrcIngestOccurrencesIsOccurrence) __premarshalJSON() (*__premarshalIsOccurrencesSrcIngestOccurrencesIsOccurrence, error) { - var retval __premarshalIsOccurrencesSrcIngestOccurrencesIsOccurrence +func (v *CertifyGoodArtifactIngestCertifyGood) __premarshalJSON() (*__premarshalCertifyGoodArtifactIngestCertifyGood, error) { + var retval __premarshalCertifyGoodArtifactIngestCertifyGood - retval.Id = v.AllIsOccurrencesTree.Id + retval.Id = v.AllCertifyGood.Id + retval.Justification = v.AllCertifyGood.Justification { dst := &retval.Subject - src := v.AllIsOccurrencesTree.Subject + src := v.AllCertifyGood.Subject var err error - *dst, err = __marshalAllIsOccurrencesTreeSubjectPackageOrSource( + *dst, err = __marshalAllCertifyGoodSubjectPackageSourceOrArtifact( &src) if err != nil { return nil, fmt.Errorf( - "unable to marshal IsOccurrencesSrcIngestOccurrencesIsOccurrence.AllIsOccurrencesTree.Subject: %w", err) + "unable to marshal CertifyGoodArtifactIngestCertifyGood.AllCertifyGood.Subject: %w", err) } } - retval.Artifact = v.AllIsOccurrencesTree.Artifact - retval.Justification = v.AllIsOccurrencesTree.Justification - retval.Origin = v.AllIsOccurrencesTree.Origin - retval.Collector = v.AllIsOccurrencesTree.Collector + retval.Origin = v.AllCertifyGood.Origin + retval.Collector = v.AllCertifyGood.Collector return &retval, nil } -// IsOccurrencesSrcResponse is returned by IsOccurrencesSrc on success. -type IsOccurrencesSrcResponse struct { - // Bulk ingest that an artifact is produced from a package or source. - IngestOccurrences []IsOccurrencesSrcIngestOccurrencesIsOccurrence `json:"ingestOccurrences"` +// CertifyGoodArtifactResponse is returned by CertifyGoodArtifact on success. +type CertifyGoodArtifactResponse struct { + // Adds a certification that a package, source or artifact is considered good. + IngestCertifyGood CertifyGoodArtifactIngestCertifyGood `json:"ingestCertifyGood"` } -// GetIngestOccurrences returns IsOccurrencesSrcResponse.IngestOccurrences, and is useful for accessing the field via an interface. -func (v *IsOccurrencesSrcResponse) GetIngestOccurrences() []IsOccurrencesSrcIngestOccurrencesIsOccurrence { - return v.IngestOccurrences +// GetIngestCertifyGood returns CertifyGoodArtifactResponse.IngestCertifyGood, and is useful for accessing the field via an interface. +func (v *CertifyGoodArtifactResponse) GetIngestCertifyGood() CertifyGoodArtifactIngestCertifyGood { + return v.IngestCertifyGood } -// IsVulnerabilityCVEIngestIsVulnerability includes the requested fields of the GraphQL type IsVulnerability. -// The GraphQL type's documentation follows. -// -// IsVulnerability is an attestation to link CVE/GHSA with data in OSV. -type IsVulnerabilityCVEIngestIsVulnerability struct { - allIsVulnerability `json:"-"` +// CertifyGoodInputSpec represents the mutation input to ingest a CertifyGood evidence. +type CertifyGoodInputSpec struct { + Justification string `json:"justification"` + Origin string `json:"origin"` + Collector string `json:"collector"` } -// GetId returns IsVulnerabilityCVEIngestIsVulnerability.Id, and is useful for accessing the field via an interface. -func (v *IsVulnerabilityCVEIngestIsVulnerability) GetId() string { return v.allIsVulnerability.Id } +// GetJustification returns CertifyGoodInputSpec.Justification, and is useful for accessing the field via an interface. +func (v *CertifyGoodInputSpec) GetJustification() string { return v.Justification } -// GetOsv returns IsVulnerabilityCVEIngestIsVulnerability.Osv, and is useful for accessing the field via an interface. -func (v *IsVulnerabilityCVEIngestIsVulnerability) GetOsv() allIsVulnerabilityOsvOSV { - return v.allIsVulnerability.Osv -} +// GetOrigin returns CertifyGoodInputSpec.Origin, and is useful for accessing the field via an interface. +func (v *CertifyGoodInputSpec) GetOrigin() string { return v.Origin } -// GetVulnerability returns IsVulnerabilityCVEIngestIsVulnerability.Vulnerability, and is useful for accessing the field via an interface. -func (v *IsVulnerabilityCVEIngestIsVulnerability) GetVulnerability() allIsVulnerabilityVulnerabilityCveOrGhsa { - return v.allIsVulnerability.Vulnerability -} +// GetCollector returns CertifyGoodInputSpec.Collector, and is useful for accessing the field via an interface. +func (v *CertifyGoodInputSpec) GetCollector() string { return v.Collector } -// GetJustification returns IsVulnerabilityCVEIngestIsVulnerability.Justification, and is useful for accessing the field via an interface. -func (v *IsVulnerabilityCVEIngestIsVulnerability) GetJustification() string { - return v.allIsVulnerability.Justification +// CertifyGoodPkgIngestCertifyGood includes the requested fields of the GraphQL type CertifyGood. +// The GraphQL type's documentation follows. +// +// CertifyGood is an attestation that a package, source, or artifact is considered +// good. +// +// All evidence trees record a justification for the property they represent as +// well as the document that contains the attestation (origin) and the collector +// that collected the document (collector). +// +// The certification applies to a subject which is a package, source, or artifact. +// If the attestation targets a package, it must target a PackageName or a +// PackageVersion. If the attestation targets a source, it must target a +// SourceName. +type CertifyGoodPkgIngestCertifyGood struct { + AllCertifyGood `json:"-"` } -// GetOrigin returns IsVulnerabilityCVEIngestIsVulnerability.Origin, and is useful for accessing the field via an interface. -func (v *IsVulnerabilityCVEIngestIsVulnerability) GetOrigin() string { - return v.allIsVulnerability.Origin +// GetId returns CertifyGoodPkgIngestCertifyGood.Id, and is useful for accessing the field via an interface. +func (v *CertifyGoodPkgIngestCertifyGood) GetId() string { return v.AllCertifyGood.Id } + +// GetJustification returns CertifyGoodPkgIngestCertifyGood.Justification, and is useful for accessing the field via an interface. +func (v *CertifyGoodPkgIngestCertifyGood) GetJustification() string { + return v.AllCertifyGood.Justification } -// GetCollector returns IsVulnerabilityCVEIngestIsVulnerability.Collector, and is useful for accessing the field via an interface. -func (v *IsVulnerabilityCVEIngestIsVulnerability) GetCollector() string { - return v.allIsVulnerability.Collector +// GetSubject returns CertifyGoodPkgIngestCertifyGood.Subject, and is useful for accessing the field via an interface. +func (v *CertifyGoodPkgIngestCertifyGood) GetSubject() AllCertifyGoodSubjectPackageSourceOrArtifact { + return v.AllCertifyGood.Subject } -func (v *IsVulnerabilityCVEIngestIsVulnerability) UnmarshalJSON(b []byte) error { +// GetOrigin returns CertifyGoodPkgIngestCertifyGood.Origin, and is useful for accessing the field via an interface. +func (v *CertifyGoodPkgIngestCertifyGood) GetOrigin() string { return v.AllCertifyGood.Origin } + +// GetCollector returns CertifyGoodPkgIngestCertifyGood.Collector, and is useful for accessing the field via an interface. +func (v *CertifyGoodPkgIngestCertifyGood) GetCollector() string { return v.AllCertifyGood.Collector } + +func (v *CertifyGoodPkgIngestCertifyGood) UnmarshalJSON(b []byte) error { if string(b) == "null" { return nil } var firstPass struct { - *IsVulnerabilityCVEIngestIsVulnerability + *CertifyGoodPkgIngestCertifyGood graphql.NoUnmarshalJSON } - firstPass.IsVulnerabilityCVEIngestIsVulnerability = v + firstPass.CertifyGoodPkgIngestCertifyGood = v err := json.Unmarshal(b, &firstPass) if err != nil { @@ -7198,28 +7168,26 @@ func (v *IsVulnerabilityCVEIngestIsVulnerability) UnmarshalJSON(b []byte) error } err = json.Unmarshal( - b, &v.allIsVulnerability) + b, &v.AllCertifyGood) if err != nil { return err } return nil } -type __premarshalIsVulnerabilityCVEIngestIsVulnerability struct { +type __premarshalCertifyGoodPkgIngestCertifyGood struct { Id string `json:"id"` - Osv allIsVulnerabilityOsvOSV `json:"osv"` - - Vulnerability json.RawMessage `json:"vulnerability"` - Justification string `json:"justification"` + Subject json.RawMessage `json:"subject"` + Origin string `json:"origin"` Collector string `json:"collector"` } -func (v *IsVulnerabilityCVEIngestIsVulnerability) MarshalJSON() ([]byte, error) { +func (v *CertifyGoodPkgIngestCertifyGood) MarshalJSON() ([]byte, error) { premarshaled, err := v.__premarshalJSON() if err != nil { return nil, err @@ -7227,87 +7195,87 @@ func (v *IsVulnerabilityCVEIngestIsVulnerability) MarshalJSON() ([]byte, error) return json.Marshal(premarshaled) } -func (v *IsVulnerabilityCVEIngestIsVulnerability) __premarshalJSON() (*__premarshalIsVulnerabilityCVEIngestIsVulnerability, error) { - var retval __premarshalIsVulnerabilityCVEIngestIsVulnerability +func (v *CertifyGoodPkgIngestCertifyGood) __premarshalJSON() (*__premarshalCertifyGoodPkgIngestCertifyGood, error) { + var retval __premarshalCertifyGoodPkgIngestCertifyGood - retval.Id = v.allIsVulnerability.Id - retval.Osv = v.allIsVulnerability.Osv + retval.Id = v.AllCertifyGood.Id + retval.Justification = v.AllCertifyGood.Justification { - dst := &retval.Vulnerability - src := v.allIsVulnerability.Vulnerability + dst := &retval.Subject + src := v.AllCertifyGood.Subject var err error - *dst, err = __marshalallIsVulnerabilityVulnerabilityCveOrGhsa( + *dst, err = __marshalAllCertifyGoodSubjectPackageSourceOrArtifact( &src) if err != nil { return nil, fmt.Errorf( - "unable to marshal IsVulnerabilityCVEIngestIsVulnerability.allIsVulnerability.Vulnerability: %w", err) + "unable to marshal CertifyGoodPkgIngestCertifyGood.AllCertifyGood.Subject: %w", err) } } - retval.Justification = v.allIsVulnerability.Justification - retval.Origin = v.allIsVulnerability.Origin - retval.Collector = v.allIsVulnerability.Collector + retval.Origin = v.AllCertifyGood.Origin + retval.Collector = v.AllCertifyGood.Collector return &retval, nil } -// IsVulnerabilityCVEResponse is returned by IsVulnerabilityCVE on success. -type IsVulnerabilityCVEResponse struct { - // Ingest a mapping between an OSV entry and a CVE/GHSA vulnerability. - IngestIsVulnerability IsVulnerabilityCVEIngestIsVulnerability `json:"ingestIsVulnerability"` +// CertifyGoodPkgResponse is returned by CertifyGoodPkg on success. +type CertifyGoodPkgResponse struct { + // Adds a certification that a package, source or artifact is considered good. + IngestCertifyGood CertifyGoodPkgIngestCertifyGood `json:"ingestCertifyGood"` } -// GetIngestIsVulnerability returns IsVulnerabilityCVEResponse.IngestIsVulnerability, and is useful for accessing the field via an interface. -func (v *IsVulnerabilityCVEResponse) GetIngestIsVulnerability() IsVulnerabilityCVEIngestIsVulnerability { - return v.IngestIsVulnerability +// GetIngestCertifyGood returns CertifyGoodPkgResponse.IngestCertifyGood, and is useful for accessing the field via an interface. +func (v *CertifyGoodPkgResponse) GetIngestCertifyGood() CertifyGoodPkgIngestCertifyGood { + return v.IngestCertifyGood } -// IsVulnerabilityGHSAIngestIsVulnerability includes the requested fields of the GraphQL type IsVulnerability. +// CertifyGoodSrcIngestCertifyGood includes the requested fields of the GraphQL type CertifyGood. // The GraphQL type's documentation follows. // -// IsVulnerability is an attestation to link CVE/GHSA with data in OSV. -type IsVulnerabilityGHSAIngestIsVulnerability struct { - allIsVulnerability `json:"-"` +// CertifyGood is an attestation that a package, source, or artifact is considered +// good. +// +// All evidence trees record a justification for the property they represent as +// well as the document that contains the attestation (origin) and the collector +// that collected the document (collector). +// +// The certification applies to a subject which is a package, source, or artifact. +// If the attestation targets a package, it must target a PackageName or a +// PackageVersion. If the attestation targets a source, it must target a +// SourceName. +type CertifyGoodSrcIngestCertifyGood struct { + AllCertifyGood `json:"-"` } -// GetId returns IsVulnerabilityGHSAIngestIsVulnerability.Id, and is useful for accessing the field via an interface. -func (v *IsVulnerabilityGHSAIngestIsVulnerability) GetId() string { return v.allIsVulnerability.Id } - -// GetOsv returns IsVulnerabilityGHSAIngestIsVulnerability.Osv, and is useful for accessing the field via an interface. -func (v *IsVulnerabilityGHSAIngestIsVulnerability) GetOsv() allIsVulnerabilityOsvOSV { - return v.allIsVulnerability.Osv -} +// GetId returns CertifyGoodSrcIngestCertifyGood.Id, and is useful for accessing the field via an interface. +func (v *CertifyGoodSrcIngestCertifyGood) GetId() string { return v.AllCertifyGood.Id } -// GetVulnerability returns IsVulnerabilityGHSAIngestIsVulnerability.Vulnerability, and is useful for accessing the field via an interface. -func (v *IsVulnerabilityGHSAIngestIsVulnerability) GetVulnerability() allIsVulnerabilityVulnerabilityCveOrGhsa { - return v.allIsVulnerability.Vulnerability +// GetJustification returns CertifyGoodSrcIngestCertifyGood.Justification, and is useful for accessing the field via an interface. +func (v *CertifyGoodSrcIngestCertifyGood) GetJustification() string { + return v.AllCertifyGood.Justification } -// GetJustification returns IsVulnerabilityGHSAIngestIsVulnerability.Justification, and is useful for accessing the field via an interface. -func (v *IsVulnerabilityGHSAIngestIsVulnerability) GetJustification() string { - return v.allIsVulnerability.Justification +// GetSubject returns CertifyGoodSrcIngestCertifyGood.Subject, and is useful for accessing the field via an interface. +func (v *CertifyGoodSrcIngestCertifyGood) GetSubject() AllCertifyGoodSubjectPackageSourceOrArtifact { + return v.AllCertifyGood.Subject } -// GetOrigin returns IsVulnerabilityGHSAIngestIsVulnerability.Origin, and is useful for accessing the field via an interface. -func (v *IsVulnerabilityGHSAIngestIsVulnerability) GetOrigin() string { - return v.allIsVulnerability.Origin -} +// GetOrigin returns CertifyGoodSrcIngestCertifyGood.Origin, and is useful for accessing the field via an interface. +func (v *CertifyGoodSrcIngestCertifyGood) GetOrigin() string { return v.AllCertifyGood.Origin } -// GetCollector returns IsVulnerabilityGHSAIngestIsVulnerability.Collector, and is useful for accessing the field via an interface. -func (v *IsVulnerabilityGHSAIngestIsVulnerability) GetCollector() string { - return v.allIsVulnerability.Collector -} +// GetCollector returns CertifyGoodSrcIngestCertifyGood.Collector, and is useful for accessing the field via an interface. +func (v *CertifyGoodSrcIngestCertifyGood) GetCollector() string { return v.AllCertifyGood.Collector } -func (v *IsVulnerabilityGHSAIngestIsVulnerability) UnmarshalJSON(b []byte) error { +func (v *CertifyGoodSrcIngestCertifyGood) UnmarshalJSON(b []byte) error { if string(b) == "null" { return nil } var firstPass struct { - *IsVulnerabilityGHSAIngestIsVulnerability + *CertifyGoodSrcIngestCertifyGood graphql.NoUnmarshalJSON } - firstPass.IsVulnerabilityGHSAIngestIsVulnerability = v + firstPass.CertifyGoodSrcIngestCertifyGood = v err := json.Unmarshal(b, &firstPass) if err != nil { @@ -7315,28 +7283,26 @@ func (v *IsVulnerabilityGHSAIngestIsVulnerability) UnmarshalJSON(b []byte) error } err = json.Unmarshal( - b, &v.allIsVulnerability) + b, &v.AllCertifyGood) if err != nil { return err } return nil } -type __premarshalIsVulnerabilityGHSAIngestIsVulnerability struct { +type __premarshalCertifyGoodSrcIngestCertifyGood struct { Id string `json:"id"` - Osv allIsVulnerabilityOsvOSV `json:"osv"` - - Vulnerability json.RawMessage `json:"vulnerability"` - Justification string `json:"justification"` + Subject json.RawMessage `json:"subject"` + Origin string `json:"origin"` Collector string `json:"collector"` } -func (v *IsVulnerabilityGHSAIngestIsVulnerability) MarshalJSON() ([]byte, error) { +func (v *CertifyGoodSrcIngestCertifyGood) MarshalJSON() ([]byte, error) { premarshaled, err := v.__premarshalJSON() if err != nil { return nil, err @@ -7344,102 +7310,79 @@ func (v *IsVulnerabilityGHSAIngestIsVulnerability) MarshalJSON() ([]byte, error) return json.Marshal(premarshaled) } -func (v *IsVulnerabilityGHSAIngestIsVulnerability) __premarshalJSON() (*__premarshalIsVulnerabilityGHSAIngestIsVulnerability, error) { - var retval __premarshalIsVulnerabilityGHSAIngestIsVulnerability +func (v *CertifyGoodSrcIngestCertifyGood) __premarshalJSON() (*__premarshalCertifyGoodSrcIngestCertifyGood, error) { + var retval __premarshalCertifyGoodSrcIngestCertifyGood - retval.Id = v.allIsVulnerability.Id - retval.Osv = v.allIsVulnerability.Osv + retval.Id = v.AllCertifyGood.Id + retval.Justification = v.AllCertifyGood.Justification { - dst := &retval.Vulnerability - src := v.allIsVulnerability.Vulnerability + dst := &retval.Subject + src := v.AllCertifyGood.Subject var err error - *dst, err = __marshalallIsVulnerabilityVulnerabilityCveOrGhsa( + *dst, err = __marshalAllCertifyGoodSubjectPackageSourceOrArtifact( &src) if err != nil { return nil, fmt.Errorf( - "unable to marshal IsVulnerabilityGHSAIngestIsVulnerability.allIsVulnerability.Vulnerability: %w", err) + "unable to marshal CertifyGoodSrcIngestCertifyGood.AllCertifyGood.Subject: %w", err) } } - retval.Justification = v.allIsVulnerability.Justification - retval.Origin = v.allIsVulnerability.Origin - retval.Collector = v.allIsVulnerability.Collector + retval.Origin = v.AllCertifyGood.Origin + retval.Collector = v.AllCertifyGood.Collector return &retval, nil } -// IsVulnerabilityGHSAResponse is returned by IsVulnerabilityGHSA on success. -type IsVulnerabilityGHSAResponse struct { - // Ingest a mapping between an OSV entry and a CVE/GHSA vulnerability. - IngestIsVulnerability IsVulnerabilityGHSAIngestIsVulnerability `json:"ingestIsVulnerability"` +// CertifyGoodSrcResponse is returned by CertifyGoodSrc on success. +type CertifyGoodSrcResponse struct { + // Adds a certification that a package, source or artifact is considered good. + IngestCertifyGood CertifyGoodSrcIngestCertifyGood `json:"ingestCertifyGood"` } -// GetIngestIsVulnerability returns IsVulnerabilityGHSAResponse.IngestIsVulnerability, and is useful for accessing the field via an interface. -func (v *IsVulnerabilityGHSAResponse) GetIngestIsVulnerability() IsVulnerabilityGHSAIngestIsVulnerability { - return v.IngestIsVulnerability +// GetIngestCertifyGood returns CertifyGoodSrcResponse.IngestCertifyGood, and is useful for accessing the field via an interface. +func (v *CertifyGoodSrcResponse) GetIngestCertifyGood() CertifyGoodSrcIngestCertifyGood { + return v.IngestCertifyGood } -// IsVulnerabilityInputSpec represents the input to link CVE/GHSA with OSV data. -type IsVulnerabilityInputSpec struct { - Justification string `json:"justification"` - Origin string `json:"origin"` - Collector string `json:"collector"` +// CertifyNoKnownVulnIngestVulnerabilityCertifyVuln includes the requested fields of the GraphQL type CertifyVuln. +// The GraphQL type's documentation follows. +// +// CertifyVuln is an attestation to attach vulnerability information to a package. +// +// This information is obtained via a scanner. If there is no vulnerability +// detected (no OSV, CVE, or GHSA), we attach the special NoVuln node. +type CertifyNoKnownVulnIngestVulnerabilityCertifyVuln struct { + AllCertifyVuln `json:"-"` } -// GetJustification returns IsVulnerabilityInputSpec.Justification, and is useful for accessing the field via an interface. -func (v *IsVulnerabilityInputSpec) GetJustification() string { return v.Justification } - -// GetOrigin returns IsVulnerabilityInputSpec.Origin, and is useful for accessing the field via an interface. -func (v *IsVulnerabilityInputSpec) GetOrigin() string { return v.Origin } - -// GetCollector returns IsVulnerabilityInputSpec.Collector, and is useful for accessing the field via an interface. -func (v *IsVulnerabilityInputSpec) GetCollector() string { return v.Collector } +// GetId returns CertifyNoKnownVulnIngestVulnerabilityCertifyVuln.Id, and is useful for accessing the field via an interface. +func (v *CertifyNoKnownVulnIngestVulnerabilityCertifyVuln) GetId() string { return v.AllCertifyVuln.Id } -// MatchFlags is used to input the PkgMatchType enum. -type MatchFlags struct { - Pkg PkgMatchType `json:"pkg"` +// GetPackage returns CertifyNoKnownVulnIngestVulnerabilityCertifyVuln.Package, and is useful for accessing the field via an interface. +func (v *CertifyNoKnownVulnIngestVulnerabilityCertifyVuln) GetPackage() AllCertifyVulnPackage { + return v.AllCertifyVuln.Package } -// GetPkg returns MatchFlags.Pkg, and is useful for accessing the field via an interface. -func (v *MatchFlags) GetPkg() PkgMatchType { return v.Pkg } +// GetVulnerability returns CertifyNoKnownVulnIngestVulnerabilityCertifyVuln.Vulnerability, and is useful for accessing the field via an interface. +func (v *CertifyNoKnownVulnIngestVulnerabilityCertifyVuln) GetVulnerability() AllCertifyVulnVulnerability { + return v.AllCertifyVuln.Vulnerability +} -// NeighborsNeighborsArtifact includes the requested fields of the GraphQL type Artifact. -// The GraphQL type's documentation follows. -// -// Artifact represents an artifact identified by a checksum hash. -// -// The checksum is split into the digest value and the algorithm used to generate -// it. Both fields are mandatory and canonicalized to be lowercase. -// -// If having a checksum Go object, algorithm can be -// strings.ToLower(string(checksum.Algorithm)) and digest can be checksum.Value. -type NeighborsNeighborsArtifact struct { - Typename *string `json:"__typename"` - AllArtifactTree `json:"-"` +// GetMetadata returns CertifyNoKnownVulnIngestVulnerabilityCertifyVuln.Metadata, and is useful for accessing the field via an interface. +func (v *CertifyNoKnownVulnIngestVulnerabilityCertifyVuln) GetMetadata() AllCertifyVulnMetadataVulnerabilityMetaData { + return v.AllCertifyVuln.Metadata } -// GetTypename returns NeighborsNeighborsArtifact.Typename, and is useful for accessing the field via an interface. -func (v *NeighborsNeighborsArtifact) GetTypename() *string { return v.Typename } - -// GetId returns NeighborsNeighborsArtifact.Id, and is useful for accessing the field via an interface. -func (v *NeighborsNeighborsArtifact) GetId() string { return v.AllArtifactTree.Id } - -// GetAlgorithm returns NeighborsNeighborsArtifact.Algorithm, and is useful for accessing the field via an interface. -func (v *NeighborsNeighborsArtifact) GetAlgorithm() string { return v.AllArtifactTree.Algorithm } - -// GetDigest returns NeighborsNeighborsArtifact.Digest, and is useful for accessing the field via an interface. -func (v *NeighborsNeighborsArtifact) GetDigest() string { return v.AllArtifactTree.Digest } - -func (v *NeighborsNeighborsArtifact) UnmarshalJSON(b []byte) error { +func (v *CertifyNoKnownVulnIngestVulnerabilityCertifyVuln) UnmarshalJSON(b []byte) error { if string(b) == "null" { return nil } var firstPass struct { - *NeighborsNeighborsArtifact + *CertifyNoKnownVulnIngestVulnerabilityCertifyVuln graphql.NoUnmarshalJSON } - firstPass.NeighborsNeighborsArtifact = v + firstPass.CertifyNoKnownVulnIngestVulnerabilityCertifyVuln = v err := json.Unmarshal(b, &firstPass) if err != nil { @@ -7447,24 +7390,24 @@ func (v *NeighborsNeighborsArtifact) UnmarshalJSON(b []byte) error { } err = json.Unmarshal( - b, &v.AllArtifactTree) + b, &v.AllCertifyVuln) if err != nil { return err } return nil } -type __premarshalNeighborsNeighborsArtifact struct { - Typename *string `json:"__typename"` - +type __premarshalCertifyNoKnownVulnIngestVulnerabilityCertifyVuln struct { Id string `json:"id"` - Algorithm string `json:"algorithm"` + Package AllCertifyVulnPackage `json:"package"` - Digest string `json:"digest"` + Vulnerability json.RawMessage `json:"vulnerability"` + + Metadata AllCertifyVulnMetadataVulnerabilityMetaData `json:"metadata"` } -func (v *NeighborsNeighborsArtifact) MarshalJSON() ([]byte, error) { +func (v *CertifyNoKnownVulnIngestVulnerabilityCertifyVuln) MarshalJSON() ([]byte, error) { premarshaled, err := v.__premarshalJSON() if err != nil { return nil, err @@ -7472,47 +7415,78 @@ func (v *NeighborsNeighborsArtifact) MarshalJSON() ([]byte, error) { return json.Marshal(premarshaled) } -func (v *NeighborsNeighborsArtifact) __premarshalJSON() (*__premarshalNeighborsNeighborsArtifact, error) { - var retval __premarshalNeighborsNeighborsArtifact +func (v *CertifyNoKnownVulnIngestVulnerabilityCertifyVuln) __premarshalJSON() (*__premarshalCertifyNoKnownVulnIngestVulnerabilityCertifyVuln, error) { + var retval __premarshalCertifyNoKnownVulnIngestVulnerabilityCertifyVuln - retval.Typename = v.Typename - retval.Id = v.AllArtifactTree.Id - retval.Algorithm = v.AllArtifactTree.Algorithm - retval.Digest = v.AllArtifactTree.Digest + retval.Id = v.AllCertifyVuln.Id + retval.Package = v.AllCertifyVuln.Package + { + + dst := &retval.Vulnerability + src := v.AllCertifyVuln.Vulnerability + var err error + *dst, err = __marshalAllCertifyVulnVulnerability( + &src) + if err != nil { + return nil, fmt.Errorf( + "unable to marshal CertifyNoKnownVulnIngestVulnerabilityCertifyVuln.AllCertifyVuln.Vulnerability: %w", err) + } + } + retval.Metadata = v.AllCertifyVuln.Metadata return &retval, nil } -// NeighborsNeighborsBuilder includes the requested fields of the GraphQL type Builder. +// CertifyNoKnownVulnResponse is returned by CertifyNoKnownVuln on success. +type CertifyNoKnownVulnResponse struct { + // Adds a certification that a package has been scanned for vulnerabilities. + IngestVulnerability CertifyNoKnownVulnIngestVulnerabilityCertifyVuln `json:"ingestVulnerability"` +} + +// GetIngestVulnerability returns CertifyNoKnownVulnResponse.IngestVulnerability, and is useful for accessing the field via an interface. +func (v *CertifyNoKnownVulnResponse) GetIngestVulnerability() CertifyNoKnownVulnIngestVulnerabilityCertifyVuln { + return v.IngestVulnerability +} + +// CertifyOSVIngestVulnerabilityCertifyVuln includes the requested fields of the GraphQL type CertifyVuln. // The GraphQL type's documentation follows. // -// Builder represents the builder (e.g., FRSCA or GitHub Actions). +// CertifyVuln is an attestation to attach vulnerability information to a package. // -// Currently builders are identified by the uri field. -type NeighborsNeighborsBuilder struct { - Typename *string `json:"__typename"` - allBuilderTree `json:"-"` +// This information is obtained via a scanner. If there is no vulnerability +// detected (no OSV, CVE, or GHSA), we attach the special NoVuln node. +type CertifyOSVIngestVulnerabilityCertifyVuln struct { + AllCertifyVuln `json:"-"` } -// GetTypename returns NeighborsNeighborsBuilder.Typename, and is useful for accessing the field via an interface. -func (v *NeighborsNeighborsBuilder) GetTypename() *string { return v.Typename } +// GetId returns CertifyOSVIngestVulnerabilityCertifyVuln.Id, and is useful for accessing the field via an interface. +func (v *CertifyOSVIngestVulnerabilityCertifyVuln) GetId() string { return v.AllCertifyVuln.Id } -// GetId returns NeighborsNeighborsBuilder.Id, and is useful for accessing the field via an interface. -func (v *NeighborsNeighborsBuilder) GetId() string { return v.allBuilderTree.Id } +// GetPackage returns CertifyOSVIngestVulnerabilityCertifyVuln.Package, and is useful for accessing the field via an interface. +func (v *CertifyOSVIngestVulnerabilityCertifyVuln) GetPackage() AllCertifyVulnPackage { + return v.AllCertifyVuln.Package +} -// GetUri returns NeighborsNeighborsBuilder.Uri, and is useful for accessing the field via an interface. -func (v *NeighborsNeighborsBuilder) GetUri() string { return v.allBuilderTree.Uri } +// GetVulnerability returns CertifyOSVIngestVulnerabilityCertifyVuln.Vulnerability, and is useful for accessing the field via an interface. +func (v *CertifyOSVIngestVulnerabilityCertifyVuln) GetVulnerability() AllCertifyVulnVulnerability { + return v.AllCertifyVuln.Vulnerability +} -func (v *NeighborsNeighborsBuilder) UnmarshalJSON(b []byte) error { +// GetMetadata returns CertifyOSVIngestVulnerabilityCertifyVuln.Metadata, and is useful for accessing the field via an interface. +func (v *CertifyOSVIngestVulnerabilityCertifyVuln) GetMetadata() AllCertifyVulnMetadataVulnerabilityMetaData { + return v.AllCertifyVuln.Metadata +} + +func (v *CertifyOSVIngestVulnerabilityCertifyVuln) UnmarshalJSON(b []byte) error { if string(b) == "null" { return nil } var firstPass struct { - *NeighborsNeighborsBuilder + *CertifyOSVIngestVulnerabilityCertifyVuln graphql.NoUnmarshalJSON } - firstPass.NeighborsNeighborsBuilder = v + firstPass.CertifyOSVIngestVulnerabilityCertifyVuln = v err := json.Unmarshal(b, &firstPass) if err != nil { @@ -7520,22 +7494,24 @@ func (v *NeighborsNeighborsBuilder) UnmarshalJSON(b []byte) error { } err = json.Unmarshal( - b, &v.allBuilderTree) + b, &v.AllCertifyVuln) if err != nil { return err } return nil } -type __premarshalNeighborsNeighborsBuilder struct { - Typename *string `json:"__typename"` - +type __premarshalCertifyOSVIngestVulnerabilityCertifyVuln struct { Id string `json:"id"` - Uri string `json:"uri"` + Package AllCertifyVulnPackage `json:"package"` + + Vulnerability json.RawMessage `json:"vulnerability"` + + Metadata AllCertifyVulnMetadataVulnerabilityMetaData `json:"metadata"` } -func (v *NeighborsNeighborsBuilder) MarshalJSON() ([]byte, error) { +func (v *CertifyOSVIngestVulnerabilityCertifyVuln) MarshalJSON() ([]byte, error) { premarshaled, err := v.__premarshalJSON() if err != nil { return nil, err @@ -7543,56 +7519,73 @@ func (v *NeighborsNeighborsBuilder) MarshalJSON() ([]byte, error) { return json.Marshal(premarshaled) } -func (v *NeighborsNeighborsBuilder) __premarshalJSON() (*__premarshalNeighborsNeighborsBuilder, error) { - var retval __premarshalNeighborsNeighborsBuilder +func (v *CertifyOSVIngestVulnerabilityCertifyVuln) __premarshalJSON() (*__premarshalCertifyOSVIngestVulnerabilityCertifyVuln, error) { + var retval __premarshalCertifyOSVIngestVulnerabilityCertifyVuln - retval.Typename = v.Typename - retval.Id = v.allBuilderTree.Id - retval.Uri = v.allBuilderTree.Uri + retval.Id = v.AllCertifyVuln.Id + retval.Package = v.AllCertifyVuln.Package + { + + dst := &retval.Vulnerability + src := v.AllCertifyVuln.Vulnerability + var err error + *dst, err = __marshalAllCertifyVulnVulnerability( + &src) + if err != nil { + return nil, fmt.Errorf( + "unable to marshal CertifyOSVIngestVulnerabilityCertifyVuln.AllCertifyVuln.Vulnerability: %w", err) + } + } + retval.Metadata = v.AllCertifyVuln.Metadata return &retval, nil } -// NeighborsNeighborsCVE includes the requested fields of the GraphQL type CVE. +// CertifyOSVResponse is returned by CertifyOSV on success. +type CertifyOSVResponse struct { + // Adds a certification that a package has been scanned for vulnerabilities. + IngestVulnerability CertifyOSVIngestVulnerabilityCertifyVuln `json:"ingestVulnerability"` +} + +// GetIngestVulnerability returns CertifyOSVResponse.IngestVulnerability, and is useful for accessing the field via an interface. +func (v *CertifyOSVResponse) GetIngestVulnerability() CertifyOSVIngestVulnerabilityCertifyVuln { + return v.IngestVulnerability +} + +// CertifyScorecardIngestScorecardCertifyScorecard includes the requested fields of the GraphQL type CertifyScorecard. // The GraphQL type's documentation follows. // -// CVE represents a vulnerability in the Common Vulnerabilities and Exposures -// schema. -// -// The vulnerability identifier contains a year field, so we are extracting that -// to allow matching for vulnerabilities found in a given year. -// -// The vulnerability identifier field is mandatory and canonicalized to be -// lowercase. -// -// This node can be referred to by other parts of GUAC. -type NeighborsNeighborsCVE struct { - Typename *string `json:"__typename"` - AllCveTree `json:"-"` +// CertifyScorecard is an attestation to attach a Scorecard analysis to a +// particular source repository. +type CertifyScorecardIngestScorecardCertifyScorecard struct { + AllCertifyScorecard `json:"-"` } -// GetTypename returns NeighborsNeighborsCVE.Typename, and is useful for accessing the field via an interface. -func (v *NeighborsNeighborsCVE) GetTypename() *string { return v.Typename } - -// GetId returns NeighborsNeighborsCVE.Id, and is useful for accessing the field via an interface. -func (v *NeighborsNeighborsCVE) GetId() string { return v.AllCveTree.Id } +// GetId returns CertifyScorecardIngestScorecardCertifyScorecard.Id, and is useful for accessing the field via an interface. +func (v *CertifyScorecardIngestScorecardCertifyScorecard) GetId() string { + return v.AllCertifyScorecard.Id +} -// GetYear returns NeighborsNeighborsCVE.Year, and is useful for accessing the field via an interface. -func (v *NeighborsNeighborsCVE) GetYear() int { return v.AllCveTree.Year } +// GetSource returns CertifyScorecardIngestScorecardCertifyScorecard.Source, and is useful for accessing the field via an interface. +func (v *CertifyScorecardIngestScorecardCertifyScorecard) GetSource() AllCertifyScorecardSource { + return v.AllCertifyScorecard.Source +} -// GetCveId returns NeighborsNeighborsCVE.CveId, and is useful for accessing the field via an interface. -func (v *NeighborsNeighborsCVE) GetCveId() string { return v.AllCveTree.CveId } +// GetScorecard returns CertifyScorecardIngestScorecardCertifyScorecard.Scorecard, and is useful for accessing the field via an interface. +func (v *CertifyScorecardIngestScorecardCertifyScorecard) GetScorecard() AllCertifyScorecardScorecard { + return v.AllCertifyScorecard.Scorecard +} -func (v *NeighborsNeighborsCVE) UnmarshalJSON(b []byte) error { +func (v *CertifyScorecardIngestScorecardCertifyScorecard) UnmarshalJSON(b []byte) error { if string(b) == "null" { return nil } var firstPass struct { - *NeighborsNeighborsCVE + *CertifyScorecardIngestScorecardCertifyScorecard graphql.NoUnmarshalJSON } - firstPass.NeighborsNeighborsCVE = v + firstPass.CertifyScorecardIngestScorecardCertifyScorecard = v err := json.Unmarshal(b, &firstPass) if err != nil { @@ -7600,24 +7593,22 @@ func (v *NeighborsNeighborsCVE) UnmarshalJSON(b []byte) error { } err = json.Unmarshal( - b, &v.AllCveTree) + b, &v.AllCertifyScorecard) if err != nil { return err } return nil } -type __premarshalNeighborsNeighborsCVE struct { - Typename *string `json:"__typename"` - +type __premarshalCertifyScorecardIngestScorecardCertifyScorecard struct { Id string `json:"id"` - Year int `json:"year"` + Source AllCertifyScorecardSource `json:"source"` - CveId string `json:"cveId"` + Scorecard AllCertifyScorecardScorecard `json:"scorecard"` } -func (v *NeighborsNeighborsCVE) MarshalJSON() ([]byte, error) { +func (v *CertifyScorecardIngestScorecardCertifyScorecard) MarshalJSON() ([]byte, error) { premarshaled, err := v.__premarshalJSON() if err != nil { return nil, err @@ -7625,68 +7616,61 @@ func (v *NeighborsNeighborsCVE) MarshalJSON() ([]byte, error) { return json.Marshal(premarshaled) } -func (v *NeighborsNeighborsCVE) __premarshalJSON() (*__premarshalNeighborsNeighborsCVE, error) { - var retval __premarshalNeighborsNeighborsCVE +func (v *CertifyScorecardIngestScorecardCertifyScorecard) __premarshalJSON() (*__premarshalCertifyScorecardIngestScorecardCertifyScorecard, error) { + var retval __premarshalCertifyScorecardIngestScorecardCertifyScorecard - retval.Typename = v.Typename - retval.Id = v.AllCveTree.Id - retval.Year = v.AllCveTree.Year - retval.CveId = v.AllCveTree.CveId + retval.Id = v.AllCertifyScorecard.Id + retval.Source = v.AllCertifyScorecard.Source + retval.Scorecard = v.AllCertifyScorecard.Scorecard return &retval, nil } -// NeighborsNeighborsCertifyBad includes the requested fields of the GraphQL type CertifyBad. -// The GraphQL type's documentation follows. -// -// CertifyBad is an attestation that a package, source, or artifact is considered -// bad. -// -// All evidence trees record a justification for the property they represent as -// well as the document that contains the attestation (origin) and the collector -// that collected the document (collector). -// -// The certification applies to a subject which is a package, source, or artifact. -// If the attestation targets a package, it must target a PackageName or a -// PackageVersion. If the attestation targets a source, it must target a -// SourceName. -type NeighborsNeighborsCertifyBad struct { - Typename *string `json:"__typename"` - AllCertifyBad `json:"-"` +// CertifyScorecardResponse is returned by CertifyScorecard on success. +type CertifyScorecardResponse struct { + // Adds a certification that a source repository has a Scorecard. + IngestScorecard CertifyScorecardIngestScorecardCertifyScorecard `json:"ingestScorecard"` } -// GetTypename returns NeighborsNeighborsCertifyBad.Typename, and is useful for accessing the field via an interface. -func (v *NeighborsNeighborsCertifyBad) GetTypename() *string { return v.Typename } - -// GetId returns NeighborsNeighborsCertifyBad.Id, and is useful for accessing the field via an interface. -func (v *NeighborsNeighborsCertifyBad) GetId() string { return v.AllCertifyBad.Id } - -// GetJustification returns NeighborsNeighborsCertifyBad.Justification, and is useful for accessing the field via an interface. -func (v *NeighborsNeighborsCertifyBad) GetJustification() string { - return v.AllCertifyBad.Justification +// GetIngestScorecard returns CertifyScorecardResponse.IngestScorecard, and is useful for accessing the field via an interface. +func (v *CertifyScorecardResponse) GetIngestScorecard() CertifyScorecardIngestScorecardCertifyScorecard { + return v.IngestScorecard } -// GetSubject returns NeighborsNeighborsCertifyBad.Subject, and is useful for accessing the field via an interface. -func (v *NeighborsNeighborsCertifyBad) GetSubject() AllCertifyBadSubjectPackageSourceOrArtifact { - return v.AllCertifyBad.Subject +// CertifyScorecardsIngestScorecardsCertifyScorecard includes the requested fields of the GraphQL type CertifyScorecard. +// The GraphQL type's documentation follows. +// +// CertifyScorecard is an attestation to attach a Scorecard analysis to a +// particular source repository. +type CertifyScorecardsIngestScorecardsCertifyScorecard struct { + AllCertifyScorecard `json:"-"` } -// GetOrigin returns NeighborsNeighborsCertifyBad.Origin, and is useful for accessing the field via an interface. -func (v *NeighborsNeighborsCertifyBad) GetOrigin() string { return v.AllCertifyBad.Origin } +// GetId returns CertifyScorecardsIngestScorecardsCertifyScorecard.Id, and is useful for accessing the field via an interface. +func (v *CertifyScorecardsIngestScorecardsCertifyScorecard) GetId() string { + return v.AllCertifyScorecard.Id +} -// GetCollector returns NeighborsNeighborsCertifyBad.Collector, and is useful for accessing the field via an interface. -func (v *NeighborsNeighborsCertifyBad) GetCollector() string { return v.AllCertifyBad.Collector } +// GetSource returns CertifyScorecardsIngestScorecardsCertifyScorecard.Source, and is useful for accessing the field via an interface. +func (v *CertifyScorecardsIngestScorecardsCertifyScorecard) GetSource() AllCertifyScorecardSource { + return v.AllCertifyScorecard.Source +} -func (v *NeighborsNeighborsCertifyBad) UnmarshalJSON(b []byte) error { +// GetScorecard returns CertifyScorecardsIngestScorecardsCertifyScorecard.Scorecard, and is useful for accessing the field via an interface. +func (v *CertifyScorecardsIngestScorecardsCertifyScorecard) GetScorecard() AllCertifyScorecardScorecard { + return v.AllCertifyScorecard.Scorecard +} + +func (v *CertifyScorecardsIngestScorecardsCertifyScorecard) UnmarshalJSON(b []byte) error { if string(b) == "null" { return nil } var firstPass struct { - *NeighborsNeighborsCertifyBad + *CertifyScorecardsIngestScorecardsCertifyScorecard graphql.NoUnmarshalJSON } - firstPass.NeighborsNeighborsCertifyBad = v + firstPass.CertifyScorecardsIngestScorecardsCertifyScorecard = v err := json.Unmarshal(b, &firstPass) if err != nil { @@ -7694,28 +7678,22 @@ func (v *NeighborsNeighborsCertifyBad) UnmarshalJSON(b []byte) error { } err = json.Unmarshal( - b, &v.AllCertifyBad) + b, &v.AllCertifyScorecard) if err != nil { return err } return nil } -type __premarshalNeighborsNeighborsCertifyBad struct { - Typename *string `json:"__typename"` - +type __premarshalCertifyScorecardsIngestScorecardsCertifyScorecard struct { Id string `json:"id"` - Justification string `json:"justification"` - - Subject json.RawMessage `json:"subject"` - - Origin string `json:"origin"` + Source AllCertifyScorecardSource `json:"source"` - Collector string `json:"collector"` + Scorecard AllCertifyScorecardScorecard `json:"scorecard"` } -func (v *NeighborsNeighborsCertifyBad) MarshalJSON() ([]byte, error) { +func (v *CertifyScorecardsIngestScorecardsCertifyScorecard) MarshalJSON() ([]byte, error) { premarshaled, err := v.__premarshalJSON() if err != nil { return nil, err @@ -7723,81 +7701,168 @@ func (v *NeighborsNeighborsCertifyBad) MarshalJSON() ([]byte, error) { return json.Marshal(premarshaled) } -func (v *NeighborsNeighborsCertifyBad) __premarshalJSON() (*__premarshalNeighborsNeighborsCertifyBad, error) { - var retval __premarshalNeighborsNeighborsCertifyBad - - retval.Typename = v.Typename - retval.Id = v.AllCertifyBad.Id - retval.Justification = v.AllCertifyBad.Justification - { +func (v *CertifyScorecardsIngestScorecardsCertifyScorecard) __premarshalJSON() (*__premarshalCertifyScorecardsIngestScorecardsCertifyScorecard, error) { + var retval __premarshalCertifyScorecardsIngestScorecardsCertifyScorecard - dst := &retval.Subject - src := v.AllCertifyBad.Subject - var err error - *dst, err = __marshalAllCertifyBadSubjectPackageSourceOrArtifact( - &src) - if err != nil { - return nil, fmt.Errorf( - "unable to marshal NeighborsNeighborsCertifyBad.AllCertifyBad.Subject: %w", err) - } - } - retval.Origin = v.AllCertifyBad.Origin - retval.Collector = v.AllCertifyBad.Collector + retval.Id = v.AllCertifyScorecard.Id + retval.Source = v.AllCertifyScorecard.Source + retval.Scorecard = v.AllCertifyScorecard.Scorecard return &retval, nil } -// NeighborsNeighborsCertifyGood includes the requested fields of the GraphQL type CertifyGood. +// CertifyScorecardsResponse is returned by CertifyScorecards on success. +type CertifyScorecardsResponse struct { + // Adds bulk certifications that a source repository has a Scorecard. + IngestScorecards []CertifyScorecardsIngestScorecardsCertifyScorecard `json:"ingestScorecards"` +} + +// GetIngestScorecards returns CertifyScorecardsResponse.IngestScorecards, and is useful for accessing the field via an interface. +func (v *CertifyScorecardsResponse) GetIngestScorecards() []CertifyScorecardsIngestScorecardsCertifyScorecard { + return v.IngestScorecards +} + +// DependencyType determines the type of the dependency. +type DependencyType string + +const ( + // direct dependency + DependencyTypeDirect DependencyType = "DIRECT" + // indirect dependency + DependencyTypeIndirect DependencyType = "INDIRECT" + // type not known/not specified + DependencyTypeUnknown DependencyType = "UNKNOWN" +) + +// Edge allows filtering path/neighbors output to only contain a subset of all +// possible GUAC links. +// +// Each member of the enum is formed by merging two Node names with _. Each name +// is converted from CamelCase to CAPITALS_WITH_UNDERSCORES. Only valid edges +// (pairs from Node to Node) are included. +// +// The only exception to the above rule is for links out of HasSLSA. The names are +// HAS_SLSA_SUBJECT, HAS_SLSA_BUILT_BY, and HAS_SLSA_MATERIALS. This is because +// ARTIFACT_HAS_SLSA is only from subject Artifact to HasSLSA. +type Edge string + +const ( + EdgeArtifactCertifyBad Edge = "ARTIFACT_CERTIFY_BAD" + EdgeArtifactCertifyGood Edge = "ARTIFACT_CERTIFY_GOOD" + EdgeArtifactCertifyVexStatement Edge = "ARTIFACT_CERTIFY_VEX_STATEMENT" + EdgeArtifactHashEqual Edge = "ARTIFACT_HASH_EQUAL" + EdgeArtifactHasSbom Edge = "ARTIFACT_HAS_SBOM" + EdgeArtifactHasSlsa Edge = "ARTIFACT_HAS_SLSA" + EdgeArtifactIsOccurrence Edge = "ARTIFACT_IS_OCCURRENCE" + EdgeArtifactHasMetadata Edge = "ARTIFACT_HAS_METADATA" + EdgeArtifactPointOfContact Edge = "ARTIFACT_POINT_OF_CONTACT" + EdgeBuilderHasSlsa Edge = "BUILDER_HAS_SLSA" + EdgeCveCertifyVexStatement Edge = "CVE_CERTIFY_VEX_STATEMENT" + EdgeCveCertifyVuln Edge = "CVE_CERTIFY_VULN" + EdgeCveIsVulnerability Edge = "CVE_IS_VULNERABILITY" + EdgeGhsaCertifyVexStatement Edge = "GHSA_CERTIFY_VEX_STATEMENT" + EdgeGhsaCertifyVuln Edge = "GHSA_CERTIFY_VULN" + EdgeGhsaIsVulnerability Edge = "GHSA_IS_VULNERABILITY" + EdgeNoVulnCertifyVuln Edge = "NO_VULN_CERTIFY_VULN" + EdgeOsvCertifyVexStatement Edge = "OSV_CERTIFY_VEX_STATEMENT" + EdgeOsvCertifyVuln Edge = "OSV_CERTIFY_VULN" + EdgeOsvIsVulnerability Edge = "OSV_IS_VULNERABILITY" + EdgePackageCertifyBad Edge = "PACKAGE_CERTIFY_BAD" + EdgePackageCertifyGood Edge = "PACKAGE_CERTIFY_GOOD" + EdgePackageCertifyVexStatement Edge = "PACKAGE_CERTIFY_VEX_STATEMENT" + EdgePackageCertifyVuln Edge = "PACKAGE_CERTIFY_VULN" + EdgePackageHasSbom Edge = "PACKAGE_HAS_SBOM" + EdgePackageHasSourceAt Edge = "PACKAGE_HAS_SOURCE_AT" + EdgePackageIsDependency Edge = "PACKAGE_IS_DEPENDENCY" + EdgePackageIsOccurrence Edge = "PACKAGE_IS_OCCURRENCE" + EdgePackagePkgEqual Edge = "PACKAGE_PKG_EQUAL" + EdgePackageHasMetadata Edge = "PACKAGE_HAS_METADATA" + EdgePackagePointOfContact Edge = "PACKAGE_POINT_OF_CONTACT" + EdgeSourceCertifyBad Edge = "SOURCE_CERTIFY_BAD" + EdgeSourceCertifyGood Edge = "SOURCE_CERTIFY_GOOD" + EdgeSourceCertifyScorecard Edge = "SOURCE_CERTIFY_SCORECARD" + EdgeSourceHasSourceAt Edge = "SOURCE_HAS_SOURCE_AT" + EdgeSourceIsOccurrence Edge = "SOURCE_IS_OCCURRENCE" + EdgeSourceHasMetadata Edge = "SOURCE_HAS_METADATA" + EdgeSourcePointOfContact Edge = "SOURCE_POINT_OF_CONTACT" + EdgeCertifyBadArtifact Edge = "CERTIFY_BAD_ARTIFACT" + EdgeCertifyBadPackage Edge = "CERTIFY_BAD_PACKAGE" + EdgeCertifyBadSource Edge = "CERTIFY_BAD_SOURCE" + EdgeCertifyGoodArtifact Edge = "CERTIFY_GOOD_ARTIFACT" + EdgeCertifyGoodPackage Edge = "CERTIFY_GOOD_PACKAGE" + EdgeCertifyGoodSource Edge = "CERTIFY_GOOD_SOURCE" + EdgeCertifyScorecardSource Edge = "CERTIFY_SCORECARD_SOURCE" + EdgeCertifyVexStatementArtifact Edge = "CERTIFY_VEX_STATEMENT_ARTIFACT" + EdgeCertifyVexStatementCve Edge = "CERTIFY_VEX_STATEMENT_CVE" + EdgeCertifyVexStatementGhsa Edge = "CERTIFY_VEX_STATEMENT_GHSA" + EdgeCertifyVexStatementOsv Edge = "CERTIFY_VEX_STATEMENT_OSV" + EdgeCertifyVexStatementPackage Edge = "CERTIFY_VEX_STATEMENT_PACKAGE" + EdgeCertifyVulnCve Edge = "CERTIFY_VULN_CVE" + EdgeCertifyVulnGhsa Edge = "CERTIFY_VULN_GHSA" + EdgeCertifyVulnNoVuln Edge = "CERTIFY_VULN_NO_VULN" + EdgeCertifyVulnOsv Edge = "CERTIFY_VULN_OSV" + EdgeCertifyVulnPackage Edge = "CERTIFY_VULN_PACKAGE" + EdgeHashEqualArtifact Edge = "HASH_EQUAL_ARTIFACT" + EdgeHasSbomArtifact Edge = "HAS_SBOM_ARTIFACT" + EdgeHasSbomPackage Edge = "HAS_SBOM_PACKAGE" + EdgeHasSlsaBuiltBy Edge = "HAS_SLSA_BUILT_BY" + EdgeHasSlsaMaterials Edge = "HAS_SLSA_MATERIALS" + EdgeHasSlsaSubject Edge = "HAS_SLSA_SUBJECT" + EdgeHasSourceAtPackage Edge = "HAS_SOURCE_AT_PACKAGE" + EdgeHasSourceAtSource Edge = "HAS_SOURCE_AT_SOURCE" + EdgeIsDependencyPackage Edge = "IS_DEPENDENCY_PACKAGE" + EdgeIsOccurrenceArtifact Edge = "IS_OCCURRENCE_ARTIFACT" + EdgeIsOccurrencePackage Edge = "IS_OCCURRENCE_PACKAGE" + EdgeIsOccurrenceSource Edge = "IS_OCCURRENCE_SOURCE" + EdgeIsVulnerabilityCve Edge = "IS_VULNERABILITY_CVE" + EdgeIsVulnerabilityGhsa Edge = "IS_VULNERABILITY_GHSA" + EdgeIsVulnerabilityOsv Edge = "IS_VULNERABILITY_OSV" + EdgePkgEqualPackage Edge = "PKG_EQUAL_PACKAGE" + EdgeHasMetadataPackage Edge = "HAS_METADATA_PACKAGE" + EdgeHasMetadataArtifact Edge = "HAS_METADATA_ARTIFACT" + EdgeHasMetadataSource Edge = "HAS_METADATA_SOURCE" + EdgePointOfContactPackage Edge = "POINT_OF_CONTACT_PACKAGE" + EdgePointOfContactArtifact Edge = "POINT_OF_CONTACT_ARTIFACT" + EdgePointOfContactSource Edge = "POINT_OF_CONTACT_SOURCE" +) + +// FindSoftwareFindSoftwareArtifact includes the requested fields of the GraphQL type Artifact. // The GraphQL type's documentation follows. // -// CertifyGood is an attestation that a package, source, or artifact is considered -// good. +// Artifact represents an artifact identified by a checksum hash. // -// All evidence trees record a justification for the property they represent as -// well as the document that contains the attestation (origin) and the collector -// that collected the document (collector). +// The checksum is split into the digest value and the algorithm used to generate +// it. Both fields are mandatory and canonicalized to be lowercase. // -// The certification applies to a subject which is a package, source, or artifact. -// If the attestation targets a package, it must target a PackageName or a -// PackageVersion. If the attestation targets a source, it must target a -// SourceName. -type NeighborsNeighborsCertifyGood struct { - Typename *string `json:"__typename"` - allCertifyGood `json:"-"` +// If having a checksum Go object, algorithm can be +// strings.ToLower(string(checksum.Algorithm)) and digest can be checksum.Value. +type FindSoftwareFindSoftwareArtifact struct { + Typename *string `json:"__typename"` + AllArtifactTree `json:"-"` } -// GetTypename returns NeighborsNeighborsCertifyGood.Typename, and is useful for accessing the field via an interface. -func (v *NeighborsNeighborsCertifyGood) GetTypename() *string { return v.Typename } - -// GetId returns NeighborsNeighborsCertifyGood.Id, and is useful for accessing the field via an interface. -func (v *NeighborsNeighborsCertifyGood) GetId() string { return v.allCertifyGood.Id } - -// GetJustification returns NeighborsNeighborsCertifyGood.Justification, and is useful for accessing the field via an interface. -func (v *NeighborsNeighborsCertifyGood) GetJustification() string { - return v.allCertifyGood.Justification -} +// GetTypename returns FindSoftwareFindSoftwareArtifact.Typename, and is useful for accessing the field via an interface. +func (v *FindSoftwareFindSoftwareArtifact) GetTypename() *string { return v.Typename } -// GetSubject returns NeighborsNeighborsCertifyGood.Subject, and is useful for accessing the field via an interface. -func (v *NeighborsNeighborsCertifyGood) GetSubject() allCertifyGoodSubjectPackageSourceOrArtifact { - return v.allCertifyGood.Subject -} +// GetId returns FindSoftwareFindSoftwareArtifact.Id, and is useful for accessing the field via an interface. +func (v *FindSoftwareFindSoftwareArtifact) GetId() string { return v.AllArtifactTree.Id } -// GetOrigin returns NeighborsNeighborsCertifyGood.Origin, and is useful for accessing the field via an interface. -func (v *NeighborsNeighborsCertifyGood) GetOrigin() string { return v.allCertifyGood.Origin } +// GetAlgorithm returns FindSoftwareFindSoftwareArtifact.Algorithm, and is useful for accessing the field via an interface. +func (v *FindSoftwareFindSoftwareArtifact) GetAlgorithm() string { return v.AllArtifactTree.Algorithm } -// GetCollector returns NeighborsNeighborsCertifyGood.Collector, and is useful for accessing the field via an interface. -func (v *NeighborsNeighborsCertifyGood) GetCollector() string { return v.allCertifyGood.Collector } +// GetDigest returns FindSoftwareFindSoftwareArtifact.Digest, and is useful for accessing the field via an interface. +func (v *FindSoftwareFindSoftwareArtifact) GetDigest() string { return v.AllArtifactTree.Digest } -func (v *NeighborsNeighborsCertifyGood) UnmarshalJSON(b []byte) error { +func (v *FindSoftwareFindSoftwareArtifact) UnmarshalJSON(b []byte) error { if string(b) == "null" { return nil } var firstPass struct { - *NeighborsNeighborsCertifyGood + *FindSoftwareFindSoftwareArtifact graphql.NoUnmarshalJSON } - firstPass.NeighborsNeighborsCertifyGood = v + firstPass.FindSoftwareFindSoftwareArtifact = v err := json.Unmarshal(b, &firstPass) if err != nil { @@ -7805,28 +7870,24 @@ func (v *NeighborsNeighborsCertifyGood) UnmarshalJSON(b []byte) error { } err = json.Unmarshal( - b, &v.allCertifyGood) + b, &v.AllArtifactTree) if err != nil { return err } return nil } -type __premarshalNeighborsNeighborsCertifyGood struct { +type __premarshalFindSoftwareFindSoftwareArtifact struct { Typename *string `json:"__typename"` Id string `json:"id"` - Justification string `json:"justification"` - - Subject json.RawMessage `json:"subject"` - - Origin string `json:"origin"` + Algorithm string `json:"algorithm"` - Collector string `json:"collector"` + Digest string `json:"digest"` } -func (v *NeighborsNeighborsCertifyGood) MarshalJSON() ([]byte, error) { +func (v *FindSoftwareFindSoftwareArtifact) MarshalJSON() ([]byte, error) { premarshaled, err := v.__premarshalJSON() if err != nil { return nil, err @@ -7834,66 +7895,63 @@ func (v *NeighborsNeighborsCertifyGood) MarshalJSON() ([]byte, error) { return json.Marshal(premarshaled) } -func (v *NeighborsNeighborsCertifyGood) __premarshalJSON() (*__premarshalNeighborsNeighborsCertifyGood, error) { - var retval __premarshalNeighborsNeighborsCertifyGood +func (v *FindSoftwareFindSoftwareArtifact) __premarshalJSON() (*__premarshalFindSoftwareFindSoftwareArtifact, error) { + var retval __premarshalFindSoftwareFindSoftwareArtifact retval.Typename = v.Typename - retval.Id = v.allCertifyGood.Id - retval.Justification = v.allCertifyGood.Justification - { - - dst := &retval.Subject - src := v.allCertifyGood.Subject - var err error - *dst, err = __marshalallCertifyGoodSubjectPackageSourceOrArtifact( - &src) - if err != nil { - return nil, fmt.Errorf( - "unable to marshal NeighborsNeighborsCertifyGood.allCertifyGood.Subject: %w", err) - } - } - retval.Origin = v.allCertifyGood.Origin - retval.Collector = v.allCertifyGood.Collector + retval.Id = v.AllArtifactTree.Id + retval.Algorithm = v.AllArtifactTree.Algorithm + retval.Digest = v.AllArtifactTree.Digest return &retval, nil } -// NeighborsNeighborsCertifyScorecard includes the requested fields of the GraphQL type CertifyScorecard. +// FindSoftwareFindSoftwarePackage includes the requested fields of the GraphQL type Package. // The GraphQL type's documentation follows. // -// CertifyScorecard is an attestation to attach a Scorecard analysis to a -// particular source repository. -type NeighborsNeighborsCertifyScorecard struct { - Typename *string `json:"__typename"` - AllCertifyScorecard `json:"-"` +// Package represents the root of the package trie/tree. +// +// We map package information to a trie, closely matching the pURL specification +// (https://github.com/package-url/purl-spec/blob/0dd92f26f8bb11956ffdf5e8acfcee71e8560407/README.rst), +// but deviating from it where GUAC heuristics allow for better representation of +// package information. Each path in the trie fully represents a package; we split +// the trie based on the pURL components. +// +// This node matches a pkg: partial pURL. The type field matches the +// pURL types but we might also use "guac" for the cases where the pURL +// representation is not complete or when we have custom rules. +// +// Since this node is at the root of the package trie, it is named Package, not +// PackageType. +type FindSoftwareFindSoftwarePackage struct { + Typename *string `json:"__typename"` + AllPkgTree `json:"-"` } -// GetTypename returns NeighborsNeighborsCertifyScorecard.Typename, and is useful for accessing the field via an interface. -func (v *NeighborsNeighborsCertifyScorecard) GetTypename() *string { return v.Typename } +// GetTypename returns FindSoftwareFindSoftwarePackage.Typename, and is useful for accessing the field via an interface. +func (v *FindSoftwareFindSoftwarePackage) GetTypename() *string { return v.Typename } -// GetId returns NeighborsNeighborsCertifyScorecard.Id, and is useful for accessing the field via an interface. -func (v *NeighborsNeighborsCertifyScorecard) GetId() string { return v.AllCertifyScorecard.Id } +// GetId returns FindSoftwareFindSoftwarePackage.Id, and is useful for accessing the field via an interface. +func (v *FindSoftwareFindSoftwarePackage) GetId() string { return v.AllPkgTree.Id } -// GetSource returns NeighborsNeighborsCertifyScorecard.Source, and is useful for accessing the field via an interface. -func (v *NeighborsNeighborsCertifyScorecard) GetSource() AllCertifyScorecardSource { - return v.AllCertifyScorecard.Source -} +// GetType returns FindSoftwareFindSoftwarePackage.Type, and is useful for accessing the field via an interface. +func (v *FindSoftwareFindSoftwarePackage) GetType() string { return v.AllPkgTree.Type } -// GetScorecard returns NeighborsNeighborsCertifyScorecard.Scorecard, and is useful for accessing the field via an interface. -func (v *NeighborsNeighborsCertifyScorecard) GetScorecard() AllCertifyScorecardScorecard { - return v.AllCertifyScorecard.Scorecard +// GetNamespaces returns FindSoftwareFindSoftwarePackage.Namespaces, and is useful for accessing the field via an interface. +func (v *FindSoftwareFindSoftwarePackage) GetNamespaces() []AllPkgTreeNamespacesPackageNamespace { + return v.AllPkgTree.Namespaces } -func (v *NeighborsNeighborsCertifyScorecard) UnmarshalJSON(b []byte) error { +func (v *FindSoftwareFindSoftwarePackage) UnmarshalJSON(b []byte) error { if string(b) == "null" { return nil } var firstPass struct { - *NeighborsNeighborsCertifyScorecard + *FindSoftwareFindSoftwarePackage graphql.NoUnmarshalJSON } - firstPass.NeighborsNeighborsCertifyScorecard = v + firstPass.FindSoftwareFindSoftwarePackage = v err := json.Unmarshal(b, &firstPass) if err != nil { @@ -7901,24 +7959,24 @@ func (v *NeighborsNeighborsCertifyScorecard) UnmarshalJSON(b []byte) error { } err = json.Unmarshal( - b, &v.AllCertifyScorecard) + b, &v.AllPkgTree) if err != nil { return err } return nil } -type __premarshalNeighborsNeighborsCertifyScorecard struct { +type __premarshalFindSoftwareFindSoftwarePackage struct { Typename *string `json:"__typename"` Id string `json:"id"` - Source AllCertifyScorecardSource `json:"source"` + Type string `json:"type"` - Scorecard AllCertifyScorecardScorecard `json:"scorecard"` + Namespaces []AllPkgTreeNamespacesPackageNamespace `json:"namespaces"` } -func (v *NeighborsNeighborsCertifyScorecard) MarshalJSON() ([]byte, error) { +func (v *FindSoftwareFindSoftwarePackage) MarshalJSON() ([]byte, error) { premarshaled, err := v.__premarshalJSON() if err != nil { return nil, err @@ -7926,88 +7984,162 @@ func (v *NeighborsNeighborsCertifyScorecard) MarshalJSON() ([]byte, error) { return json.Marshal(premarshaled) } -func (v *NeighborsNeighborsCertifyScorecard) __premarshalJSON() (*__premarshalNeighborsNeighborsCertifyScorecard, error) { - var retval __premarshalNeighborsNeighborsCertifyScorecard +func (v *FindSoftwareFindSoftwarePackage) __premarshalJSON() (*__premarshalFindSoftwareFindSoftwarePackage, error) { + var retval __premarshalFindSoftwareFindSoftwarePackage retval.Typename = v.Typename - retval.Id = v.AllCertifyScorecard.Id - retval.Source = v.AllCertifyScorecard.Source - retval.Scorecard = v.AllCertifyScorecard.Scorecard + retval.Id = v.AllPkgTree.Id + retval.Type = v.AllPkgTree.Type + retval.Namespaces = v.AllPkgTree.Namespaces return &retval, nil } -// NeighborsNeighborsCertifyVEXStatement includes the requested fields of the GraphQL type CertifyVEXStatement. +// FindSoftwareFindSoftwarePackageSourceOrArtifact includes the requested fields of the GraphQL interface PackageSourceOrArtifact. +// +// FindSoftwareFindSoftwarePackageSourceOrArtifact is implemented by the following types: +// FindSoftwareFindSoftwareArtifact +// FindSoftwareFindSoftwarePackage +// FindSoftwareFindSoftwareSource // The GraphQL type's documentation follows. // -// CertifyVEXStatement is an attestation to attach VEX statements to a package or -// artifact to clarify the impact of a specific vulnerability (CVE, GHSA or OSV). -type NeighborsNeighborsCertifyVEXStatement struct { - Typename *string `json:"__typename"` - allCertifyVEXStatement `json:"-"` +// PackageSourceOrArtifact is a union of Package, Source, and Artifact. +type FindSoftwareFindSoftwarePackageSourceOrArtifact interface { + implementsGraphQLInterfaceFindSoftwareFindSoftwarePackageSourceOrArtifact() + // GetTypename returns the receiver's concrete GraphQL type-name (see interface doc for possible values). + GetTypename() *string } -// GetTypename returns NeighborsNeighborsCertifyVEXStatement.Typename, and is useful for accessing the field via an interface. -func (v *NeighborsNeighborsCertifyVEXStatement) GetTypename() *string { return v.Typename } +func (v *FindSoftwareFindSoftwareArtifact) implementsGraphQLInterfaceFindSoftwareFindSoftwarePackageSourceOrArtifact() { +} +func (v *FindSoftwareFindSoftwarePackage) implementsGraphQLInterfaceFindSoftwareFindSoftwarePackageSourceOrArtifact() { +} +func (v *FindSoftwareFindSoftwareSource) implementsGraphQLInterfaceFindSoftwareFindSoftwarePackageSourceOrArtifact() { +} -// GetId returns NeighborsNeighborsCertifyVEXStatement.Id, and is useful for accessing the field via an interface. -func (v *NeighborsNeighborsCertifyVEXStatement) GetId() string { return v.allCertifyVEXStatement.Id } +func __unmarshalFindSoftwareFindSoftwarePackageSourceOrArtifact(b []byte, v *FindSoftwareFindSoftwarePackageSourceOrArtifact) error { + if string(b) == "null" { + return nil + } -// GetSubject returns NeighborsNeighborsCertifyVEXStatement.Subject, and is useful for accessing the field via an interface. -func (v *NeighborsNeighborsCertifyVEXStatement) GetSubject() allCertifyVEXStatementSubjectPackageOrArtifact { - return v.allCertifyVEXStatement.Subject -} + var tn struct { + TypeName string `json:"__typename"` + } + err := json.Unmarshal(b, &tn) + if err != nil { + return err + } -// GetVulnerability returns NeighborsNeighborsCertifyVEXStatement.Vulnerability, and is useful for accessing the field via an interface. -func (v *NeighborsNeighborsCertifyVEXStatement) GetVulnerability() allCertifyVEXStatementVulnerability { - return v.allCertifyVEXStatement.Vulnerability + switch tn.TypeName { + case "Artifact": + *v = new(FindSoftwareFindSoftwareArtifact) + return json.Unmarshal(b, *v) + case "Package": + *v = new(FindSoftwareFindSoftwarePackage) + return json.Unmarshal(b, *v) + case "Source": + *v = new(FindSoftwareFindSoftwareSource) + return json.Unmarshal(b, *v) + case "": + return fmt.Errorf( + "response was missing PackageSourceOrArtifact.__typename") + default: + return fmt.Errorf( + `unexpected concrete type for FindSoftwareFindSoftwarePackageSourceOrArtifact: "%v"`, tn.TypeName) + } } -// GetStatus returns NeighborsNeighborsCertifyVEXStatement.Status, and is useful for accessing the field via an interface. -func (v *NeighborsNeighborsCertifyVEXStatement) GetStatus() VexStatus { - return v.allCertifyVEXStatement.Status -} +func __marshalFindSoftwareFindSoftwarePackageSourceOrArtifact(v *FindSoftwareFindSoftwarePackageSourceOrArtifact) ([]byte, error) { -// GetVexJustification returns NeighborsNeighborsCertifyVEXStatement.VexJustification, and is useful for accessing the field via an interface. -func (v *NeighborsNeighborsCertifyVEXStatement) GetVexJustification() VexJustification { - return v.allCertifyVEXStatement.VexJustification -} + var typename string + switch v := (*v).(type) { + case *FindSoftwareFindSoftwareArtifact: + typename = "Artifact" -// GetStatement returns NeighborsNeighborsCertifyVEXStatement.Statement, and is useful for accessing the field via an interface. -func (v *NeighborsNeighborsCertifyVEXStatement) GetStatement() string { - return v.allCertifyVEXStatement.Statement -} + premarshaled, err := v.__premarshalJSON() + if err != nil { + return nil, err + } + result := struct { + TypeName string `json:"__typename"` + *__premarshalFindSoftwareFindSoftwareArtifact + }{typename, premarshaled} + return json.Marshal(result) + case *FindSoftwareFindSoftwarePackage: + typename = "Package" -// GetStatusNotes returns NeighborsNeighborsCertifyVEXStatement.StatusNotes, and is useful for accessing the field via an interface. -func (v *NeighborsNeighborsCertifyVEXStatement) GetStatusNotes() string { - return v.allCertifyVEXStatement.StatusNotes -} + premarshaled, err := v.__premarshalJSON() + if err != nil { + return nil, err + } + result := struct { + TypeName string `json:"__typename"` + *__premarshalFindSoftwareFindSoftwarePackage + }{typename, premarshaled} + return json.Marshal(result) + case *FindSoftwareFindSoftwareSource: + typename = "Source" -// GetKnownSince returns NeighborsNeighborsCertifyVEXStatement.KnownSince, and is useful for accessing the field via an interface. -func (v *NeighborsNeighborsCertifyVEXStatement) GetKnownSince() time.Time { - return v.allCertifyVEXStatement.KnownSince + premarshaled, err := v.__premarshalJSON() + if err != nil { + return nil, err + } + result := struct { + TypeName string `json:"__typename"` + *__premarshalFindSoftwareFindSoftwareSource + }{typename, premarshaled} + return json.Marshal(result) + case nil: + return []byte("null"), nil + default: + return nil, fmt.Errorf( + `unexpected concrete type for FindSoftwareFindSoftwarePackageSourceOrArtifact: "%T"`, v) + } } -// GetOrigin returns NeighborsNeighborsCertifyVEXStatement.Origin, and is useful for accessing the field via an interface. -func (v *NeighborsNeighborsCertifyVEXStatement) GetOrigin() string { - return v.allCertifyVEXStatement.Origin +// FindSoftwareFindSoftwareSource includes the requested fields of the GraphQL type Source. +// The GraphQL type's documentation follows. +// +// Source represents the root of the source trie/tree. +// +// We map source information to a trie, as a derivative of the pURL specification: +// each path in the trie represents a type, namespace, name and an optional +// qualifier that stands for tag/commit information. +// +// This node represents the type part of the trie path. It is used to represent +// the version control system that is being used. +// +// Since this node is at the root of the source trie, it is named Source, not +// SourceType. +type FindSoftwareFindSoftwareSource struct { + Typename *string `json:"__typename"` + AllSourceTree `json:"-"` } -// GetCollector returns NeighborsNeighborsCertifyVEXStatement.Collector, and is useful for accessing the field via an interface. -func (v *NeighborsNeighborsCertifyVEXStatement) GetCollector() string { - return v.allCertifyVEXStatement.Collector +// GetTypename returns FindSoftwareFindSoftwareSource.Typename, and is useful for accessing the field via an interface. +func (v *FindSoftwareFindSoftwareSource) GetTypename() *string { return v.Typename } + +// GetId returns FindSoftwareFindSoftwareSource.Id, and is useful for accessing the field via an interface. +func (v *FindSoftwareFindSoftwareSource) GetId() string { return v.AllSourceTree.Id } + +// GetType returns FindSoftwareFindSoftwareSource.Type, and is useful for accessing the field via an interface. +func (v *FindSoftwareFindSoftwareSource) GetType() string { return v.AllSourceTree.Type } + +// GetNamespaces returns FindSoftwareFindSoftwareSource.Namespaces, and is useful for accessing the field via an interface. +func (v *FindSoftwareFindSoftwareSource) GetNamespaces() []AllSourceTreeNamespacesSourceNamespace { + return v.AllSourceTree.Namespaces } -func (v *NeighborsNeighborsCertifyVEXStatement) UnmarshalJSON(b []byte) error { +func (v *FindSoftwareFindSoftwareSource) UnmarshalJSON(b []byte) error { if string(b) == "null" { return nil } var firstPass struct { - *NeighborsNeighborsCertifyVEXStatement + *FindSoftwareFindSoftwareSource graphql.NoUnmarshalJSON } - firstPass.NeighborsNeighborsCertifyVEXStatement = v + firstPass.FindSoftwareFindSoftwareSource = v err := json.Unmarshal(b, &firstPass) if err != nil { @@ -8015,38 +8147,24 @@ func (v *NeighborsNeighborsCertifyVEXStatement) UnmarshalJSON(b []byte) error { } err = json.Unmarshal( - b, &v.allCertifyVEXStatement) + b, &v.AllSourceTree) if err != nil { return err } return nil } -type __premarshalNeighborsNeighborsCertifyVEXStatement struct { +type __premarshalFindSoftwareFindSoftwareSource struct { Typename *string `json:"__typename"` Id string `json:"id"` - Subject json.RawMessage `json:"subject"` - - Vulnerability json.RawMessage `json:"vulnerability"` - - Status VexStatus `json:"status"` - - VexJustification VexJustification `json:"vexJustification"` - - Statement string `json:"statement"` - - StatusNotes string `json:"statusNotes"` - - KnownSince time.Time `json:"knownSince"` - - Origin string `json:"origin"` + Type string `json:"type"` - Collector string `json:"collector"` + Namespaces []AllSourceTreeNamespacesSourceNamespace `json:"namespaces"` } -func (v *NeighborsNeighborsCertifyVEXStatement) MarshalJSON() ([]byte, error) { +func (v *FindSoftwareFindSoftwareSource) MarshalJSON() ([]byte, error) { premarshaled, err := v.__premarshalJSON() if err != nil { return nil, err @@ -8054,116 +8172,87 @@ func (v *NeighborsNeighborsCertifyVEXStatement) MarshalJSON() ([]byte, error) { return json.Marshal(premarshaled) } -func (v *NeighborsNeighborsCertifyVEXStatement) __premarshalJSON() (*__premarshalNeighborsNeighborsCertifyVEXStatement, error) { - var retval __premarshalNeighborsNeighborsCertifyVEXStatement +func (v *FindSoftwareFindSoftwareSource) __premarshalJSON() (*__premarshalFindSoftwareFindSoftwareSource, error) { + var retval __premarshalFindSoftwareFindSoftwareSource retval.Typename = v.Typename - retval.Id = v.allCertifyVEXStatement.Id - { + retval.Id = v.AllSourceTree.Id + retval.Type = v.AllSourceTree.Type + retval.Namespaces = v.AllSourceTree.Namespaces + return &retval, nil +} - dst := &retval.Subject - src := v.allCertifyVEXStatement.Subject - var err error - *dst, err = __marshalallCertifyVEXStatementSubjectPackageOrArtifact( - &src) - if err != nil { - return nil, fmt.Errorf( - "unable to marshal NeighborsNeighborsCertifyVEXStatement.allCertifyVEXStatement.Subject: %w", err) - } - } - { - - dst := &retval.Vulnerability - src := v.allCertifyVEXStatement.Vulnerability - var err error - *dst, err = __marshalallCertifyVEXStatementVulnerability( - &src) - if err != nil { - return nil, fmt.Errorf( - "unable to marshal NeighborsNeighborsCertifyVEXStatement.allCertifyVEXStatement.Vulnerability: %w", err) - } - } - retval.Status = v.allCertifyVEXStatement.Status - retval.VexJustification = v.allCertifyVEXStatement.VexJustification - retval.Statement = v.allCertifyVEXStatement.Statement - retval.StatusNotes = v.allCertifyVEXStatement.StatusNotes - retval.KnownSince = v.allCertifyVEXStatement.KnownSince - retval.Origin = v.allCertifyVEXStatement.Origin - retval.Collector = v.allCertifyVEXStatement.Collector - return &retval, nil -} - -// NeighborsNeighborsCertifyVuln includes the requested fields of the GraphQL type CertifyVuln. -// The GraphQL type's documentation follows. -// -// CertifyVuln is an attestation to attach vulnerability information to a package. -// -// This information is obtained via a scanner. If there is no vulnerability -// detected (no OSV, CVE, or GHSA), we attach the special NoVuln node. -type NeighborsNeighborsCertifyVuln struct { - Typename *string `json:"__typename"` - AllCertifyVuln `json:"-"` -} - -// GetTypename returns NeighborsNeighborsCertifyVuln.Typename, and is useful for accessing the field via an interface. -func (v *NeighborsNeighborsCertifyVuln) GetTypename() *string { return v.Typename } - -// GetId returns NeighborsNeighborsCertifyVuln.Id, and is useful for accessing the field via an interface. -func (v *NeighborsNeighborsCertifyVuln) GetId() string { return v.AllCertifyVuln.Id } - -// GetPackage returns NeighborsNeighborsCertifyVuln.Package, and is useful for accessing the field via an interface. -func (v *NeighborsNeighborsCertifyVuln) GetPackage() AllCertifyVulnPackage { - return v.AllCertifyVuln.Package -} - -// GetVulnerability returns NeighborsNeighborsCertifyVuln.Vulnerability, and is useful for accessing the field via an interface. -func (v *NeighborsNeighborsCertifyVuln) GetVulnerability() AllCertifyVulnVulnerability { - return v.AllCertifyVuln.Vulnerability +// FindSoftwareResponse is returned by FindSoftware on success. +type FindSoftwareResponse struct { + // findSoftware takes in a searchText string and looks for software + // that may be relevant for the input text. This can be seen as fuzzy search + // function for Packages, Sources and Artifacts. findSoftware returns a list + // of Packages, Sources and Artifacts that it determines to be relevant to + // the input searchText. + // + // Due to the nature of full text search being implemented differently on + // different db platforms, the behavior of findSoftware is not guaranteed + // to be the same. In addition, their statistical nature may result in + // results being different per call and not reproducible. + // + // All that is asked in the implementation of this API is that it follows + // the spirit of helping to retrieve the right nodes with best effort. + // + // Warning: This is an EXPERIMENTAL feature. This is subject to change. + // Warning: This is an OPTIONAL feature. Backends are not required to + // implement this API. + FindSoftware []FindSoftwareFindSoftwarePackageSourceOrArtifact `json:"-"` } -// GetMetadata returns NeighborsNeighborsCertifyVuln.Metadata, and is useful for accessing the field via an interface. -func (v *NeighborsNeighborsCertifyVuln) GetMetadata() AllCertifyVulnMetadataVulnerabilityMetaData { - return v.AllCertifyVuln.Metadata +// GetFindSoftware returns FindSoftwareResponse.FindSoftware, and is useful for accessing the field via an interface. +func (v *FindSoftwareResponse) GetFindSoftware() []FindSoftwareFindSoftwarePackageSourceOrArtifact { + return v.FindSoftware } -func (v *NeighborsNeighborsCertifyVuln) UnmarshalJSON(b []byte) error { +func (v *FindSoftwareResponse) UnmarshalJSON(b []byte) error { if string(b) == "null" { return nil } var firstPass struct { - *NeighborsNeighborsCertifyVuln + *FindSoftwareResponse + FindSoftware []json.RawMessage `json:"findSoftware"` graphql.NoUnmarshalJSON } - firstPass.NeighborsNeighborsCertifyVuln = v + firstPass.FindSoftwareResponse = v err := json.Unmarshal(b, &firstPass) if err != nil { return err } - err = json.Unmarshal( - b, &v.AllCertifyVuln) - if err != nil { - return err + { + dst := &v.FindSoftware + src := firstPass.FindSoftware + *dst = make( + []FindSoftwareFindSoftwarePackageSourceOrArtifact, + len(src)) + for i, src := range src { + dst := &(*dst)[i] + if len(src) != 0 && string(src) != "null" { + err = __unmarshalFindSoftwareFindSoftwarePackageSourceOrArtifact( + src, dst) + if err != nil { + return fmt.Errorf( + "unable to unmarshal FindSoftwareResponse.FindSoftware: %w", err) + } + } + } } return nil } -type __premarshalNeighborsNeighborsCertifyVuln struct { - Typename *string `json:"__typename"` - - Id string `json:"id"` - - Package AllCertifyVulnPackage `json:"package"` - - Vulnerability json.RawMessage `json:"vulnerability"` - - Metadata AllCertifyVulnMetadataVulnerabilityMetaData `json:"metadata"` +type __premarshalFindSoftwareResponse struct { + FindSoftware []json.RawMessage `json:"findSoftware"` } -func (v *NeighborsNeighborsCertifyVuln) MarshalJSON() ([]byte, error) { +func (v *FindSoftwareResponse) MarshalJSON() ([]byte, error) { premarshaled, err := v.__premarshalJSON() if err != nil { return nil, err @@ -8171,29 +8260,51 @@ func (v *NeighborsNeighborsCertifyVuln) MarshalJSON() ([]byte, error) { return json.Marshal(premarshaled) } -func (v *NeighborsNeighborsCertifyVuln) __premarshalJSON() (*__premarshalNeighborsNeighborsCertifyVuln, error) { - var retval __premarshalNeighborsNeighborsCertifyVuln +func (v *FindSoftwareResponse) __premarshalJSON() (*__premarshalFindSoftwareResponse, error) { + var retval __premarshalFindSoftwareResponse - retval.Typename = v.Typename - retval.Id = v.AllCertifyVuln.Id - retval.Package = v.AllCertifyVuln.Package { - dst := &retval.Vulnerability - src := v.AllCertifyVuln.Vulnerability - var err error - *dst, err = __marshalAllCertifyVulnVulnerability( - &src) - if err != nil { - return nil, fmt.Errorf( - "unable to marshal NeighborsNeighborsCertifyVuln.AllCertifyVuln.Vulnerability: %w", err) + dst := &retval.FindSoftware + src := v.FindSoftware + *dst = make( + []json.RawMessage, + len(src)) + for i, src := range src { + dst := &(*dst)[i] + var err error + *dst, err = __marshalFindSoftwareFindSoftwarePackageSourceOrArtifact( + &src) + if err != nil { + return nil, fmt.Errorf( + "unable to marshal FindSoftwareResponse.FindSoftware: %w", err) + } } } - retval.Metadata = v.AllCertifyVuln.Metadata return &retval, nil } -// NeighborsNeighborsGHSA includes the requested fields of the GraphQL type GHSA. +// GHSAInputSpec specifies a GitHub Security Advisory for mutations. +type GHSAInputSpec struct { + GhsaId string `json:"ghsaId"` +} + +// GetGhsaId returns GHSAInputSpec.GhsaId, and is useful for accessing the field via an interface. +func (v *GHSAInputSpec) GetGhsaId() string { return v.GhsaId } + +// GHSASpec allows filtering the list of advisories to return in a query. +type GHSASpec struct { + Id *string `json:"id"` + GhsaId *string `json:"ghsaId"` +} + +// GetId returns GHSASpec.Id, and is useful for accessing the field via an interface. +func (v *GHSASpec) GetId() *string { return v.Id } + +// GetGhsaId returns GHSASpec.GhsaId, and is useful for accessing the field via an interface. +func (v *GHSASpec) GetGhsaId() *string { return v.GhsaId } + +// GHSAsGhsaGHSA includes the requested fields of the GraphQL type GHSA. // The GraphQL type's documentation follows. // // GHSA represents GitHub security advisories. @@ -8201,31 +8312,27 @@ func (v *NeighborsNeighborsCertifyVuln) __premarshalJSON() (*__premarshalNeighbo // The advisory id field is mandatory and canonicalized to be lowercase. // // This node can be referred to by other parts of GUAC. -type NeighborsNeighborsGHSA struct { - Typename *string `json:"__typename"` +type GHSAsGhsaGHSA struct { AllGHSATree `json:"-"` } -// GetTypename returns NeighborsNeighborsGHSA.Typename, and is useful for accessing the field via an interface. -func (v *NeighborsNeighborsGHSA) GetTypename() *string { return v.Typename } - -// GetId returns NeighborsNeighborsGHSA.Id, and is useful for accessing the field via an interface. -func (v *NeighborsNeighborsGHSA) GetId() string { return v.AllGHSATree.Id } +// GetId returns GHSAsGhsaGHSA.Id, and is useful for accessing the field via an interface. +func (v *GHSAsGhsaGHSA) GetId() string { return v.AllGHSATree.Id } -// GetGhsaId returns NeighborsNeighborsGHSA.GhsaId, and is useful for accessing the field via an interface. -func (v *NeighborsNeighborsGHSA) GetGhsaId() string { return v.AllGHSATree.GhsaId } +// GetGhsaId returns GHSAsGhsaGHSA.GhsaId, and is useful for accessing the field via an interface. +func (v *GHSAsGhsaGHSA) GetGhsaId() string { return v.AllGHSATree.GhsaId } -func (v *NeighborsNeighborsGHSA) UnmarshalJSON(b []byte) error { +func (v *GHSAsGhsaGHSA) UnmarshalJSON(b []byte) error { if string(b) == "null" { return nil } var firstPass struct { - *NeighborsNeighborsGHSA + *GHSAsGhsaGHSA graphql.NoUnmarshalJSON } - firstPass.NeighborsNeighborsGHSA = v + firstPass.GHSAsGhsaGHSA = v err := json.Unmarshal(b, &firstPass) if err != nil { @@ -8240,15 +8347,13 @@ func (v *NeighborsNeighborsGHSA) UnmarshalJSON(b []byte) error { return nil } -type __premarshalNeighborsNeighborsGHSA struct { - Typename *string `json:"__typename"` - +type __premarshalGHSAsGhsaGHSA struct { Id string `json:"id"` GhsaId string `json:"ghsaId"` } -func (v *NeighborsNeighborsGHSA) MarshalJSON() ([]byte, error) { +func (v *GHSAsGhsaGHSA) MarshalJSON() ([]byte, error) { premarshaled, err := v.__premarshalJSON() if err != nil { return nil, err @@ -8256,16 +8361,24 @@ func (v *NeighborsNeighborsGHSA) MarshalJSON() ([]byte, error) { return json.Marshal(premarshaled) } -func (v *NeighborsNeighborsGHSA) __premarshalJSON() (*__premarshalNeighborsNeighborsGHSA, error) { - var retval __premarshalNeighborsNeighborsGHSA +func (v *GHSAsGhsaGHSA) __premarshalJSON() (*__premarshalGHSAsGhsaGHSA, error) { + var retval __premarshalGHSAsGhsaGHSA - retval.Typename = v.Typename retval.Id = v.AllGHSATree.Id retval.GhsaId = v.AllGHSATree.GhsaId return &retval, nil } -// NeighborsNeighborsHasMetadata includes the requested fields of the GraphQL type HasMetadata. +// GHSAsResponse is returned by GHSAs on success. +type GHSAsResponse struct { + // Returns all GitHub Security Advisories matching a filter. + Ghsa []GHSAsGhsaGHSA `json:"ghsa"` +} + +// GetGhsa returns GHSAsResponse.Ghsa, and is useful for accessing the field via an interface. +func (v *GHSAsResponse) GetGhsa() []GHSAsGhsaGHSA { return v.Ghsa } + +// HasMetadataArtifactIngestHasMetadata includes the requested fields of the GraphQL type HasMetadata. // The GraphQL type's documentation follows. // // HasMetadata is an attestation that a package, source, or artifact has a certain @@ -8282,61 +8395,53 @@ func (v *NeighborsNeighborsGHSA) __premarshalJSON() (*__premarshalNeighborsNeigh // If the attestation targets a package, it must target a PackageName or a // PackageVersion. If the attestation targets a source, it must target a // SourceName. -type NeighborsNeighborsHasMetadata struct { - Typename *string `json:"__typename"` +type HasMetadataArtifactIngestHasMetadata struct { + AllHasMetadata `json:"-"` } -// GetTypename returns NeighborsNeighborsHasMetadata.Typename, and is useful for accessing the field via an interface. -func (v *NeighborsNeighborsHasMetadata) GetTypename() *string { return v.Typename } +// GetId returns HasMetadataArtifactIngestHasMetadata.Id, and is useful for accessing the field via an interface. +func (v *HasMetadataArtifactIngestHasMetadata) GetId() string { return v.AllHasMetadata.Id } -// NeighborsNeighborsHasSBOM includes the requested fields of the GraphQL type HasSBOM. -type NeighborsNeighborsHasSBOM struct { - Typename *string `json:"__typename"` - allHasSBOMTree `json:"-"` +// GetSubject returns HasMetadataArtifactIngestHasMetadata.Subject, and is useful for accessing the field via an interface. +func (v *HasMetadataArtifactIngestHasMetadata) GetSubject() AllHasMetadataSubjectPackageSourceOrArtifact { + return v.AllHasMetadata.Subject } -// GetTypename returns NeighborsNeighborsHasSBOM.Typename, and is useful for accessing the field via an interface. -func (v *NeighborsNeighborsHasSBOM) GetTypename() *string { return v.Typename } +// GetKey returns HasMetadataArtifactIngestHasMetadata.Key, and is useful for accessing the field via an interface. +func (v *HasMetadataArtifactIngestHasMetadata) GetKey() string { return v.AllHasMetadata.Key } -// GetId returns NeighborsNeighborsHasSBOM.Id, and is useful for accessing the field via an interface. -func (v *NeighborsNeighborsHasSBOM) GetId() string { return v.allHasSBOMTree.Id } +// GetValue returns HasMetadataArtifactIngestHasMetadata.Value, and is useful for accessing the field via an interface. +func (v *HasMetadataArtifactIngestHasMetadata) GetValue() string { return v.AllHasMetadata.Value } -// GetSubject returns NeighborsNeighborsHasSBOM.Subject, and is useful for accessing the field via an interface. -func (v *NeighborsNeighborsHasSBOM) GetSubject() allHasSBOMTreeSubjectPackageOrArtifact { - return v.allHasSBOMTree.Subject +// GetTimestamp returns HasMetadataArtifactIngestHasMetadata.Timestamp, and is useful for accessing the field via an interface. +func (v *HasMetadataArtifactIngestHasMetadata) GetTimestamp() time.Time { + return v.AllHasMetadata.Timestamp } -// GetUri returns NeighborsNeighborsHasSBOM.Uri, and is useful for accessing the field via an interface. -func (v *NeighborsNeighborsHasSBOM) GetUri() string { return v.allHasSBOMTree.Uri } - -// GetAlgorithm returns NeighborsNeighborsHasSBOM.Algorithm, and is useful for accessing the field via an interface. -func (v *NeighborsNeighborsHasSBOM) GetAlgorithm() string { return v.allHasSBOMTree.Algorithm } - -// GetDigest returns NeighborsNeighborsHasSBOM.Digest, and is useful for accessing the field via an interface. -func (v *NeighborsNeighborsHasSBOM) GetDigest() string { return v.allHasSBOMTree.Digest } - -// GetDownloadLocation returns NeighborsNeighborsHasSBOM.DownloadLocation, and is useful for accessing the field via an interface. -func (v *NeighborsNeighborsHasSBOM) GetDownloadLocation() string { - return v.allHasSBOMTree.DownloadLocation +// GetJustification returns HasMetadataArtifactIngestHasMetadata.Justification, and is useful for accessing the field via an interface. +func (v *HasMetadataArtifactIngestHasMetadata) GetJustification() string { + return v.AllHasMetadata.Justification } -// GetOrigin returns NeighborsNeighborsHasSBOM.Origin, and is useful for accessing the field via an interface. -func (v *NeighborsNeighborsHasSBOM) GetOrigin() string { return v.allHasSBOMTree.Origin } +// GetOrigin returns HasMetadataArtifactIngestHasMetadata.Origin, and is useful for accessing the field via an interface. +func (v *HasMetadataArtifactIngestHasMetadata) GetOrigin() string { return v.AllHasMetadata.Origin } -// GetCollector returns NeighborsNeighborsHasSBOM.Collector, and is useful for accessing the field via an interface. -func (v *NeighborsNeighborsHasSBOM) GetCollector() string { return v.allHasSBOMTree.Collector } +// GetCollector returns HasMetadataArtifactIngestHasMetadata.Collector, and is useful for accessing the field via an interface. +func (v *HasMetadataArtifactIngestHasMetadata) GetCollector() string { + return v.AllHasMetadata.Collector +} -func (v *NeighborsNeighborsHasSBOM) UnmarshalJSON(b []byte) error { +func (v *HasMetadataArtifactIngestHasMetadata) UnmarshalJSON(b []byte) error { if string(b) == "null" { return nil } var firstPass struct { - *NeighborsNeighborsHasSBOM + *HasMetadataArtifactIngestHasMetadata graphql.NoUnmarshalJSON } - firstPass.NeighborsNeighborsHasSBOM = v + firstPass.HasMetadataArtifactIngestHasMetadata = v err := json.Unmarshal(b, &firstPass) if err != nil { @@ -8344,34 +8449,32 @@ func (v *NeighborsNeighborsHasSBOM) UnmarshalJSON(b []byte) error { } err = json.Unmarshal( - b, &v.allHasSBOMTree) + b, &v.AllHasMetadata) if err != nil { return err } return nil } -type __premarshalNeighborsNeighborsHasSBOM struct { - Typename *string `json:"__typename"` - +type __premarshalHasMetadataArtifactIngestHasMetadata struct { Id string `json:"id"` Subject json.RawMessage `json:"subject"` - Uri string `json:"uri"` + Key string `json:"key"` - Algorithm string `json:"algorithm"` + Value string `json:"value"` - Digest string `json:"digest"` + Timestamp time.Time `json:"timestamp"` - DownloadLocation string `json:"downloadLocation"` + Justification string `json:"justification"` Origin string `json:"origin"` Collector string `json:"collector"` } -func (v *NeighborsNeighborsHasSBOM) MarshalJSON() ([]byte, error) { +func (v *HasMetadataArtifactIngestHasMetadata) MarshalJSON() ([]byte, error) { premarshaled, err := v.__premarshalJSON() if err != nil { return nil, err @@ -8379,66 +8482,130 @@ func (v *NeighborsNeighborsHasSBOM) MarshalJSON() ([]byte, error) { return json.Marshal(premarshaled) } -func (v *NeighborsNeighborsHasSBOM) __premarshalJSON() (*__premarshalNeighborsNeighborsHasSBOM, error) { - var retval __premarshalNeighborsNeighborsHasSBOM +func (v *HasMetadataArtifactIngestHasMetadata) __premarshalJSON() (*__premarshalHasMetadataArtifactIngestHasMetadata, error) { + var retval __premarshalHasMetadataArtifactIngestHasMetadata - retval.Typename = v.Typename - retval.Id = v.allHasSBOMTree.Id + retval.Id = v.AllHasMetadata.Id { dst := &retval.Subject - src := v.allHasSBOMTree.Subject + src := v.AllHasMetadata.Subject var err error - *dst, err = __marshalallHasSBOMTreeSubjectPackageOrArtifact( + *dst, err = __marshalAllHasMetadataSubjectPackageSourceOrArtifact( &src) if err != nil { return nil, fmt.Errorf( - "unable to marshal NeighborsNeighborsHasSBOM.allHasSBOMTree.Subject: %w", err) + "unable to marshal HasMetadataArtifactIngestHasMetadata.AllHasMetadata.Subject: %w", err) } } - retval.Uri = v.allHasSBOMTree.Uri - retval.Algorithm = v.allHasSBOMTree.Algorithm - retval.Digest = v.allHasSBOMTree.Digest - retval.DownloadLocation = v.allHasSBOMTree.DownloadLocation - retval.Origin = v.allHasSBOMTree.Origin - retval.Collector = v.allHasSBOMTree.Collector + retval.Key = v.AllHasMetadata.Key + retval.Value = v.AllHasMetadata.Value + retval.Timestamp = v.AllHasMetadata.Timestamp + retval.Justification = v.AllHasMetadata.Justification + retval.Origin = v.AllHasMetadata.Origin + retval.Collector = v.AllHasMetadata.Collector return &retval, nil } -// NeighborsNeighborsHasSLSA includes the requested fields of the GraphQL type HasSLSA. +// HasMetadataArtifactResponse is returned by HasMetadataArtifact on success. +type HasMetadataArtifactResponse struct { + // Adds metadata about a package, source or artifact. + IngestHasMetadata HasMetadataArtifactIngestHasMetadata `json:"ingestHasMetadata"` +} + +// GetIngestHasMetadata returns HasMetadataArtifactResponse.IngestHasMetadata, and is useful for accessing the field via an interface. +func (v *HasMetadataArtifactResponse) GetIngestHasMetadata() HasMetadataArtifactIngestHasMetadata { + return v.IngestHasMetadata +} + +// HasMetadataInputSpec represents the mutation input to ingest a CertifyGood evidence. +type HasMetadataInputSpec struct { + Key string `json:"key"` + Value string `json:"value"` + Timestamp time.Time `json:"timestamp"` + Justification string `json:"justification"` + Origin string `json:"origin"` + Collector string `json:"collector"` +} + +// GetKey returns HasMetadataInputSpec.Key, and is useful for accessing the field via an interface. +func (v *HasMetadataInputSpec) GetKey() string { return v.Key } + +// GetValue returns HasMetadataInputSpec.Value, and is useful for accessing the field via an interface. +func (v *HasMetadataInputSpec) GetValue() string { return v.Value } + +// GetTimestamp returns HasMetadataInputSpec.Timestamp, and is useful for accessing the field via an interface. +func (v *HasMetadataInputSpec) GetTimestamp() time.Time { return v.Timestamp } + +// GetJustification returns HasMetadataInputSpec.Justification, and is useful for accessing the field via an interface. +func (v *HasMetadataInputSpec) GetJustification() string { return v.Justification } + +// GetOrigin returns HasMetadataInputSpec.Origin, and is useful for accessing the field via an interface. +func (v *HasMetadataInputSpec) GetOrigin() string { return v.Origin } + +// GetCollector returns HasMetadataInputSpec.Collector, and is useful for accessing the field via an interface. +func (v *HasMetadataInputSpec) GetCollector() string { return v.Collector } + +// HasMetadataPkgIngestHasMetadata includes the requested fields of the GraphQL type HasMetadata. // The GraphQL type's documentation follows. // -// HasSLSA records that a subject node has a SLSA attestation. -type NeighborsNeighborsHasSLSA struct { - Typename *string `json:"__typename"` - allSLSATree `json:"-"` +// HasMetadata is an attestation that a package, source, or artifact has a certain +// attested property (key) with value (value). For example, a source may have +// metadata "SourceRepo2FAEnabled=true". +// +// The intent of this evidence tree predicate is to allow extensibility of metadata +// expressible within the GUAC ontology. Metadata that is commonly used will then +// be promoted to a predicate on its own. +// +// Justification indicates how the metadata was determined. +// +// The metadata applies to a subject which is a package, source, or artifact. +// If the attestation targets a package, it must target a PackageName or a +// PackageVersion. If the attestation targets a source, it must target a +// SourceName. +type HasMetadataPkgIngestHasMetadata struct { + AllHasMetadata `json:"-"` } -// GetTypename returns NeighborsNeighborsHasSLSA.Typename, and is useful for accessing the field via an interface. -func (v *NeighborsNeighborsHasSLSA) GetTypename() *string { return v.Typename } +// GetId returns HasMetadataPkgIngestHasMetadata.Id, and is useful for accessing the field via an interface. +func (v *HasMetadataPkgIngestHasMetadata) GetId() string { return v.AllHasMetadata.Id } -// GetId returns NeighborsNeighborsHasSLSA.Id, and is useful for accessing the field via an interface. -func (v *NeighborsNeighborsHasSLSA) GetId() string { return v.allSLSATree.Id } +// GetSubject returns HasMetadataPkgIngestHasMetadata.Subject, and is useful for accessing the field via an interface. +func (v *HasMetadataPkgIngestHasMetadata) GetSubject() AllHasMetadataSubjectPackageSourceOrArtifact { + return v.AllHasMetadata.Subject +} -// GetSubject returns NeighborsNeighborsHasSLSA.Subject, and is useful for accessing the field via an interface. -func (v *NeighborsNeighborsHasSLSA) GetSubject() allSLSATreeSubjectArtifact { - return v.allSLSATree.Subject +// GetKey returns HasMetadataPkgIngestHasMetadata.Key, and is useful for accessing the field via an interface. +func (v *HasMetadataPkgIngestHasMetadata) GetKey() string { return v.AllHasMetadata.Key } + +// GetValue returns HasMetadataPkgIngestHasMetadata.Value, and is useful for accessing the field via an interface. +func (v *HasMetadataPkgIngestHasMetadata) GetValue() string { return v.AllHasMetadata.Value } + +// GetTimestamp returns HasMetadataPkgIngestHasMetadata.Timestamp, and is useful for accessing the field via an interface. +func (v *HasMetadataPkgIngestHasMetadata) GetTimestamp() time.Time { return v.AllHasMetadata.Timestamp } + +// GetJustification returns HasMetadataPkgIngestHasMetadata.Justification, and is useful for accessing the field via an interface. +func (v *HasMetadataPkgIngestHasMetadata) GetJustification() string { + return v.AllHasMetadata.Justification } -// GetSlsa returns NeighborsNeighborsHasSLSA.Slsa, and is useful for accessing the field via an interface. -func (v *NeighborsNeighborsHasSLSA) GetSlsa() allSLSATreeSlsaSLSA { return v.allSLSATree.Slsa } +// GetOrigin returns HasMetadataPkgIngestHasMetadata.Origin, and is useful for accessing the field via an interface. +func (v *HasMetadataPkgIngestHasMetadata) GetOrigin() string { return v.AllHasMetadata.Origin } -func (v *NeighborsNeighborsHasSLSA) UnmarshalJSON(b []byte) error { +// GetCollector returns HasMetadataPkgIngestHasMetadata.Collector, and is useful for accessing the field via an interface. +func (v *HasMetadataPkgIngestHasMetadata) GetCollector() string { return v.AllHasMetadata.Collector } + +func (v *HasMetadataPkgIngestHasMetadata) UnmarshalJSON(b []byte) error { if string(b) == "null" { return nil } var firstPass struct { - *NeighborsNeighborsHasSLSA + *HasMetadataPkgIngestHasMetadata graphql.NoUnmarshalJSON } - firstPass.NeighborsNeighborsHasSLSA = v + firstPass.HasMetadataPkgIngestHasMetadata = v err := json.Unmarshal(b, &firstPass) if err != nil { @@ -8446,24 +8613,32 @@ func (v *NeighborsNeighborsHasSLSA) UnmarshalJSON(b []byte) error { } err = json.Unmarshal( - b, &v.allSLSATree) + b, &v.AllHasMetadata) if err != nil { return err } return nil } -type __premarshalNeighborsNeighborsHasSLSA struct { - Typename *string `json:"__typename"` - +type __premarshalHasMetadataPkgIngestHasMetadata struct { Id string `json:"id"` - Subject allSLSATreeSubjectArtifact `json:"subject"` + Subject json.RawMessage `json:"subject"` + + Key string `json:"key"` + + Value string `json:"value"` + + Timestamp time.Time `json:"timestamp"` + + Justification string `json:"justification"` + + Origin string `json:"origin"` - Slsa allSLSATreeSlsaSLSA `json:"slsa"` + Collector string `json:"collector"` } -func (v *NeighborsNeighborsHasSLSA) MarshalJSON() ([]byte, error) { +func (v *HasMetadataPkgIngestHasMetadata) MarshalJSON() ([]byte, error) { premarshaled, err := v.__premarshalJSON() if err != nil { return nil, err @@ -8471,66 +8646,102 @@ func (v *NeighborsNeighborsHasSLSA) MarshalJSON() ([]byte, error) { return json.Marshal(premarshaled) } -func (v *NeighborsNeighborsHasSLSA) __premarshalJSON() (*__premarshalNeighborsNeighborsHasSLSA, error) { - var retval __premarshalNeighborsNeighborsHasSLSA +func (v *HasMetadataPkgIngestHasMetadata) __premarshalJSON() (*__premarshalHasMetadataPkgIngestHasMetadata, error) { + var retval __premarshalHasMetadataPkgIngestHasMetadata - retval.Typename = v.Typename - retval.Id = v.allSLSATree.Id - retval.Subject = v.allSLSATree.Subject - retval.Slsa = v.allSLSATree.Slsa + retval.Id = v.AllHasMetadata.Id + { + + dst := &retval.Subject + src := v.AllHasMetadata.Subject + var err error + *dst, err = __marshalAllHasMetadataSubjectPackageSourceOrArtifact( + &src) + if err != nil { + return nil, fmt.Errorf( + "unable to marshal HasMetadataPkgIngestHasMetadata.AllHasMetadata.Subject: %w", err) + } + } + retval.Key = v.AllHasMetadata.Key + retval.Value = v.AllHasMetadata.Value + retval.Timestamp = v.AllHasMetadata.Timestamp + retval.Justification = v.AllHasMetadata.Justification + retval.Origin = v.AllHasMetadata.Origin + retval.Collector = v.AllHasMetadata.Collector return &retval, nil } -// NeighborsNeighborsHasSourceAt includes the requested fields of the GraphQL type HasSourceAt. +// HasMetadataPkgResponse is returned by HasMetadataPkg on success. +type HasMetadataPkgResponse struct { + // Adds metadata about a package, source or artifact. + IngestHasMetadata HasMetadataPkgIngestHasMetadata `json:"ingestHasMetadata"` +} + +// GetIngestHasMetadata returns HasMetadataPkgResponse.IngestHasMetadata, and is useful for accessing the field via an interface. +func (v *HasMetadataPkgResponse) GetIngestHasMetadata() HasMetadataPkgIngestHasMetadata { + return v.IngestHasMetadata +} + +// HasMetadataSrcIngestHasMetadata includes the requested fields of the GraphQL type HasMetadata. // The GraphQL type's documentation follows. // -// HasSourceAt records that a package's repository is a given source. -type NeighborsNeighborsHasSourceAt struct { - Typename *string `json:"__typename"` - allHasSourceAt `json:"-"` +// HasMetadata is an attestation that a package, source, or artifact has a certain +// attested property (key) with value (value). For example, a source may have +// metadata "SourceRepo2FAEnabled=true". +// +// The intent of this evidence tree predicate is to allow extensibility of metadata +// expressible within the GUAC ontology. Metadata that is commonly used will then +// be promoted to a predicate on its own. +// +// Justification indicates how the metadata was determined. +// +// The metadata applies to a subject which is a package, source, or artifact. +// If the attestation targets a package, it must target a PackageName or a +// PackageVersion. If the attestation targets a source, it must target a +// SourceName. +type HasMetadataSrcIngestHasMetadata struct { + AllHasMetadata `json:"-"` } -// GetTypename returns NeighborsNeighborsHasSourceAt.Typename, and is useful for accessing the field via an interface. -func (v *NeighborsNeighborsHasSourceAt) GetTypename() *string { return v.Typename } - -// GetId returns NeighborsNeighborsHasSourceAt.Id, and is useful for accessing the field via an interface. -func (v *NeighborsNeighborsHasSourceAt) GetId() string { return v.allHasSourceAt.Id } +// GetId returns HasMetadataSrcIngestHasMetadata.Id, and is useful for accessing the field via an interface. +func (v *HasMetadataSrcIngestHasMetadata) GetId() string { return v.AllHasMetadata.Id } -// GetJustification returns NeighborsNeighborsHasSourceAt.Justification, and is useful for accessing the field via an interface. -func (v *NeighborsNeighborsHasSourceAt) GetJustification() string { - return v.allHasSourceAt.Justification +// GetSubject returns HasMetadataSrcIngestHasMetadata.Subject, and is useful for accessing the field via an interface. +func (v *HasMetadataSrcIngestHasMetadata) GetSubject() AllHasMetadataSubjectPackageSourceOrArtifact { + return v.AllHasMetadata.Subject } -// GetKnownSince returns NeighborsNeighborsHasSourceAt.KnownSince, and is useful for accessing the field via an interface. -func (v *NeighborsNeighborsHasSourceAt) GetKnownSince() time.Time { return v.allHasSourceAt.KnownSince } +// GetKey returns HasMetadataSrcIngestHasMetadata.Key, and is useful for accessing the field via an interface. +func (v *HasMetadataSrcIngestHasMetadata) GetKey() string { return v.AllHasMetadata.Key } -// GetPackage returns NeighborsNeighborsHasSourceAt.Package, and is useful for accessing the field via an interface. -func (v *NeighborsNeighborsHasSourceAt) GetPackage() allHasSourceAtPackage { - return v.allHasSourceAt.Package -} +// GetValue returns HasMetadataSrcIngestHasMetadata.Value, and is useful for accessing the field via an interface. +func (v *HasMetadataSrcIngestHasMetadata) GetValue() string { return v.AllHasMetadata.Value } -// GetSource returns NeighborsNeighborsHasSourceAt.Source, and is useful for accessing the field via an interface. -func (v *NeighborsNeighborsHasSourceAt) GetSource() allHasSourceAtSource { - return v.allHasSourceAt.Source +// GetTimestamp returns HasMetadataSrcIngestHasMetadata.Timestamp, and is useful for accessing the field via an interface. +func (v *HasMetadataSrcIngestHasMetadata) GetTimestamp() time.Time { return v.AllHasMetadata.Timestamp } + +// GetJustification returns HasMetadataSrcIngestHasMetadata.Justification, and is useful for accessing the field via an interface. +func (v *HasMetadataSrcIngestHasMetadata) GetJustification() string { + return v.AllHasMetadata.Justification } -// GetOrigin returns NeighborsNeighborsHasSourceAt.Origin, and is useful for accessing the field via an interface. -func (v *NeighborsNeighborsHasSourceAt) GetOrigin() string { return v.allHasSourceAt.Origin } +// GetOrigin returns HasMetadataSrcIngestHasMetadata.Origin, and is useful for accessing the field via an interface. +func (v *HasMetadataSrcIngestHasMetadata) GetOrigin() string { return v.AllHasMetadata.Origin } -// GetCollector returns NeighborsNeighborsHasSourceAt.Collector, and is useful for accessing the field via an interface. -func (v *NeighborsNeighborsHasSourceAt) GetCollector() string { return v.allHasSourceAt.Collector } +// GetCollector returns HasMetadataSrcIngestHasMetadata.Collector, and is useful for accessing the field via an interface. +func (v *HasMetadataSrcIngestHasMetadata) GetCollector() string { return v.AllHasMetadata.Collector } -func (v *NeighborsNeighborsHasSourceAt) UnmarshalJSON(b []byte) error { +func (v *HasMetadataSrcIngestHasMetadata) UnmarshalJSON(b []byte) error { if string(b) == "null" { return nil } var firstPass struct { - *NeighborsNeighborsHasSourceAt + *HasMetadataSrcIngestHasMetadata graphql.NoUnmarshalJSON } - firstPass.NeighborsNeighborsHasSourceAt = v + firstPass.HasMetadataSrcIngestHasMetadata = v err := json.Unmarshal(b, &firstPass) if err != nil { @@ -8538,32 +8749,32 @@ func (v *NeighborsNeighborsHasSourceAt) UnmarshalJSON(b []byte) error { } err = json.Unmarshal( - b, &v.allHasSourceAt) + b, &v.AllHasMetadata) if err != nil { return err } return nil } -type __premarshalNeighborsNeighborsHasSourceAt struct { - Typename *string `json:"__typename"` - +type __premarshalHasMetadataSrcIngestHasMetadata struct { Id string `json:"id"` - Justification string `json:"justification"` + Subject json.RawMessage `json:"subject"` - KnownSince time.Time `json:"knownSince"` + Key string `json:"key"` + + Value string `json:"value"` - Package allHasSourceAtPackage `json:"package"` + Timestamp time.Time `json:"timestamp"` - Source allHasSourceAtSource `json:"source"` + Justification string `json:"justification"` Origin string `json:"origin"` Collector string `json:"collector"` } -func (v *NeighborsNeighborsHasSourceAt) MarshalJSON() ([]byte, error) { +func (v *HasMetadataSrcIngestHasMetadata) MarshalJSON() ([]byte, error) { premarshaled, err := v.__premarshalJSON() if err != nil { return nil, err @@ -8571,62 +8782,86 @@ func (v *NeighborsNeighborsHasSourceAt) MarshalJSON() ([]byte, error) { return json.Marshal(premarshaled) } -func (v *NeighborsNeighborsHasSourceAt) __premarshalJSON() (*__premarshalNeighborsNeighborsHasSourceAt, error) { - var retval __premarshalNeighborsNeighborsHasSourceAt +func (v *HasMetadataSrcIngestHasMetadata) __premarshalJSON() (*__premarshalHasMetadataSrcIngestHasMetadata, error) { + var retval __premarshalHasMetadataSrcIngestHasMetadata - retval.Typename = v.Typename - retval.Id = v.allHasSourceAt.Id - retval.Justification = v.allHasSourceAt.Justification - retval.KnownSince = v.allHasSourceAt.KnownSince - retval.Package = v.allHasSourceAt.Package - retval.Source = v.allHasSourceAt.Source - retval.Origin = v.allHasSourceAt.Origin - retval.Collector = v.allHasSourceAt.Collector + retval.Id = v.AllHasMetadata.Id + { + + dst := &retval.Subject + src := v.AllHasMetadata.Subject + var err error + *dst, err = __marshalAllHasMetadataSubjectPackageSourceOrArtifact( + &src) + if err != nil { + return nil, fmt.Errorf( + "unable to marshal HasMetadataSrcIngestHasMetadata.AllHasMetadata.Subject: %w", err) + } + } + retval.Key = v.AllHasMetadata.Key + retval.Value = v.AllHasMetadata.Value + retval.Timestamp = v.AllHasMetadata.Timestamp + retval.Justification = v.AllHasMetadata.Justification + retval.Origin = v.AllHasMetadata.Origin + retval.Collector = v.AllHasMetadata.Collector return &retval, nil } -// NeighborsNeighborsHashEqual includes the requested fields of the GraphQL type HashEqual. -// The GraphQL type's documentation follows. -// -// HashEqual is an attestation that a set of artifacts are identical. -type NeighborsNeighborsHashEqual struct { - Typename *string `json:"__typename"` - allHashEqualTree `json:"-"` +// HasMetadataSrcResponse is returned by HasMetadataSrc on success. +type HasMetadataSrcResponse struct { + // Adds metadata about a package, source or artifact. + IngestHasMetadata HasMetadataSrcIngestHasMetadata `json:"ingestHasMetadata"` } -// GetTypename returns NeighborsNeighborsHashEqual.Typename, and is useful for accessing the field via an interface. -func (v *NeighborsNeighborsHashEqual) GetTypename() *string { return v.Typename } +// GetIngestHasMetadata returns HasMetadataSrcResponse.IngestHasMetadata, and is useful for accessing the field via an interface. +func (v *HasMetadataSrcResponse) GetIngestHasMetadata() HasMetadataSrcIngestHasMetadata { + return v.IngestHasMetadata +} -// GetId returns NeighborsNeighborsHashEqual.Id, and is useful for accessing the field via an interface. -func (v *NeighborsNeighborsHashEqual) GetId() string { return v.allHashEqualTree.Id } +// HasSBOMArtifactIngestHasSBOM includes the requested fields of the GraphQL type HasSBOM. +type HasSBOMArtifactIngestHasSBOM struct { + AllHasSBOMTree `json:"-"` +} -// GetJustification returns NeighborsNeighborsHashEqual.Justification, and is useful for accessing the field via an interface. -func (v *NeighborsNeighborsHashEqual) GetJustification() string { - return v.allHashEqualTree.Justification +// GetId returns HasSBOMArtifactIngestHasSBOM.Id, and is useful for accessing the field via an interface. +func (v *HasSBOMArtifactIngestHasSBOM) GetId() string { return v.AllHasSBOMTree.Id } + +// GetSubject returns HasSBOMArtifactIngestHasSBOM.Subject, and is useful for accessing the field via an interface. +func (v *HasSBOMArtifactIngestHasSBOM) GetSubject() AllHasSBOMTreeSubjectPackageOrArtifact { + return v.AllHasSBOMTree.Subject } -// GetArtifacts returns NeighborsNeighborsHashEqual.Artifacts, and is useful for accessing the field via an interface. -func (v *NeighborsNeighborsHashEqual) GetArtifacts() []allHashEqualTreeArtifactsArtifact { - return v.allHashEqualTree.Artifacts +// GetUri returns HasSBOMArtifactIngestHasSBOM.Uri, and is useful for accessing the field via an interface. +func (v *HasSBOMArtifactIngestHasSBOM) GetUri() string { return v.AllHasSBOMTree.Uri } + +// GetAlgorithm returns HasSBOMArtifactIngestHasSBOM.Algorithm, and is useful for accessing the field via an interface. +func (v *HasSBOMArtifactIngestHasSBOM) GetAlgorithm() string { return v.AllHasSBOMTree.Algorithm } + +// GetDigest returns HasSBOMArtifactIngestHasSBOM.Digest, and is useful for accessing the field via an interface. +func (v *HasSBOMArtifactIngestHasSBOM) GetDigest() string { return v.AllHasSBOMTree.Digest } + +// GetDownloadLocation returns HasSBOMArtifactIngestHasSBOM.DownloadLocation, and is useful for accessing the field via an interface. +func (v *HasSBOMArtifactIngestHasSBOM) GetDownloadLocation() string { + return v.AllHasSBOMTree.DownloadLocation } -// GetOrigin returns NeighborsNeighborsHashEqual.Origin, and is useful for accessing the field via an interface. -func (v *NeighborsNeighborsHashEqual) GetOrigin() string { return v.allHashEqualTree.Origin } +// GetOrigin returns HasSBOMArtifactIngestHasSBOM.Origin, and is useful for accessing the field via an interface. +func (v *HasSBOMArtifactIngestHasSBOM) GetOrigin() string { return v.AllHasSBOMTree.Origin } -// GetCollector returns NeighborsNeighborsHashEqual.Collector, and is useful for accessing the field via an interface. -func (v *NeighborsNeighborsHashEqual) GetCollector() string { return v.allHashEqualTree.Collector } +// GetCollector returns HasSBOMArtifactIngestHasSBOM.Collector, and is useful for accessing the field via an interface. +func (v *HasSBOMArtifactIngestHasSBOM) GetCollector() string { return v.AllHasSBOMTree.Collector } -func (v *NeighborsNeighborsHashEqual) UnmarshalJSON(b []byte) error { +func (v *HasSBOMArtifactIngestHasSBOM) UnmarshalJSON(b []byte) error { if string(b) == "null" { return nil } var firstPass struct { - *NeighborsNeighborsHashEqual + *HasSBOMArtifactIngestHasSBOM graphql.NoUnmarshalJSON } - firstPass.NeighborsNeighborsHashEqual = v + firstPass.HasSBOMArtifactIngestHasSBOM = v err := json.Unmarshal(b, &firstPass) if err != nil { @@ -8634,28 +8869,32 @@ func (v *NeighborsNeighborsHashEqual) UnmarshalJSON(b []byte) error { } err = json.Unmarshal( - b, &v.allHashEqualTree) + b, &v.AllHasSBOMTree) if err != nil { return err } return nil } -type __premarshalNeighborsNeighborsHashEqual struct { - Typename *string `json:"__typename"` - +type __premarshalHasSBOMArtifactIngestHasSBOM struct { Id string `json:"id"` - Justification string `json:"justification"` + Subject json.RawMessage `json:"subject"` + + Uri string `json:"uri"` + + Algorithm string `json:"algorithm"` + + Digest string `json:"digest"` - Artifacts []allHashEqualTreeArtifactsArtifact `json:"artifacts"` + DownloadLocation string `json:"downloadLocation"` Origin string `json:"origin"` Collector string `json:"collector"` } -func (v *NeighborsNeighborsHashEqual) MarshalJSON() ([]byte, error) { +func (v *HasSBOMArtifactIngestHasSBOM) MarshalJSON() ([]byte, error) { premarshaled, err := v.__premarshalJSON() if err != nil { return nil, err @@ -8663,77 +8902,114 @@ func (v *NeighborsNeighborsHashEqual) MarshalJSON() ([]byte, error) { return json.Marshal(premarshaled) } -func (v *NeighborsNeighborsHashEqual) __premarshalJSON() (*__premarshalNeighborsNeighborsHashEqual, error) { - var retval __premarshalNeighborsNeighborsHashEqual +func (v *HasSBOMArtifactIngestHasSBOM) __premarshalJSON() (*__premarshalHasSBOMArtifactIngestHasSBOM, error) { + var retval __premarshalHasSBOMArtifactIngestHasSBOM - retval.Typename = v.Typename - retval.Id = v.allHashEqualTree.Id - retval.Justification = v.allHashEqualTree.Justification - retval.Artifacts = v.allHashEqualTree.Artifacts - retval.Origin = v.allHashEqualTree.Origin - retval.Collector = v.allHashEqualTree.Collector + retval.Id = v.AllHasSBOMTree.Id + { + + dst := &retval.Subject + src := v.AllHasSBOMTree.Subject + var err error + *dst, err = __marshalAllHasSBOMTreeSubjectPackageOrArtifact( + &src) + if err != nil { + return nil, fmt.Errorf( + "unable to marshal HasSBOMArtifactIngestHasSBOM.AllHasSBOMTree.Subject: %w", err) + } + } + retval.Uri = v.AllHasSBOMTree.Uri + retval.Algorithm = v.AllHasSBOMTree.Algorithm + retval.Digest = v.AllHasSBOMTree.Digest + retval.DownloadLocation = v.AllHasSBOMTree.DownloadLocation + retval.Origin = v.AllHasSBOMTree.Origin + retval.Collector = v.AllHasSBOMTree.Collector return &retval, nil } -// NeighborsNeighborsIsDependency includes the requested fields of the GraphQL type IsDependency. -// The GraphQL type's documentation follows. -// -// IsDependency is an attestation to record that a package depends on another. -type NeighborsNeighborsIsDependency struct { - Typename *string `json:"__typename"` - allIsDependencyTree `json:"-"` +// HasSBOMArtifactResponse is returned by HasSBOMArtifact on success. +type HasSBOMArtifactResponse struct { + // Certifies that a package or artifact has an SBOM. + IngestHasSBOM HasSBOMArtifactIngestHasSBOM `json:"ingestHasSBOM"` } -// GetTypename returns NeighborsNeighborsIsDependency.Typename, and is useful for accessing the field via an interface. -func (v *NeighborsNeighborsIsDependency) GetTypename() *string { return v.Typename } - -// GetId returns NeighborsNeighborsIsDependency.Id, and is useful for accessing the field via an interface. -func (v *NeighborsNeighborsIsDependency) GetId() string { return v.allIsDependencyTree.Id } - -// GetJustification returns NeighborsNeighborsIsDependency.Justification, and is useful for accessing the field via an interface. -func (v *NeighborsNeighborsIsDependency) GetJustification() string { - return v.allIsDependencyTree.Justification +// GetIngestHasSBOM returns HasSBOMArtifactResponse.IngestHasSBOM, and is useful for accessing the field via an interface. +func (v *HasSBOMArtifactResponse) GetIngestHasSBOM() HasSBOMArtifactIngestHasSBOM { + return v.IngestHasSBOM } -// GetPackage returns NeighborsNeighborsIsDependency.Package, and is useful for accessing the field via an interface. -func (v *NeighborsNeighborsIsDependency) GetPackage() allIsDependencyTreePackage { - return v.allIsDependencyTree.Package +// HasSBOMInputSpec is the same as HasSBOM but for mutation input. +type HasSBOMInputSpec struct { + Uri string `json:"uri"` + Algorithm string `json:"algorithm"` + Digest string `json:"digest"` + DownloadLocation string `json:"downloadLocation"` + Origin string `json:"origin"` + Collector string `json:"collector"` } -// GetDependentPackage returns NeighborsNeighborsIsDependency.DependentPackage, and is useful for accessing the field via an interface. -func (v *NeighborsNeighborsIsDependency) GetDependentPackage() allIsDependencyTreeDependentPackage { - return v.allIsDependencyTree.DependentPackage -} +// GetUri returns HasSBOMInputSpec.Uri, and is useful for accessing the field via an interface. +func (v *HasSBOMInputSpec) GetUri() string { return v.Uri } -// GetDependencyType returns NeighborsNeighborsIsDependency.DependencyType, and is useful for accessing the field via an interface. -func (v *NeighborsNeighborsIsDependency) GetDependencyType() DependencyType { - return v.allIsDependencyTree.DependencyType +// GetAlgorithm returns HasSBOMInputSpec.Algorithm, and is useful for accessing the field via an interface. +func (v *HasSBOMInputSpec) GetAlgorithm() string { return v.Algorithm } + +// GetDigest returns HasSBOMInputSpec.Digest, and is useful for accessing the field via an interface. +func (v *HasSBOMInputSpec) GetDigest() string { return v.Digest } + +// GetDownloadLocation returns HasSBOMInputSpec.DownloadLocation, and is useful for accessing the field via an interface. +func (v *HasSBOMInputSpec) GetDownloadLocation() string { return v.DownloadLocation } + +// GetOrigin returns HasSBOMInputSpec.Origin, and is useful for accessing the field via an interface. +func (v *HasSBOMInputSpec) GetOrigin() string { return v.Origin } + +// GetCollector returns HasSBOMInputSpec.Collector, and is useful for accessing the field via an interface. +func (v *HasSBOMInputSpec) GetCollector() string { return v.Collector } + +// HasSBOMPkgIngestHasSBOM includes the requested fields of the GraphQL type HasSBOM. +type HasSBOMPkgIngestHasSBOM struct { + AllHasSBOMTree `json:"-"` } -// GetVersionRange returns NeighborsNeighborsIsDependency.VersionRange, and is useful for accessing the field via an interface. -func (v *NeighborsNeighborsIsDependency) GetVersionRange() string { - return v.allIsDependencyTree.VersionRange +// GetId returns HasSBOMPkgIngestHasSBOM.Id, and is useful for accessing the field via an interface. +func (v *HasSBOMPkgIngestHasSBOM) GetId() string { return v.AllHasSBOMTree.Id } + +// GetSubject returns HasSBOMPkgIngestHasSBOM.Subject, and is useful for accessing the field via an interface. +func (v *HasSBOMPkgIngestHasSBOM) GetSubject() AllHasSBOMTreeSubjectPackageOrArtifact { + return v.AllHasSBOMTree.Subject } -// GetOrigin returns NeighborsNeighborsIsDependency.Origin, and is useful for accessing the field via an interface. -func (v *NeighborsNeighborsIsDependency) GetOrigin() string { return v.allIsDependencyTree.Origin } +// GetUri returns HasSBOMPkgIngestHasSBOM.Uri, and is useful for accessing the field via an interface. +func (v *HasSBOMPkgIngestHasSBOM) GetUri() string { return v.AllHasSBOMTree.Uri } -// GetCollector returns NeighborsNeighborsIsDependency.Collector, and is useful for accessing the field via an interface. -func (v *NeighborsNeighborsIsDependency) GetCollector() string { - return v.allIsDependencyTree.Collector +// GetAlgorithm returns HasSBOMPkgIngestHasSBOM.Algorithm, and is useful for accessing the field via an interface. +func (v *HasSBOMPkgIngestHasSBOM) GetAlgorithm() string { return v.AllHasSBOMTree.Algorithm } + +// GetDigest returns HasSBOMPkgIngestHasSBOM.Digest, and is useful for accessing the field via an interface. +func (v *HasSBOMPkgIngestHasSBOM) GetDigest() string { return v.AllHasSBOMTree.Digest } + +// GetDownloadLocation returns HasSBOMPkgIngestHasSBOM.DownloadLocation, and is useful for accessing the field via an interface. +func (v *HasSBOMPkgIngestHasSBOM) GetDownloadLocation() string { + return v.AllHasSBOMTree.DownloadLocation } -func (v *NeighborsNeighborsIsDependency) UnmarshalJSON(b []byte) error { +// GetOrigin returns HasSBOMPkgIngestHasSBOM.Origin, and is useful for accessing the field via an interface. +func (v *HasSBOMPkgIngestHasSBOM) GetOrigin() string { return v.AllHasSBOMTree.Origin } + +// GetCollector returns HasSBOMPkgIngestHasSBOM.Collector, and is useful for accessing the field via an interface. +func (v *HasSBOMPkgIngestHasSBOM) GetCollector() string { return v.AllHasSBOMTree.Collector } + +func (v *HasSBOMPkgIngestHasSBOM) UnmarshalJSON(b []byte) error { if string(b) == "null" { return nil } var firstPass struct { - *NeighborsNeighborsIsDependency + *HasSBOMPkgIngestHasSBOM graphql.NoUnmarshalJSON } - firstPass.NeighborsNeighborsIsDependency = v + firstPass.HasSBOMPkgIngestHasSBOM = v err := json.Unmarshal(b, &firstPass) if err != nil { @@ -8741,34 +9017,32 @@ func (v *NeighborsNeighborsIsDependency) UnmarshalJSON(b []byte) error { } err = json.Unmarshal( - b, &v.allIsDependencyTree) + b, &v.AllHasSBOMTree) if err != nil { return err } return nil } -type __premarshalNeighborsNeighborsIsDependency struct { - Typename *string `json:"__typename"` - +type __premarshalHasSBOMPkgIngestHasSBOM struct { Id string `json:"id"` - Justification string `json:"justification"` + Subject json.RawMessage `json:"subject"` - Package allIsDependencyTreePackage `json:"package"` + Uri string `json:"uri"` - DependentPackage allIsDependencyTreeDependentPackage `json:"dependentPackage"` + Algorithm string `json:"algorithm"` - DependencyType DependencyType `json:"dependencyType"` + Digest string `json:"digest"` - VersionRange string `json:"versionRange"` + DownloadLocation string `json:"downloadLocation"` Origin string `json:"origin"` Collector string `json:"collector"` } -func (v *NeighborsNeighborsIsDependency) MarshalJSON() ([]byte, error) { +func (v *HasSBOMPkgIngestHasSBOM) MarshalJSON() ([]byte, error) { premarshaled, err := v.__premarshalJSON() if err != nil { return nil, err @@ -8776,72 +9050,86 @@ func (v *NeighborsNeighborsIsDependency) MarshalJSON() ([]byte, error) { return json.Marshal(premarshaled) } -func (v *NeighborsNeighborsIsDependency) __premarshalJSON() (*__premarshalNeighborsNeighborsIsDependency, error) { - var retval __premarshalNeighborsNeighborsIsDependency +func (v *HasSBOMPkgIngestHasSBOM) __premarshalJSON() (*__premarshalHasSBOMPkgIngestHasSBOM, error) { + var retval __premarshalHasSBOMPkgIngestHasSBOM - retval.Typename = v.Typename - retval.Id = v.allIsDependencyTree.Id - retval.Justification = v.allIsDependencyTree.Justification - retval.Package = v.allIsDependencyTree.Package - retval.DependentPackage = v.allIsDependencyTree.DependentPackage - retval.DependencyType = v.allIsDependencyTree.DependencyType - retval.VersionRange = v.allIsDependencyTree.VersionRange - retval.Origin = v.allIsDependencyTree.Origin - retval.Collector = v.allIsDependencyTree.Collector + retval.Id = v.AllHasSBOMTree.Id + { + + dst := &retval.Subject + src := v.AllHasSBOMTree.Subject + var err error + *dst, err = __marshalAllHasSBOMTreeSubjectPackageOrArtifact( + &src) + if err != nil { + return nil, fmt.Errorf( + "unable to marshal HasSBOMPkgIngestHasSBOM.AllHasSBOMTree.Subject: %w", err) + } + } + retval.Uri = v.AllHasSBOMTree.Uri + retval.Algorithm = v.AllHasSBOMTree.Algorithm + retval.Digest = v.AllHasSBOMTree.Digest + retval.DownloadLocation = v.AllHasSBOMTree.DownloadLocation + retval.Origin = v.AllHasSBOMTree.Origin + retval.Collector = v.AllHasSBOMTree.Collector return &retval, nil } -// NeighborsNeighborsIsOccurrence includes the requested fields of the GraphQL type IsOccurrence. +// HasSBOMPkgResponse is returned by HasSBOMPkg on success. +type HasSBOMPkgResponse struct { + // Certifies that a package or artifact has an SBOM. + IngestHasSBOM HasSBOMPkgIngestHasSBOM `json:"ingestHasSBOM"` +} + +// GetIngestHasSBOM returns HasSBOMPkgResponse.IngestHasSBOM, and is useful for accessing the field via an interface. +func (v *HasSBOMPkgResponse) GetIngestHasSBOM() HasSBOMPkgIngestHasSBOM { return v.IngestHasSBOM } + +// HasSourceAtIngestHasSourceAt includes the requested fields of the GraphQL type HasSourceAt. // The GraphQL type's documentation follows. // -// IsOccurrence is an attestation to link an artifact to a package or source. -// -// Attestation must occur at the PackageVersion or at the SourceName. -type NeighborsNeighborsIsOccurrence struct { - Typename *string `json:"__typename"` - AllIsOccurrencesTree `json:"-"` +// HasSourceAt records that a package's repository is a given source. +type HasSourceAtIngestHasSourceAt struct { + AllHasSourceAt `json:"-"` } -// GetTypename returns NeighborsNeighborsIsOccurrence.Typename, and is useful for accessing the field via an interface. -func (v *NeighborsNeighborsIsOccurrence) GetTypename() *string { return v.Typename } - -// GetId returns NeighborsNeighborsIsOccurrence.Id, and is useful for accessing the field via an interface. -func (v *NeighborsNeighborsIsOccurrence) GetId() string { return v.AllIsOccurrencesTree.Id } +// GetId returns HasSourceAtIngestHasSourceAt.Id, and is useful for accessing the field via an interface. +func (v *HasSourceAtIngestHasSourceAt) GetId() string { return v.AllHasSourceAt.Id } -// GetSubject returns NeighborsNeighborsIsOccurrence.Subject, and is useful for accessing the field via an interface. -func (v *NeighborsNeighborsIsOccurrence) GetSubject() AllIsOccurrencesTreeSubjectPackageOrSource { - return v.AllIsOccurrencesTree.Subject +// GetJustification returns HasSourceAtIngestHasSourceAt.Justification, and is useful for accessing the field via an interface. +func (v *HasSourceAtIngestHasSourceAt) GetJustification() string { + return v.AllHasSourceAt.Justification } -// GetArtifact returns NeighborsNeighborsIsOccurrence.Artifact, and is useful for accessing the field via an interface. -func (v *NeighborsNeighborsIsOccurrence) GetArtifact() AllIsOccurrencesTreeArtifact { - return v.AllIsOccurrencesTree.Artifact +// GetKnownSince returns HasSourceAtIngestHasSourceAt.KnownSince, and is useful for accessing the field via an interface. +func (v *HasSourceAtIngestHasSourceAt) GetKnownSince() time.Time { return v.AllHasSourceAt.KnownSince } + +// GetPackage returns HasSourceAtIngestHasSourceAt.Package, and is useful for accessing the field via an interface. +func (v *HasSourceAtIngestHasSourceAt) GetPackage() AllHasSourceAtPackage { + return v.AllHasSourceAt.Package } -// GetJustification returns NeighborsNeighborsIsOccurrence.Justification, and is useful for accessing the field via an interface. -func (v *NeighborsNeighborsIsOccurrence) GetJustification() string { - return v.AllIsOccurrencesTree.Justification +// GetSource returns HasSourceAtIngestHasSourceAt.Source, and is useful for accessing the field via an interface. +func (v *HasSourceAtIngestHasSourceAt) GetSource() AllHasSourceAtSource { + return v.AllHasSourceAt.Source } -// GetOrigin returns NeighborsNeighborsIsOccurrence.Origin, and is useful for accessing the field via an interface. -func (v *NeighborsNeighborsIsOccurrence) GetOrigin() string { return v.AllIsOccurrencesTree.Origin } +// GetOrigin returns HasSourceAtIngestHasSourceAt.Origin, and is useful for accessing the field via an interface. +func (v *HasSourceAtIngestHasSourceAt) GetOrigin() string { return v.AllHasSourceAt.Origin } -// GetCollector returns NeighborsNeighborsIsOccurrence.Collector, and is useful for accessing the field via an interface. -func (v *NeighborsNeighborsIsOccurrence) GetCollector() string { - return v.AllIsOccurrencesTree.Collector -} +// GetCollector returns HasSourceAtIngestHasSourceAt.Collector, and is useful for accessing the field via an interface. +func (v *HasSourceAtIngestHasSourceAt) GetCollector() string { return v.AllHasSourceAt.Collector } -func (v *NeighborsNeighborsIsOccurrence) UnmarshalJSON(b []byte) error { +func (v *HasSourceAtIngestHasSourceAt) UnmarshalJSON(b []byte) error { if string(b) == "null" { return nil } var firstPass struct { - *NeighborsNeighborsIsOccurrence + *HasSourceAtIngestHasSourceAt graphql.NoUnmarshalJSON } - firstPass.NeighborsNeighborsIsOccurrence = v + firstPass.HasSourceAtIngestHasSourceAt = v err := json.Unmarshal(b, &firstPass) if err != nil { @@ -8849,30 +9137,30 @@ func (v *NeighborsNeighborsIsOccurrence) UnmarshalJSON(b []byte) error { } err = json.Unmarshal( - b, &v.AllIsOccurrencesTree) + b, &v.AllHasSourceAt) if err != nil { return err } return nil } -type __premarshalNeighborsNeighborsIsOccurrence struct { - Typename *string `json:"__typename"` - +type __premarshalHasSourceAtIngestHasSourceAt struct { Id string `json:"id"` - Subject json.RawMessage `json:"subject"` + Justification string `json:"justification"` - Artifact AllIsOccurrencesTreeArtifact `json:"artifact"` + KnownSince time.Time `json:"knownSince"` - Justification string `json:"justification"` + Package AllHasSourceAtPackage `json:"package"` + + Source AllHasSourceAtSource `json:"source"` Origin string `json:"origin"` Collector string `json:"collector"` } -func (v *NeighborsNeighborsIsOccurrence) MarshalJSON() ([]byte, error) { +func (v *HasSourceAtIngestHasSourceAt) MarshalJSON() ([]byte, error) { premarshaled, err := v.__premarshalJSON() if err != nil { return nil, err @@ -8880,79 +9168,86 @@ func (v *NeighborsNeighborsIsOccurrence) MarshalJSON() ([]byte, error) { return json.Marshal(premarshaled) } -func (v *NeighborsNeighborsIsOccurrence) __premarshalJSON() (*__premarshalNeighborsNeighborsIsOccurrence, error) { - var retval __premarshalNeighborsNeighborsIsOccurrence - - retval.Typename = v.Typename - retval.Id = v.AllIsOccurrencesTree.Id - { +func (v *HasSourceAtIngestHasSourceAt) __premarshalJSON() (*__premarshalHasSourceAtIngestHasSourceAt, error) { + var retval __premarshalHasSourceAtIngestHasSourceAt - dst := &retval.Subject - src := v.AllIsOccurrencesTree.Subject - var err error - *dst, err = __marshalAllIsOccurrencesTreeSubjectPackageOrSource( - &src) - if err != nil { - return nil, fmt.Errorf( - "unable to marshal NeighborsNeighborsIsOccurrence.AllIsOccurrencesTree.Subject: %w", err) - } - } - retval.Artifact = v.AllIsOccurrencesTree.Artifact - retval.Justification = v.AllIsOccurrencesTree.Justification - retval.Origin = v.AllIsOccurrencesTree.Origin - retval.Collector = v.AllIsOccurrencesTree.Collector + retval.Id = v.AllHasSourceAt.Id + retval.Justification = v.AllHasSourceAt.Justification + retval.KnownSince = v.AllHasSourceAt.KnownSince + retval.Package = v.AllHasSourceAt.Package + retval.Source = v.AllHasSourceAt.Source + retval.Origin = v.AllHasSourceAt.Origin + retval.Collector = v.AllHasSourceAt.Collector return &retval, nil } -// NeighborsNeighborsIsVulnerability includes the requested fields of the GraphQL type IsVulnerability. -// The GraphQL type's documentation follows. -// -// IsVulnerability is an attestation to link CVE/GHSA with data in OSV. -type NeighborsNeighborsIsVulnerability struct { - Typename *string `json:"__typename"` - allIsVulnerability `json:"-"` +// HasSourceAtInputSpec is the same as HasSourceAt but for mutation input. +type HasSourceAtInputSpec struct { + KnownSince time.Time `json:"knownSince"` + Justification string `json:"justification"` + Origin string `json:"origin"` + Collector string `json:"collector"` } -// GetTypename returns NeighborsNeighborsIsVulnerability.Typename, and is useful for accessing the field via an interface. -func (v *NeighborsNeighborsIsVulnerability) GetTypename() *string { return v.Typename } +// GetKnownSince returns HasSourceAtInputSpec.KnownSince, and is useful for accessing the field via an interface. +func (v *HasSourceAtInputSpec) GetKnownSince() time.Time { return v.KnownSince } -// GetId returns NeighborsNeighborsIsVulnerability.Id, and is useful for accessing the field via an interface. -func (v *NeighborsNeighborsIsVulnerability) GetId() string { return v.allIsVulnerability.Id } +// GetJustification returns HasSourceAtInputSpec.Justification, and is useful for accessing the field via an interface. +func (v *HasSourceAtInputSpec) GetJustification() string { return v.Justification } -// GetOsv returns NeighborsNeighborsIsVulnerability.Osv, and is useful for accessing the field via an interface. -func (v *NeighborsNeighborsIsVulnerability) GetOsv() allIsVulnerabilityOsvOSV { - return v.allIsVulnerability.Osv -} +// GetOrigin returns HasSourceAtInputSpec.Origin, and is useful for accessing the field via an interface. +func (v *HasSourceAtInputSpec) GetOrigin() string { return v.Origin } -// GetVulnerability returns NeighborsNeighborsIsVulnerability.Vulnerability, and is useful for accessing the field via an interface. -func (v *NeighborsNeighborsIsVulnerability) GetVulnerability() allIsVulnerabilityVulnerabilityCveOrGhsa { - return v.allIsVulnerability.Vulnerability -} +// GetCollector returns HasSourceAtInputSpec.Collector, and is useful for accessing the field via an interface. +func (v *HasSourceAtInputSpec) GetCollector() string { return v.Collector } -// GetJustification returns NeighborsNeighborsIsVulnerability.Justification, and is useful for accessing the field via an interface. -func (v *NeighborsNeighborsIsVulnerability) GetJustification() string { - return v.allIsVulnerability.Justification +// HasSourceAtResponse is returned by HasSourceAt on success. +type HasSourceAtResponse struct { + // Adds a certification that a package (PackageName or PackageVersion) is built from the source. + IngestHasSourceAt HasSourceAtIngestHasSourceAt `json:"ingestHasSourceAt"` } -// GetOrigin returns NeighborsNeighborsIsVulnerability.Origin, and is useful for accessing the field via an interface. -func (v *NeighborsNeighborsIsVulnerability) GetOrigin() string { return v.allIsVulnerability.Origin } +// GetIngestHasSourceAt returns HasSourceAtResponse.IngestHasSourceAt, and is useful for accessing the field via an interface. +func (v *HasSourceAtResponse) GetIngestHasSourceAt() HasSourceAtIngestHasSourceAt { + return v.IngestHasSourceAt +} -// GetCollector returns NeighborsNeighborsIsVulnerability.Collector, and is useful for accessing the field via an interface. -func (v *NeighborsNeighborsIsVulnerability) GetCollector() string { - return v.allIsVulnerability.Collector +// HashEqualIngestHashEqual includes the requested fields of the GraphQL type HashEqual. +// The GraphQL type's documentation follows. +// +// HashEqual is an attestation that a set of artifacts are identical. +type HashEqualIngestHashEqual struct { + AllHashEqualTree `json:"-"` } -func (v *NeighborsNeighborsIsVulnerability) UnmarshalJSON(b []byte) error { +// GetId returns HashEqualIngestHashEqual.Id, and is useful for accessing the field via an interface. +func (v *HashEqualIngestHashEqual) GetId() string { return v.AllHashEqualTree.Id } + +// GetJustification returns HashEqualIngestHashEqual.Justification, and is useful for accessing the field via an interface. +func (v *HashEqualIngestHashEqual) GetJustification() string { return v.AllHashEqualTree.Justification } + +// GetArtifacts returns HashEqualIngestHashEqual.Artifacts, and is useful for accessing the field via an interface. +func (v *HashEqualIngestHashEqual) GetArtifacts() []AllHashEqualTreeArtifactsArtifact { + return v.AllHashEqualTree.Artifacts +} + +// GetOrigin returns HashEqualIngestHashEqual.Origin, and is useful for accessing the field via an interface. +func (v *HashEqualIngestHashEqual) GetOrigin() string { return v.AllHashEqualTree.Origin } + +// GetCollector returns HashEqualIngestHashEqual.Collector, and is useful for accessing the field via an interface. +func (v *HashEqualIngestHashEqual) GetCollector() string { return v.AllHashEqualTree.Collector } + +func (v *HashEqualIngestHashEqual) UnmarshalJSON(b []byte) error { if string(b) == "null" { return nil } var firstPass struct { - *NeighborsNeighborsIsVulnerability + *HashEqualIngestHashEqual graphql.NoUnmarshalJSON } - firstPass.NeighborsNeighborsIsVulnerability = v + firstPass.HashEqualIngestHashEqual = v err := json.Unmarshal(b, &firstPass) if err != nil { @@ -8960,30 +9255,26 @@ func (v *NeighborsNeighborsIsVulnerability) UnmarshalJSON(b []byte) error { } err = json.Unmarshal( - b, &v.allIsVulnerability) + b, &v.AllHashEqualTree) if err != nil { return err } return nil } -type __premarshalNeighborsNeighborsIsVulnerability struct { - Typename *string `json:"__typename"` - +type __premarshalHashEqualIngestHashEqual struct { Id string `json:"id"` - Osv allIsVulnerabilityOsvOSV `json:"osv"` - - Vulnerability json.RawMessage `json:"vulnerability"` - Justification string `json:"justification"` + Artifacts []AllHashEqualTreeArtifactsArtifact `json:"artifacts"` + Origin string `json:"origin"` Collector string `json:"collector"` } -func (v *NeighborsNeighborsIsVulnerability) MarshalJSON() ([]byte, error) { +func (v *HashEqualIngestHashEqual) MarshalJSON() ([]byte, error) { premarshaled, err := v.__premarshalJSON() if err != nil { return nil, err @@ -8991,515 +9282,295 @@ func (v *NeighborsNeighborsIsVulnerability) MarshalJSON() ([]byte, error) { return json.Marshal(premarshaled) } -func (v *NeighborsNeighborsIsVulnerability) __premarshalJSON() (*__premarshalNeighborsNeighborsIsVulnerability, error) { - var retval __premarshalNeighborsNeighborsIsVulnerability - - retval.Typename = v.Typename - retval.Id = v.allIsVulnerability.Id - retval.Osv = v.allIsVulnerability.Osv - { +func (v *HashEqualIngestHashEqual) __premarshalJSON() (*__premarshalHashEqualIngestHashEqual, error) { + var retval __premarshalHashEqualIngestHashEqual - dst := &retval.Vulnerability - src := v.allIsVulnerability.Vulnerability - var err error - *dst, err = __marshalallIsVulnerabilityVulnerabilityCveOrGhsa( - &src) - if err != nil { - return nil, fmt.Errorf( - "unable to marshal NeighborsNeighborsIsVulnerability.allIsVulnerability.Vulnerability: %w", err) - } - } - retval.Justification = v.allIsVulnerability.Justification - retval.Origin = v.allIsVulnerability.Origin - retval.Collector = v.allIsVulnerability.Collector + retval.Id = v.AllHashEqualTree.Id + retval.Justification = v.AllHashEqualTree.Justification + retval.Artifacts = v.AllHashEqualTree.Artifacts + retval.Origin = v.AllHashEqualTree.Origin + retval.Collector = v.AllHashEqualTree.Collector return &retval, nil } -// NeighborsNeighborsNoVuln includes the requested fields of the GraphQL type NoVuln. -// The GraphQL type's documentation follows. -// -// NoVuln is a special vulnerability node to attest that no vulnerability has been -// found during a vulnerability scan. -// -// Backends guarantee that this is a singleton node. -type NeighborsNeighborsNoVuln struct { - Typename *string `json:"__typename"` - Id string `json:"id"` +// HashEqualInputSpec represents the input to certify that packages are similar. +type HashEqualInputSpec struct { + Justification string `json:"justification"` + Origin string `json:"origin"` + Collector string `json:"collector"` } -// GetTypename returns NeighborsNeighborsNoVuln.Typename, and is useful for accessing the field via an interface. -func (v *NeighborsNeighborsNoVuln) GetTypename() *string { return v.Typename } +// GetJustification returns HashEqualInputSpec.Justification, and is useful for accessing the field via an interface. +func (v *HashEqualInputSpec) GetJustification() string { return v.Justification } -// GetId returns NeighborsNeighborsNoVuln.Id, and is useful for accessing the field via an interface. -func (v *NeighborsNeighborsNoVuln) GetId() string { return v.Id } +// GetOrigin returns HashEqualInputSpec.Origin, and is useful for accessing the field via an interface. +func (v *HashEqualInputSpec) GetOrigin() string { return v.Origin } -// NeighborsNeighborsNode includes the requested fields of the GraphQL interface Node. -// -// NeighborsNeighborsNode is implemented by the following types: -// NeighborsNeighborsArtifact -// NeighborsNeighborsBuilder -// NeighborsNeighborsCVE -// NeighborsNeighborsCertifyBad -// NeighborsNeighborsCertifyGood -// NeighborsNeighborsCertifyScorecard -// NeighborsNeighborsCertifyVEXStatement -// NeighborsNeighborsCertifyVuln -// NeighborsNeighborsGHSA -// NeighborsNeighborsHasMetadata -// NeighborsNeighborsHasSBOM -// NeighborsNeighborsHasSLSA -// NeighborsNeighborsHasSourceAt -// NeighborsNeighborsHashEqual -// NeighborsNeighborsIsDependency -// NeighborsNeighborsIsOccurrence -// NeighborsNeighborsIsVulnerability -// NeighborsNeighborsNoVuln -// NeighborsNeighborsOSV -// NeighborsNeighborsPackage -// NeighborsNeighborsPkgEqual -// NeighborsNeighborsPointOfContact -// NeighborsNeighborsSource +// GetCollector returns HashEqualInputSpec.Collector, and is useful for accessing the field via an interface. +func (v *HashEqualInputSpec) GetCollector() string { return v.Collector } + +// HashEqualResponse is returned by HashEqual on success. +type HashEqualResponse struct { + // Adds a certification that two artifacts are similar. + IngestHashEqual HashEqualIngestHashEqual `json:"ingestHashEqual"` +} + +// GetIngestHashEqual returns HashEqualResponse.IngestHashEqual, and is useful for accessing the field via an interface. +func (v *HashEqualResponse) GetIngestHashEqual() HashEqualIngestHashEqual { return v.IngestHashEqual } + +// IngestArtifactIngestArtifact includes the requested fields of the GraphQL type Artifact. // The GraphQL type's documentation follows. // -// Node is a union type of all the possible nodes. +// Artifact represents an artifact identified by a checksum hash. // -// It encapsulates the software tree nodes along with the evidence nodes. In a -// path query, all connecting evidence nodes along with their intermediate subject -// nodes need to be returned in order to create a complete graph. -type NeighborsNeighborsNode interface { - implementsGraphQLInterfaceNeighborsNeighborsNode() - // GetTypename returns the receiver's concrete GraphQL type-name (see interface doc for possible values). - GetTypename() *string +// The checksum is split into the digest value and the algorithm used to generate +// it. Both fields are mandatory and canonicalized to be lowercase. +// +// If having a checksum Go object, algorithm can be +// strings.ToLower(string(checksum.Algorithm)) and digest can be checksum.Value. +type IngestArtifactIngestArtifact struct { + AllArtifactTree `json:"-"` } -func (v *NeighborsNeighborsArtifact) implementsGraphQLInterfaceNeighborsNeighborsNode() {} -func (v *NeighborsNeighborsBuilder) implementsGraphQLInterfaceNeighborsNeighborsNode() {} -func (v *NeighborsNeighborsCVE) implementsGraphQLInterfaceNeighborsNeighborsNode() {} -func (v *NeighborsNeighborsCertifyBad) implementsGraphQLInterfaceNeighborsNeighborsNode() {} -func (v *NeighborsNeighborsCertifyGood) implementsGraphQLInterfaceNeighborsNeighborsNode() {} -func (v *NeighborsNeighborsCertifyScorecard) implementsGraphQLInterfaceNeighborsNeighborsNode() {} -func (v *NeighborsNeighborsCertifyVEXStatement) implementsGraphQLInterfaceNeighborsNeighborsNode() {} -func (v *NeighborsNeighborsCertifyVuln) implementsGraphQLInterfaceNeighborsNeighborsNode() {} -func (v *NeighborsNeighborsGHSA) implementsGraphQLInterfaceNeighborsNeighborsNode() {} -func (v *NeighborsNeighborsHasMetadata) implementsGraphQLInterfaceNeighborsNeighborsNode() {} -func (v *NeighborsNeighborsHasSBOM) implementsGraphQLInterfaceNeighborsNeighborsNode() {} -func (v *NeighborsNeighborsHasSLSA) implementsGraphQLInterfaceNeighborsNeighborsNode() {} -func (v *NeighborsNeighborsHasSourceAt) implementsGraphQLInterfaceNeighborsNeighborsNode() {} -func (v *NeighborsNeighborsHashEqual) implementsGraphQLInterfaceNeighborsNeighborsNode() {} -func (v *NeighborsNeighborsIsDependency) implementsGraphQLInterfaceNeighborsNeighborsNode() {} -func (v *NeighborsNeighborsIsOccurrence) implementsGraphQLInterfaceNeighborsNeighborsNode() {} -func (v *NeighborsNeighborsIsVulnerability) implementsGraphQLInterfaceNeighborsNeighborsNode() {} -func (v *NeighborsNeighborsNoVuln) implementsGraphQLInterfaceNeighborsNeighborsNode() {} -func (v *NeighborsNeighborsOSV) implementsGraphQLInterfaceNeighborsNeighborsNode() {} -func (v *NeighborsNeighborsPackage) implementsGraphQLInterfaceNeighborsNeighborsNode() {} -func (v *NeighborsNeighborsPkgEqual) implementsGraphQLInterfaceNeighborsNeighborsNode() {} -func (v *NeighborsNeighborsPointOfContact) implementsGraphQLInterfaceNeighborsNeighborsNode() {} -func (v *NeighborsNeighborsSource) implementsGraphQLInterfaceNeighborsNeighborsNode() {} +// GetId returns IngestArtifactIngestArtifact.Id, and is useful for accessing the field via an interface. +func (v *IngestArtifactIngestArtifact) GetId() string { return v.AllArtifactTree.Id } + +// GetAlgorithm returns IngestArtifactIngestArtifact.Algorithm, and is useful for accessing the field via an interface. +func (v *IngestArtifactIngestArtifact) GetAlgorithm() string { return v.AllArtifactTree.Algorithm } + +// GetDigest returns IngestArtifactIngestArtifact.Digest, and is useful for accessing the field via an interface. +func (v *IngestArtifactIngestArtifact) GetDigest() string { return v.AllArtifactTree.Digest } + +func (v *IngestArtifactIngestArtifact) UnmarshalJSON(b []byte) error { -func __unmarshalNeighborsNeighborsNode(b []byte, v *NeighborsNeighborsNode) error { if string(b) == "null" { return nil } - var tn struct { - TypeName string `json:"__typename"` + var firstPass struct { + *IngestArtifactIngestArtifact + graphql.NoUnmarshalJSON } - err := json.Unmarshal(b, &tn) + firstPass.IngestArtifactIngestArtifact = v + + err := json.Unmarshal(b, &firstPass) if err != nil { return err } - switch tn.TypeName { - case "Artifact": - *v = new(NeighborsNeighborsArtifact) - return json.Unmarshal(b, *v) - case "Builder": - *v = new(NeighborsNeighborsBuilder) - return json.Unmarshal(b, *v) - case "CVE": - *v = new(NeighborsNeighborsCVE) - return json.Unmarshal(b, *v) - case "CertifyBad": - *v = new(NeighborsNeighborsCertifyBad) - return json.Unmarshal(b, *v) - case "CertifyGood": - *v = new(NeighborsNeighborsCertifyGood) - return json.Unmarshal(b, *v) - case "CertifyScorecard": - *v = new(NeighborsNeighborsCertifyScorecard) - return json.Unmarshal(b, *v) - case "CertifyVEXStatement": - *v = new(NeighborsNeighborsCertifyVEXStatement) - return json.Unmarshal(b, *v) - case "CertifyVuln": - *v = new(NeighborsNeighborsCertifyVuln) - return json.Unmarshal(b, *v) - case "GHSA": - *v = new(NeighborsNeighborsGHSA) - return json.Unmarshal(b, *v) - case "HasMetadata": - *v = new(NeighborsNeighborsHasMetadata) - return json.Unmarshal(b, *v) - case "HasSBOM": - *v = new(NeighborsNeighborsHasSBOM) - return json.Unmarshal(b, *v) - case "HasSLSA": - *v = new(NeighborsNeighborsHasSLSA) - return json.Unmarshal(b, *v) - case "HasSourceAt": - *v = new(NeighborsNeighborsHasSourceAt) - return json.Unmarshal(b, *v) - case "HashEqual": - *v = new(NeighborsNeighborsHashEqual) - return json.Unmarshal(b, *v) - case "IsDependency": - *v = new(NeighborsNeighborsIsDependency) - return json.Unmarshal(b, *v) - case "IsOccurrence": - *v = new(NeighborsNeighborsIsOccurrence) - return json.Unmarshal(b, *v) - case "IsVulnerability": - *v = new(NeighborsNeighborsIsVulnerability) - return json.Unmarshal(b, *v) - case "NoVuln": - *v = new(NeighborsNeighborsNoVuln) - return json.Unmarshal(b, *v) - case "OSV": - *v = new(NeighborsNeighborsOSV) - return json.Unmarshal(b, *v) - case "Package": - *v = new(NeighborsNeighborsPackage) - return json.Unmarshal(b, *v) - case "PkgEqual": - *v = new(NeighborsNeighborsPkgEqual) - return json.Unmarshal(b, *v) - case "PointOfContact": - *v = new(NeighborsNeighborsPointOfContact) - return json.Unmarshal(b, *v) - case "Source": - *v = new(NeighborsNeighborsSource) - return json.Unmarshal(b, *v) - case "": - return fmt.Errorf( - "response was missing Node.__typename") - default: - return fmt.Errorf( - `unexpected concrete type for NeighborsNeighborsNode: "%v"`, tn.TypeName) + err = json.Unmarshal( + b, &v.AllArtifactTree) + if err != nil { + return err } + return nil } -func __marshalNeighborsNeighborsNode(v *NeighborsNeighborsNode) ([]byte, error) { +type __premarshalIngestArtifactIngestArtifact struct { + Id string `json:"id"` - var typename string - switch v := (*v).(type) { - case *NeighborsNeighborsArtifact: - typename = "Artifact" + Algorithm string `json:"algorithm"` - premarshaled, err := v.__premarshalJSON() - if err != nil { - return nil, err - } - result := struct { - TypeName string `json:"__typename"` - *__premarshalNeighborsNeighborsArtifact - }{typename, premarshaled} - return json.Marshal(result) - case *NeighborsNeighborsBuilder: - typename = "Builder" + Digest string `json:"digest"` +} - premarshaled, err := v.__premarshalJSON() - if err != nil { - return nil, err - } - result := struct { - TypeName string `json:"__typename"` - *__premarshalNeighborsNeighborsBuilder - }{typename, premarshaled} - return json.Marshal(result) - case *NeighborsNeighborsCVE: - typename = "CVE" +func (v *IngestArtifactIngestArtifact) MarshalJSON() ([]byte, error) { + premarshaled, err := v.__premarshalJSON() + if err != nil { + return nil, err + } + return json.Marshal(premarshaled) +} - premarshaled, err := v.__premarshalJSON() - if err != nil { - return nil, err - } - result := struct { - TypeName string `json:"__typename"` - *__premarshalNeighborsNeighborsCVE - }{typename, premarshaled} - return json.Marshal(result) - case *NeighborsNeighborsCertifyBad: - typename = "CertifyBad" +func (v *IngestArtifactIngestArtifact) __premarshalJSON() (*__premarshalIngestArtifactIngestArtifact, error) { + var retval __premarshalIngestArtifactIngestArtifact - premarshaled, err := v.__premarshalJSON() - if err != nil { - return nil, err - } - result := struct { - TypeName string `json:"__typename"` - *__premarshalNeighborsNeighborsCertifyBad - }{typename, premarshaled} - return json.Marshal(result) - case *NeighborsNeighborsCertifyGood: - typename = "CertifyGood" + retval.Id = v.AllArtifactTree.Id + retval.Algorithm = v.AllArtifactTree.Algorithm + retval.Digest = v.AllArtifactTree.Digest + return &retval, nil +} - premarshaled, err := v.__premarshalJSON() - if err != nil { - return nil, err - } - result := struct { - TypeName string `json:"__typename"` - *__premarshalNeighborsNeighborsCertifyGood - }{typename, premarshaled} - return json.Marshal(result) - case *NeighborsNeighborsCertifyScorecard: - typename = "CertifyScorecard" +// IngestArtifactResponse is returned by IngestArtifact on success. +type IngestArtifactResponse struct { + // Ingests a new artifact and returns it. + IngestArtifact IngestArtifactIngestArtifact `json:"ingestArtifact"` +} - premarshaled, err := v.__premarshalJSON() - if err != nil { - return nil, err - } - result := struct { - TypeName string `json:"__typename"` - *__premarshalNeighborsNeighborsCertifyScorecard - }{typename, premarshaled} - return json.Marshal(result) - case *NeighborsNeighborsCertifyVEXStatement: - typename = "CertifyVEXStatement" +// GetIngestArtifact returns IngestArtifactResponse.IngestArtifact, and is useful for accessing the field via an interface. +func (v *IngestArtifactResponse) GetIngestArtifact() IngestArtifactIngestArtifact { + return v.IngestArtifact +} - premarshaled, err := v.__premarshalJSON() - if err != nil { - return nil, err - } - result := struct { - TypeName string `json:"__typename"` - *__premarshalNeighborsNeighborsCertifyVEXStatement - }{typename, premarshaled} - return json.Marshal(result) - case *NeighborsNeighborsCertifyVuln: - typename = "CertifyVuln" +// IngestArtifactsIngestArtifactsArtifact includes the requested fields of the GraphQL type Artifact. +// The GraphQL type's documentation follows. +// +// Artifact represents an artifact identified by a checksum hash. +// +// The checksum is split into the digest value and the algorithm used to generate +// it. Both fields are mandatory and canonicalized to be lowercase. +// +// If having a checksum Go object, algorithm can be +// strings.ToLower(string(checksum.Algorithm)) and digest can be checksum.Value. +type IngestArtifactsIngestArtifactsArtifact struct { + AllArtifactTree `json:"-"` +} - premarshaled, err := v.__premarshalJSON() - if err != nil { - return nil, err - } - result := struct { - TypeName string `json:"__typename"` - *__premarshalNeighborsNeighborsCertifyVuln - }{typename, premarshaled} - return json.Marshal(result) - case *NeighborsNeighborsGHSA: - typename = "GHSA" +// GetId returns IngestArtifactsIngestArtifactsArtifact.Id, and is useful for accessing the field via an interface. +func (v *IngestArtifactsIngestArtifactsArtifact) GetId() string { return v.AllArtifactTree.Id } - premarshaled, err := v.__premarshalJSON() - if err != nil { - return nil, err - } - result := struct { - TypeName string `json:"__typename"` - *__premarshalNeighborsNeighborsGHSA - }{typename, premarshaled} - return json.Marshal(result) - case *NeighborsNeighborsHasMetadata: - typename = "HasMetadata" +// GetAlgorithm returns IngestArtifactsIngestArtifactsArtifact.Algorithm, and is useful for accessing the field via an interface. +func (v *IngestArtifactsIngestArtifactsArtifact) GetAlgorithm() string { + return v.AllArtifactTree.Algorithm +} - result := struct { - TypeName string `json:"__typename"` - *NeighborsNeighborsHasMetadata - }{typename, v} - return json.Marshal(result) - case *NeighborsNeighborsHasSBOM: - typename = "HasSBOM" +// GetDigest returns IngestArtifactsIngestArtifactsArtifact.Digest, and is useful for accessing the field via an interface. +func (v *IngestArtifactsIngestArtifactsArtifact) GetDigest() string { return v.AllArtifactTree.Digest } - premarshaled, err := v.__premarshalJSON() - if err != nil { - return nil, err - } - result := struct { - TypeName string `json:"__typename"` - *__premarshalNeighborsNeighborsHasSBOM - }{typename, premarshaled} - return json.Marshal(result) - case *NeighborsNeighborsHasSLSA: - typename = "HasSLSA" +func (v *IngestArtifactsIngestArtifactsArtifact) UnmarshalJSON(b []byte) error { - premarshaled, err := v.__premarshalJSON() - if err != nil { - return nil, err - } - result := struct { - TypeName string `json:"__typename"` - *__premarshalNeighborsNeighborsHasSLSA - }{typename, premarshaled} - return json.Marshal(result) - case *NeighborsNeighborsHasSourceAt: - typename = "HasSourceAt" + if string(b) == "null" { + return nil + } - premarshaled, err := v.__premarshalJSON() - if err != nil { - return nil, err - } - result := struct { - TypeName string `json:"__typename"` - *__premarshalNeighborsNeighborsHasSourceAt - }{typename, premarshaled} - return json.Marshal(result) - case *NeighborsNeighborsHashEqual: - typename = "HashEqual" + var firstPass struct { + *IngestArtifactsIngestArtifactsArtifact + graphql.NoUnmarshalJSON + } + firstPass.IngestArtifactsIngestArtifactsArtifact = v - premarshaled, err := v.__premarshalJSON() - if err != nil { - return nil, err - } - result := struct { - TypeName string `json:"__typename"` - *__premarshalNeighborsNeighborsHashEqual - }{typename, premarshaled} - return json.Marshal(result) - case *NeighborsNeighborsIsDependency: - typename = "IsDependency" + err := json.Unmarshal(b, &firstPass) + if err != nil { + return err + } - premarshaled, err := v.__premarshalJSON() - if err != nil { - return nil, err - } - result := struct { - TypeName string `json:"__typename"` - *__premarshalNeighborsNeighborsIsDependency - }{typename, premarshaled} - return json.Marshal(result) - case *NeighborsNeighborsIsOccurrence: - typename = "IsOccurrence" + err = json.Unmarshal( + b, &v.AllArtifactTree) + if err != nil { + return err + } + return nil +} - premarshaled, err := v.__premarshalJSON() - if err != nil { - return nil, err - } - result := struct { - TypeName string `json:"__typename"` - *__premarshalNeighborsNeighborsIsOccurrence - }{typename, premarshaled} - return json.Marshal(result) - case *NeighborsNeighborsIsVulnerability: - typename = "IsVulnerability" +type __premarshalIngestArtifactsIngestArtifactsArtifact struct { + Id string `json:"id"` - premarshaled, err := v.__premarshalJSON() - if err != nil { - return nil, err - } - result := struct { - TypeName string `json:"__typename"` - *__premarshalNeighborsNeighborsIsVulnerability - }{typename, premarshaled} - return json.Marshal(result) - case *NeighborsNeighborsNoVuln: - typename = "NoVuln" + Algorithm string `json:"algorithm"` - result := struct { - TypeName string `json:"__typename"` - *NeighborsNeighborsNoVuln - }{typename, v} - return json.Marshal(result) - case *NeighborsNeighborsOSV: - typename = "OSV" + Digest string `json:"digest"` +} - premarshaled, err := v.__premarshalJSON() - if err != nil { - return nil, err - } - result := struct { - TypeName string `json:"__typename"` - *__premarshalNeighborsNeighborsOSV - }{typename, premarshaled} - return json.Marshal(result) - case *NeighborsNeighborsPackage: - typename = "Package" +func (v *IngestArtifactsIngestArtifactsArtifact) MarshalJSON() ([]byte, error) { + premarshaled, err := v.__premarshalJSON() + if err != nil { + return nil, err + } + return json.Marshal(premarshaled) +} - premarshaled, err := v.__premarshalJSON() - if err != nil { - return nil, err - } - result := struct { - TypeName string `json:"__typename"` - *__premarshalNeighborsNeighborsPackage - }{typename, premarshaled} - return json.Marshal(result) - case *NeighborsNeighborsPkgEqual: - typename = "PkgEqual" +func (v *IngestArtifactsIngestArtifactsArtifact) __premarshalJSON() (*__premarshalIngestArtifactsIngestArtifactsArtifact, error) { + var retval __premarshalIngestArtifactsIngestArtifactsArtifact - premarshaled, err := v.__premarshalJSON() - if err != nil { - return nil, err - } - result := struct { - TypeName string `json:"__typename"` - *__premarshalNeighborsNeighborsPkgEqual - }{typename, premarshaled} - return json.Marshal(result) - case *NeighborsNeighborsPointOfContact: - typename = "PointOfContact" + retval.Id = v.AllArtifactTree.Id + retval.Algorithm = v.AllArtifactTree.Algorithm + retval.Digest = v.AllArtifactTree.Digest + return &retval, nil +} - result := struct { - TypeName string `json:"__typename"` - *NeighborsNeighborsPointOfContact - }{typename, v} - return json.Marshal(result) - case *NeighborsNeighborsSource: - typename = "Source" +// IngestArtifactsResponse is returned by IngestArtifacts on success. +type IngestArtifactsResponse struct { + // Bulk ingests new artifacts and returns a list of them. + IngestArtifacts []IngestArtifactsIngestArtifactsArtifact `json:"ingestArtifacts"` +} - premarshaled, err := v.__premarshalJSON() - if err != nil { - return nil, err - } - result := struct { - TypeName string `json:"__typename"` - *__premarshalNeighborsNeighborsSource - }{typename, premarshaled} - return json.Marshal(result) - case nil: - return []byte("null"), nil - default: - return nil, fmt.Errorf( - `unexpected concrete type for NeighborsNeighborsNode: "%T"`, v) - } +// GetIngestArtifacts returns IngestArtifactsResponse.IngestArtifacts, and is useful for accessing the field via an interface. +func (v *IngestArtifactsResponse) GetIngestArtifacts() []IngestArtifactsIngestArtifactsArtifact { + return v.IngestArtifacts } -// NeighborsNeighborsOSV includes the requested fields of the GraphQL type OSV. +// IngestBuilderIngestBuilder includes the requested fields of the GraphQL type Builder. // The GraphQL type's documentation follows. // -// OSV represents an Open Source Vulnerability. +// Builder represents the builder (e.g., FRSCA or GitHub Actions). // -// The osvId field is mandatory and canonicalized to be lowercase. +// Currently builders are identified by the uri field. +type IngestBuilderIngestBuilder struct { + Uri string `json:"uri"` +} + +// GetUri returns IngestBuilderIngestBuilder.Uri, and is useful for accessing the field via an interface. +func (v *IngestBuilderIngestBuilder) GetUri() string { return v.Uri } + +// IngestBuilderResponse is returned by IngestBuilder on success. +type IngestBuilderResponse struct { + // Ingests a new builder and returns it. + IngestBuilder IngestBuilderIngestBuilder `json:"ingestBuilder"` +} + +// GetIngestBuilder returns IngestBuilderResponse.IngestBuilder, and is useful for accessing the field via an interface. +func (v *IngestBuilderResponse) GetIngestBuilder() IngestBuilderIngestBuilder { return v.IngestBuilder } + +// IngestBuildersIngestBuildersBuilder includes the requested fields of the GraphQL type Builder. +// The GraphQL type's documentation follows. // -// This maps to a vulnerability ID specific to the environment (e.g., GHSA ID or -// CVE ID). +// Builder represents the builder (e.g., FRSCA or GitHub Actions). +// +// Currently builders are identified by the uri field. +type IngestBuildersIngestBuildersBuilder struct { + Uri string `json:"uri"` +} + +// GetUri returns IngestBuildersIngestBuildersBuilder.Uri, and is useful for accessing the field via an interface. +func (v *IngestBuildersIngestBuildersBuilder) GetUri() string { return v.Uri } + +// IngestBuildersResponse is returned by IngestBuilders on success. +type IngestBuildersResponse struct { + // Bulk ingests new builders and returns a list of them. + IngestBuilders []IngestBuildersIngestBuildersBuilder `json:"ingestBuilders"` +} + +// GetIngestBuilders returns IngestBuildersResponse.IngestBuilders, and is useful for accessing the field via an interface. +func (v *IngestBuildersResponse) GetIngestBuilders() []IngestBuildersIngestBuildersBuilder { + return v.IngestBuilders +} + +// IngestCVEIngestCVE includes the requested fields of the GraphQL type CVE. +// The GraphQL type's documentation follows. +// +// CVE represents a vulnerability in the Common Vulnerabilities and Exposures +// schema. +// +// The vulnerability identifier contains a year field, so we are extracting that +// to allow matching for vulnerabilities found in a given year. +// +// The vulnerability identifier field is mandatory and canonicalized to be +// lowercase. // // This node can be referred to by other parts of GUAC. -type NeighborsNeighborsOSV struct { - Typename *string `json:"__typename"` - AllOSVTree `json:"-"` +type IngestCVEIngestCVE struct { + AllCveTree `json:"-"` } -// GetTypename returns NeighborsNeighborsOSV.Typename, and is useful for accessing the field via an interface. -func (v *NeighborsNeighborsOSV) GetTypename() *string { return v.Typename } +// GetId returns IngestCVEIngestCVE.Id, and is useful for accessing the field via an interface. +func (v *IngestCVEIngestCVE) GetId() string { return v.AllCveTree.Id } -// GetId returns NeighborsNeighborsOSV.Id, and is useful for accessing the field via an interface. -func (v *NeighborsNeighborsOSV) GetId() string { return v.AllOSVTree.Id } +// GetYear returns IngestCVEIngestCVE.Year, and is useful for accessing the field via an interface. +func (v *IngestCVEIngestCVE) GetYear() int { return v.AllCveTree.Year } -// GetOsvId returns NeighborsNeighborsOSV.OsvId, and is useful for accessing the field via an interface. -func (v *NeighborsNeighborsOSV) GetOsvId() string { return v.AllOSVTree.OsvId } +// GetCveId returns IngestCVEIngestCVE.CveId, and is useful for accessing the field via an interface. +func (v *IngestCVEIngestCVE) GetCveId() string { return v.AllCveTree.CveId } -func (v *NeighborsNeighborsOSV) UnmarshalJSON(b []byte) error { +func (v *IngestCVEIngestCVE) UnmarshalJSON(b []byte) error { if string(b) == "null" { return nil } var firstPass struct { - *NeighborsNeighborsOSV + *IngestCVEIngestCVE graphql.NoUnmarshalJSON } - firstPass.NeighborsNeighborsOSV = v + firstPass.IngestCVEIngestCVE = v err := json.Unmarshal(b, &firstPass) if err != nil { @@ -9507,22 +9578,22 @@ func (v *NeighborsNeighborsOSV) UnmarshalJSON(b []byte) error { } err = json.Unmarshal( - b, &v.AllOSVTree) + b, &v.AllCveTree) if err != nil { return err } return nil } -type __premarshalNeighborsNeighborsOSV struct { - Typename *string `json:"__typename"` - +type __premarshalIngestCVEIngestCVE struct { Id string `json:"id"` - OsvId string `json:"osvId"` + Year int `json:"year"` + + CveId string `json:"cveId"` } -func (v *NeighborsNeighborsOSV) MarshalJSON() ([]byte, error) { +func (v *IngestCVEIngestCVE) MarshalJSON() ([]byte, error) { premarshaled, err := v.__premarshalJSON() if err != nil { return nil, err @@ -9530,62 +9601,61 @@ func (v *NeighborsNeighborsOSV) MarshalJSON() ([]byte, error) { return json.Marshal(premarshaled) } -func (v *NeighborsNeighborsOSV) __premarshalJSON() (*__premarshalNeighborsNeighborsOSV, error) { - var retval __premarshalNeighborsNeighborsOSV +func (v *IngestCVEIngestCVE) __premarshalJSON() (*__premarshalIngestCVEIngestCVE, error) { + var retval __premarshalIngestCVEIngestCVE - retval.Typename = v.Typename - retval.Id = v.AllOSVTree.Id - retval.OsvId = v.AllOSVTree.OsvId + retval.Id = v.AllCveTree.Id + retval.Year = v.AllCveTree.Year + retval.CveId = v.AllCveTree.CveId return &retval, nil } -// NeighborsNeighborsPackage includes the requested fields of the GraphQL type Package. +// IngestCVEResponse is returned by IngestCVE on success. +type IngestCVEResponse struct { + // Ingests new CVE and returns it. + IngestCVE IngestCVEIngestCVE `json:"ingestCVE"` +} + +// GetIngestCVE returns IngestCVEResponse.IngestCVE, and is useful for accessing the field via an interface. +func (v *IngestCVEResponse) GetIngestCVE() IngestCVEIngestCVE { return v.IngestCVE } + +// IngestCVEsIngestCVEsCVE includes the requested fields of the GraphQL type CVE. // The GraphQL type's documentation follows. // -// Package represents the root of the package trie/tree. +// CVE represents a vulnerability in the Common Vulnerabilities and Exposures +// schema. // -// We map package information to a trie, closely matching the pURL specification -// (https://github.com/package-url/purl-spec/blob/0dd92f26f8bb11956ffdf5e8acfcee71e8560407/README.rst), -// but deviating from it where GUAC heuristics allow for better representation of -// package information. Each path in the trie fully represents a package; we split -// the trie based on the pURL components. +// The vulnerability identifier contains a year field, so we are extracting that +// to allow matching for vulnerabilities found in a given year. // -// This node matches a pkg: partial pURL. The type field matches the -// pURL types but we might also use "guac" for the cases where the pURL -// representation is not complete or when we have custom rules. +// The vulnerability identifier field is mandatory and canonicalized to be +// lowercase. // -// Since this node is at the root of the package trie, it is named Package, not -// PackageType. -type NeighborsNeighborsPackage struct { - Typename *string `json:"__typename"` - AllPkgTree `json:"-"` +// This node can be referred to by other parts of GUAC. +type IngestCVEsIngestCVEsCVE struct { + AllCveTree `json:"-"` } -// GetTypename returns NeighborsNeighborsPackage.Typename, and is useful for accessing the field via an interface. -func (v *NeighborsNeighborsPackage) GetTypename() *string { return v.Typename } - -// GetId returns NeighborsNeighborsPackage.Id, and is useful for accessing the field via an interface. -func (v *NeighborsNeighborsPackage) GetId() string { return v.AllPkgTree.Id } +// GetId returns IngestCVEsIngestCVEsCVE.Id, and is useful for accessing the field via an interface. +func (v *IngestCVEsIngestCVEsCVE) GetId() string { return v.AllCveTree.Id } -// GetType returns NeighborsNeighborsPackage.Type, and is useful for accessing the field via an interface. -func (v *NeighborsNeighborsPackage) GetType() string { return v.AllPkgTree.Type } +// GetYear returns IngestCVEsIngestCVEsCVE.Year, and is useful for accessing the field via an interface. +func (v *IngestCVEsIngestCVEsCVE) GetYear() int { return v.AllCveTree.Year } -// GetNamespaces returns NeighborsNeighborsPackage.Namespaces, and is useful for accessing the field via an interface. -func (v *NeighborsNeighborsPackage) GetNamespaces() []AllPkgTreeNamespacesPackageNamespace { - return v.AllPkgTree.Namespaces -} +// GetCveId returns IngestCVEsIngestCVEsCVE.CveId, and is useful for accessing the field via an interface. +func (v *IngestCVEsIngestCVEsCVE) GetCveId() string { return v.AllCveTree.CveId } -func (v *NeighborsNeighborsPackage) UnmarshalJSON(b []byte) error { +func (v *IngestCVEsIngestCVEsCVE) UnmarshalJSON(b []byte) error { if string(b) == "null" { return nil } var firstPass struct { - *NeighborsNeighborsPackage + *IngestCVEsIngestCVEsCVE graphql.NoUnmarshalJSON } - firstPass.NeighborsNeighborsPackage = v + firstPass.IngestCVEsIngestCVEsCVE = v err := json.Unmarshal(b, &firstPass) if err != nil { @@ -9593,24 +9663,22 @@ func (v *NeighborsNeighborsPackage) UnmarshalJSON(b []byte) error { } err = json.Unmarshal( - b, &v.AllPkgTree) + b, &v.AllCveTree) if err != nil { return err } return nil } -type __premarshalNeighborsNeighborsPackage struct { - Typename *string `json:"__typename"` - +type __premarshalIngestCVEsIngestCVEsCVE struct { Id string `json:"id"` - Type string `json:"type"` + Year int `json:"year"` - Namespaces []AllPkgTreeNamespacesPackageNamespace `json:"namespaces"` + CveId string `json:"cveId"` } -func (v *NeighborsNeighborsPackage) MarshalJSON() ([]byte, error) { +func (v *IngestCVEsIngestCVEsCVE) MarshalJSON() ([]byte, error) { premarshaled, err := v.__premarshalJSON() if err != nil { return nil, err @@ -9618,56 +9686,53 @@ func (v *NeighborsNeighborsPackage) MarshalJSON() ([]byte, error) { return json.Marshal(premarshaled) } -func (v *NeighborsNeighborsPackage) __premarshalJSON() (*__premarshalNeighborsNeighborsPackage, error) { - var retval __premarshalNeighborsNeighborsPackage +func (v *IngestCVEsIngestCVEsCVE) __premarshalJSON() (*__premarshalIngestCVEsIngestCVEsCVE, error) { + var retval __premarshalIngestCVEsIngestCVEsCVE - retval.Typename = v.Typename - retval.Id = v.AllPkgTree.Id - retval.Type = v.AllPkgTree.Type - retval.Namespaces = v.AllPkgTree.Namespaces + retval.Id = v.AllCveTree.Id + retval.Year = v.AllCveTree.Year + retval.CveId = v.AllCveTree.CveId return &retval, nil } -// NeighborsNeighborsPkgEqual includes the requested fields of the GraphQL type PkgEqual. -// The GraphQL type's documentation follows. -// -// PkgEqual is an attestation that a set of packages are similar. -type NeighborsNeighborsPkgEqual struct { - Typename *string `json:"__typename"` - allPkgEqual `json:"-"` +// IngestCVEsResponse is returned by IngestCVEs on success. +type IngestCVEsResponse struct { + // Bulk ingests new CVEs and returns a list of them. + IngestCVEs []IngestCVEsIngestCVEsCVE `json:"ingestCVEs"` } -// GetTypename returns NeighborsNeighborsPkgEqual.Typename, and is useful for accessing the field via an interface. -func (v *NeighborsNeighborsPkgEqual) GetTypename() *string { return v.Typename } - -// GetId returns NeighborsNeighborsPkgEqual.Id, and is useful for accessing the field via an interface. -func (v *NeighborsNeighborsPkgEqual) GetId() string { return v.allPkgEqual.Id } - -// GetJustification returns NeighborsNeighborsPkgEqual.Justification, and is useful for accessing the field via an interface. -func (v *NeighborsNeighborsPkgEqual) GetJustification() string { return v.allPkgEqual.Justification } +// GetIngestCVEs returns IngestCVEsResponse.IngestCVEs, and is useful for accessing the field via an interface. +func (v *IngestCVEsResponse) GetIngestCVEs() []IngestCVEsIngestCVEsCVE { return v.IngestCVEs } -// GetPackages returns NeighborsNeighborsPkgEqual.Packages, and is useful for accessing the field via an interface. -func (v *NeighborsNeighborsPkgEqual) GetPackages() []allPkgEqualPackagesPackage { - return v.allPkgEqual.Packages +// IngestGHSAIngestGHSA includes the requested fields of the GraphQL type GHSA. +// The GraphQL type's documentation follows. +// +// GHSA represents GitHub security advisories. +// +// The advisory id field is mandatory and canonicalized to be lowercase. +// +// This node can be referred to by other parts of GUAC. +type IngestGHSAIngestGHSA struct { + AllGHSATree `json:"-"` } -// GetOrigin returns NeighborsNeighborsPkgEqual.Origin, and is useful for accessing the field via an interface. -func (v *NeighborsNeighborsPkgEqual) GetOrigin() string { return v.allPkgEqual.Origin } +// GetId returns IngestGHSAIngestGHSA.Id, and is useful for accessing the field via an interface. +func (v *IngestGHSAIngestGHSA) GetId() string { return v.AllGHSATree.Id } -// GetCollector returns NeighborsNeighborsPkgEqual.Collector, and is useful for accessing the field via an interface. -func (v *NeighborsNeighborsPkgEqual) GetCollector() string { return v.allPkgEqual.Collector } +// GetGhsaId returns IngestGHSAIngestGHSA.GhsaId, and is useful for accessing the field via an interface. +func (v *IngestGHSAIngestGHSA) GetGhsaId() string { return v.AllGHSATree.GhsaId } -func (v *NeighborsNeighborsPkgEqual) UnmarshalJSON(b []byte) error { +func (v *IngestGHSAIngestGHSA) UnmarshalJSON(b []byte) error { if string(b) == "null" { return nil } var firstPass struct { - *NeighborsNeighborsPkgEqual + *IngestGHSAIngestGHSA graphql.NoUnmarshalJSON } - firstPass.NeighborsNeighborsPkgEqual = v + firstPass.IngestGHSAIngestGHSA = v err := json.Unmarshal(b, &firstPass) if err != nil { @@ -9675,28 +9740,20 @@ func (v *NeighborsNeighborsPkgEqual) UnmarshalJSON(b []byte) error { } err = json.Unmarshal( - b, &v.allPkgEqual) + b, &v.AllGHSATree) if err != nil { return err } return nil } -type __premarshalNeighborsNeighborsPkgEqual struct { - Typename *string `json:"__typename"` - +type __premarshalIngestGHSAIngestGHSA struct { Id string `json:"id"` - Justification string `json:"justification"` - - Packages []allPkgEqualPackagesPackage `json:"packages"` - - Origin string `json:"origin"` - - Collector string `json:"collector"` + GhsaId string `json:"ghsaId"` } -func (v *NeighborsNeighborsPkgEqual) MarshalJSON() ([]byte, error) { +func (v *IngestGHSAIngestGHSA) MarshalJSON() ([]byte, error) { premarshaled, err := v.__premarshalJSON() if err != nil { return nil, err @@ -9704,93 +9761,52 @@ func (v *NeighborsNeighborsPkgEqual) MarshalJSON() ([]byte, error) { return json.Marshal(premarshaled) } -func (v *NeighborsNeighborsPkgEqual) __premarshalJSON() (*__premarshalNeighborsNeighborsPkgEqual, error) { - var retval __premarshalNeighborsNeighborsPkgEqual +func (v *IngestGHSAIngestGHSA) __premarshalJSON() (*__premarshalIngestGHSAIngestGHSA, error) { + var retval __premarshalIngestGHSAIngestGHSA - retval.Typename = v.Typename - retval.Id = v.allPkgEqual.Id - retval.Justification = v.allPkgEqual.Justification - retval.Packages = v.allPkgEqual.Packages - retval.Origin = v.allPkgEqual.Origin - retval.Collector = v.allPkgEqual.Collector + retval.Id = v.AllGHSATree.Id + retval.GhsaId = v.AllGHSATree.GhsaId return &retval, nil } -// NeighborsNeighborsPointOfContact includes the requested fields of the GraphQL type PointOfContact. -// The GraphQL type's documentation follows. -// -// PointOfContact is an attestation of how to get in touch with the person(s) responsible -// for a package, source, or artifact. -// -// All evidence trees record a justification for the property they represent as -// well as the document that contains the attestation (origin) and the collector -// that collected the document (collector). -// -// The attestation applies to a subject which is a package, source, or artifact. -// If the attestation targets a package, it must target a PackageName or a -// PackageVersion. If the attestation targets a source, it must target a -// SourceName. -// -// email is the email address (singular) of the point of contact. -// -// info is additional contact information other than email address. This is free -// form. -// -// NOTE: the identifiers for point of contact should be part of software trees. -// This will benefit from identifier look up and traversal as well as organization -// hierarchy. However, until the use case arises, PointOfContact will be a flat -// reference to the contact details. -type NeighborsNeighborsPointOfContact struct { - Typename *string `json:"__typename"` +// IngestGHSAResponse is returned by IngestGHSA on success. +type IngestGHSAResponse struct { + // Ingests a new GitHub Security Advisory and returns it. + IngestGHSA IngestGHSAIngestGHSA `json:"ingestGHSA"` } -// GetTypename returns NeighborsNeighborsPointOfContact.Typename, and is useful for accessing the field via an interface. -func (v *NeighborsNeighborsPointOfContact) GetTypename() *string { return v.Typename } +// GetIngestGHSA returns IngestGHSAResponse.IngestGHSA, and is useful for accessing the field via an interface. +func (v *IngestGHSAResponse) GetIngestGHSA() IngestGHSAIngestGHSA { return v.IngestGHSA } -// NeighborsNeighborsSource includes the requested fields of the GraphQL type Source. +// IngestGHSAsIngestGHSAsGHSA includes the requested fields of the GraphQL type GHSA. // The GraphQL type's documentation follows. // -// Source represents the root of the source trie/tree. -// -// We map source information to a trie, as a derivative of the pURL specification: -// each path in the trie represents a type, namespace, name and an optional -// qualifier that stands for tag/commit information. +// GHSA represents GitHub security advisories. // -// This node represents the type part of the trie path. It is used to represent -// the version control system that is being used. +// The advisory id field is mandatory and canonicalized to be lowercase. // -// Since this node is at the root of the source trie, it is named Source, not -// SourceType. -type NeighborsNeighborsSource struct { - Typename *string `json:"__typename"` - AllSourceTree `json:"-"` +// This node can be referred to by other parts of GUAC. +type IngestGHSAsIngestGHSAsGHSA struct { + AllGHSATree `json:"-"` } -// GetTypename returns NeighborsNeighborsSource.Typename, and is useful for accessing the field via an interface. -func (v *NeighborsNeighborsSource) GetTypename() *string { return v.Typename } - -// GetId returns NeighborsNeighborsSource.Id, and is useful for accessing the field via an interface. -func (v *NeighborsNeighborsSource) GetId() string { return v.AllSourceTree.Id } - -// GetType returns NeighborsNeighborsSource.Type, and is useful for accessing the field via an interface. -func (v *NeighborsNeighborsSource) GetType() string { return v.AllSourceTree.Type } +// GetId returns IngestGHSAsIngestGHSAsGHSA.Id, and is useful for accessing the field via an interface. +func (v *IngestGHSAsIngestGHSAsGHSA) GetId() string { return v.AllGHSATree.Id } -// GetNamespaces returns NeighborsNeighborsSource.Namespaces, and is useful for accessing the field via an interface. -func (v *NeighborsNeighborsSource) GetNamespaces() []AllSourceTreeNamespacesSourceNamespace { - return v.AllSourceTree.Namespaces -} +// GetGhsaId returns IngestGHSAsIngestGHSAsGHSA.GhsaId, and is useful for accessing the field via an interface. +func (v *IngestGHSAsIngestGHSAsGHSA) GetGhsaId() string { return v.AllGHSATree.GhsaId } -func (v *NeighborsNeighborsSource) UnmarshalJSON(b []byte) error { +func (v *IngestGHSAsIngestGHSAsGHSA) UnmarshalJSON(b []byte) error { if string(b) == "null" { return nil } var firstPass struct { - *NeighborsNeighborsSource + *IngestGHSAsIngestGHSAsGHSA graphql.NoUnmarshalJSON } - firstPass.NeighborsNeighborsSource = v + firstPass.IngestGHSAsIngestGHSAsGHSA = v err := json.Unmarshal(b, &firstPass) if err != nil { @@ -9798,24 +9814,20 @@ func (v *NeighborsNeighborsSource) UnmarshalJSON(b []byte) error { } err = json.Unmarshal( - b, &v.AllSourceTree) + b, &v.AllGHSATree) if err != nil { return err } return nil } -type __premarshalNeighborsNeighborsSource struct { - Typename *string `json:"__typename"` - +type __premarshalIngestGHSAsIngestGHSAsGHSA struct { Id string `json:"id"` - Type string `json:"type"` - - Namespaces []AllSourceTreeNamespacesSourceNamespace `json:"namespaces"` + GhsaId string `json:"ghsaId"` } -func (v *NeighborsNeighborsSource) MarshalJSON() ([]byte, error) { +func (v *IngestGHSAsIngestGHSAsGHSA) MarshalJSON() ([]byte, error) { premarshaled, err := v.__premarshalJSON() if err != nil { return nil, err @@ -9823,74 +9835,76 @@ func (v *NeighborsNeighborsSource) MarshalJSON() ([]byte, error) { return json.Marshal(premarshaled) } -func (v *NeighborsNeighborsSource) __premarshalJSON() (*__premarshalNeighborsNeighborsSource, error) { - var retval __premarshalNeighborsNeighborsSource +func (v *IngestGHSAsIngestGHSAsGHSA) __premarshalJSON() (*__premarshalIngestGHSAsIngestGHSAsGHSA, error) { + var retval __premarshalIngestGHSAsIngestGHSAsGHSA - retval.Typename = v.Typename - retval.Id = v.AllSourceTree.Id - retval.Type = v.AllSourceTree.Type - retval.Namespaces = v.AllSourceTree.Namespaces + retval.Id = v.AllGHSATree.Id + retval.GhsaId = v.AllGHSATree.GhsaId return &retval, nil } -// NeighborsResponse is returned by Neighbors on success. -type NeighborsResponse struct { - // neighbors returns all the direct neighbors of a node. - // - // Similarly, the input is only specified by its ID. - // - // Specifying any Edge value in `usingOnly` will make the neighbors list only - // contain the corresponding GUAC evidence trees (GUAC verbs). - Neighbors []NeighborsNeighborsNode `json:"-"` +// IngestGHSAsResponse is returned by IngestGHSAs on success. +type IngestGHSAsResponse struct { + // Bulk ingests new GHSAs and returns a list of them. + IngestGHSAs []IngestGHSAsIngestGHSAsGHSA `json:"ingestGHSAs"` } -// GetNeighbors returns NeighborsResponse.Neighbors, and is useful for accessing the field via an interface. -func (v *NeighborsResponse) GetNeighbors() []NeighborsNeighborsNode { return v.Neighbors } +// GetIngestGHSAs returns IngestGHSAsResponse.IngestGHSAs, and is useful for accessing the field via an interface. +func (v *IngestGHSAsResponse) GetIngestGHSAs() []IngestGHSAsIngestGHSAsGHSA { return v.IngestGHSAs } -func (v *NeighborsResponse) UnmarshalJSON(b []byte) error { +// IngestOSVIngestOSV includes the requested fields of the GraphQL type OSV. +// The GraphQL type's documentation follows. +// +// OSV represents an Open Source Vulnerability. +// +// The osvId field is mandatory and canonicalized to be lowercase. +// +// This maps to a vulnerability ID specific to the environment (e.g., GHSA ID or +// CVE ID). +// +// This node can be referred to by other parts of GUAC. +type IngestOSVIngestOSV struct { + AllOSVTree `json:"-"` +} + +// GetId returns IngestOSVIngestOSV.Id, and is useful for accessing the field via an interface. +func (v *IngestOSVIngestOSV) GetId() string { return v.AllOSVTree.Id } + +// GetOsvId returns IngestOSVIngestOSV.OsvId, and is useful for accessing the field via an interface. +func (v *IngestOSVIngestOSV) GetOsvId() string { return v.AllOSVTree.OsvId } + +func (v *IngestOSVIngestOSV) UnmarshalJSON(b []byte) error { if string(b) == "null" { return nil } var firstPass struct { - *NeighborsResponse - Neighbors []json.RawMessage `json:"neighbors"` + *IngestOSVIngestOSV graphql.NoUnmarshalJSON } - firstPass.NeighborsResponse = v + firstPass.IngestOSVIngestOSV = v err := json.Unmarshal(b, &firstPass) if err != nil { return err } - { - dst := &v.Neighbors - src := firstPass.Neighbors - *dst = make( - []NeighborsNeighborsNode, - len(src)) - for i, src := range src { - dst := &(*dst)[i] - if len(src) != 0 && string(src) != "null" { - err = __unmarshalNeighborsNeighborsNode( - src, dst) - if err != nil { - return fmt.Errorf( - "unable to unmarshal NeighborsResponse.Neighbors: %w", err) - } - } - } + err = json.Unmarshal( + b, &v.AllOSVTree) + if err != nil { + return err } return nil } -type __premarshalNeighborsResponse struct { - Neighbors []json.RawMessage `json:"neighbors"` +type __premarshalIngestOSVIngestOSV struct { + Id string `json:"id"` + + OsvId string `json:"osvId"` } -func (v *NeighborsResponse) MarshalJSON() ([]byte, error) { +func (v *IngestOSVIngestOSV) MarshalJSON() ([]byte, error) { premarshaled, err := v.__premarshalJSON() if err != nil { return nil, err @@ -9898,499 +9912,143 @@ func (v *NeighborsResponse) MarshalJSON() ([]byte, error) { return json.Marshal(premarshaled) } -func (v *NeighborsResponse) __premarshalJSON() (*__premarshalNeighborsResponse, error) { - var retval __premarshalNeighborsResponse +func (v *IngestOSVIngestOSV) __premarshalJSON() (*__premarshalIngestOSVIngestOSV, error) { + var retval __premarshalIngestOSVIngestOSV - { + retval.Id = v.AllOSVTree.Id + retval.OsvId = v.AllOSVTree.OsvId + return &retval, nil +} - dst := &retval.Neighbors - src := v.Neighbors - *dst = make( - []json.RawMessage, - len(src)) - for i, src := range src { - dst := &(*dst)[i] - var err error - *dst, err = __marshalNeighborsNeighborsNode( - &src) - if err != nil { - return nil, fmt.Errorf( - "unable to marshal NeighborsResponse.Neighbors: %w", err) - } - } - } - return &retval, nil +// IngestOSVResponse is returned by IngestOSV on success. +type IngestOSVResponse struct { + // Ingests a new OSV vulnerability and returns it. + IngestOSV IngestOSVIngestOSV `json:"ingestOSV"` } -// NodeNode includes the requested fields of the GraphQL interface Node. -// -// NodeNode is implemented by the following types: -// NodeNodeArtifact -// NodeNodeBuilder -// NodeNodeCVE -// NodeNodeCertifyBad -// NodeNodeCertifyGood -// NodeNodeCertifyScorecard -// NodeNodeCertifyVEXStatement -// NodeNodeCertifyVuln -// NodeNodeGHSA -// NodeNodeHasMetadata -// NodeNodeHasSBOM -// NodeNodeHasSLSA -// NodeNodeHasSourceAt -// NodeNodeHashEqual -// NodeNodeIsDependency -// NodeNodeIsOccurrence -// NodeNodeIsVulnerability -// NodeNodeNoVuln -// NodeNodeOSV -// NodeNodePackage -// NodeNodePkgEqual -// NodeNodePointOfContact -// NodeNodeSource +// GetIngestOSV returns IngestOSVResponse.IngestOSV, and is useful for accessing the field via an interface. +func (v *IngestOSVResponse) GetIngestOSV() IngestOSVIngestOSV { return v.IngestOSV } + +// IngestOSVsIngestOSVsOSV includes the requested fields of the GraphQL type OSV. // The GraphQL type's documentation follows. // -// Node is a union type of all the possible nodes. +// OSV represents an Open Source Vulnerability. // -// It encapsulates the software tree nodes along with the evidence nodes. In a -// path query, all connecting evidence nodes along with their intermediate subject -// nodes need to be returned in order to create a complete graph. -type NodeNode interface { - implementsGraphQLInterfaceNodeNode() - // GetTypename returns the receiver's concrete GraphQL type-name (see interface doc for possible values). - GetTypename() *string +// The osvId field is mandatory and canonicalized to be lowercase. +// +// This maps to a vulnerability ID specific to the environment (e.g., GHSA ID or +// CVE ID). +// +// This node can be referred to by other parts of GUAC. +type IngestOSVsIngestOSVsOSV struct { + AllOSVTree `json:"-"` } -func (v *NodeNodeArtifact) implementsGraphQLInterfaceNodeNode() {} -func (v *NodeNodeBuilder) implementsGraphQLInterfaceNodeNode() {} -func (v *NodeNodeCVE) implementsGraphQLInterfaceNodeNode() {} -func (v *NodeNodeCertifyBad) implementsGraphQLInterfaceNodeNode() {} -func (v *NodeNodeCertifyGood) implementsGraphQLInterfaceNodeNode() {} -func (v *NodeNodeCertifyScorecard) implementsGraphQLInterfaceNodeNode() {} -func (v *NodeNodeCertifyVEXStatement) implementsGraphQLInterfaceNodeNode() {} -func (v *NodeNodeCertifyVuln) implementsGraphQLInterfaceNodeNode() {} -func (v *NodeNodeGHSA) implementsGraphQLInterfaceNodeNode() {} -func (v *NodeNodeHasMetadata) implementsGraphQLInterfaceNodeNode() {} -func (v *NodeNodeHasSBOM) implementsGraphQLInterfaceNodeNode() {} -func (v *NodeNodeHasSLSA) implementsGraphQLInterfaceNodeNode() {} -func (v *NodeNodeHasSourceAt) implementsGraphQLInterfaceNodeNode() {} -func (v *NodeNodeHashEqual) implementsGraphQLInterfaceNodeNode() {} -func (v *NodeNodeIsDependency) implementsGraphQLInterfaceNodeNode() {} -func (v *NodeNodeIsOccurrence) implementsGraphQLInterfaceNodeNode() {} -func (v *NodeNodeIsVulnerability) implementsGraphQLInterfaceNodeNode() {} -func (v *NodeNodeNoVuln) implementsGraphQLInterfaceNodeNode() {} -func (v *NodeNodeOSV) implementsGraphQLInterfaceNodeNode() {} -func (v *NodeNodePackage) implementsGraphQLInterfaceNodeNode() {} -func (v *NodeNodePkgEqual) implementsGraphQLInterfaceNodeNode() {} -func (v *NodeNodePointOfContact) implementsGraphQLInterfaceNodeNode() {} -func (v *NodeNodeSource) implementsGraphQLInterfaceNodeNode() {} +// GetId returns IngestOSVsIngestOSVsOSV.Id, and is useful for accessing the field via an interface. +func (v *IngestOSVsIngestOSVsOSV) GetId() string { return v.AllOSVTree.Id } -func __unmarshalNodeNode(b []byte, v *NodeNode) error { - if string(b) == "null" { - return nil - } +// GetOsvId returns IngestOSVsIngestOSVsOSV.OsvId, and is useful for accessing the field via an interface. +func (v *IngestOSVsIngestOSVsOSV) GetOsvId() string { return v.AllOSVTree.OsvId } - var tn struct { - TypeName string `json:"__typename"` - } - err := json.Unmarshal(b, &tn) - if err != nil { - return err - } +func (v *IngestOSVsIngestOSVsOSV) UnmarshalJSON(b []byte) error { - switch tn.TypeName { - case "Artifact": - *v = new(NodeNodeArtifact) - return json.Unmarshal(b, *v) - case "Builder": - *v = new(NodeNodeBuilder) - return json.Unmarshal(b, *v) - case "CVE": - *v = new(NodeNodeCVE) - return json.Unmarshal(b, *v) - case "CertifyBad": - *v = new(NodeNodeCertifyBad) - return json.Unmarshal(b, *v) - case "CertifyGood": - *v = new(NodeNodeCertifyGood) - return json.Unmarshal(b, *v) - case "CertifyScorecard": - *v = new(NodeNodeCertifyScorecard) - return json.Unmarshal(b, *v) - case "CertifyVEXStatement": - *v = new(NodeNodeCertifyVEXStatement) - return json.Unmarshal(b, *v) - case "CertifyVuln": - *v = new(NodeNodeCertifyVuln) - return json.Unmarshal(b, *v) - case "GHSA": - *v = new(NodeNodeGHSA) - return json.Unmarshal(b, *v) - case "HasMetadata": - *v = new(NodeNodeHasMetadata) - return json.Unmarshal(b, *v) - case "HasSBOM": - *v = new(NodeNodeHasSBOM) - return json.Unmarshal(b, *v) - case "HasSLSA": - *v = new(NodeNodeHasSLSA) - return json.Unmarshal(b, *v) - case "HasSourceAt": - *v = new(NodeNodeHasSourceAt) - return json.Unmarshal(b, *v) - case "HashEqual": - *v = new(NodeNodeHashEqual) - return json.Unmarshal(b, *v) - case "IsDependency": - *v = new(NodeNodeIsDependency) - return json.Unmarshal(b, *v) - case "IsOccurrence": - *v = new(NodeNodeIsOccurrence) - return json.Unmarshal(b, *v) - case "IsVulnerability": - *v = new(NodeNodeIsVulnerability) - return json.Unmarshal(b, *v) - case "NoVuln": - *v = new(NodeNodeNoVuln) - return json.Unmarshal(b, *v) - case "OSV": - *v = new(NodeNodeOSV) - return json.Unmarshal(b, *v) - case "Package": - *v = new(NodeNodePackage) - return json.Unmarshal(b, *v) - case "PkgEqual": - *v = new(NodeNodePkgEqual) - return json.Unmarshal(b, *v) - case "PointOfContact": - *v = new(NodeNodePointOfContact) - return json.Unmarshal(b, *v) - case "Source": - *v = new(NodeNodeSource) - return json.Unmarshal(b, *v) - case "": - return fmt.Errorf( - "response was missing Node.__typename") - default: - return fmt.Errorf( - `unexpected concrete type for NodeNode: "%v"`, tn.TypeName) + if string(b) == "null" { + return nil } -} - -func __marshalNodeNode(v *NodeNode) ([]byte, error) { - - var typename string - switch v := (*v).(type) { - case *NodeNodeArtifact: - typename = "Artifact" - - premarshaled, err := v.__premarshalJSON() - if err != nil { - return nil, err - } - result := struct { - TypeName string `json:"__typename"` - *__premarshalNodeNodeArtifact - }{typename, premarshaled} - return json.Marshal(result) - case *NodeNodeBuilder: - typename = "Builder" - - premarshaled, err := v.__premarshalJSON() - if err != nil { - return nil, err - } - result := struct { - TypeName string `json:"__typename"` - *__premarshalNodeNodeBuilder - }{typename, premarshaled} - return json.Marshal(result) - case *NodeNodeCVE: - typename = "CVE" - - premarshaled, err := v.__premarshalJSON() - if err != nil { - return nil, err - } - result := struct { - TypeName string `json:"__typename"` - *__premarshalNodeNodeCVE - }{typename, premarshaled} - return json.Marshal(result) - case *NodeNodeCertifyBad: - typename = "CertifyBad" - - premarshaled, err := v.__premarshalJSON() - if err != nil { - return nil, err - } - result := struct { - TypeName string `json:"__typename"` - *__premarshalNodeNodeCertifyBad - }{typename, premarshaled} - return json.Marshal(result) - case *NodeNodeCertifyGood: - typename = "CertifyGood" - - premarshaled, err := v.__premarshalJSON() - if err != nil { - return nil, err - } - result := struct { - TypeName string `json:"__typename"` - *__premarshalNodeNodeCertifyGood - }{typename, premarshaled} - return json.Marshal(result) - case *NodeNodeCertifyScorecard: - typename = "CertifyScorecard" - - premarshaled, err := v.__premarshalJSON() - if err != nil { - return nil, err - } - result := struct { - TypeName string `json:"__typename"` - *__premarshalNodeNodeCertifyScorecard - }{typename, premarshaled} - return json.Marshal(result) - case *NodeNodeCertifyVEXStatement: - typename = "CertifyVEXStatement" - - premarshaled, err := v.__premarshalJSON() - if err != nil { - return nil, err - } - result := struct { - TypeName string `json:"__typename"` - *__premarshalNodeNodeCertifyVEXStatement - }{typename, premarshaled} - return json.Marshal(result) - case *NodeNodeCertifyVuln: - typename = "CertifyVuln" - premarshaled, err := v.__premarshalJSON() - if err != nil { - return nil, err - } - result := struct { - TypeName string `json:"__typename"` - *__premarshalNodeNodeCertifyVuln - }{typename, premarshaled} - return json.Marshal(result) - case *NodeNodeGHSA: - typename = "GHSA" - - premarshaled, err := v.__premarshalJSON() - if err != nil { - return nil, err - } - result := struct { - TypeName string `json:"__typename"` - *__premarshalNodeNodeGHSA - }{typename, premarshaled} - return json.Marshal(result) - case *NodeNodeHasMetadata: - typename = "HasMetadata" - - result := struct { - TypeName string `json:"__typename"` - *NodeNodeHasMetadata - }{typename, v} - return json.Marshal(result) - case *NodeNodeHasSBOM: - typename = "HasSBOM" - - premarshaled, err := v.__premarshalJSON() - if err != nil { - return nil, err - } - result := struct { - TypeName string `json:"__typename"` - *__premarshalNodeNodeHasSBOM - }{typename, premarshaled} - return json.Marshal(result) - case *NodeNodeHasSLSA: - typename = "HasSLSA" - - premarshaled, err := v.__premarshalJSON() - if err != nil { - return nil, err - } - result := struct { - TypeName string `json:"__typename"` - *__premarshalNodeNodeHasSLSA - }{typename, premarshaled} - return json.Marshal(result) - case *NodeNodeHasSourceAt: - typename = "HasSourceAt" - - premarshaled, err := v.__premarshalJSON() - if err != nil { - return nil, err - } - result := struct { - TypeName string `json:"__typename"` - *__premarshalNodeNodeHasSourceAt - }{typename, premarshaled} - return json.Marshal(result) - case *NodeNodeHashEqual: - typename = "HashEqual" - - premarshaled, err := v.__premarshalJSON() - if err != nil { - return nil, err - } - result := struct { - TypeName string `json:"__typename"` - *__premarshalNodeNodeHashEqual - }{typename, premarshaled} - return json.Marshal(result) - case *NodeNodeIsDependency: - typename = "IsDependency" - - premarshaled, err := v.__premarshalJSON() - if err != nil { - return nil, err - } - result := struct { - TypeName string `json:"__typename"` - *__premarshalNodeNodeIsDependency - }{typename, premarshaled} - return json.Marshal(result) - case *NodeNodeIsOccurrence: - typename = "IsOccurrence" - - premarshaled, err := v.__premarshalJSON() - if err != nil { - return nil, err - } - result := struct { - TypeName string `json:"__typename"` - *__premarshalNodeNodeIsOccurrence - }{typename, premarshaled} - return json.Marshal(result) - case *NodeNodeIsVulnerability: - typename = "IsVulnerability" - - premarshaled, err := v.__premarshalJSON() - if err != nil { - return nil, err - } - result := struct { - TypeName string `json:"__typename"` - *__premarshalNodeNodeIsVulnerability - }{typename, premarshaled} - return json.Marshal(result) - case *NodeNodeNoVuln: - typename = "NoVuln" - - result := struct { - TypeName string `json:"__typename"` - *NodeNodeNoVuln - }{typename, v} - return json.Marshal(result) - case *NodeNodeOSV: - typename = "OSV" + var firstPass struct { + *IngestOSVsIngestOSVsOSV + graphql.NoUnmarshalJSON + } + firstPass.IngestOSVsIngestOSVsOSV = v - premarshaled, err := v.__premarshalJSON() - if err != nil { - return nil, err - } - result := struct { - TypeName string `json:"__typename"` - *__premarshalNodeNodeOSV - }{typename, premarshaled} - return json.Marshal(result) - case *NodeNodePackage: - typename = "Package" + err := json.Unmarshal(b, &firstPass) + if err != nil { + return err + } - premarshaled, err := v.__premarshalJSON() - if err != nil { - return nil, err - } - result := struct { - TypeName string `json:"__typename"` - *__premarshalNodeNodePackage - }{typename, premarshaled} - return json.Marshal(result) - case *NodeNodePkgEqual: - typename = "PkgEqual" + err = json.Unmarshal( + b, &v.AllOSVTree) + if err != nil { + return err + } + return nil +} - premarshaled, err := v.__premarshalJSON() - if err != nil { - return nil, err - } - result := struct { - TypeName string `json:"__typename"` - *__premarshalNodeNodePkgEqual - }{typename, premarshaled} - return json.Marshal(result) - case *NodeNodePointOfContact: - typename = "PointOfContact" +type __premarshalIngestOSVsIngestOSVsOSV struct { + Id string `json:"id"` - result := struct { - TypeName string `json:"__typename"` - *NodeNodePointOfContact - }{typename, v} - return json.Marshal(result) - case *NodeNodeSource: - typename = "Source" + OsvId string `json:"osvId"` +} - premarshaled, err := v.__premarshalJSON() - if err != nil { - return nil, err - } - result := struct { - TypeName string `json:"__typename"` - *__premarshalNodeNodeSource - }{typename, premarshaled} - return json.Marshal(result) - case nil: - return []byte("null"), nil - default: - return nil, fmt.Errorf( - `unexpected concrete type for NodeNode: "%T"`, v) +func (v *IngestOSVsIngestOSVsOSV) MarshalJSON() ([]byte, error) { + premarshaled, err := v.__premarshalJSON() + if err != nil { + return nil, err } + return json.Marshal(premarshaled) } -// NodeNodeArtifact includes the requested fields of the GraphQL type Artifact. +func (v *IngestOSVsIngestOSVsOSV) __premarshalJSON() (*__premarshalIngestOSVsIngestOSVsOSV, error) { + var retval __premarshalIngestOSVsIngestOSVsOSV + + retval.Id = v.AllOSVTree.Id + retval.OsvId = v.AllOSVTree.OsvId + return &retval, nil +} + +// IngestOSVsResponse is returned by IngestOSVs on success. +type IngestOSVsResponse struct { + // Bulk ingests new OSVs and returns a list of them. + IngestOSVs []IngestOSVsIngestOSVsOSV `json:"ingestOSVs"` +} + +// GetIngestOSVs returns IngestOSVsResponse.IngestOSVs, and is useful for accessing the field via an interface. +func (v *IngestOSVsResponse) GetIngestOSVs() []IngestOSVsIngestOSVsOSV { return v.IngestOSVs } + +// IngestPackageIngestPackage includes the requested fields of the GraphQL type Package. // The GraphQL type's documentation follows. // -// Artifact represents an artifact identified by a checksum hash. +// Package represents the root of the package trie/tree. // -// The checksum is split into the digest value and the algorithm used to generate -// it. Both fields are mandatory and canonicalized to be lowercase. +// We map package information to a trie, closely matching the pURL specification +// (https://github.com/package-url/purl-spec/blob/0dd92f26f8bb11956ffdf5e8acfcee71e8560407/README.rst), +// but deviating from it where GUAC heuristics allow for better representation of +// package information. Each path in the trie fully represents a package; we split +// the trie based on the pURL components. // -// If having a checksum Go object, algorithm can be -// strings.ToLower(string(checksum.Algorithm)) and digest can be checksum.Value. -type NodeNodeArtifact struct { - Typename *string `json:"__typename"` - AllArtifactTree `json:"-"` +// This node matches a pkg: partial pURL. The type field matches the +// pURL types but we might also use "guac" for the cases where the pURL +// representation is not complete or when we have custom rules. +// +// Since this node is at the root of the package trie, it is named Package, not +// PackageType. +type IngestPackageIngestPackage struct { + AllPkgTree `json:"-"` } -// GetTypename returns NodeNodeArtifact.Typename, and is useful for accessing the field via an interface. -func (v *NodeNodeArtifact) GetTypename() *string { return v.Typename } - -// GetId returns NodeNodeArtifact.Id, and is useful for accessing the field via an interface. -func (v *NodeNodeArtifact) GetId() string { return v.AllArtifactTree.Id } +// GetId returns IngestPackageIngestPackage.Id, and is useful for accessing the field via an interface. +func (v *IngestPackageIngestPackage) GetId() string { return v.AllPkgTree.Id } -// GetAlgorithm returns NodeNodeArtifact.Algorithm, and is useful for accessing the field via an interface. -func (v *NodeNodeArtifact) GetAlgorithm() string { return v.AllArtifactTree.Algorithm } +// GetType returns IngestPackageIngestPackage.Type, and is useful for accessing the field via an interface. +func (v *IngestPackageIngestPackage) GetType() string { return v.AllPkgTree.Type } -// GetDigest returns NodeNodeArtifact.Digest, and is useful for accessing the field via an interface. -func (v *NodeNodeArtifact) GetDigest() string { return v.AllArtifactTree.Digest } +// GetNamespaces returns IngestPackageIngestPackage.Namespaces, and is useful for accessing the field via an interface. +func (v *IngestPackageIngestPackage) GetNamespaces() []AllPkgTreeNamespacesPackageNamespace { + return v.AllPkgTree.Namespaces +} -func (v *NodeNodeArtifact) UnmarshalJSON(b []byte) error { +func (v *IngestPackageIngestPackage) UnmarshalJSON(b []byte) error { if string(b) == "null" { return nil } var firstPass struct { - *NodeNodeArtifact + *IngestPackageIngestPackage graphql.NoUnmarshalJSON } - firstPass.NodeNodeArtifact = v + firstPass.IngestPackageIngestPackage = v err := json.Unmarshal(b, &firstPass) if err != nil { @@ -10398,24 +10056,22 @@ func (v *NodeNodeArtifact) UnmarshalJSON(b []byte) error { } err = json.Unmarshal( - b, &v.AllArtifactTree) + b, &v.AllPkgTree) if err != nil { return err } return nil } -type __premarshalNodeNodeArtifact struct { - Typename *string `json:"__typename"` - +type __premarshalIngestPackageIngestPackage struct { Id string `json:"id"` - Algorithm string `json:"algorithm"` + Type string `json:"type"` - Digest string `json:"digest"` + Namespaces []AllPkgTreeNamespacesPackageNamespace `json:"namespaces"` } -func (v *NodeNodeArtifact) MarshalJSON() ([]byte, error) { +func (v *IngestPackageIngestPackage) MarshalJSON() ([]byte, error) { premarshaled, err := v.__premarshalJSON() if err != nil { return nil, err @@ -10423,47 +10079,67 @@ func (v *NodeNodeArtifact) MarshalJSON() ([]byte, error) { return json.Marshal(premarshaled) } -func (v *NodeNodeArtifact) __premarshalJSON() (*__premarshalNodeNodeArtifact, error) { - var retval __premarshalNodeNodeArtifact +func (v *IngestPackageIngestPackage) __premarshalJSON() (*__premarshalIngestPackageIngestPackage, error) { + var retval __premarshalIngestPackageIngestPackage - retval.Typename = v.Typename - retval.Id = v.AllArtifactTree.Id - retval.Algorithm = v.AllArtifactTree.Algorithm - retval.Digest = v.AllArtifactTree.Digest + retval.Id = v.AllPkgTree.Id + retval.Type = v.AllPkgTree.Type + retval.Namespaces = v.AllPkgTree.Namespaces return &retval, nil } -// NodeNodeBuilder includes the requested fields of the GraphQL type Builder. +// IngestPackageResponse is returned by IngestPackage on success. +type IngestPackageResponse struct { + // Ingests a new package and returns the corresponding package trie path. + IngestPackage IngestPackageIngestPackage `json:"ingestPackage"` +} + +// GetIngestPackage returns IngestPackageResponse.IngestPackage, and is useful for accessing the field via an interface. +func (v *IngestPackageResponse) GetIngestPackage() IngestPackageIngestPackage { return v.IngestPackage } + +// IngestPackagesIngestPackagesPackage includes the requested fields of the GraphQL type Package. // The GraphQL type's documentation follows. // -// Builder represents the builder (e.g., FRSCA or GitHub Actions). +// Package represents the root of the package trie/tree. // -// Currently builders are identified by the uri field. -type NodeNodeBuilder struct { - Typename *string `json:"__typename"` - allBuilderTree `json:"-"` +// We map package information to a trie, closely matching the pURL specification +// (https://github.com/package-url/purl-spec/blob/0dd92f26f8bb11956ffdf5e8acfcee71e8560407/README.rst), +// but deviating from it where GUAC heuristics allow for better representation of +// package information. Each path in the trie fully represents a package; we split +// the trie based on the pURL components. +// +// This node matches a pkg: partial pURL. The type field matches the +// pURL types but we might also use "guac" for the cases where the pURL +// representation is not complete or when we have custom rules. +// +// Since this node is at the root of the package trie, it is named Package, not +// PackageType. +type IngestPackagesIngestPackagesPackage struct { + AllPkgTree `json:"-"` } -// GetTypename returns NodeNodeBuilder.Typename, and is useful for accessing the field via an interface. -func (v *NodeNodeBuilder) GetTypename() *string { return v.Typename } +// GetId returns IngestPackagesIngestPackagesPackage.Id, and is useful for accessing the field via an interface. +func (v *IngestPackagesIngestPackagesPackage) GetId() string { return v.AllPkgTree.Id } -// GetId returns NodeNodeBuilder.Id, and is useful for accessing the field via an interface. -func (v *NodeNodeBuilder) GetId() string { return v.allBuilderTree.Id } +// GetType returns IngestPackagesIngestPackagesPackage.Type, and is useful for accessing the field via an interface. +func (v *IngestPackagesIngestPackagesPackage) GetType() string { return v.AllPkgTree.Type } -// GetUri returns NodeNodeBuilder.Uri, and is useful for accessing the field via an interface. -func (v *NodeNodeBuilder) GetUri() string { return v.allBuilderTree.Uri } +// GetNamespaces returns IngestPackagesIngestPackagesPackage.Namespaces, and is useful for accessing the field via an interface. +func (v *IngestPackagesIngestPackagesPackage) GetNamespaces() []AllPkgTreeNamespacesPackageNamespace { + return v.AllPkgTree.Namespaces +} -func (v *NodeNodeBuilder) UnmarshalJSON(b []byte) error { +func (v *IngestPackagesIngestPackagesPackage) UnmarshalJSON(b []byte) error { if string(b) == "null" { return nil } var firstPass struct { - *NodeNodeBuilder + *IngestPackagesIngestPackagesPackage graphql.NoUnmarshalJSON } - firstPass.NodeNodeBuilder = v + firstPass.IngestPackagesIngestPackagesPackage = v err := json.Unmarshal(b, &firstPass) if err != nil { @@ -10471,22 +10147,22 @@ func (v *NodeNodeBuilder) UnmarshalJSON(b []byte) error { } err = json.Unmarshal( - b, &v.allBuilderTree) + b, &v.AllPkgTree) if err != nil { return err } return nil } -type __premarshalNodeNodeBuilder struct { - Typename *string `json:"__typename"` - +type __premarshalIngestPackagesIngestPackagesPackage struct { Id string `json:"id"` - Uri string `json:"uri"` + Type string `json:"type"` + + Namespaces []AllPkgTreeNamespacesPackageNamespace `json:"namespaces"` } -func (v *NodeNodeBuilder) MarshalJSON() ([]byte, error) { +func (v *IngestPackagesIngestPackagesPackage) MarshalJSON() ([]byte, error) { premarshaled, err := v.__premarshalJSON() if err != nil { return nil, err @@ -10494,56 +10170,66 @@ func (v *NodeNodeBuilder) MarshalJSON() ([]byte, error) { return json.Marshal(premarshaled) } -func (v *NodeNodeBuilder) __premarshalJSON() (*__premarshalNodeNodeBuilder, error) { - var retval __premarshalNodeNodeBuilder +func (v *IngestPackagesIngestPackagesPackage) __premarshalJSON() (*__premarshalIngestPackagesIngestPackagesPackage, error) { + var retval __premarshalIngestPackagesIngestPackagesPackage - retval.Typename = v.Typename - retval.Id = v.allBuilderTree.Id - retval.Uri = v.allBuilderTree.Uri + retval.Id = v.AllPkgTree.Id + retval.Type = v.AllPkgTree.Type + retval.Namespaces = v.AllPkgTree.Namespaces return &retval, nil } -// NodeNodeCVE includes the requested fields of the GraphQL type CVE. +// IngestPackagesResponse is returned by IngestPackages on success. +type IngestPackagesResponse struct { + // Bulk ingests packages and returns the list of corresponding package trie path. + IngestPackages []IngestPackagesIngestPackagesPackage `json:"ingestPackages"` +} + +// GetIngestPackages returns IngestPackagesResponse.IngestPackages, and is useful for accessing the field via an interface. +func (v *IngestPackagesResponse) GetIngestPackages() []IngestPackagesIngestPackagesPackage { + return v.IngestPackages +} + +// IngestSourceIngestSource includes the requested fields of the GraphQL type Source. // The GraphQL type's documentation follows. // -// CVE represents a vulnerability in the Common Vulnerabilities and Exposures -// schema. -// -// The vulnerability identifier contains a year field, so we are extracting that -// to allow matching for vulnerabilities found in a given year. +// Source represents the root of the source trie/tree. // -// The vulnerability identifier field is mandatory and canonicalized to be -// lowercase. +// We map source information to a trie, as a derivative of the pURL specification: +// each path in the trie represents a type, namespace, name and an optional +// qualifier that stands for tag/commit information. // -// This node can be referred to by other parts of GUAC. -type NodeNodeCVE struct { - Typename *string `json:"__typename"` - AllCveTree `json:"-"` +// This node represents the type part of the trie path. It is used to represent +// the version control system that is being used. +// +// Since this node is at the root of the source trie, it is named Source, not +// SourceType. +type IngestSourceIngestSource struct { + AllSourceTree `json:"-"` } -// GetTypename returns NodeNodeCVE.Typename, and is useful for accessing the field via an interface. -func (v *NodeNodeCVE) GetTypename() *string { return v.Typename } - -// GetId returns NodeNodeCVE.Id, and is useful for accessing the field via an interface. -func (v *NodeNodeCVE) GetId() string { return v.AllCveTree.Id } +// GetId returns IngestSourceIngestSource.Id, and is useful for accessing the field via an interface. +func (v *IngestSourceIngestSource) GetId() string { return v.AllSourceTree.Id } -// GetYear returns NodeNodeCVE.Year, and is useful for accessing the field via an interface. -func (v *NodeNodeCVE) GetYear() int { return v.AllCveTree.Year } +// GetType returns IngestSourceIngestSource.Type, and is useful for accessing the field via an interface. +func (v *IngestSourceIngestSource) GetType() string { return v.AllSourceTree.Type } -// GetCveId returns NodeNodeCVE.CveId, and is useful for accessing the field via an interface. -func (v *NodeNodeCVE) GetCveId() string { return v.AllCveTree.CveId } +// GetNamespaces returns IngestSourceIngestSource.Namespaces, and is useful for accessing the field via an interface. +func (v *IngestSourceIngestSource) GetNamespaces() []AllSourceTreeNamespacesSourceNamespace { + return v.AllSourceTree.Namespaces +} -func (v *NodeNodeCVE) UnmarshalJSON(b []byte) error { +func (v *IngestSourceIngestSource) UnmarshalJSON(b []byte) error { if string(b) == "null" { return nil } var firstPass struct { - *NodeNodeCVE + *IngestSourceIngestSource graphql.NoUnmarshalJSON } - firstPass.NodeNodeCVE = v + firstPass.IngestSourceIngestSource = v err := json.Unmarshal(b, &firstPass) if err != nil { @@ -10551,24 +10237,22 @@ func (v *NodeNodeCVE) UnmarshalJSON(b []byte) error { } err = json.Unmarshal( - b, &v.AllCveTree) + b, &v.AllSourceTree) if err != nil { return err } return nil } -type __premarshalNodeNodeCVE struct { - Typename *string `json:"__typename"` - +type __premarshalIngestSourceIngestSource struct { Id string `json:"id"` - Year int `json:"year"` + Type string `json:"type"` - CveId string `json:"cveId"` + Namespaces []AllSourceTreeNamespacesSourceNamespace `json:"namespaces"` } -func (v *NodeNodeCVE) MarshalJSON() ([]byte, error) { +func (v *IngestSourceIngestSource) MarshalJSON() ([]byte, error) { premarshaled, err := v.__premarshalJSON() if err != nil { return nil, err @@ -10576,66 +10260,64 @@ func (v *NodeNodeCVE) MarshalJSON() ([]byte, error) { return json.Marshal(premarshaled) } -func (v *NodeNodeCVE) __premarshalJSON() (*__premarshalNodeNodeCVE, error) { - var retval __premarshalNodeNodeCVE +func (v *IngestSourceIngestSource) __premarshalJSON() (*__premarshalIngestSourceIngestSource, error) { + var retval __premarshalIngestSourceIngestSource - retval.Typename = v.Typename - retval.Id = v.AllCveTree.Id - retval.Year = v.AllCveTree.Year - retval.CveId = v.AllCveTree.CveId + retval.Id = v.AllSourceTree.Id + retval.Type = v.AllSourceTree.Type + retval.Namespaces = v.AllSourceTree.Namespaces return &retval, nil } -// NodeNodeCertifyBad includes the requested fields of the GraphQL type CertifyBad. +// IngestSourceResponse is returned by IngestSource on success. +type IngestSourceResponse struct { + // Ingests a new source and returns the corresponding source trie path. + IngestSource IngestSourceIngestSource `json:"ingestSource"` +} + +// GetIngestSource returns IngestSourceResponse.IngestSource, and is useful for accessing the field via an interface. +func (v *IngestSourceResponse) GetIngestSource() IngestSourceIngestSource { return v.IngestSource } + +// IngestSourcesIngestSourcesSource includes the requested fields of the GraphQL type Source. // The GraphQL type's documentation follows. // -// CertifyBad is an attestation that a package, source, or artifact is considered -// bad. +// Source represents the root of the source trie/tree. // -// All evidence trees record a justification for the property they represent as -// well as the document that contains the attestation (origin) and the collector -// that collected the document (collector). +// We map source information to a trie, as a derivative of the pURL specification: +// each path in the trie represents a type, namespace, name and an optional +// qualifier that stands for tag/commit information. // -// The certification applies to a subject which is a package, source, or artifact. -// If the attestation targets a package, it must target a PackageName or a -// PackageVersion. If the attestation targets a source, it must target a -// SourceName. -type NodeNodeCertifyBad struct { - Typename *string `json:"__typename"` - AllCertifyBad `json:"-"` +// This node represents the type part of the trie path. It is used to represent +// the version control system that is being used. +// +// Since this node is at the root of the source trie, it is named Source, not +// SourceType. +type IngestSourcesIngestSourcesSource struct { + AllSourceTree `json:"-"` } -// GetTypename returns NodeNodeCertifyBad.Typename, and is useful for accessing the field via an interface. -func (v *NodeNodeCertifyBad) GetTypename() *string { return v.Typename } - -// GetId returns NodeNodeCertifyBad.Id, and is useful for accessing the field via an interface. -func (v *NodeNodeCertifyBad) GetId() string { return v.AllCertifyBad.Id } +// GetId returns IngestSourcesIngestSourcesSource.Id, and is useful for accessing the field via an interface. +func (v *IngestSourcesIngestSourcesSource) GetId() string { return v.AllSourceTree.Id } -// GetJustification returns NodeNodeCertifyBad.Justification, and is useful for accessing the field via an interface. -func (v *NodeNodeCertifyBad) GetJustification() string { return v.AllCertifyBad.Justification } +// GetType returns IngestSourcesIngestSourcesSource.Type, and is useful for accessing the field via an interface. +func (v *IngestSourcesIngestSourcesSource) GetType() string { return v.AllSourceTree.Type } -// GetSubject returns NodeNodeCertifyBad.Subject, and is useful for accessing the field via an interface. -func (v *NodeNodeCertifyBad) GetSubject() AllCertifyBadSubjectPackageSourceOrArtifact { - return v.AllCertifyBad.Subject +// GetNamespaces returns IngestSourcesIngestSourcesSource.Namespaces, and is useful for accessing the field via an interface. +func (v *IngestSourcesIngestSourcesSource) GetNamespaces() []AllSourceTreeNamespacesSourceNamespace { + return v.AllSourceTree.Namespaces } -// GetOrigin returns NodeNodeCertifyBad.Origin, and is useful for accessing the field via an interface. -func (v *NodeNodeCertifyBad) GetOrigin() string { return v.AllCertifyBad.Origin } - -// GetCollector returns NodeNodeCertifyBad.Collector, and is useful for accessing the field via an interface. -func (v *NodeNodeCertifyBad) GetCollector() string { return v.AllCertifyBad.Collector } - -func (v *NodeNodeCertifyBad) UnmarshalJSON(b []byte) error { +func (v *IngestSourcesIngestSourcesSource) UnmarshalJSON(b []byte) error { if string(b) == "null" { return nil } var firstPass struct { - *NodeNodeCertifyBad + *IngestSourcesIngestSourcesSource graphql.NoUnmarshalJSON } - firstPass.NodeNodeCertifyBad = v + firstPass.IngestSourcesIngestSourcesSource = v err := json.Unmarshal(b, &firstPass) if err != nil { @@ -10643,28 +10325,22 @@ func (v *NodeNodeCertifyBad) UnmarshalJSON(b []byte) error { } err = json.Unmarshal( - b, &v.AllCertifyBad) + b, &v.AllSourceTree) if err != nil { return err } return nil } -type __premarshalNodeNodeCertifyBad struct { - Typename *string `json:"__typename"` - +type __premarshalIngestSourcesIngestSourcesSource struct { Id string `json:"id"` - Justification string `json:"justification"` - - Subject json.RawMessage `json:"subject"` - - Origin string `json:"origin"` + Type string `json:"type"` - Collector string `json:"collector"` + Namespaces []AllSourceTreeNamespacesSourceNamespace `json:"namespaces"` } -func (v *NodeNodeCertifyBad) MarshalJSON() ([]byte, error) { +func (v *IngestSourcesIngestSourcesSource) MarshalJSON() ([]byte, error) { premarshaled, err := v.__premarshalJSON() if err != nil { return nil, err @@ -10672,79 +10348,85 @@ func (v *NodeNodeCertifyBad) MarshalJSON() ([]byte, error) { return json.Marshal(premarshaled) } -func (v *NodeNodeCertifyBad) __premarshalJSON() (*__premarshalNodeNodeCertifyBad, error) { - var retval __premarshalNodeNodeCertifyBad - - retval.Typename = v.Typename - retval.Id = v.AllCertifyBad.Id - retval.Justification = v.AllCertifyBad.Justification - { +func (v *IngestSourcesIngestSourcesSource) __premarshalJSON() (*__premarshalIngestSourcesIngestSourcesSource, error) { + var retval __premarshalIngestSourcesIngestSourcesSource - dst := &retval.Subject - src := v.AllCertifyBad.Subject - var err error - *dst, err = __marshalAllCertifyBadSubjectPackageSourceOrArtifact( - &src) - if err != nil { - return nil, fmt.Errorf( - "unable to marshal NodeNodeCertifyBad.AllCertifyBad.Subject: %w", err) - } - } - retval.Origin = v.AllCertifyBad.Origin - retval.Collector = v.AllCertifyBad.Collector + retval.Id = v.AllSourceTree.Id + retval.Type = v.AllSourceTree.Type + retval.Namespaces = v.AllSourceTree.Namespaces return &retval, nil } -// NodeNodeCertifyGood includes the requested fields of the GraphQL type CertifyGood. +// IngestSourcesResponse is returned by IngestSources on success. +type IngestSourcesResponse struct { + // Bulk ingests sources and returns the list of corresponding source trie path. + IngestSources []IngestSourcesIngestSourcesSource `json:"ingestSources"` +} + +// GetIngestSources returns IngestSourcesResponse.IngestSources, and is useful for accessing the field via an interface. +func (v *IngestSourcesResponse) GetIngestSources() []IngestSourcesIngestSourcesSource { + return v.IngestSources +} + +// IsDependenciesIngestDependenciesIsDependency includes the requested fields of the GraphQL type IsDependency. // The GraphQL type's documentation follows. // -// CertifyGood is an attestation that a package, source, or artifact is considered -// good. -// -// All evidence trees record a justification for the property they represent as -// well as the document that contains the attestation (origin) and the collector -// that collected the document (collector). -// -// The certification applies to a subject which is a package, source, or artifact. -// If the attestation targets a package, it must target a PackageName or a -// PackageVersion. If the attestation targets a source, it must target a -// SourceName. -type NodeNodeCertifyGood struct { - Typename *string `json:"__typename"` - allCertifyGood `json:"-"` +// IsDependency is an attestation to record that a package depends on another. +type IsDependenciesIngestDependenciesIsDependency struct { + AllIsDependencyTree `json:"-"` } -// GetTypename returns NodeNodeCertifyGood.Typename, and is useful for accessing the field via an interface. -func (v *NodeNodeCertifyGood) GetTypename() *string { return v.Typename } +// GetId returns IsDependenciesIngestDependenciesIsDependency.Id, and is useful for accessing the field via an interface. +func (v *IsDependenciesIngestDependenciesIsDependency) GetId() string { + return v.AllIsDependencyTree.Id +} -// GetId returns NodeNodeCertifyGood.Id, and is useful for accessing the field via an interface. -func (v *NodeNodeCertifyGood) GetId() string { return v.allCertifyGood.Id } +// GetJustification returns IsDependenciesIngestDependenciesIsDependency.Justification, and is useful for accessing the field via an interface. +func (v *IsDependenciesIngestDependenciesIsDependency) GetJustification() string { + return v.AllIsDependencyTree.Justification +} -// GetJustification returns NodeNodeCertifyGood.Justification, and is useful for accessing the field via an interface. -func (v *NodeNodeCertifyGood) GetJustification() string { return v.allCertifyGood.Justification } +// GetPackage returns IsDependenciesIngestDependenciesIsDependency.Package, and is useful for accessing the field via an interface. +func (v *IsDependenciesIngestDependenciesIsDependency) GetPackage() AllIsDependencyTreePackage { + return v.AllIsDependencyTree.Package +} -// GetSubject returns NodeNodeCertifyGood.Subject, and is useful for accessing the field via an interface. -func (v *NodeNodeCertifyGood) GetSubject() allCertifyGoodSubjectPackageSourceOrArtifact { - return v.allCertifyGood.Subject +// GetDependentPackage returns IsDependenciesIngestDependenciesIsDependency.DependentPackage, and is useful for accessing the field via an interface. +func (v *IsDependenciesIngestDependenciesIsDependency) GetDependentPackage() AllIsDependencyTreeDependentPackage { + return v.AllIsDependencyTree.DependentPackage } -// GetOrigin returns NodeNodeCertifyGood.Origin, and is useful for accessing the field via an interface. -func (v *NodeNodeCertifyGood) GetOrigin() string { return v.allCertifyGood.Origin } +// GetDependencyType returns IsDependenciesIngestDependenciesIsDependency.DependencyType, and is useful for accessing the field via an interface. +func (v *IsDependenciesIngestDependenciesIsDependency) GetDependencyType() DependencyType { + return v.AllIsDependencyTree.DependencyType +} -// GetCollector returns NodeNodeCertifyGood.Collector, and is useful for accessing the field via an interface. -func (v *NodeNodeCertifyGood) GetCollector() string { return v.allCertifyGood.Collector } +// GetVersionRange returns IsDependenciesIngestDependenciesIsDependency.VersionRange, and is useful for accessing the field via an interface. +func (v *IsDependenciesIngestDependenciesIsDependency) GetVersionRange() string { + return v.AllIsDependencyTree.VersionRange +} -func (v *NodeNodeCertifyGood) UnmarshalJSON(b []byte) error { +// GetOrigin returns IsDependenciesIngestDependenciesIsDependency.Origin, and is useful for accessing the field via an interface. +func (v *IsDependenciesIngestDependenciesIsDependency) GetOrigin() string { + return v.AllIsDependencyTree.Origin +} + +// GetCollector returns IsDependenciesIngestDependenciesIsDependency.Collector, and is useful for accessing the field via an interface. +func (v *IsDependenciesIngestDependenciesIsDependency) GetCollector() string { + return v.AllIsDependencyTree.Collector +} + +func (v *IsDependenciesIngestDependenciesIsDependency) UnmarshalJSON(b []byte) error { if string(b) == "null" { return nil } var firstPass struct { - *NodeNodeCertifyGood + *IsDependenciesIngestDependenciesIsDependency graphql.NoUnmarshalJSON } - firstPass.NodeNodeCertifyGood = v + firstPass.IsDependenciesIngestDependenciesIsDependency = v err := json.Unmarshal(b, &firstPass) if err != nil { @@ -10752,28 +10434,32 @@ func (v *NodeNodeCertifyGood) UnmarshalJSON(b []byte) error { } err = json.Unmarshal( - b, &v.allCertifyGood) + b, &v.AllIsDependencyTree) if err != nil { return err } return nil } -type __premarshalNodeNodeCertifyGood struct { - Typename *string `json:"__typename"` - +type __premarshalIsDependenciesIngestDependenciesIsDependency struct { Id string `json:"id"` Justification string `json:"justification"` - Subject json.RawMessage `json:"subject"` + Package AllIsDependencyTreePackage `json:"package"` + + DependentPackage AllIsDependencyTreeDependentPackage `json:"dependentPackage"` + + DependencyType DependencyType `json:"dependencyType"` + + VersionRange string `json:"versionRange"` Origin string `json:"origin"` Collector string `json:"collector"` } -func (v *NodeNodeCertifyGood) MarshalJSON() ([]byte, error) { +func (v *IsDependenciesIngestDependenciesIsDependency) MarshalJSON() ([]byte, error) { premarshaled, err := v.__premarshalJSON() if err != nil { return nil, err @@ -10781,66 +10467,88 @@ func (v *NodeNodeCertifyGood) MarshalJSON() ([]byte, error) { return json.Marshal(premarshaled) } -func (v *NodeNodeCertifyGood) __premarshalJSON() (*__premarshalNodeNodeCertifyGood, error) { - var retval __premarshalNodeNodeCertifyGood +func (v *IsDependenciesIngestDependenciesIsDependency) __premarshalJSON() (*__premarshalIsDependenciesIngestDependenciesIsDependency, error) { + var retval __premarshalIsDependenciesIngestDependenciesIsDependency + + retval.Id = v.AllIsDependencyTree.Id + retval.Justification = v.AllIsDependencyTree.Justification + retval.Package = v.AllIsDependencyTree.Package + retval.DependentPackage = v.AllIsDependencyTree.DependentPackage + retval.DependencyType = v.AllIsDependencyTree.DependencyType + retval.VersionRange = v.AllIsDependencyTree.VersionRange + retval.Origin = v.AllIsDependencyTree.Origin + retval.Collector = v.AllIsDependencyTree.Collector + return &retval, nil +} + +// IsDependenciesResponse is returned by IsDependencies on success. +type IsDependenciesResponse struct { + // Bulk adds a dependency between two packages + IngestDependencies []IsDependenciesIngestDependenciesIsDependency `json:"ingestDependencies"` +} + +// GetIngestDependencies returns IsDependenciesResponse.IngestDependencies, and is useful for accessing the field via an interface. +func (v *IsDependenciesResponse) GetIngestDependencies() []IsDependenciesIngestDependenciesIsDependency { + return v.IngestDependencies +} + +// IsDependencyIngestDependencyIsDependency includes the requested fields of the GraphQL type IsDependency. +// The GraphQL type's documentation follows. +// +// IsDependency is an attestation to record that a package depends on another. +type IsDependencyIngestDependencyIsDependency struct { + AllIsDependencyTree `json:"-"` +} + +// GetId returns IsDependencyIngestDependencyIsDependency.Id, and is useful for accessing the field via an interface. +func (v *IsDependencyIngestDependencyIsDependency) GetId() string { return v.AllIsDependencyTree.Id } - retval.Typename = v.Typename - retval.Id = v.allCertifyGood.Id - retval.Justification = v.allCertifyGood.Justification - { +// GetJustification returns IsDependencyIngestDependencyIsDependency.Justification, and is useful for accessing the field via an interface. +func (v *IsDependencyIngestDependencyIsDependency) GetJustification() string { + return v.AllIsDependencyTree.Justification +} - dst := &retval.Subject - src := v.allCertifyGood.Subject - var err error - *dst, err = __marshalallCertifyGoodSubjectPackageSourceOrArtifact( - &src) - if err != nil { - return nil, fmt.Errorf( - "unable to marshal NodeNodeCertifyGood.allCertifyGood.Subject: %w", err) - } - } - retval.Origin = v.allCertifyGood.Origin - retval.Collector = v.allCertifyGood.Collector - return &retval, nil +// GetPackage returns IsDependencyIngestDependencyIsDependency.Package, and is useful for accessing the field via an interface. +func (v *IsDependencyIngestDependencyIsDependency) GetPackage() AllIsDependencyTreePackage { + return v.AllIsDependencyTree.Package } -// NodeNodeCertifyScorecard includes the requested fields of the GraphQL type CertifyScorecard. -// The GraphQL type's documentation follows. -// -// CertifyScorecard is an attestation to attach a Scorecard analysis to a -// particular source repository. -type NodeNodeCertifyScorecard struct { - Typename *string `json:"__typename"` - AllCertifyScorecard `json:"-"` +// GetDependentPackage returns IsDependencyIngestDependencyIsDependency.DependentPackage, and is useful for accessing the field via an interface. +func (v *IsDependencyIngestDependencyIsDependency) GetDependentPackage() AllIsDependencyTreeDependentPackage { + return v.AllIsDependencyTree.DependentPackage } -// GetTypename returns NodeNodeCertifyScorecard.Typename, and is useful for accessing the field via an interface. -func (v *NodeNodeCertifyScorecard) GetTypename() *string { return v.Typename } +// GetDependencyType returns IsDependencyIngestDependencyIsDependency.DependencyType, and is useful for accessing the field via an interface. +func (v *IsDependencyIngestDependencyIsDependency) GetDependencyType() DependencyType { + return v.AllIsDependencyTree.DependencyType +} -// GetId returns NodeNodeCertifyScorecard.Id, and is useful for accessing the field via an interface. -func (v *NodeNodeCertifyScorecard) GetId() string { return v.AllCertifyScorecard.Id } +// GetVersionRange returns IsDependencyIngestDependencyIsDependency.VersionRange, and is useful for accessing the field via an interface. +func (v *IsDependencyIngestDependencyIsDependency) GetVersionRange() string { + return v.AllIsDependencyTree.VersionRange +} -// GetSource returns NodeNodeCertifyScorecard.Source, and is useful for accessing the field via an interface. -func (v *NodeNodeCertifyScorecard) GetSource() AllCertifyScorecardSource { - return v.AllCertifyScorecard.Source +// GetOrigin returns IsDependencyIngestDependencyIsDependency.Origin, and is useful for accessing the field via an interface. +func (v *IsDependencyIngestDependencyIsDependency) GetOrigin() string { + return v.AllIsDependencyTree.Origin } -// GetScorecard returns NodeNodeCertifyScorecard.Scorecard, and is useful for accessing the field via an interface. -func (v *NodeNodeCertifyScorecard) GetScorecard() AllCertifyScorecardScorecard { - return v.AllCertifyScorecard.Scorecard +// GetCollector returns IsDependencyIngestDependencyIsDependency.Collector, and is useful for accessing the field via an interface. +func (v *IsDependencyIngestDependencyIsDependency) GetCollector() string { + return v.AllIsDependencyTree.Collector } -func (v *NodeNodeCertifyScorecard) UnmarshalJSON(b []byte) error { +func (v *IsDependencyIngestDependencyIsDependency) UnmarshalJSON(b []byte) error { if string(b) == "null" { return nil } var firstPass struct { - *NodeNodeCertifyScorecard + *IsDependencyIngestDependencyIsDependency graphql.NoUnmarshalJSON } - firstPass.NodeNodeCertifyScorecard = v + firstPass.IsDependencyIngestDependencyIsDependency = v err := json.Unmarshal(b, &firstPass) if err != nil { @@ -10848,24 +10556,32 @@ func (v *NodeNodeCertifyScorecard) UnmarshalJSON(b []byte) error { } err = json.Unmarshal( - b, &v.AllCertifyScorecard) + b, &v.AllIsDependencyTree) if err != nil { return err } return nil } -type __premarshalNodeNodeCertifyScorecard struct { - Typename *string `json:"__typename"` - +type __premarshalIsDependencyIngestDependencyIsDependency struct { Id string `json:"id"` - Source AllCertifyScorecardSource `json:"source"` + Justification string `json:"justification"` - Scorecard AllCertifyScorecardScorecard `json:"scorecard"` + Package AllIsDependencyTreePackage `json:"package"` + + DependentPackage AllIsDependencyTreeDependentPackage `json:"dependentPackage"` + + DependencyType DependencyType `json:"dependencyType"` + + VersionRange string `json:"versionRange"` + + Origin string `json:"origin"` + + Collector string `json:"collector"` } -func (v *NodeNodeCertifyScorecard) MarshalJSON() ([]byte, error) { +func (v *IsDependencyIngestDependencyIsDependency) MarshalJSON() ([]byte, error) { premarshaled, err := v.__premarshalJSON() if err != nil { return nil, err @@ -10873,84 +10589,122 @@ func (v *NodeNodeCertifyScorecard) MarshalJSON() ([]byte, error) { return json.Marshal(premarshaled) } -func (v *NodeNodeCertifyScorecard) __premarshalJSON() (*__premarshalNodeNodeCertifyScorecard, error) { - var retval __premarshalNodeNodeCertifyScorecard +func (v *IsDependencyIngestDependencyIsDependency) __premarshalJSON() (*__premarshalIsDependencyIngestDependencyIsDependency, error) { + var retval __premarshalIsDependencyIngestDependencyIsDependency - retval.Typename = v.Typename - retval.Id = v.AllCertifyScorecard.Id - retval.Source = v.AllCertifyScorecard.Source - retval.Scorecard = v.AllCertifyScorecard.Scorecard + retval.Id = v.AllIsDependencyTree.Id + retval.Justification = v.AllIsDependencyTree.Justification + retval.Package = v.AllIsDependencyTree.Package + retval.DependentPackage = v.AllIsDependencyTree.DependentPackage + retval.DependencyType = v.AllIsDependencyTree.DependencyType + retval.VersionRange = v.AllIsDependencyTree.VersionRange + retval.Origin = v.AllIsDependencyTree.Origin + retval.Collector = v.AllIsDependencyTree.Collector return &retval, nil } -// NodeNodeCertifyVEXStatement includes the requested fields of the GraphQL type CertifyVEXStatement. -// The GraphQL type's documentation follows. -// -// CertifyVEXStatement is an attestation to attach VEX statements to a package or -// artifact to clarify the impact of a specific vulnerability (CVE, GHSA or OSV). -type NodeNodeCertifyVEXStatement struct { - Typename *string `json:"__typename"` - allCertifyVEXStatement `json:"-"` +// IsDependencyInputSpec is the input to record a new dependency. +type IsDependencyInputSpec struct { + VersionRange string `json:"versionRange"` + DependencyType DependencyType `json:"dependencyType"` + Justification string `json:"justification"` + Origin string `json:"origin"` + Collector string `json:"collector"` } -// GetTypename returns NodeNodeCertifyVEXStatement.Typename, and is useful for accessing the field via an interface. -func (v *NodeNodeCertifyVEXStatement) GetTypename() *string { return v.Typename } +// GetVersionRange returns IsDependencyInputSpec.VersionRange, and is useful for accessing the field via an interface. +func (v *IsDependencyInputSpec) GetVersionRange() string { return v.VersionRange } -// GetId returns NodeNodeCertifyVEXStatement.Id, and is useful for accessing the field via an interface. -func (v *NodeNodeCertifyVEXStatement) GetId() string { return v.allCertifyVEXStatement.Id } +// GetDependencyType returns IsDependencyInputSpec.DependencyType, and is useful for accessing the field via an interface. +func (v *IsDependencyInputSpec) GetDependencyType() DependencyType { return v.DependencyType } -// GetSubject returns NodeNodeCertifyVEXStatement.Subject, and is useful for accessing the field via an interface. -func (v *NodeNodeCertifyVEXStatement) GetSubject() allCertifyVEXStatementSubjectPackageOrArtifact { - return v.allCertifyVEXStatement.Subject +// GetJustification returns IsDependencyInputSpec.Justification, and is useful for accessing the field via an interface. +func (v *IsDependencyInputSpec) GetJustification() string { return v.Justification } + +// GetOrigin returns IsDependencyInputSpec.Origin, and is useful for accessing the field via an interface. +func (v *IsDependencyInputSpec) GetOrigin() string { return v.Origin } + +// GetCollector returns IsDependencyInputSpec.Collector, and is useful for accessing the field via an interface. +func (v *IsDependencyInputSpec) GetCollector() string { return v.Collector } + +// IsDependencyResponse is returned by IsDependency on success. +type IsDependencyResponse struct { + // Adds a dependency between two packages + IngestDependency IsDependencyIngestDependencyIsDependency `json:"ingestDependency"` } -// GetVulnerability returns NodeNodeCertifyVEXStatement.Vulnerability, and is useful for accessing the field via an interface. -func (v *NodeNodeCertifyVEXStatement) GetVulnerability() allCertifyVEXStatementVulnerability { - return v.allCertifyVEXStatement.Vulnerability +// GetIngestDependency returns IsDependencyResponse.IngestDependency, and is useful for accessing the field via an interface. +func (v *IsDependencyResponse) GetIngestDependency() IsDependencyIngestDependencyIsDependency { + return v.IngestDependency } -// GetStatus returns NodeNodeCertifyVEXStatement.Status, and is useful for accessing the field via an interface. -func (v *NodeNodeCertifyVEXStatement) GetStatus() VexStatus { return v.allCertifyVEXStatement.Status } +// IsOccurrenceInputSpec represents the input to record an artifact's origin. +type IsOccurrenceInputSpec struct { + Justification string `json:"justification"` + Origin string `json:"origin"` + Collector string `json:"collector"` +} -// GetVexJustification returns NodeNodeCertifyVEXStatement.VexJustification, and is useful for accessing the field via an interface. -func (v *NodeNodeCertifyVEXStatement) GetVexJustification() VexJustification { - return v.allCertifyVEXStatement.VexJustification +// GetJustification returns IsOccurrenceInputSpec.Justification, and is useful for accessing the field via an interface. +func (v *IsOccurrenceInputSpec) GetJustification() string { return v.Justification } + +// GetOrigin returns IsOccurrenceInputSpec.Origin, and is useful for accessing the field via an interface. +func (v *IsOccurrenceInputSpec) GetOrigin() string { return v.Origin } + +// GetCollector returns IsOccurrenceInputSpec.Collector, and is useful for accessing the field via an interface. +func (v *IsOccurrenceInputSpec) GetCollector() string { return v.Collector } + +// IsOccurrencePkgIngestOccurrenceIsOccurrence includes the requested fields of the GraphQL type IsOccurrence. +// The GraphQL type's documentation follows. +// +// IsOccurrence is an attestation to link an artifact to a package or source. +// +// Attestation must occur at the PackageVersion or at the SourceName. +type IsOccurrencePkgIngestOccurrenceIsOccurrence struct { + AllIsOccurrencesTree `json:"-"` } -// GetStatement returns NodeNodeCertifyVEXStatement.Statement, and is useful for accessing the field via an interface. -func (v *NodeNodeCertifyVEXStatement) GetStatement() string { - return v.allCertifyVEXStatement.Statement +// GetId returns IsOccurrencePkgIngestOccurrenceIsOccurrence.Id, and is useful for accessing the field via an interface. +func (v *IsOccurrencePkgIngestOccurrenceIsOccurrence) GetId() string { + return v.AllIsOccurrencesTree.Id } -// GetStatusNotes returns NodeNodeCertifyVEXStatement.StatusNotes, and is useful for accessing the field via an interface. -func (v *NodeNodeCertifyVEXStatement) GetStatusNotes() string { - return v.allCertifyVEXStatement.StatusNotes +// GetSubject returns IsOccurrencePkgIngestOccurrenceIsOccurrence.Subject, and is useful for accessing the field via an interface. +func (v *IsOccurrencePkgIngestOccurrenceIsOccurrence) GetSubject() AllIsOccurrencesTreeSubjectPackageOrSource { + return v.AllIsOccurrencesTree.Subject } -// GetKnownSince returns NodeNodeCertifyVEXStatement.KnownSince, and is useful for accessing the field via an interface. -func (v *NodeNodeCertifyVEXStatement) GetKnownSince() time.Time { - return v.allCertifyVEXStatement.KnownSince +// GetArtifact returns IsOccurrencePkgIngestOccurrenceIsOccurrence.Artifact, and is useful for accessing the field via an interface. +func (v *IsOccurrencePkgIngestOccurrenceIsOccurrence) GetArtifact() AllIsOccurrencesTreeArtifact { + return v.AllIsOccurrencesTree.Artifact } -// GetOrigin returns NodeNodeCertifyVEXStatement.Origin, and is useful for accessing the field via an interface. -func (v *NodeNodeCertifyVEXStatement) GetOrigin() string { return v.allCertifyVEXStatement.Origin } +// GetJustification returns IsOccurrencePkgIngestOccurrenceIsOccurrence.Justification, and is useful for accessing the field via an interface. +func (v *IsOccurrencePkgIngestOccurrenceIsOccurrence) GetJustification() string { + return v.AllIsOccurrencesTree.Justification +} -// GetCollector returns NodeNodeCertifyVEXStatement.Collector, and is useful for accessing the field via an interface. -func (v *NodeNodeCertifyVEXStatement) GetCollector() string { - return v.allCertifyVEXStatement.Collector +// GetOrigin returns IsOccurrencePkgIngestOccurrenceIsOccurrence.Origin, and is useful for accessing the field via an interface. +func (v *IsOccurrencePkgIngestOccurrenceIsOccurrence) GetOrigin() string { + return v.AllIsOccurrencesTree.Origin } -func (v *NodeNodeCertifyVEXStatement) UnmarshalJSON(b []byte) error { +// GetCollector returns IsOccurrencePkgIngestOccurrenceIsOccurrence.Collector, and is useful for accessing the field via an interface. +func (v *IsOccurrencePkgIngestOccurrenceIsOccurrence) GetCollector() string { + return v.AllIsOccurrencesTree.Collector +} + +func (v *IsOccurrencePkgIngestOccurrenceIsOccurrence) UnmarshalJSON(b []byte) error { if string(b) == "null" { return nil } var firstPass struct { - *NodeNodeCertifyVEXStatement + *IsOccurrencePkgIngestOccurrenceIsOccurrence graphql.NoUnmarshalJSON } - firstPass.NodeNodeCertifyVEXStatement = v + firstPass.IsOccurrencePkgIngestOccurrenceIsOccurrence = v err := json.Unmarshal(b, &firstPass) if err != nil { @@ -10958,38 +10712,28 @@ func (v *NodeNodeCertifyVEXStatement) UnmarshalJSON(b []byte) error { } err = json.Unmarshal( - b, &v.allCertifyVEXStatement) + b, &v.AllIsOccurrencesTree) if err != nil { return err } return nil } -type __premarshalNodeNodeCertifyVEXStatement struct { - Typename *string `json:"__typename"` - +type __premarshalIsOccurrencePkgIngestOccurrenceIsOccurrence struct { Id string `json:"id"` Subject json.RawMessage `json:"subject"` - Vulnerability json.RawMessage `json:"vulnerability"` - - Status VexStatus `json:"status"` - - VexJustification VexJustification `json:"vexJustification"` - - Statement string `json:"statement"` - - StatusNotes string `json:"statusNotes"` + Artifact AllIsOccurrencesTreeArtifact `json:"artifact"` - KnownSince time.Time `json:"knownSince"` + Justification string `json:"justification"` Origin string `json:"origin"` Collector string `json:"collector"` } -func (v *NodeNodeCertifyVEXStatement) MarshalJSON() ([]byte, error) { +func (v *IsOccurrencePkgIngestOccurrenceIsOccurrence) MarshalJSON() ([]byte, error) { premarshaled, err := v.__premarshalJSON() if err != nil { return nil, err @@ -10997,87 +10741,91 @@ func (v *NodeNodeCertifyVEXStatement) MarshalJSON() ([]byte, error) { return json.Marshal(premarshaled) } -func (v *NodeNodeCertifyVEXStatement) __premarshalJSON() (*__premarshalNodeNodeCertifyVEXStatement, error) { - var retval __premarshalNodeNodeCertifyVEXStatement +func (v *IsOccurrencePkgIngestOccurrenceIsOccurrence) __premarshalJSON() (*__premarshalIsOccurrencePkgIngestOccurrenceIsOccurrence, error) { + var retval __premarshalIsOccurrencePkgIngestOccurrenceIsOccurrence - retval.Typename = v.Typename - retval.Id = v.allCertifyVEXStatement.Id + retval.Id = v.AllIsOccurrencesTree.Id { dst := &retval.Subject - src := v.allCertifyVEXStatement.Subject - var err error - *dst, err = __marshalallCertifyVEXStatementSubjectPackageOrArtifact( - &src) - if err != nil { - return nil, fmt.Errorf( - "unable to marshal NodeNodeCertifyVEXStatement.allCertifyVEXStatement.Subject: %w", err) - } - } - { - - dst := &retval.Vulnerability - src := v.allCertifyVEXStatement.Vulnerability + src := v.AllIsOccurrencesTree.Subject var err error - *dst, err = __marshalallCertifyVEXStatementVulnerability( + *dst, err = __marshalAllIsOccurrencesTreeSubjectPackageOrSource( &src) if err != nil { return nil, fmt.Errorf( - "unable to marshal NodeNodeCertifyVEXStatement.allCertifyVEXStatement.Vulnerability: %w", err) + "unable to marshal IsOccurrencePkgIngestOccurrenceIsOccurrence.AllIsOccurrencesTree.Subject: %w", err) } } - retval.Status = v.allCertifyVEXStatement.Status - retval.VexJustification = v.allCertifyVEXStatement.VexJustification - retval.Statement = v.allCertifyVEXStatement.Statement - retval.StatusNotes = v.allCertifyVEXStatement.StatusNotes - retval.KnownSince = v.allCertifyVEXStatement.KnownSince - retval.Origin = v.allCertifyVEXStatement.Origin - retval.Collector = v.allCertifyVEXStatement.Collector + retval.Artifact = v.AllIsOccurrencesTree.Artifact + retval.Justification = v.AllIsOccurrencesTree.Justification + retval.Origin = v.AllIsOccurrencesTree.Origin + retval.Collector = v.AllIsOccurrencesTree.Collector return &retval, nil } -// NodeNodeCertifyVuln includes the requested fields of the GraphQL type CertifyVuln. +// IsOccurrencePkgResponse is returned by IsOccurrencePkg on success. +type IsOccurrencePkgResponse struct { + // Ingest that an artifact is produced from a package or source. + IngestOccurrence IsOccurrencePkgIngestOccurrenceIsOccurrence `json:"ingestOccurrence"` +} + +// GetIngestOccurrence returns IsOccurrencePkgResponse.IngestOccurrence, and is useful for accessing the field via an interface. +func (v *IsOccurrencePkgResponse) GetIngestOccurrence() IsOccurrencePkgIngestOccurrenceIsOccurrence { + return v.IngestOccurrence +} + +// IsOccurrenceSrcIngestOccurrenceIsOccurrence includes the requested fields of the GraphQL type IsOccurrence. // The GraphQL type's documentation follows. // -// CertifyVuln is an attestation to attach vulnerability information to a package. +// IsOccurrence is an attestation to link an artifact to a package or source. // -// This information is obtained via a scanner. If there is no vulnerability -// detected (no OSV, CVE, or GHSA), we attach the special NoVuln node. -type NodeNodeCertifyVuln struct { - Typename *string `json:"__typename"` - AllCertifyVuln `json:"-"` +// Attestation must occur at the PackageVersion or at the SourceName. +type IsOccurrenceSrcIngestOccurrenceIsOccurrence struct { + AllIsOccurrencesTree `json:"-"` +} + +// GetId returns IsOccurrenceSrcIngestOccurrenceIsOccurrence.Id, and is useful for accessing the field via an interface. +func (v *IsOccurrenceSrcIngestOccurrenceIsOccurrence) GetId() string { + return v.AllIsOccurrencesTree.Id +} + +// GetSubject returns IsOccurrenceSrcIngestOccurrenceIsOccurrence.Subject, and is useful for accessing the field via an interface. +func (v *IsOccurrenceSrcIngestOccurrenceIsOccurrence) GetSubject() AllIsOccurrencesTreeSubjectPackageOrSource { + return v.AllIsOccurrencesTree.Subject } -// GetTypename returns NodeNodeCertifyVuln.Typename, and is useful for accessing the field via an interface. -func (v *NodeNodeCertifyVuln) GetTypename() *string { return v.Typename } - -// GetId returns NodeNodeCertifyVuln.Id, and is useful for accessing the field via an interface. -func (v *NodeNodeCertifyVuln) GetId() string { return v.AllCertifyVuln.Id } +// GetArtifact returns IsOccurrenceSrcIngestOccurrenceIsOccurrence.Artifact, and is useful for accessing the field via an interface. +func (v *IsOccurrenceSrcIngestOccurrenceIsOccurrence) GetArtifact() AllIsOccurrencesTreeArtifact { + return v.AllIsOccurrencesTree.Artifact +} -// GetPackage returns NodeNodeCertifyVuln.Package, and is useful for accessing the field via an interface. -func (v *NodeNodeCertifyVuln) GetPackage() AllCertifyVulnPackage { return v.AllCertifyVuln.Package } +// GetJustification returns IsOccurrenceSrcIngestOccurrenceIsOccurrence.Justification, and is useful for accessing the field via an interface. +func (v *IsOccurrenceSrcIngestOccurrenceIsOccurrence) GetJustification() string { + return v.AllIsOccurrencesTree.Justification +} -// GetVulnerability returns NodeNodeCertifyVuln.Vulnerability, and is useful for accessing the field via an interface. -func (v *NodeNodeCertifyVuln) GetVulnerability() AllCertifyVulnVulnerability { - return v.AllCertifyVuln.Vulnerability +// GetOrigin returns IsOccurrenceSrcIngestOccurrenceIsOccurrence.Origin, and is useful for accessing the field via an interface. +func (v *IsOccurrenceSrcIngestOccurrenceIsOccurrence) GetOrigin() string { + return v.AllIsOccurrencesTree.Origin } -// GetMetadata returns NodeNodeCertifyVuln.Metadata, and is useful for accessing the field via an interface. -func (v *NodeNodeCertifyVuln) GetMetadata() AllCertifyVulnMetadataVulnerabilityMetaData { - return v.AllCertifyVuln.Metadata +// GetCollector returns IsOccurrenceSrcIngestOccurrenceIsOccurrence.Collector, and is useful for accessing the field via an interface. +func (v *IsOccurrenceSrcIngestOccurrenceIsOccurrence) GetCollector() string { + return v.AllIsOccurrencesTree.Collector } -func (v *NodeNodeCertifyVuln) UnmarshalJSON(b []byte) error { +func (v *IsOccurrenceSrcIngestOccurrenceIsOccurrence) UnmarshalJSON(b []byte) error { if string(b) == "null" { return nil } var firstPass struct { - *NodeNodeCertifyVuln + *IsOccurrenceSrcIngestOccurrenceIsOccurrence graphql.NoUnmarshalJSON } - firstPass.NodeNodeCertifyVuln = v + firstPass.IsOccurrenceSrcIngestOccurrenceIsOccurrence = v err := json.Unmarshal(b, &firstPass) if err != nil { @@ -11085,26 +10833,28 @@ func (v *NodeNodeCertifyVuln) UnmarshalJSON(b []byte) error { } err = json.Unmarshal( - b, &v.AllCertifyVuln) + b, &v.AllIsOccurrencesTree) if err != nil { return err } return nil } -type __premarshalNodeNodeCertifyVuln struct { - Typename *string `json:"__typename"` - +type __premarshalIsOccurrenceSrcIngestOccurrenceIsOccurrence struct { Id string `json:"id"` - Package AllCertifyVulnPackage `json:"package"` + Subject json.RawMessage `json:"subject"` - Vulnerability json.RawMessage `json:"vulnerability"` + Artifact AllIsOccurrencesTreeArtifact `json:"artifact"` - Metadata AllCertifyVulnMetadataVulnerabilityMetaData `json:"metadata"` + Justification string `json:"justification"` + + Origin string `json:"origin"` + + Collector string `json:"collector"` } -func (v *NodeNodeCertifyVuln) MarshalJSON() ([]byte, error) { +func (v *IsOccurrenceSrcIngestOccurrenceIsOccurrence) MarshalJSON() ([]byte, error) { premarshaled, err := v.__premarshalJSON() if err != nil { return nil, err @@ -11112,61 +10862,91 @@ func (v *NodeNodeCertifyVuln) MarshalJSON() ([]byte, error) { return json.Marshal(premarshaled) } -func (v *NodeNodeCertifyVuln) __premarshalJSON() (*__premarshalNodeNodeCertifyVuln, error) { - var retval __premarshalNodeNodeCertifyVuln +func (v *IsOccurrenceSrcIngestOccurrenceIsOccurrence) __premarshalJSON() (*__premarshalIsOccurrenceSrcIngestOccurrenceIsOccurrence, error) { + var retval __premarshalIsOccurrenceSrcIngestOccurrenceIsOccurrence - retval.Typename = v.Typename - retval.Id = v.AllCertifyVuln.Id - retval.Package = v.AllCertifyVuln.Package + retval.Id = v.AllIsOccurrencesTree.Id { - dst := &retval.Vulnerability - src := v.AllCertifyVuln.Vulnerability + dst := &retval.Subject + src := v.AllIsOccurrencesTree.Subject var err error - *dst, err = __marshalAllCertifyVulnVulnerability( + *dst, err = __marshalAllIsOccurrencesTreeSubjectPackageOrSource( &src) if err != nil { return nil, fmt.Errorf( - "unable to marshal NodeNodeCertifyVuln.AllCertifyVuln.Vulnerability: %w", err) + "unable to marshal IsOccurrenceSrcIngestOccurrenceIsOccurrence.AllIsOccurrencesTree.Subject: %w", err) } } - retval.Metadata = v.AllCertifyVuln.Metadata + retval.Artifact = v.AllIsOccurrencesTree.Artifact + retval.Justification = v.AllIsOccurrencesTree.Justification + retval.Origin = v.AllIsOccurrencesTree.Origin + retval.Collector = v.AllIsOccurrencesTree.Collector return &retval, nil } -// NodeNodeGHSA includes the requested fields of the GraphQL type GHSA. +// IsOccurrenceSrcResponse is returned by IsOccurrenceSrc on success. +type IsOccurrenceSrcResponse struct { + // Ingest that an artifact is produced from a package or source. + IngestOccurrence IsOccurrenceSrcIngestOccurrenceIsOccurrence `json:"ingestOccurrence"` +} + +// GetIngestOccurrence returns IsOccurrenceSrcResponse.IngestOccurrence, and is useful for accessing the field via an interface. +func (v *IsOccurrenceSrcResponse) GetIngestOccurrence() IsOccurrenceSrcIngestOccurrenceIsOccurrence { + return v.IngestOccurrence +} + +// IsOccurrencesPkgIngestOccurrencesIsOccurrence includes the requested fields of the GraphQL type IsOccurrence. // The GraphQL type's documentation follows. // -// GHSA represents GitHub security advisories. -// -// The advisory id field is mandatory and canonicalized to be lowercase. +// IsOccurrence is an attestation to link an artifact to a package or source. // -// This node can be referred to by other parts of GUAC. -type NodeNodeGHSA struct { - Typename *string `json:"__typename"` - AllGHSATree `json:"-"` +// Attestation must occur at the PackageVersion or at the SourceName. +type IsOccurrencesPkgIngestOccurrencesIsOccurrence struct { + AllIsOccurrencesTree `json:"-"` } -// GetTypename returns NodeNodeGHSA.Typename, and is useful for accessing the field via an interface. -func (v *NodeNodeGHSA) GetTypename() *string { return v.Typename } +// GetId returns IsOccurrencesPkgIngestOccurrencesIsOccurrence.Id, and is useful for accessing the field via an interface. +func (v *IsOccurrencesPkgIngestOccurrencesIsOccurrence) GetId() string { + return v.AllIsOccurrencesTree.Id +} -// GetId returns NodeNodeGHSA.Id, and is useful for accessing the field via an interface. -func (v *NodeNodeGHSA) GetId() string { return v.AllGHSATree.Id } +// GetSubject returns IsOccurrencesPkgIngestOccurrencesIsOccurrence.Subject, and is useful for accessing the field via an interface. +func (v *IsOccurrencesPkgIngestOccurrencesIsOccurrence) GetSubject() AllIsOccurrencesTreeSubjectPackageOrSource { + return v.AllIsOccurrencesTree.Subject +} -// GetGhsaId returns NodeNodeGHSA.GhsaId, and is useful for accessing the field via an interface. -func (v *NodeNodeGHSA) GetGhsaId() string { return v.AllGHSATree.GhsaId } +// GetArtifact returns IsOccurrencesPkgIngestOccurrencesIsOccurrence.Artifact, and is useful for accessing the field via an interface. +func (v *IsOccurrencesPkgIngestOccurrencesIsOccurrence) GetArtifact() AllIsOccurrencesTreeArtifact { + return v.AllIsOccurrencesTree.Artifact +} -func (v *NodeNodeGHSA) UnmarshalJSON(b []byte) error { +// GetJustification returns IsOccurrencesPkgIngestOccurrencesIsOccurrence.Justification, and is useful for accessing the field via an interface. +func (v *IsOccurrencesPkgIngestOccurrencesIsOccurrence) GetJustification() string { + return v.AllIsOccurrencesTree.Justification +} + +// GetOrigin returns IsOccurrencesPkgIngestOccurrencesIsOccurrence.Origin, and is useful for accessing the field via an interface. +func (v *IsOccurrencesPkgIngestOccurrencesIsOccurrence) GetOrigin() string { + return v.AllIsOccurrencesTree.Origin +} + +// GetCollector returns IsOccurrencesPkgIngestOccurrencesIsOccurrence.Collector, and is useful for accessing the field via an interface. +func (v *IsOccurrencesPkgIngestOccurrencesIsOccurrence) GetCollector() string { + return v.AllIsOccurrencesTree.Collector +} + +func (v *IsOccurrencesPkgIngestOccurrencesIsOccurrence) UnmarshalJSON(b []byte) error { if string(b) == "null" { return nil } var firstPass struct { - *NodeNodeGHSA + *IsOccurrencesPkgIngestOccurrencesIsOccurrence graphql.NoUnmarshalJSON } - firstPass.NodeNodeGHSA = v + firstPass.IsOccurrencesPkgIngestOccurrencesIsOccurrence = v err := json.Unmarshal(b, &firstPass) if err != nil { @@ -11174,22 +10954,28 @@ func (v *NodeNodeGHSA) UnmarshalJSON(b []byte) error { } err = json.Unmarshal( - b, &v.AllGHSATree) + b, &v.AllIsOccurrencesTree) if err != nil { return err } return nil } -type __premarshalNodeNodeGHSA struct { - Typename *string `json:"__typename"` - +type __premarshalIsOccurrencesPkgIngestOccurrencesIsOccurrence struct { Id string `json:"id"` - GhsaId string `json:"ghsaId"` + Subject json.RawMessage `json:"subject"` + + Artifact AllIsOccurrencesTreeArtifact `json:"artifact"` + + Justification string `json:"justification"` + + Origin string `json:"origin"` + + Collector string `json:"collector"` } -func (v *NodeNodeGHSA) MarshalJSON() ([]byte, error) { +func (v *IsOccurrencesPkgIngestOccurrencesIsOccurrence) MarshalJSON() ([]byte, error) { premarshaled, err := v.__premarshalJSON() if err != nil { return nil, err @@ -11197,85 +10983,91 @@ func (v *NodeNodeGHSA) MarshalJSON() ([]byte, error) { return json.Marshal(premarshaled) } -func (v *NodeNodeGHSA) __premarshalJSON() (*__premarshalNodeNodeGHSA, error) { - var retval __premarshalNodeNodeGHSA +func (v *IsOccurrencesPkgIngestOccurrencesIsOccurrence) __premarshalJSON() (*__premarshalIsOccurrencesPkgIngestOccurrencesIsOccurrence, error) { + var retval __premarshalIsOccurrencesPkgIngestOccurrencesIsOccurrence - retval.Typename = v.Typename - retval.Id = v.AllGHSATree.Id - retval.GhsaId = v.AllGHSATree.GhsaId + retval.Id = v.AllIsOccurrencesTree.Id + { + + dst := &retval.Subject + src := v.AllIsOccurrencesTree.Subject + var err error + *dst, err = __marshalAllIsOccurrencesTreeSubjectPackageOrSource( + &src) + if err != nil { + return nil, fmt.Errorf( + "unable to marshal IsOccurrencesPkgIngestOccurrencesIsOccurrence.AllIsOccurrencesTree.Subject: %w", err) + } + } + retval.Artifact = v.AllIsOccurrencesTree.Artifact + retval.Justification = v.AllIsOccurrencesTree.Justification + retval.Origin = v.AllIsOccurrencesTree.Origin + retval.Collector = v.AllIsOccurrencesTree.Collector return &retval, nil } -// NodeNodeHasMetadata includes the requested fields of the GraphQL type HasMetadata. +// IsOccurrencesPkgResponse is returned by IsOccurrencesPkg on success. +type IsOccurrencesPkgResponse struct { + // Bulk ingest that an artifact is produced from a package or source. + IngestOccurrences []IsOccurrencesPkgIngestOccurrencesIsOccurrence `json:"ingestOccurrences"` +} + +// GetIngestOccurrences returns IsOccurrencesPkgResponse.IngestOccurrences, and is useful for accessing the field via an interface. +func (v *IsOccurrencesPkgResponse) GetIngestOccurrences() []IsOccurrencesPkgIngestOccurrencesIsOccurrence { + return v.IngestOccurrences +} + +// IsOccurrencesSrcIngestOccurrencesIsOccurrence includes the requested fields of the GraphQL type IsOccurrence. // The GraphQL type's documentation follows. // -// HasMetadata is an attestation that a package, source, or artifact has a certain -// attested property (key) with value (value). For example, a source may have -// metadata "SourceRepo2FAEnabled=true". -// -// The intent of this evidence tree predicate is to allow extensibility of metadata -// expressible within the GUAC ontology. Metadata that is commonly used will then -// be promoted to a predicate on its own. -// -// Justification indicates how the metadata was determined. +// IsOccurrence is an attestation to link an artifact to a package or source. // -// The metadata applies to a subject which is a package, source, or artifact. -// If the attestation targets a package, it must target a PackageName or a -// PackageVersion. If the attestation targets a source, it must target a -// SourceName. -type NodeNodeHasMetadata struct { - Typename *string `json:"__typename"` +// Attestation must occur at the PackageVersion or at the SourceName. +type IsOccurrencesSrcIngestOccurrencesIsOccurrence struct { + AllIsOccurrencesTree `json:"-"` } -// GetTypename returns NodeNodeHasMetadata.Typename, and is useful for accessing the field via an interface. -func (v *NodeNodeHasMetadata) GetTypename() *string { return v.Typename } - -// NodeNodeHasSBOM includes the requested fields of the GraphQL type HasSBOM. -type NodeNodeHasSBOM struct { - Typename *string `json:"__typename"` - allHasSBOMTree `json:"-"` +// GetId returns IsOccurrencesSrcIngestOccurrencesIsOccurrence.Id, and is useful for accessing the field via an interface. +func (v *IsOccurrencesSrcIngestOccurrencesIsOccurrence) GetId() string { + return v.AllIsOccurrencesTree.Id } -// GetTypename returns NodeNodeHasSBOM.Typename, and is useful for accessing the field via an interface. -func (v *NodeNodeHasSBOM) GetTypename() *string { return v.Typename } - -// GetId returns NodeNodeHasSBOM.Id, and is useful for accessing the field via an interface. -func (v *NodeNodeHasSBOM) GetId() string { return v.allHasSBOMTree.Id } - -// GetSubject returns NodeNodeHasSBOM.Subject, and is useful for accessing the field via an interface. -func (v *NodeNodeHasSBOM) GetSubject() allHasSBOMTreeSubjectPackageOrArtifact { - return v.allHasSBOMTree.Subject +// GetSubject returns IsOccurrencesSrcIngestOccurrencesIsOccurrence.Subject, and is useful for accessing the field via an interface. +func (v *IsOccurrencesSrcIngestOccurrencesIsOccurrence) GetSubject() AllIsOccurrencesTreeSubjectPackageOrSource { + return v.AllIsOccurrencesTree.Subject } -// GetUri returns NodeNodeHasSBOM.Uri, and is useful for accessing the field via an interface. -func (v *NodeNodeHasSBOM) GetUri() string { return v.allHasSBOMTree.Uri } - -// GetAlgorithm returns NodeNodeHasSBOM.Algorithm, and is useful for accessing the field via an interface. -func (v *NodeNodeHasSBOM) GetAlgorithm() string { return v.allHasSBOMTree.Algorithm } - -// GetDigest returns NodeNodeHasSBOM.Digest, and is useful for accessing the field via an interface. -func (v *NodeNodeHasSBOM) GetDigest() string { return v.allHasSBOMTree.Digest } +// GetArtifact returns IsOccurrencesSrcIngestOccurrencesIsOccurrence.Artifact, and is useful for accessing the field via an interface. +func (v *IsOccurrencesSrcIngestOccurrencesIsOccurrence) GetArtifact() AllIsOccurrencesTreeArtifact { + return v.AllIsOccurrencesTree.Artifact +} -// GetDownloadLocation returns NodeNodeHasSBOM.DownloadLocation, and is useful for accessing the field via an interface. -func (v *NodeNodeHasSBOM) GetDownloadLocation() string { return v.allHasSBOMTree.DownloadLocation } +// GetJustification returns IsOccurrencesSrcIngestOccurrencesIsOccurrence.Justification, and is useful for accessing the field via an interface. +func (v *IsOccurrencesSrcIngestOccurrencesIsOccurrence) GetJustification() string { + return v.AllIsOccurrencesTree.Justification +} -// GetOrigin returns NodeNodeHasSBOM.Origin, and is useful for accessing the field via an interface. -func (v *NodeNodeHasSBOM) GetOrigin() string { return v.allHasSBOMTree.Origin } +// GetOrigin returns IsOccurrencesSrcIngestOccurrencesIsOccurrence.Origin, and is useful for accessing the field via an interface. +func (v *IsOccurrencesSrcIngestOccurrencesIsOccurrence) GetOrigin() string { + return v.AllIsOccurrencesTree.Origin +} -// GetCollector returns NodeNodeHasSBOM.Collector, and is useful for accessing the field via an interface. -func (v *NodeNodeHasSBOM) GetCollector() string { return v.allHasSBOMTree.Collector } +// GetCollector returns IsOccurrencesSrcIngestOccurrencesIsOccurrence.Collector, and is useful for accessing the field via an interface. +func (v *IsOccurrencesSrcIngestOccurrencesIsOccurrence) GetCollector() string { + return v.AllIsOccurrencesTree.Collector +} -func (v *NodeNodeHasSBOM) UnmarshalJSON(b []byte) error { +func (v *IsOccurrencesSrcIngestOccurrencesIsOccurrence) UnmarshalJSON(b []byte) error { if string(b) == "null" { return nil } var firstPass struct { - *NodeNodeHasSBOM + *IsOccurrencesSrcIngestOccurrencesIsOccurrence graphql.NoUnmarshalJSON } - firstPass.NodeNodeHasSBOM = v + firstPass.IsOccurrencesSrcIngestOccurrencesIsOccurrence = v err := json.Unmarshal(b, &firstPass) if err != nil { @@ -11283,34 +11075,28 @@ func (v *NodeNodeHasSBOM) UnmarshalJSON(b []byte) error { } err = json.Unmarshal( - b, &v.allHasSBOMTree) + b, &v.AllIsOccurrencesTree) if err != nil { return err } return nil } -type __premarshalNodeNodeHasSBOM struct { - Typename *string `json:"__typename"` - +type __premarshalIsOccurrencesSrcIngestOccurrencesIsOccurrence struct { Id string `json:"id"` Subject json.RawMessage `json:"subject"` - Uri string `json:"uri"` - - Algorithm string `json:"algorithm"` - - Digest string `json:"digest"` + Artifact AllIsOccurrencesTreeArtifact `json:"artifact"` - DownloadLocation string `json:"downloadLocation"` + Justification string `json:"justification"` Origin string `json:"origin"` Collector string `json:"collector"` } -func (v *NodeNodeHasSBOM) MarshalJSON() ([]byte, error) { +func (v *IsOccurrencesSrcIngestOccurrencesIsOccurrence) MarshalJSON() ([]byte, error) { premarshaled, err := v.__premarshalJSON() if err != nil { return nil, err @@ -11318,64 +11104,87 @@ func (v *NodeNodeHasSBOM) MarshalJSON() ([]byte, error) { return json.Marshal(premarshaled) } -func (v *NodeNodeHasSBOM) __premarshalJSON() (*__premarshalNodeNodeHasSBOM, error) { - var retval __premarshalNodeNodeHasSBOM +func (v *IsOccurrencesSrcIngestOccurrencesIsOccurrence) __premarshalJSON() (*__premarshalIsOccurrencesSrcIngestOccurrencesIsOccurrence, error) { + var retval __premarshalIsOccurrencesSrcIngestOccurrencesIsOccurrence - retval.Typename = v.Typename - retval.Id = v.allHasSBOMTree.Id + retval.Id = v.AllIsOccurrencesTree.Id { dst := &retval.Subject - src := v.allHasSBOMTree.Subject + src := v.AllIsOccurrencesTree.Subject var err error - *dst, err = __marshalallHasSBOMTreeSubjectPackageOrArtifact( + *dst, err = __marshalAllIsOccurrencesTreeSubjectPackageOrSource( &src) if err != nil { return nil, fmt.Errorf( - "unable to marshal NodeNodeHasSBOM.allHasSBOMTree.Subject: %w", err) + "unable to marshal IsOccurrencesSrcIngestOccurrencesIsOccurrence.AllIsOccurrencesTree.Subject: %w", err) } } - retval.Uri = v.allHasSBOMTree.Uri - retval.Algorithm = v.allHasSBOMTree.Algorithm - retval.Digest = v.allHasSBOMTree.Digest - retval.DownloadLocation = v.allHasSBOMTree.DownloadLocation - retval.Origin = v.allHasSBOMTree.Origin - retval.Collector = v.allHasSBOMTree.Collector + retval.Artifact = v.AllIsOccurrencesTree.Artifact + retval.Justification = v.AllIsOccurrencesTree.Justification + retval.Origin = v.AllIsOccurrencesTree.Origin + retval.Collector = v.AllIsOccurrencesTree.Collector return &retval, nil } -// NodeNodeHasSLSA includes the requested fields of the GraphQL type HasSLSA. +// IsOccurrencesSrcResponse is returned by IsOccurrencesSrc on success. +type IsOccurrencesSrcResponse struct { + // Bulk ingest that an artifact is produced from a package or source. + IngestOccurrences []IsOccurrencesSrcIngestOccurrencesIsOccurrence `json:"ingestOccurrences"` +} + +// GetIngestOccurrences returns IsOccurrencesSrcResponse.IngestOccurrences, and is useful for accessing the field via an interface. +func (v *IsOccurrencesSrcResponse) GetIngestOccurrences() []IsOccurrencesSrcIngestOccurrencesIsOccurrence { + return v.IngestOccurrences +} + +// IsVulnerabilityCVEIngestIsVulnerability includes the requested fields of the GraphQL type IsVulnerability. // The GraphQL type's documentation follows. // -// HasSLSA records that a subject node has a SLSA attestation. -type NodeNodeHasSLSA struct { - Typename *string `json:"__typename"` - allSLSATree `json:"-"` +// IsVulnerability is an attestation to link CVE/GHSA with data in OSV. +type IsVulnerabilityCVEIngestIsVulnerability struct { + AllIsVulnerability `json:"-"` } -// GetTypename returns NodeNodeHasSLSA.Typename, and is useful for accessing the field via an interface. -func (v *NodeNodeHasSLSA) GetTypename() *string { return v.Typename } +// GetId returns IsVulnerabilityCVEIngestIsVulnerability.Id, and is useful for accessing the field via an interface. +func (v *IsVulnerabilityCVEIngestIsVulnerability) GetId() string { return v.AllIsVulnerability.Id } -// GetId returns NodeNodeHasSLSA.Id, and is useful for accessing the field via an interface. -func (v *NodeNodeHasSLSA) GetId() string { return v.allSLSATree.Id } +// GetOsv returns IsVulnerabilityCVEIngestIsVulnerability.Osv, and is useful for accessing the field via an interface. +func (v *IsVulnerabilityCVEIngestIsVulnerability) GetOsv() AllIsVulnerabilityOsvOSV { + return v.AllIsVulnerability.Osv +} -// GetSubject returns NodeNodeHasSLSA.Subject, and is useful for accessing the field via an interface. -func (v *NodeNodeHasSLSA) GetSubject() allSLSATreeSubjectArtifact { return v.allSLSATree.Subject } +// GetVulnerability returns IsVulnerabilityCVEIngestIsVulnerability.Vulnerability, and is useful for accessing the field via an interface. +func (v *IsVulnerabilityCVEIngestIsVulnerability) GetVulnerability() AllIsVulnerabilityVulnerabilityCveOrGhsa { + return v.AllIsVulnerability.Vulnerability +} -// GetSlsa returns NodeNodeHasSLSA.Slsa, and is useful for accessing the field via an interface. -func (v *NodeNodeHasSLSA) GetSlsa() allSLSATreeSlsaSLSA { return v.allSLSATree.Slsa } +// GetJustification returns IsVulnerabilityCVEIngestIsVulnerability.Justification, and is useful for accessing the field via an interface. +func (v *IsVulnerabilityCVEIngestIsVulnerability) GetJustification() string { + return v.AllIsVulnerability.Justification +} -func (v *NodeNodeHasSLSA) UnmarshalJSON(b []byte) error { +// GetOrigin returns IsVulnerabilityCVEIngestIsVulnerability.Origin, and is useful for accessing the field via an interface. +func (v *IsVulnerabilityCVEIngestIsVulnerability) GetOrigin() string { + return v.AllIsVulnerability.Origin +} + +// GetCollector returns IsVulnerabilityCVEIngestIsVulnerability.Collector, and is useful for accessing the field via an interface. +func (v *IsVulnerabilityCVEIngestIsVulnerability) GetCollector() string { + return v.AllIsVulnerability.Collector +} + +func (v *IsVulnerabilityCVEIngestIsVulnerability) UnmarshalJSON(b []byte) error { if string(b) == "null" { return nil } var firstPass struct { - *NodeNodeHasSLSA + *IsVulnerabilityCVEIngestIsVulnerability graphql.NoUnmarshalJSON } - firstPass.NodeNodeHasSLSA = v + firstPass.IsVulnerabilityCVEIngestIsVulnerability = v err := json.Unmarshal(b, &firstPass) if err != nil { @@ -11383,24 +11192,28 @@ func (v *NodeNodeHasSLSA) UnmarshalJSON(b []byte) error { } err = json.Unmarshal( - b, &v.allSLSATree) + b, &v.AllIsVulnerability) if err != nil { return err } return nil } -type __premarshalNodeNodeHasSLSA struct { - Typename *string `json:"__typename"` - +type __premarshalIsVulnerabilityCVEIngestIsVulnerability struct { Id string `json:"id"` - Subject allSLSATreeSubjectArtifact `json:"subject"` + Osv AllIsVulnerabilityOsvOSV `json:"osv"` - Slsa allSLSATreeSlsaSLSA `json:"slsa"` + Vulnerability json.RawMessage `json:"vulnerability"` + + Justification string `json:"justification"` + + Origin string `json:"origin"` + + Collector string `json:"collector"` } -func (v *NodeNodeHasSLSA) MarshalJSON() ([]byte, error) { +func (v *IsVulnerabilityCVEIngestIsVulnerability) MarshalJSON() ([]byte, error) { premarshaled, err := v.__premarshalJSON() if err != nil { return nil, err @@ -11408,60 +11221,87 @@ func (v *NodeNodeHasSLSA) MarshalJSON() ([]byte, error) { return json.Marshal(premarshaled) } -func (v *NodeNodeHasSLSA) __premarshalJSON() (*__premarshalNodeNodeHasSLSA, error) { - var retval __premarshalNodeNodeHasSLSA +func (v *IsVulnerabilityCVEIngestIsVulnerability) __premarshalJSON() (*__premarshalIsVulnerabilityCVEIngestIsVulnerability, error) { + var retval __premarshalIsVulnerabilityCVEIngestIsVulnerability - retval.Typename = v.Typename - retval.Id = v.allSLSATree.Id - retval.Subject = v.allSLSATree.Subject - retval.Slsa = v.allSLSATree.Slsa + retval.Id = v.AllIsVulnerability.Id + retval.Osv = v.AllIsVulnerability.Osv + { + + dst := &retval.Vulnerability + src := v.AllIsVulnerability.Vulnerability + var err error + *dst, err = __marshalAllIsVulnerabilityVulnerabilityCveOrGhsa( + &src) + if err != nil { + return nil, fmt.Errorf( + "unable to marshal IsVulnerabilityCVEIngestIsVulnerability.AllIsVulnerability.Vulnerability: %w", err) + } + } + retval.Justification = v.AllIsVulnerability.Justification + retval.Origin = v.AllIsVulnerability.Origin + retval.Collector = v.AllIsVulnerability.Collector return &retval, nil } -// NodeNodeHasSourceAt includes the requested fields of the GraphQL type HasSourceAt. -// The GraphQL type's documentation follows. -// -// HasSourceAt records that a package's repository is a given source. -type NodeNodeHasSourceAt struct { - Typename *string `json:"__typename"` - allHasSourceAt `json:"-"` +// IsVulnerabilityCVEResponse is returned by IsVulnerabilityCVE on success. +type IsVulnerabilityCVEResponse struct { + // Ingest a mapping between an OSV entry and a CVE/GHSA vulnerability. + IngestIsVulnerability IsVulnerabilityCVEIngestIsVulnerability `json:"ingestIsVulnerability"` } -// GetTypename returns NodeNodeHasSourceAt.Typename, and is useful for accessing the field via an interface. -func (v *NodeNodeHasSourceAt) GetTypename() *string { return v.Typename } +// GetIngestIsVulnerability returns IsVulnerabilityCVEResponse.IngestIsVulnerability, and is useful for accessing the field via an interface. +func (v *IsVulnerabilityCVEResponse) GetIngestIsVulnerability() IsVulnerabilityCVEIngestIsVulnerability { + return v.IngestIsVulnerability +} -// GetId returns NodeNodeHasSourceAt.Id, and is useful for accessing the field via an interface. -func (v *NodeNodeHasSourceAt) GetId() string { return v.allHasSourceAt.Id } +// IsVulnerabilityGHSAIngestIsVulnerability includes the requested fields of the GraphQL type IsVulnerability. +// The GraphQL type's documentation follows. +// +// IsVulnerability is an attestation to link CVE/GHSA with data in OSV. +type IsVulnerabilityGHSAIngestIsVulnerability struct { + AllIsVulnerability `json:"-"` +} -// GetJustification returns NodeNodeHasSourceAt.Justification, and is useful for accessing the field via an interface. -func (v *NodeNodeHasSourceAt) GetJustification() string { return v.allHasSourceAt.Justification } +// GetId returns IsVulnerabilityGHSAIngestIsVulnerability.Id, and is useful for accessing the field via an interface. +func (v *IsVulnerabilityGHSAIngestIsVulnerability) GetId() string { return v.AllIsVulnerability.Id } -// GetKnownSince returns NodeNodeHasSourceAt.KnownSince, and is useful for accessing the field via an interface. -func (v *NodeNodeHasSourceAt) GetKnownSince() time.Time { return v.allHasSourceAt.KnownSince } +// GetOsv returns IsVulnerabilityGHSAIngestIsVulnerability.Osv, and is useful for accessing the field via an interface. +func (v *IsVulnerabilityGHSAIngestIsVulnerability) GetOsv() AllIsVulnerabilityOsvOSV { + return v.AllIsVulnerability.Osv +} -// GetPackage returns NodeNodeHasSourceAt.Package, and is useful for accessing the field via an interface. -func (v *NodeNodeHasSourceAt) GetPackage() allHasSourceAtPackage { return v.allHasSourceAt.Package } +// GetVulnerability returns IsVulnerabilityGHSAIngestIsVulnerability.Vulnerability, and is useful for accessing the field via an interface. +func (v *IsVulnerabilityGHSAIngestIsVulnerability) GetVulnerability() AllIsVulnerabilityVulnerabilityCveOrGhsa { + return v.AllIsVulnerability.Vulnerability +} -// GetSource returns NodeNodeHasSourceAt.Source, and is useful for accessing the field via an interface. -func (v *NodeNodeHasSourceAt) GetSource() allHasSourceAtSource { return v.allHasSourceAt.Source } +// GetJustification returns IsVulnerabilityGHSAIngestIsVulnerability.Justification, and is useful for accessing the field via an interface. +func (v *IsVulnerabilityGHSAIngestIsVulnerability) GetJustification() string { + return v.AllIsVulnerability.Justification +} -// GetOrigin returns NodeNodeHasSourceAt.Origin, and is useful for accessing the field via an interface. -func (v *NodeNodeHasSourceAt) GetOrigin() string { return v.allHasSourceAt.Origin } +// GetOrigin returns IsVulnerabilityGHSAIngestIsVulnerability.Origin, and is useful for accessing the field via an interface. +func (v *IsVulnerabilityGHSAIngestIsVulnerability) GetOrigin() string { + return v.AllIsVulnerability.Origin +} -// GetCollector returns NodeNodeHasSourceAt.Collector, and is useful for accessing the field via an interface. -func (v *NodeNodeHasSourceAt) GetCollector() string { return v.allHasSourceAt.Collector } +// GetCollector returns IsVulnerabilityGHSAIngestIsVulnerability.Collector, and is useful for accessing the field via an interface. +func (v *IsVulnerabilityGHSAIngestIsVulnerability) GetCollector() string { + return v.AllIsVulnerability.Collector +} -func (v *NodeNodeHasSourceAt) UnmarshalJSON(b []byte) error { +func (v *IsVulnerabilityGHSAIngestIsVulnerability) UnmarshalJSON(b []byte) error { if string(b) == "null" { return nil } var firstPass struct { - *NodeNodeHasSourceAt + *IsVulnerabilityGHSAIngestIsVulnerability graphql.NoUnmarshalJSON } - firstPass.NodeNodeHasSourceAt = v + firstPass.IsVulnerabilityGHSAIngestIsVulnerability = v err := json.Unmarshal(b, &firstPass) if err != nil { @@ -11469,32 +11309,28 @@ func (v *NodeNodeHasSourceAt) UnmarshalJSON(b []byte) error { } err = json.Unmarshal( - b, &v.allHasSourceAt) + b, &v.AllIsVulnerability) if err != nil { return err } return nil } -type __premarshalNodeNodeHasSourceAt struct { - Typename *string `json:"__typename"` - +type __premarshalIsVulnerabilityGHSAIngestIsVulnerability struct { Id string `json:"id"` - Justification string `json:"justification"` - - KnownSince time.Time `json:"knownSince"` + Osv AllIsVulnerabilityOsvOSV `json:"osv"` - Package allHasSourceAtPackage `json:"package"` + Vulnerability json.RawMessage `json:"vulnerability"` - Source allHasSourceAtSource `json:"source"` + Justification string `json:"justification"` Origin string `json:"origin"` Collector string `json:"collector"` } -func (v *NodeNodeHasSourceAt) MarshalJSON() ([]byte, error) { +func (v *IsVulnerabilityGHSAIngestIsVulnerability) MarshalJSON() ([]byte, error) { premarshaled, err := v.__premarshalJSON() if err != nil { return nil, err @@ -11502,60 +11338,102 @@ func (v *NodeNodeHasSourceAt) MarshalJSON() ([]byte, error) { return json.Marshal(premarshaled) } -func (v *NodeNodeHasSourceAt) __premarshalJSON() (*__premarshalNodeNodeHasSourceAt, error) { - var retval __premarshalNodeNodeHasSourceAt +func (v *IsVulnerabilityGHSAIngestIsVulnerability) __premarshalJSON() (*__premarshalIsVulnerabilityGHSAIngestIsVulnerability, error) { + var retval __premarshalIsVulnerabilityGHSAIngestIsVulnerability - retval.Typename = v.Typename - retval.Id = v.allHasSourceAt.Id - retval.Justification = v.allHasSourceAt.Justification - retval.KnownSince = v.allHasSourceAt.KnownSince - retval.Package = v.allHasSourceAt.Package - retval.Source = v.allHasSourceAt.Source - retval.Origin = v.allHasSourceAt.Origin - retval.Collector = v.allHasSourceAt.Collector + retval.Id = v.AllIsVulnerability.Id + retval.Osv = v.AllIsVulnerability.Osv + { + + dst := &retval.Vulnerability + src := v.AllIsVulnerability.Vulnerability + var err error + *dst, err = __marshalAllIsVulnerabilityVulnerabilityCveOrGhsa( + &src) + if err != nil { + return nil, fmt.Errorf( + "unable to marshal IsVulnerabilityGHSAIngestIsVulnerability.AllIsVulnerability.Vulnerability: %w", err) + } + } + retval.Justification = v.AllIsVulnerability.Justification + retval.Origin = v.AllIsVulnerability.Origin + retval.Collector = v.AllIsVulnerability.Collector return &retval, nil } -// NodeNodeHashEqual includes the requested fields of the GraphQL type HashEqual. -// The GraphQL type's documentation follows. -// -// HashEqual is an attestation that a set of artifacts are identical. -type NodeNodeHashEqual struct { - Typename *string `json:"__typename"` - allHashEqualTree `json:"-"` +// IsVulnerabilityGHSAResponse is returned by IsVulnerabilityGHSA on success. +type IsVulnerabilityGHSAResponse struct { + // Ingest a mapping between an OSV entry and a CVE/GHSA vulnerability. + IngestIsVulnerability IsVulnerabilityGHSAIngestIsVulnerability `json:"ingestIsVulnerability"` } -// GetTypename returns NodeNodeHashEqual.Typename, and is useful for accessing the field via an interface. -func (v *NodeNodeHashEqual) GetTypename() *string { return v.Typename } +// GetIngestIsVulnerability returns IsVulnerabilityGHSAResponse.IngestIsVulnerability, and is useful for accessing the field via an interface. +func (v *IsVulnerabilityGHSAResponse) GetIngestIsVulnerability() IsVulnerabilityGHSAIngestIsVulnerability { + return v.IngestIsVulnerability +} -// GetId returns NodeNodeHashEqual.Id, and is useful for accessing the field via an interface. -func (v *NodeNodeHashEqual) GetId() string { return v.allHashEqualTree.Id } +// IsVulnerabilityInputSpec represents the input to link CVE/GHSA with OSV data. +type IsVulnerabilityInputSpec struct { + Justification string `json:"justification"` + Origin string `json:"origin"` + Collector string `json:"collector"` +} -// GetJustification returns NodeNodeHashEqual.Justification, and is useful for accessing the field via an interface. -func (v *NodeNodeHashEqual) GetJustification() string { return v.allHashEqualTree.Justification } +// GetJustification returns IsVulnerabilityInputSpec.Justification, and is useful for accessing the field via an interface. +func (v *IsVulnerabilityInputSpec) GetJustification() string { return v.Justification } -// GetArtifacts returns NodeNodeHashEqual.Artifacts, and is useful for accessing the field via an interface. -func (v *NodeNodeHashEqual) GetArtifacts() []allHashEqualTreeArtifactsArtifact { - return v.allHashEqualTree.Artifacts +// GetOrigin returns IsVulnerabilityInputSpec.Origin, and is useful for accessing the field via an interface. +func (v *IsVulnerabilityInputSpec) GetOrigin() string { return v.Origin } + +// GetCollector returns IsVulnerabilityInputSpec.Collector, and is useful for accessing the field via an interface. +func (v *IsVulnerabilityInputSpec) GetCollector() string { return v.Collector } + +// MatchFlags is used to input the PkgMatchType enum. +type MatchFlags struct { + Pkg PkgMatchType `json:"pkg"` } -// GetOrigin returns NodeNodeHashEqual.Origin, and is useful for accessing the field via an interface. -func (v *NodeNodeHashEqual) GetOrigin() string { return v.allHashEqualTree.Origin } +// GetPkg returns MatchFlags.Pkg, and is useful for accessing the field via an interface. +func (v *MatchFlags) GetPkg() PkgMatchType { return v.Pkg } -// GetCollector returns NodeNodeHashEqual.Collector, and is useful for accessing the field via an interface. -func (v *NodeNodeHashEqual) GetCollector() string { return v.allHashEqualTree.Collector } +// NeighborsNeighborsArtifact includes the requested fields of the GraphQL type Artifact. +// The GraphQL type's documentation follows. +// +// Artifact represents an artifact identified by a checksum hash. +// +// The checksum is split into the digest value and the algorithm used to generate +// it. Both fields are mandatory and canonicalized to be lowercase. +// +// If having a checksum Go object, algorithm can be +// strings.ToLower(string(checksum.Algorithm)) and digest can be checksum.Value. +type NeighborsNeighborsArtifact struct { + Typename *string `json:"__typename"` + AllArtifactTree `json:"-"` +} -func (v *NodeNodeHashEqual) UnmarshalJSON(b []byte) error { +// GetTypename returns NeighborsNeighborsArtifact.Typename, and is useful for accessing the field via an interface. +func (v *NeighborsNeighborsArtifact) GetTypename() *string { return v.Typename } + +// GetId returns NeighborsNeighborsArtifact.Id, and is useful for accessing the field via an interface. +func (v *NeighborsNeighborsArtifact) GetId() string { return v.AllArtifactTree.Id } + +// GetAlgorithm returns NeighborsNeighborsArtifact.Algorithm, and is useful for accessing the field via an interface. +func (v *NeighborsNeighborsArtifact) GetAlgorithm() string { return v.AllArtifactTree.Algorithm } + +// GetDigest returns NeighborsNeighborsArtifact.Digest, and is useful for accessing the field via an interface. +func (v *NeighborsNeighborsArtifact) GetDigest() string { return v.AllArtifactTree.Digest } + +func (v *NeighborsNeighborsArtifact) UnmarshalJSON(b []byte) error { if string(b) == "null" { return nil } var firstPass struct { - *NodeNodeHashEqual + *NeighborsNeighborsArtifact graphql.NoUnmarshalJSON } - firstPass.NodeNodeHashEqual = v + firstPass.NeighborsNeighborsArtifact = v err := json.Unmarshal(b, &firstPass) if err != nil { @@ -11563,28 +11441,24 @@ func (v *NodeNodeHashEqual) UnmarshalJSON(b []byte) error { } err = json.Unmarshal( - b, &v.allHashEqualTree) + b, &v.AllArtifactTree) if err != nil { return err } return nil } -type __premarshalNodeNodeHashEqual struct { +type __premarshalNeighborsNeighborsArtifact struct { Typename *string `json:"__typename"` Id string `json:"id"` - Justification string `json:"justification"` - - Artifacts []allHashEqualTreeArtifactsArtifact `json:"artifacts"` - - Origin string `json:"origin"` + Algorithm string `json:"algorithm"` - Collector string `json:"collector"` + Digest string `json:"digest"` } -func (v *NodeNodeHashEqual) MarshalJSON() ([]byte, error) { +func (v *NeighborsNeighborsArtifact) MarshalJSON() ([]byte, error) { premarshaled, err := v.__premarshalJSON() if err != nil { return nil, err @@ -11592,71 +11466,47 @@ func (v *NodeNodeHashEqual) MarshalJSON() ([]byte, error) { return json.Marshal(premarshaled) } -func (v *NodeNodeHashEqual) __premarshalJSON() (*__premarshalNodeNodeHashEqual, error) { - var retval __premarshalNodeNodeHashEqual +func (v *NeighborsNeighborsArtifact) __premarshalJSON() (*__premarshalNeighborsNeighborsArtifact, error) { + var retval __premarshalNeighborsNeighborsArtifact retval.Typename = v.Typename - retval.Id = v.allHashEqualTree.Id - retval.Justification = v.allHashEqualTree.Justification - retval.Artifacts = v.allHashEqualTree.Artifacts - retval.Origin = v.allHashEqualTree.Origin - retval.Collector = v.allHashEqualTree.Collector + retval.Id = v.AllArtifactTree.Id + retval.Algorithm = v.AllArtifactTree.Algorithm + retval.Digest = v.AllArtifactTree.Digest return &retval, nil } -// NodeNodeIsDependency includes the requested fields of the GraphQL type IsDependency. +// NeighborsNeighborsBuilder includes the requested fields of the GraphQL type Builder. // The GraphQL type's documentation follows. // -// IsDependency is an attestation to record that a package depends on another. -type NodeNodeIsDependency struct { - Typename *string `json:"__typename"` - allIsDependencyTree `json:"-"` -} - -// GetTypename returns NodeNodeIsDependency.Typename, and is useful for accessing the field via an interface. -func (v *NodeNodeIsDependency) GetTypename() *string { return v.Typename } - -// GetId returns NodeNodeIsDependency.Id, and is useful for accessing the field via an interface. -func (v *NodeNodeIsDependency) GetId() string { return v.allIsDependencyTree.Id } - -// GetJustification returns NodeNodeIsDependency.Justification, and is useful for accessing the field via an interface. -func (v *NodeNodeIsDependency) GetJustification() string { return v.allIsDependencyTree.Justification } - -// GetPackage returns NodeNodeIsDependency.Package, and is useful for accessing the field via an interface. -func (v *NodeNodeIsDependency) GetPackage() allIsDependencyTreePackage { - return v.allIsDependencyTree.Package -} - -// GetDependentPackage returns NodeNodeIsDependency.DependentPackage, and is useful for accessing the field via an interface. -func (v *NodeNodeIsDependency) GetDependentPackage() allIsDependencyTreeDependentPackage { - return v.allIsDependencyTree.DependentPackage -} - -// GetDependencyType returns NodeNodeIsDependency.DependencyType, and is useful for accessing the field via an interface. -func (v *NodeNodeIsDependency) GetDependencyType() DependencyType { - return v.allIsDependencyTree.DependencyType +// Builder represents the builder (e.g., FRSCA or GitHub Actions). +// +// Currently builders are identified by the uri field. +type NeighborsNeighborsBuilder struct { + Typename *string `json:"__typename"` + AllBuilderTree `json:"-"` } -// GetVersionRange returns NodeNodeIsDependency.VersionRange, and is useful for accessing the field via an interface. -func (v *NodeNodeIsDependency) GetVersionRange() string { return v.allIsDependencyTree.VersionRange } +// GetTypename returns NeighborsNeighborsBuilder.Typename, and is useful for accessing the field via an interface. +func (v *NeighborsNeighborsBuilder) GetTypename() *string { return v.Typename } -// GetOrigin returns NodeNodeIsDependency.Origin, and is useful for accessing the field via an interface. -func (v *NodeNodeIsDependency) GetOrigin() string { return v.allIsDependencyTree.Origin } +// GetId returns NeighborsNeighborsBuilder.Id, and is useful for accessing the field via an interface. +func (v *NeighborsNeighborsBuilder) GetId() string { return v.AllBuilderTree.Id } -// GetCollector returns NodeNodeIsDependency.Collector, and is useful for accessing the field via an interface. -func (v *NodeNodeIsDependency) GetCollector() string { return v.allIsDependencyTree.Collector } +// GetUri returns NeighborsNeighborsBuilder.Uri, and is useful for accessing the field via an interface. +func (v *NeighborsNeighborsBuilder) GetUri() string { return v.AllBuilderTree.Uri } -func (v *NodeNodeIsDependency) UnmarshalJSON(b []byte) error { +func (v *NeighborsNeighborsBuilder) UnmarshalJSON(b []byte) error { if string(b) == "null" { return nil } var firstPass struct { - *NodeNodeIsDependency + *NeighborsNeighborsBuilder graphql.NoUnmarshalJSON } - firstPass.NodeNodeIsDependency = v + firstPass.NeighborsNeighborsBuilder = v err := json.Unmarshal(b, &firstPass) if err != nil { @@ -11664,34 +11514,22 @@ func (v *NodeNodeIsDependency) UnmarshalJSON(b []byte) error { } err = json.Unmarshal( - b, &v.allIsDependencyTree) + b, &v.AllBuilderTree) if err != nil { return err } return nil } -type __premarshalNodeNodeIsDependency struct { +type __premarshalNeighborsNeighborsBuilder struct { Typename *string `json:"__typename"` Id string `json:"id"` - Justification string `json:"justification"` - - Package allIsDependencyTreePackage `json:"package"` - - DependentPackage allIsDependencyTreeDependentPackage `json:"dependentPackage"` - - DependencyType DependencyType `json:"dependencyType"` - - VersionRange string `json:"versionRange"` - - Origin string `json:"origin"` - - Collector string `json:"collector"` + Uri string `json:"uri"` } -func (v *NodeNodeIsDependency) MarshalJSON() ([]byte, error) { +func (v *NeighborsNeighborsBuilder) MarshalJSON() ([]byte, error) { premarshaled, err := v.__premarshalJSON() if err != nil { return nil, err @@ -11699,68 +11537,56 @@ func (v *NodeNodeIsDependency) MarshalJSON() ([]byte, error) { return json.Marshal(premarshaled) } -func (v *NodeNodeIsDependency) __premarshalJSON() (*__premarshalNodeNodeIsDependency, error) { - var retval __premarshalNodeNodeIsDependency +func (v *NeighborsNeighborsBuilder) __premarshalJSON() (*__premarshalNeighborsNeighborsBuilder, error) { + var retval __premarshalNeighborsNeighborsBuilder retval.Typename = v.Typename - retval.Id = v.allIsDependencyTree.Id - retval.Justification = v.allIsDependencyTree.Justification - retval.Package = v.allIsDependencyTree.Package - retval.DependentPackage = v.allIsDependencyTree.DependentPackage - retval.DependencyType = v.allIsDependencyTree.DependencyType - retval.VersionRange = v.allIsDependencyTree.VersionRange - retval.Origin = v.allIsDependencyTree.Origin - retval.Collector = v.allIsDependencyTree.Collector + retval.Id = v.AllBuilderTree.Id + retval.Uri = v.AllBuilderTree.Uri return &retval, nil } -// NodeNodeIsOccurrence includes the requested fields of the GraphQL type IsOccurrence. +// NeighborsNeighborsCVE includes the requested fields of the GraphQL type CVE. // The GraphQL type's documentation follows. // -// IsOccurrence is an attestation to link an artifact to a package or source. +// CVE represents a vulnerability in the Common Vulnerabilities and Exposures +// schema. // -// Attestation must occur at the PackageVersion or at the SourceName. -type NodeNodeIsOccurrence struct { - Typename *string `json:"__typename"` - AllIsOccurrencesTree `json:"-"` -} - -// GetTypename returns NodeNodeIsOccurrence.Typename, and is useful for accessing the field via an interface. -func (v *NodeNodeIsOccurrence) GetTypename() *string { return v.Typename } - -// GetId returns NodeNodeIsOccurrence.Id, and is useful for accessing the field via an interface. -func (v *NodeNodeIsOccurrence) GetId() string { return v.AllIsOccurrencesTree.Id } - -// GetSubject returns NodeNodeIsOccurrence.Subject, and is useful for accessing the field via an interface. -func (v *NodeNodeIsOccurrence) GetSubject() AllIsOccurrencesTreeSubjectPackageOrSource { - return v.AllIsOccurrencesTree.Subject +// The vulnerability identifier contains a year field, so we are extracting that +// to allow matching for vulnerabilities found in a given year. +// +// The vulnerability identifier field is mandatory and canonicalized to be +// lowercase. +// +// This node can be referred to by other parts of GUAC. +type NeighborsNeighborsCVE struct { + Typename *string `json:"__typename"` + AllCveTree `json:"-"` } -// GetArtifact returns NodeNodeIsOccurrence.Artifact, and is useful for accessing the field via an interface. -func (v *NodeNodeIsOccurrence) GetArtifact() AllIsOccurrencesTreeArtifact { - return v.AllIsOccurrencesTree.Artifact -} +// GetTypename returns NeighborsNeighborsCVE.Typename, and is useful for accessing the field via an interface. +func (v *NeighborsNeighborsCVE) GetTypename() *string { return v.Typename } -// GetJustification returns NodeNodeIsOccurrence.Justification, and is useful for accessing the field via an interface. -func (v *NodeNodeIsOccurrence) GetJustification() string { return v.AllIsOccurrencesTree.Justification } +// GetId returns NeighborsNeighborsCVE.Id, and is useful for accessing the field via an interface. +func (v *NeighborsNeighborsCVE) GetId() string { return v.AllCveTree.Id } -// GetOrigin returns NodeNodeIsOccurrence.Origin, and is useful for accessing the field via an interface. -func (v *NodeNodeIsOccurrence) GetOrigin() string { return v.AllIsOccurrencesTree.Origin } +// GetYear returns NeighborsNeighborsCVE.Year, and is useful for accessing the field via an interface. +func (v *NeighborsNeighborsCVE) GetYear() int { return v.AllCveTree.Year } -// GetCollector returns NodeNodeIsOccurrence.Collector, and is useful for accessing the field via an interface. -func (v *NodeNodeIsOccurrence) GetCollector() string { return v.AllIsOccurrencesTree.Collector } +// GetCveId returns NeighborsNeighborsCVE.CveId, and is useful for accessing the field via an interface. +func (v *NeighborsNeighborsCVE) GetCveId() string { return v.AllCveTree.CveId } -func (v *NodeNodeIsOccurrence) UnmarshalJSON(b []byte) error { +func (v *NeighborsNeighborsCVE) UnmarshalJSON(b []byte) error { if string(b) == "null" { return nil } var firstPass struct { - *NodeNodeIsOccurrence + *NeighborsNeighborsCVE graphql.NoUnmarshalJSON } - firstPass.NodeNodeIsOccurrence = v + firstPass.NeighborsNeighborsCVE = v err := json.Unmarshal(b, &firstPass) if err != nil { @@ -11768,30 +11594,24 @@ func (v *NodeNodeIsOccurrence) UnmarshalJSON(b []byte) error { } err = json.Unmarshal( - b, &v.AllIsOccurrencesTree) + b, &v.AllCveTree) if err != nil { return err } return nil } -type __premarshalNodeNodeIsOccurrence struct { +type __premarshalNeighborsNeighborsCVE struct { Typename *string `json:"__typename"` Id string `json:"id"` - Subject json.RawMessage `json:"subject"` - - Artifact AllIsOccurrencesTreeArtifact `json:"artifact"` - - Justification string `json:"justification"` - - Origin string `json:"origin"` + Year int `json:"year"` - Collector string `json:"collector"` + CveId string `json:"cveId"` } -func (v *NodeNodeIsOccurrence) MarshalJSON() ([]byte, error) { +func (v *NeighborsNeighborsCVE) MarshalJSON() ([]byte, error) { premarshaled, err := v.__premarshalJSON() if err != nil { return nil, err @@ -11799,75 +11619,68 @@ func (v *NodeNodeIsOccurrence) MarshalJSON() ([]byte, error) { return json.Marshal(premarshaled) } -func (v *NodeNodeIsOccurrence) __premarshalJSON() (*__premarshalNodeNodeIsOccurrence, error) { - var retval __premarshalNodeNodeIsOccurrence +func (v *NeighborsNeighborsCVE) __premarshalJSON() (*__premarshalNeighborsNeighborsCVE, error) { + var retval __premarshalNeighborsNeighborsCVE retval.Typename = v.Typename - retval.Id = v.AllIsOccurrencesTree.Id - { - - dst := &retval.Subject - src := v.AllIsOccurrencesTree.Subject - var err error - *dst, err = __marshalAllIsOccurrencesTreeSubjectPackageOrSource( - &src) - if err != nil { - return nil, fmt.Errorf( - "unable to marshal NodeNodeIsOccurrence.AllIsOccurrencesTree.Subject: %w", err) - } - } - retval.Artifact = v.AllIsOccurrencesTree.Artifact - retval.Justification = v.AllIsOccurrencesTree.Justification - retval.Origin = v.AllIsOccurrencesTree.Origin - retval.Collector = v.AllIsOccurrencesTree.Collector + retval.Id = v.AllCveTree.Id + retval.Year = v.AllCveTree.Year + retval.CveId = v.AllCveTree.CveId return &retval, nil } -// NodeNodeIsVulnerability includes the requested fields of the GraphQL type IsVulnerability. +// NeighborsNeighborsCertifyBad includes the requested fields of the GraphQL type CertifyBad. // The GraphQL type's documentation follows. // -// IsVulnerability is an attestation to link CVE/GHSA with data in OSV. -type NodeNodeIsVulnerability struct { - Typename *string `json:"__typename"` - allIsVulnerability `json:"-"` +// CertifyBad is an attestation that a package, source, or artifact is considered +// bad. +// +// All evidence trees record a justification for the property they represent as +// well as the document that contains the attestation (origin) and the collector +// that collected the document (collector). +// +// The certification applies to a subject which is a package, source, or artifact. +// If the attestation targets a package, it must target a PackageName or a +// PackageVersion. If the attestation targets a source, it must target a +// SourceName. +type NeighborsNeighborsCertifyBad struct { + Typename *string `json:"__typename"` + AllCertifyBad `json:"-"` } -// GetTypename returns NodeNodeIsVulnerability.Typename, and is useful for accessing the field via an interface. -func (v *NodeNodeIsVulnerability) GetTypename() *string { return v.Typename } - -// GetId returns NodeNodeIsVulnerability.Id, and is useful for accessing the field via an interface. -func (v *NodeNodeIsVulnerability) GetId() string { return v.allIsVulnerability.Id } +// GetTypename returns NeighborsNeighborsCertifyBad.Typename, and is useful for accessing the field via an interface. +func (v *NeighborsNeighborsCertifyBad) GetTypename() *string { return v.Typename } -// GetOsv returns NodeNodeIsVulnerability.Osv, and is useful for accessing the field via an interface. -func (v *NodeNodeIsVulnerability) GetOsv() allIsVulnerabilityOsvOSV { return v.allIsVulnerability.Osv } +// GetId returns NeighborsNeighborsCertifyBad.Id, and is useful for accessing the field via an interface. +func (v *NeighborsNeighborsCertifyBad) GetId() string { return v.AllCertifyBad.Id } -// GetVulnerability returns NodeNodeIsVulnerability.Vulnerability, and is useful for accessing the field via an interface. -func (v *NodeNodeIsVulnerability) GetVulnerability() allIsVulnerabilityVulnerabilityCveOrGhsa { - return v.allIsVulnerability.Vulnerability +// GetJustification returns NeighborsNeighborsCertifyBad.Justification, and is useful for accessing the field via an interface. +func (v *NeighborsNeighborsCertifyBad) GetJustification() string { + return v.AllCertifyBad.Justification } -// GetJustification returns NodeNodeIsVulnerability.Justification, and is useful for accessing the field via an interface. -func (v *NodeNodeIsVulnerability) GetJustification() string { - return v.allIsVulnerability.Justification +// GetSubject returns NeighborsNeighborsCertifyBad.Subject, and is useful for accessing the field via an interface. +func (v *NeighborsNeighborsCertifyBad) GetSubject() AllCertifyBadSubjectPackageSourceOrArtifact { + return v.AllCertifyBad.Subject } -// GetOrigin returns NodeNodeIsVulnerability.Origin, and is useful for accessing the field via an interface. -func (v *NodeNodeIsVulnerability) GetOrigin() string { return v.allIsVulnerability.Origin } +// GetOrigin returns NeighborsNeighborsCertifyBad.Origin, and is useful for accessing the field via an interface. +func (v *NeighborsNeighborsCertifyBad) GetOrigin() string { return v.AllCertifyBad.Origin } -// GetCollector returns NodeNodeIsVulnerability.Collector, and is useful for accessing the field via an interface. -func (v *NodeNodeIsVulnerability) GetCollector() string { return v.allIsVulnerability.Collector } +// GetCollector returns NeighborsNeighborsCertifyBad.Collector, and is useful for accessing the field via an interface. +func (v *NeighborsNeighborsCertifyBad) GetCollector() string { return v.AllCertifyBad.Collector } -func (v *NodeNodeIsVulnerability) UnmarshalJSON(b []byte) error { +func (v *NeighborsNeighborsCertifyBad) UnmarshalJSON(b []byte) error { if string(b) == "null" { return nil } var firstPass struct { - *NodeNodeIsVulnerability + *NeighborsNeighborsCertifyBad graphql.NoUnmarshalJSON } - firstPass.NodeNodeIsVulnerability = v + firstPass.NeighborsNeighborsCertifyBad = v err := json.Unmarshal(b, &firstPass) if err != nil { @@ -11875,30 +11688,28 @@ func (v *NodeNodeIsVulnerability) UnmarshalJSON(b []byte) error { } err = json.Unmarshal( - b, &v.allIsVulnerability) + b, &v.AllCertifyBad) if err != nil { return err } return nil } -type __premarshalNodeNodeIsVulnerability struct { +type __premarshalNeighborsNeighborsCertifyBad struct { Typename *string `json:"__typename"` Id string `json:"id"` - Osv allIsVulnerabilityOsvOSV `json:"osv"` - - Vulnerability json.RawMessage `json:"vulnerability"` - Justification string `json:"justification"` + Subject json.RawMessage `json:"subject"` + Origin string `json:"origin"` Collector string `json:"collector"` } -func (v *NodeNodeIsVulnerability) MarshalJSON() ([]byte, error) { +func (v *NeighborsNeighborsCertifyBad) MarshalJSON() ([]byte, error) { premarshaled, err := v.__premarshalJSON() if err != nil { return nil, err @@ -11906,84 +11717,81 @@ func (v *NodeNodeIsVulnerability) MarshalJSON() ([]byte, error) { return json.Marshal(premarshaled) } -func (v *NodeNodeIsVulnerability) __premarshalJSON() (*__premarshalNodeNodeIsVulnerability, error) { - var retval __premarshalNodeNodeIsVulnerability +func (v *NeighborsNeighborsCertifyBad) __premarshalJSON() (*__premarshalNeighborsNeighborsCertifyBad, error) { + var retval __premarshalNeighborsNeighborsCertifyBad retval.Typename = v.Typename - retval.Id = v.allIsVulnerability.Id - retval.Osv = v.allIsVulnerability.Osv + retval.Id = v.AllCertifyBad.Id + retval.Justification = v.AllCertifyBad.Justification { - dst := &retval.Vulnerability - src := v.allIsVulnerability.Vulnerability + dst := &retval.Subject + src := v.AllCertifyBad.Subject var err error - *dst, err = __marshalallIsVulnerabilityVulnerabilityCveOrGhsa( + *dst, err = __marshalAllCertifyBadSubjectPackageSourceOrArtifact( &src) if err != nil { return nil, fmt.Errorf( - "unable to marshal NodeNodeIsVulnerability.allIsVulnerability.Vulnerability: %w", err) + "unable to marshal NeighborsNeighborsCertifyBad.AllCertifyBad.Subject: %w", err) } } - retval.Justification = v.allIsVulnerability.Justification - retval.Origin = v.allIsVulnerability.Origin - retval.Collector = v.allIsVulnerability.Collector - return &retval, nil -} - -// NodeNodeNoVuln includes the requested fields of the GraphQL type NoVuln. -// The GraphQL type's documentation follows. -// -// NoVuln is a special vulnerability node to attest that no vulnerability has been -// found during a vulnerability scan. -// -// Backends guarantee that this is a singleton node. -type NodeNodeNoVuln struct { - Typename *string `json:"__typename"` - Id string `json:"id"` -} - -// GetTypename returns NodeNodeNoVuln.Typename, and is useful for accessing the field via an interface. -func (v *NodeNodeNoVuln) GetTypename() *string { return v.Typename } - -// GetId returns NodeNodeNoVuln.Id, and is useful for accessing the field via an interface. -func (v *NodeNodeNoVuln) GetId() string { return v.Id } + retval.Origin = v.AllCertifyBad.Origin + retval.Collector = v.AllCertifyBad.Collector + return &retval, nil +} -// NodeNodeOSV includes the requested fields of the GraphQL type OSV. +// NeighborsNeighborsCertifyGood includes the requested fields of the GraphQL type CertifyGood. // The GraphQL type's documentation follows. // -// OSV represents an Open Source Vulnerability. -// -// The osvId field is mandatory and canonicalized to be lowercase. +// CertifyGood is an attestation that a package, source, or artifact is considered +// good. // -// This maps to a vulnerability ID specific to the environment (e.g., GHSA ID or -// CVE ID). +// All evidence trees record a justification for the property they represent as +// well as the document that contains the attestation (origin) and the collector +// that collected the document (collector). // -// This node can be referred to by other parts of GUAC. -type NodeNodeOSV struct { - Typename *string `json:"__typename"` - AllOSVTree `json:"-"` +// The certification applies to a subject which is a package, source, or artifact. +// If the attestation targets a package, it must target a PackageName or a +// PackageVersion. If the attestation targets a source, it must target a +// SourceName. +type NeighborsNeighborsCertifyGood struct { + Typename *string `json:"__typename"` + AllCertifyGood `json:"-"` } -// GetTypename returns NodeNodeOSV.Typename, and is useful for accessing the field via an interface. -func (v *NodeNodeOSV) GetTypename() *string { return v.Typename } +// GetTypename returns NeighborsNeighborsCertifyGood.Typename, and is useful for accessing the field via an interface. +func (v *NeighborsNeighborsCertifyGood) GetTypename() *string { return v.Typename } -// GetId returns NodeNodeOSV.Id, and is useful for accessing the field via an interface. -func (v *NodeNodeOSV) GetId() string { return v.AllOSVTree.Id } +// GetId returns NeighborsNeighborsCertifyGood.Id, and is useful for accessing the field via an interface. +func (v *NeighborsNeighborsCertifyGood) GetId() string { return v.AllCertifyGood.Id } -// GetOsvId returns NodeNodeOSV.OsvId, and is useful for accessing the field via an interface. -func (v *NodeNodeOSV) GetOsvId() string { return v.AllOSVTree.OsvId } +// GetJustification returns NeighborsNeighborsCertifyGood.Justification, and is useful for accessing the field via an interface. +func (v *NeighborsNeighborsCertifyGood) GetJustification() string { + return v.AllCertifyGood.Justification +} -func (v *NodeNodeOSV) UnmarshalJSON(b []byte) error { +// GetSubject returns NeighborsNeighborsCertifyGood.Subject, and is useful for accessing the field via an interface. +func (v *NeighborsNeighborsCertifyGood) GetSubject() AllCertifyGoodSubjectPackageSourceOrArtifact { + return v.AllCertifyGood.Subject +} + +// GetOrigin returns NeighborsNeighborsCertifyGood.Origin, and is useful for accessing the field via an interface. +func (v *NeighborsNeighborsCertifyGood) GetOrigin() string { return v.AllCertifyGood.Origin } + +// GetCollector returns NeighborsNeighborsCertifyGood.Collector, and is useful for accessing the field via an interface. +func (v *NeighborsNeighborsCertifyGood) GetCollector() string { return v.AllCertifyGood.Collector } + +func (v *NeighborsNeighborsCertifyGood) UnmarshalJSON(b []byte) error { if string(b) == "null" { return nil } var firstPass struct { - *NodeNodeOSV + *NeighborsNeighborsCertifyGood graphql.NoUnmarshalJSON } - firstPass.NodeNodeOSV = v + firstPass.NeighborsNeighborsCertifyGood = v err := json.Unmarshal(b, &firstPass) if err != nil { @@ -11991,22 +11799,28 @@ func (v *NodeNodeOSV) UnmarshalJSON(b []byte) error { } err = json.Unmarshal( - b, &v.AllOSVTree) + b, &v.AllCertifyGood) if err != nil { return err } return nil } -type __premarshalNodeNodeOSV struct { +type __premarshalNeighborsNeighborsCertifyGood struct { Typename *string `json:"__typename"` Id string `json:"id"` - OsvId string `json:"osvId"` + Justification string `json:"justification"` + + Subject json.RawMessage `json:"subject"` + + Origin string `json:"origin"` + + Collector string `json:"collector"` } -func (v *NodeNodeOSV) MarshalJSON() ([]byte, error) { +func (v *NeighborsNeighborsCertifyGood) MarshalJSON() ([]byte, error) { premarshaled, err := v.__premarshalJSON() if err != nil { return nil, err @@ -12014,62 +11828,66 @@ func (v *NodeNodeOSV) MarshalJSON() ([]byte, error) { return json.Marshal(premarshaled) } -func (v *NodeNodeOSV) __premarshalJSON() (*__premarshalNodeNodeOSV, error) { - var retval __premarshalNodeNodeOSV +func (v *NeighborsNeighborsCertifyGood) __premarshalJSON() (*__premarshalNeighborsNeighborsCertifyGood, error) { + var retval __premarshalNeighborsNeighborsCertifyGood retval.Typename = v.Typename - retval.Id = v.AllOSVTree.Id - retval.OsvId = v.AllOSVTree.OsvId + retval.Id = v.AllCertifyGood.Id + retval.Justification = v.AllCertifyGood.Justification + { + + dst := &retval.Subject + src := v.AllCertifyGood.Subject + var err error + *dst, err = __marshalAllCertifyGoodSubjectPackageSourceOrArtifact( + &src) + if err != nil { + return nil, fmt.Errorf( + "unable to marshal NeighborsNeighborsCertifyGood.AllCertifyGood.Subject: %w", err) + } + } + retval.Origin = v.AllCertifyGood.Origin + retval.Collector = v.AllCertifyGood.Collector return &retval, nil } -// NodeNodePackage includes the requested fields of the GraphQL type Package. +// NeighborsNeighborsCertifyScorecard includes the requested fields of the GraphQL type CertifyScorecard. // The GraphQL type's documentation follows. // -// Package represents the root of the package trie/tree. -// -// We map package information to a trie, closely matching the pURL specification -// (https://github.com/package-url/purl-spec/blob/0dd92f26f8bb11956ffdf5e8acfcee71e8560407/README.rst), -// but deviating from it where GUAC heuristics allow for better representation of -// package information. Each path in the trie fully represents a package; we split -// the trie based on the pURL components. -// -// This node matches a pkg: partial pURL. The type field matches the -// pURL types but we might also use "guac" for the cases where the pURL -// representation is not complete or when we have custom rules. -// -// Since this node is at the root of the package trie, it is named Package, not -// PackageType. -type NodeNodePackage struct { - Typename *string `json:"__typename"` - AllPkgTree `json:"-"` +// CertifyScorecard is an attestation to attach a Scorecard analysis to a +// particular source repository. +type NeighborsNeighborsCertifyScorecard struct { + Typename *string `json:"__typename"` + AllCertifyScorecard `json:"-"` } -// GetTypename returns NodeNodePackage.Typename, and is useful for accessing the field via an interface. -func (v *NodeNodePackage) GetTypename() *string { return v.Typename } +// GetTypename returns NeighborsNeighborsCertifyScorecard.Typename, and is useful for accessing the field via an interface. +func (v *NeighborsNeighborsCertifyScorecard) GetTypename() *string { return v.Typename } -// GetId returns NodeNodePackage.Id, and is useful for accessing the field via an interface. -func (v *NodeNodePackage) GetId() string { return v.AllPkgTree.Id } +// GetId returns NeighborsNeighborsCertifyScorecard.Id, and is useful for accessing the field via an interface. +func (v *NeighborsNeighborsCertifyScorecard) GetId() string { return v.AllCertifyScorecard.Id } -// GetType returns NodeNodePackage.Type, and is useful for accessing the field via an interface. -func (v *NodeNodePackage) GetType() string { return v.AllPkgTree.Type } +// GetSource returns NeighborsNeighborsCertifyScorecard.Source, and is useful for accessing the field via an interface. +func (v *NeighborsNeighborsCertifyScorecard) GetSource() AllCertifyScorecardSource { + return v.AllCertifyScorecard.Source +} -// GetNamespaces returns NodeNodePackage.Namespaces, and is useful for accessing the field via an interface. -func (v *NodeNodePackage) GetNamespaces() []AllPkgTreeNamespacesPackageNamespace { - return v.AllPkgTree.Namespaces +// GetScorecard returns NeighborsNeighborsCertifyScorecard.Scorecard, and is useful for accessing the field via an interface. +func (v *NeighborsNeighborsCertifyScorecard) GetScorecard() AllCertifyScorecardScorecard { + return v.AllCertifyScorecard.Scorecard } -func (v *NodeNodePackage) UnmarshalJSON(b []byte) error { +func (v *NeighborsNeighborsCertifyScorecard) UnmarshalJSON(b []byte) error { if string(b) == "null" { return nil } var firstPass struct { - *NodeNodePackage + *NeighborsNeighborsCertifyScorecard graphql.NoUnmarshalJSON } - firstPass.NodeNodePackage = v + firstPass.NeighborsNeighborsCertifyScorecard = v err := json.Unmarshal(b, &firstPass) if err != nil { @@ -12077,24 +11895,24 @@ func (v *NodeNodePackage) UnmarshalJSON(b []byte) error { } err = json.Unmarshal( - b, &v.AllPkgTree) + b, &v.AllCertifyScorecard) if err != nil { return err } return nil } -type __premarshalNodeNodePackage struct { +type __premarshalNeighborsNeighborsCertifyScorecard struct { Typename *string `json:"__typename"` Id string `json:"id"` - Type string `json:"type"` + Source AllCertifyScorecardSource `json:"source"` - Namespaces []AllPkgTreeNamespacesPackageNamespace `json:"namespaces"` + Scorecard AllCertifyScorecardScorecard `json:"scorecard"` } -func (v *NodeNodePackage) MarshalJSON() ([]byte, error) { +func (v *NeighborsNeighborsCertifyScorecard) MarshalJSON() ([]byte, error) { premarshaled, err := v.__premarshalJSON() if err != nil { return nil, err @@ -12102,54 +11920,88 @@ func (v *NodeNodePackage) MarshalJSON() ([]byte, error) { return json.Marshal(premarshaled) } -func (v *NodeNodePackage) __premarshalJSON() (*__premarshalNodeNodePackage, error) { - var retval __premarshalNodeNodePackage +func (v *NeighborsNeighborsCertifyScorecard) __premarshalJSON() (*__premarshalNeighborsNeighborsCertifyScorecard, error) { + var retval __premarshalNeighborsNeighborsCertifyScorecard retval.Typename = v.Typename - retval.Id = v.AllPkgTree.Id - retval.Type = v.AllPkgTree.Type - retval.Namespaces = v.AllPkgTree.Namespaces + retval.Id = v.AllCertifyScorecard.Id + retval.Source = v.AllCertifyScorecard.Source + retval.Scorecard = v.AllCertifyScorecard.Scorecard return &retval, nil } -// NodeNodePkgEqual includes the requested fields of the GraphQL type PkgEqual. +// NeighborsNeighborsCertifyVEXStatement includes the requested fields of the GraphQL type CertifyVEXStatement. // The GraphQL type's documentation follows. // -// PkgEqual is an attestation that a set of packages are similar. -type NodeNodePkgEqual struct { - Typename *string `json:"__typename"` - allPkgEqual `json:"-"` +// CertifyVEXStatement is an attestation to attach VEX statements to a package or +// artifact to clarify the impact of a specific vulnerability (CVE, GHSA or OSV). +type NeighborsNeighborsCertifyVEXStatement struct { + Typename *string `json:"__typename"` + AllCertifyVEXStatement `json:"-"` } -// GetTypename returns NodeNodePkgEqual.Typename, and is useful for accessing the field via an interface. -func (v *NodeNodePkgEqual) GetTypename() *string { return v.Typename } +// GetTypename returns NeighborsNeighborsCertifyVEXStatement.Typename, and is useful for accessing the field via an interface. +func (v *NeighborsNeighborsCertifyVEXStatement) GetTypename() *string { return v.Typename } -// GetId returns NodeNodePkgEqual.Id, and is useful for accessing the field via an interface. -func (v *NodeNodePkgEqual) GetId() string { return v.allPkgEqual.Id } +// GetId returns NeighborsNeighborsCertifyVEXStatement.Id, and is useful for accessing the field via an interface. +func (v *NeighborsNeighborsCertifyVEXStatement) GetId() string { return v.AllCertifyVEXStatement.Id } -// GetJustification returns NodeNodePkgEqual.Justification, and is useful for accessing the field via an interface. -func (v *NodeNodePkgEqual) GetJustification() string { return v.allPkgEqual.Justification } +// GetSubject returns NeighborsNeighborsCertifyVEXStatement.Subject, and is useful for accessing the field via an interface. +func (v *NeighborsNeighborsCertifyVEXStatement) GetSubject() AllCertifyVEXStatementSubjectPackageOrArtifact { + return v.AllCertifyVEXStatement.Subject +} -// GetPackages returns NodeNodePkgEqual.Packages, and is useful for accessing the field via an interface. -func (v *NodeNodePkgEqual) GetPackages() []allPkgEqualPackagesPackage { return v.allPkgEqual.Packages } +// GetVulnerability returns NeighborsNeighborsCertifyVEXStatement.Vulnerability, and is useful for accessing the field via an interface. +func (v *NeighborsNeighborsCertifyVEXStatement) GetVulnerability() AllCertifyVEXStatementVulnerability { + return v.AllCertifyVEXStatement.Vulnerability +} -// GetOrigin returns NodeNodePkgEqual.Origin, and is useful for accessing the field via an interface. -func (v *NodeNodePkgEqual) GetOrigin() string { return v.allPkgEqual.Origin } +// GetStatus returns NeighborsNeighborsCertifyVEXStatement.Status, and is useful for accessing the field via an interface. +func (v *NeighborsNeighborsCertifyVEXStatement) GetStatus() VexStatus { + return v.AllCertifyVEXStatement.Status +} -// GetCollector returns NodeNodePkgEqual.Collector, and is useful for accessing the field via an interface. -func (v *NodeNodePkgEqual) GetCollector() string { return v.allPkgEqual.Collector } +// GetVexJustification returns NeighborsNeighborsCertifyVEXStatement.VexJustification, and is useful for accessing the field via an interface. +func (v *NeighborsNeighborsCertifyVEXStatement) GetVexJustification() VexJustification { + return v.AllCertifyVEXStatement.VexJustification +} -func (v *NodeNodePkgEqual) UnmarshalJSON(b []byte) error { +// GetStatement returns NeighborsNeighborsCertifyVEXStatement.Statement, and is useful for accessing the field via an interface. +func (v *NeighborsNeighborsCertifyVEXStatement) GetStatement() string { + return v.AllCertifyVEXStatement.Statement +} + +// GetStatusNotes returns NeighborsNeighborsCertifyVEXStatement.StatusNotes, and is useful for accessing the field via an interface. +func (v *NeighborsNeighborsCertifyVEXStatement) GetStatusNotes() string { + return v.AllCertifyVEXStatement.StatusNotes +} + +// GetKnownSince returns NeighborsNeighborsCertifyVEXStatement.KnownSince, and is useful for accessing the field via an interface. +func (v *NeighborsNeighborsCertifyVEXStatement) GetKnownSince() time.Time { + return v.AllCertifyVEXStatement.KnownSince +} + +// GetOrigin returns NeighborsNeighborsCertifyVEXStatement.Origin, and is useful for accessing the field via an interface. +func (v *NeighborsNeighborsCertifyVEXStatement) GetOrigin() string { + return v.AllCertifyVEXStatement.Origin +} + +// GetCollector returns NeighborsNeighborsCertifyVEXStatement.Collector, and is useful for accessing the field via an interface. +func (v *NeighborsNeighborsCertifyVEXStatement) GetCollector() string { + return v.AllCertifyVEXStatement.Collector +} + +func (v *NeighborsNeighborsCertifyVEXStatement) UnmarshalJSON(b []byte) error { if string(b) == "null" { return nil } var firstPass struct { - *NodeNodePkgEqual + *NeighborsNeighborsCertifyVEXStatement graphql.NoUnmarshalJSON } - firstPass.NodeNodePkgEqual = v + firstPass.NeighborsNeighborsCertifyVEXStatement = v err := json.Unmarshal(b, &firstPass) if err != nil { @@ -12157,28 +12009,38 @@ func (v *NodeNodePkgEqual) UnmarshalJSON(b []byte) error { } err = json.Unmarshal( - b, &v.allPkgEqual) + b, &v.AllCertifyVEXStatement) if err != nil { return err } return nil } -type __premarshalNodeNodePkgEqual struct { +type __premarshalNeighborsNeighborsCertifyVEXStatement struct { Typename *string `json:"__typename"` Id string `json:"id"` - Justification string `json:"justification"` + Subject json.RawMessage `json:"subject"` - Packages []allPkgEqualPackagesPackage `json:"packages"` + Vulnerability json.RawMessage `json:"vulnerability"` + + Status VexStatus `json:"status"` + + VexJustification VexJustification `json:"vexJustification"` + + Statement string `json:"statement"` + + StatusNotes string `json:"statusNotes"` + + KnownSince time.Time `json:"knownSince"` Origin string `json:"origin"` Collector string `json:"collector"` } -func (v *NodeNodePkgEqual) MarshalJSON() ([]byte, error) { +func (v *NeighborsNeighborsCertifyVEXStatement) MarshalJSON() ([]byte, error) { premarshaled, err := v.__premarshalJSON() if err != nil { return nil, err @@ -12186,93 +12048,89 @@ func (v *NodeNodePkgEqual) MarshalJSON() ([]byte, error) { return json.Marshal(premarshaled) } -func (v *NodeNodePkgEqual) __premarshalJSON() (*__premarshalNodeNodePkgEqual, error) { - var retval __premarshalNodeNodePkgEqual - - retval.Typename = v.Typename - retval.Id = v.allPkgEqual.Id - retval.Justification = v.allPkgEqual.Justification - retval.Packages = v.allPkgEqual.Packages - retval.Origin = v.allPkgEqual.Origin - retval.Collector = v.allPkgEqual.Collector - return &retval, nil -} +func (v *NeighborsNeighborsCertifyVEXStatement) __premarshalJSON() (*__premarshalNeighborsNeighborsCertifyVEXStatement, error) { + var retval __premarshalNeighborsNeighborsCertifyVEXStatement -// NodeNodePointOfContact includes the requested fields of the GraphQL type PointOfContact. -// The GraphQL type's documentation follows. -// -// PointOfContact is an attestation of how to get in touch with the person(s) responsible -// for a package, source, or artifact. -// -// All evidence trees record a justification for the property they represent as -// well as the document that contains the attestation (origin) and the collector -// that collected the document (collector). -// -// The attestation applies to a subject which is a package, source, or artifact. -// If the attestation targets a package, it must target a PackageName or a -// PackageVersion. If the attestation targets a source, it must target a -// SourceName. -// -// email is the email address (singular) of the point of contact. -// -// info is additional contact information other than email address. This is free -// form. -// -// NOTE: the identifiers for point of contact should be part of software trees. -// This will benefit from identifier look up and traversal as well as organization -// hierarchy. However, until the use case arises, PointOfContact will be a flat -// reference to the contact details. -type NodeNodePointOfContact struct { - Typename *string `json:"__typename"` -} + retval.Typename = v.Typename + retval.Id = v.AllCertifyVEXStatement.Id + { -// GetTypename returns NodeNodePointOfContact.Typename, and is useful for accessing the field via an interface. -func (v *NodeNodePointOfContact) GetTypename() *string { return v.Typename } + dst := &retval.Subject + src := v.AllCertifyVEXStatement.Subject + var err error + *dst, err = __marshalAllCertifyVEXStatementSubjectPackageOrArtifact( + &src) + if err != nil { + return nil, fmt.Errorf( + "unable to marshal NeighborsNeighborsCertifyVEXStatement.AllCertifyVEXStatement.Subject: %w", err) + } + } + { -// NodeNodeSource includes the requested fields of the GraphQL type Source. + dst := &retval.Vulnerability + src := v.AllCertifyVEXStatement.Vulnerability + var err error + *dst, err = __marshalAllCertifyVEXStatementVulnerability( + &src) + if err != nil { + return nil, fmt.Errorf( + "unable to marshal NeighborsNeighborsCertifyVEXStatement.AllCertifyVEXStatement.Vulnerability: %w", err) + } + } + retval.Status = v.AllCertifyVEXStatement.Status + retval.VexJustification = v.AllCertifyVEXStatement.VexJustification + retval.Statement = v.AllCertifyVEXStatement.Statement + retval.StatusNotes = v.AllCertifyVEXStatement.StatusNotes + retval.KnownSince = v.AllCertifyVEXStatement.KnownSince + retval.Origin = v.AllCertifyVEXStatement.Origin + retval.Collector = v.AllCertifyVEXStatement.Collector + return &retval, nil +} + +// NeighborsNeighborsCertifyVuln includes the requested fields of the GraphQL type CertifyVuln. // The GraphQL type's documentation follows. // -// Source represents the root of the source trie/tree. -// -// We map source information to a trie, as a derivative of the pURL specification: -// each path in the trie represents a type, namespace, name and an optional -// qualifier that stands for tag/commit information. -// -// This node represents the type part of the trie path. It is used to represent -// the version control system that is being used. +// CertifyVuln is an attestation to attach vulnerability information to a package. // -// Since this node is at the root of the source trie, it is named Source, not -// SourceType. -type NodeNodeSource struct { - Typename *string `json:"__typename"` - AllSourceTree `json:"-"` +// This information is obtained via a scanner. If there is no vulnerability +// detected (no OSV, CVE, or GHSA), we attach the special NoVuln node. +type NeighborsNeighborsCertifyVuln struct { + Typename *string `json:"__typename"` + AllCertifyVuln `json:"-"` } -// GetTypename returns NodeNodeSource.Typename, and is useful for accessing the field via an interface. -func (v *NodeNodeSource) GetTypename() *string { return v.Typename } +// GetTypename returns NeighborsNeighborsCertifyVuln.Typename, and is useful for accessing the field via an interface. +func (v *NeighborsNeighborsCertifyVuln) GetTypename() *string { return v.Typename } -// GetId returns NodeNodeSource.Id, and is useful for accessing the field via an interface. -func (v *NodeNodeSource) GetId() string { return v.AllSourceTree.Id } +// GetId returns NeighborsNeighborsCertifyVuln.Id, and is useful for accessing the field via an interface. +func (v *NeighborsNeighborsCertifyVuln) GetId() string { return v.AllCertifyVuln.Id } -// GetType returns NodeNodeSource.Type, and is useful for accessing the field via an interface. -func (v *NodeNodeSource) GetType() string { return v.AllSourceTree.Type } +// GetPackage returns NeighborsNeighborsCertifyVuln.Package, and is useful for accessing the field via an interface. +func (v *NeighborsNeighborsCertifyVuln) GetPackage() AllCertifyVulnPackage { + return v.AllCertifyVuln.Package +} -// GetNamespaces returns NodeNodeSource.Namespaces, and is useful for accessing the field via an interface. -func (v *NodeNodeSource) GetNamespaces() []AllSourceTreeNamespacesSourceNamespace { - return v.AllSourceTree.Namespaces +// GetVulnerability returns NeighborsNeighborsCertifyVuln.Vulnerability, and is useful for accessing the field via an interface. +func (v *NeighborsNeighborsCertifyVuln) GetVulnerability() AllCertifyVulnVulnerability { + return v.AllCertifyVuln.Vulnerability } -func (v *NodeNodeSource) UnmarshalJSON(b []byte) error { +// GetMetadata returns NeighborsNeighborsCertifyVuln.Metadata, and is useful for accessing the field via an interface. +func (v *NeighborsNeighborsCertifyVuln) GetMetadata() AllCertifyVulnMetadataVulnerabilityMetaData { + return v.AllCertifyVuln.Metadata +} + +func (v *NeighborsNeighborsCertifyVuln) UnmarshalJSON(b []byte) error { if string(b) == "null" { return nil } var firstPass struct { - *NodeNodeSource + *NeighborsNeighborsCertifyVuln graphql.NoUnmarshalJSON } - firstPass.NodeNodeSource = v + firstPass.NeighborsNeighborsCertifyVuln = v err := json.Unmarshal(b, &firstPass) if err != nil { @@ -12280,24 +12138,26 @@ func (v *NodeNodeSource) UnmarshalJSON(b []byte) error { } err = json.Unmarshal( - b, &v.AllSourceTree) + b, &v.AllCertifyVuln) if err != nil { return err } return nil } -type __premarshalNodeNodeSource struct { +type __premarshalNeighborsNeighborsCertifyVuln struct { Typename *string `json:"__typename"` Id string `json:"id"` - Type string `json:"type"` + Package AllCertifyVulnPackage `json:"package"` - Namespaces []AllSourceTreeNamespacesSourceNamespace `json:"namespaces"` + Vulnerability json.RawMessage `json:"vulnerability"` + + Metadata AllCertifyVulnMetadataVulnerabilityMetaData `json:"metadata"` } -func (v *NodeNodeSource) MarshalJSON() ([]byte, error) { +func (v *NeighborsNeighborsCertifyVuln) MarshalJSON() ([]byte, error) { premarshaled, err := v.__premarshalJSON() if err != nil { return nil, err @@ -12305,65 +12165,84 @@ func (v *NodeNodeSource) MarshalJSON() ([]byte, error) { return json.Marshal(premarshaled) } -func (v *NodeNodeSource) __premarshalJSON() (*__premarshalNodeNodeSource, error) { - var retval __premarshalNodeNodeSource +func (v *NeighborsNeighborsCertifyVuln) __premarshalJSON() (*__premarshalNeighborsNeighborsCertifyVuln, error) { + var retval __premarshalNeighborsNeighborsCertifyVuln retval.Typename = v.Typename - retval.Id = v.AllSourceTree.Id - retval.Type = v.AllSourceTree.Type - retval.Namespaces = v.AllSourceTree.Namespaces + retval.Id = v.AllCertifyVuln.Id + retval.Package = v.AllCertifyVuln.Package + { + + dst := &retval.Vulnerability + src := v.AllCertifyVuln.Vulnerability + var err error + *dst, err = __marshalAllCertifyVulnVulnerability( + &src) + if err != nil { + return nil, fmt.Errorf( + "unable to marshal NeighborsNeighborsCertifyVuln.AllCertifyVuln.Vulnerability: %w", err) + } + } + retval.Metadata = v.AllCertifyVuln.Metadata return &retval, nil } -// NodeResponse is returned by Node on success. -type NodeResponse struct { - // node returns a single node, regardless of type. - // - // The input is only specified by its ID. - Node NodeNode `json:"-"` +// NeighborsNeighborsGHSA includes the requested fields of the GraphQL type GHSA. +// The GraphQL type's documentation follows. +// +// GHSA represents GitHub security advisories. +// +// The advisory id field is mandatory and canonicalized to be lowercase. +// +// This node can be referred to by other parts of GUAC. +type NeighborsNeighborsGHSA struct { + Typename *string `json:"__typename"` + AllGHSATree `json:"-"` } -// GetNode returns NodeResponse.Node, and is useful for accessing the field via an interface. -func (v *NodeResponse) GetNode() NodeNode { return v.Node } +// GetTypename returns NeighborsNeighborsGHSA.Typename, and is useful for accessing the field via an interface. +func (v *NeighborsNeighborsGHSA) GetTypename() *string { return v.Typename } -func (v *NodeResponse) UnmarshalJSON(b []byte) error { +// GetId returns NeighborsNeighborsGHSA.Id, and is useful for accessing the field via an interface. +func (v *NeighborsNeighborsGHSA) GetId() string { return v.AllGHSATree.Id } + +// GetGhsaId returns NeighborsNeighborsGHSA.GhsaId, and is useful for accessing the field via an interface. +func (v *NeighborsNeighborsGHSA) GetGhsaId() string { return v.AllGHSATree.GhsaId } + +func (v *NeighborsNeighborsGHSA) UnmarshalJSON(b []byte) error { if string(b) == "null" { return nil } var firstPass struct { - *NodeResponse - Node json.RawMessage `json:"node"` + *NeighborsNeighborsGHSA graphql.NoUnmarshalJSON } - firstPass.NodeResponse = v + firstPass.NeighborsNeighborsGHSA = v err := json.Unmarshal(b, &firstPass) if err != nil { return err } - { - dst := &v.Node - src := firstPass.Node - if len(src) != 0 && string(src) != "null" { - err = __unmarshalNodeNode( - src, dst) - if err != nil { - return fmt.Errorf( - "unable to unmarshal NodeResponse.Node: %w", err) - } - } + err = json.Unmarshal( + b, &v.AllGHSATree) + if err != nil { + return err } return nil } -type __premarshalNodeResponse struct { - Node json.RawMessage `json:"node"` +type __premarshalNeighborsNeighborsGHSA struct { + Typename *string `json:"__typename"` + + Id string `json:"id"` + + GhsaId string `json:"ghsaId"` } -func (v *NodeResponse) MarshalJSON() ([]byte, error) { +func (v *NeighborsNeighborsGHSA) MarshalJSON() ([]byte, error) { premarshaled, err := v.__premarshalJSON() if err != nil { return nil, err @@ -12371,62 +12250,87 @@ func (v *NodeResponse) MarshalJSON() ([]byte, error) { return json.Marshal(premarshaled) } -func (v *NodeResponse) __premarshalJSON() (*__premarshalNodeResponse, error) { - var retval __premarshalNodeResponse - - { +func (v *NeighborsNeighborsGHSA) __premarshalJSON() (*__premarshalNeighborsNeighborsGHSA, error) { + var retval __premarshalNeighborsNeighborsGHSA - dst := &retval.Node - src := v.Node - var err error - *dst, err = __marshalNodeNode( - &src) - if err != nil { - return nil, fmt.Errorf( - "unable to marshal NodeResponse.Node: %w", err) - } - } + retval.Typename = v.Typename + retval.Id = v.AllGHSATree.Id + retval.GhsaId = v.AllGHSATree.GhsaId return &retval, nil } -// NodesNodesArtifact includes the requested fields of the GraphQL type Artifact. +// NeighborsNeighborsHasMetadata includes the requested fields of the GraphQL type HasMetadata. // The GraphQL type's documentation follows. // -// Artifact represents an artifact identified by a checksum hash. +// HasMetadata is an attestation that a package, source, or artifact has a certain +// attested property (key) with value (value). For example, a source may have +// metadata "SourceRepo2FAEnabled=true". // -// The checksum is split into the digest value and the algorithm used to generate -// it. Both fields are mandatory and canonicalized to be lowercase. +// The intent of this evidence tree predicate is to allow extensibility of metadata +// expressible within the GUAC ontology. Metadata that is commonly used will then +// be promoted to a predicate on its own. // -// If having a checksum Go object, algorithm can be -// strings.ToLower(string(checksum.Algorithm)) and digest can be checksum.Value. -type NodesNodesArtifact struct { - Typename *string `json:"__typename"` - AllArtifactTree `json:"-"` +// Justification indicates how the metadata was determined. +// +// The metadata applies to a subject which is a package, source, or artifact. +// If the attestation targets a package, it must target a PackageName or a +// PackageVersion. If the attestation targets a source, it must target a +// SourceName. +type NeighborsNeighborsHasMetadata struct { + Typename *string `json:"__typename"` } -// GetTypename returns NodesNodesArtifact.Typename, and is useful for accessing the field via an interface. -func (v *NodesNodesArtifact) GetTypename() *string { return v.Typename } +// GetTypename returns NeighborsNeighborsHasMetadata.Typename, and is useful for accessing the field via an interface. +func (v *NeighborsNeighborsHasMetadata) GetTypename() *string { return v.Typename } -// GetId returns NodesNodesArtifact.Id, and is useful for accessing the field via an interface. -func (v *NodesNodesArtifact) GetId() string { return v.AllArtifactTree.Id } +// NeighborsNeighborsHasSBOM includes the requested fields of the GraphQL type HasSBOM. +type NeighborsNeighborsHasSBOM struct { + Typename *string `json:"__typename"` + AllHasSBOMTree `json:"-"` +} -// GetAlgorithm returns NodesNodesArtifact.Algorithm, and is useful for accessing the field via an interface. -func (v *NodesNodesArtifact) GetAlgorithm() string { return v.AllArtifactTree.Algorithm } +// GetTypename returns NeighborsNeighborsHasSBOM.Typename, and is useful for accessing the field via an interface. +func (v *NeighborsNeighborsHasSBOM) GetTypename() *string { return v.Typename } -// GetDigest returns NodesNodesArtifact.Digest, and is useful for accessing the field via an interface. -func (v *NodesNodesArtifact) GetDigest() string { return v.AllArtifactTree.Digest } +// GetId returns NeighborsNeighborsHasSBOM.Id, and is useful for accessing the field via an interface. +func (v *NeighborsNeighborsHasSBOM) GetId() string { return v.AllHasSBOMTree.Id } -func (v *NodesNodesArtifact) UnmarshalJSON(b []byte) error { +// GetSubject returns NeighborsNeighborsHasSBOM.Subject, and is useful for accessing the field via an interface. +func (v *NeighborsNeighborsHasSBOM) GetSubject() AllHasSBOMTreeSubjectPackageOrArtifact { + return v.AllHasSBOMTree.Subject +} + +// GetUri returns NeighborsNeighborsHasSBOM.Uri, and is useful for accessing the field via an interface. +func (v *NeighborsNeighborsHasSBOM) GetUri() string { return v.AllHasSBOMTree.Uri } + +// GetAlgorithm returns NeighborsNeighborsHasSBOM.Algorithm, and is useful for accessing the field via an interface. +func (v *NeighborsNeighborsHasSBOM) GetAlgorithm() string { return v.AllHasSBOMTree.Algorithm } + +// GetDigest returns NeighborsNeighborsHasSBOM.Digest, and is useful for accessing the field via an interface. +func (v *NeighborsNeighborsHasSBOM) GetDigest() string { return v.AllHasSBOMTree.Digest } + +// GetDownloadLocation returns NeighborsNeighborsHasSBOM.DownloadLocation, and is useful for accessing the field via an interface. +func (v *NeighborsNeighborsHasSBOM) GetDownloadLocation() string { + return v.AllHasSBOMTree.DownloadLocation +} + +// GetOrigin returns NeighborsNeighborsHasSBOM.Origin, and is useful for accessing the field via an interface. +func (v *NeighborsNeighborsHasSBOM) GetOrigin() string { return v.AllHasSBOMTree.Origin } + +// GetCollector returns NeighborsNeighborsHasSBOM.Collector, and is useful for accessing the field via an interface. +func (v *NeighborsNeighborsHasSBOM) GetCollector() string { return v.AllHasSBOMTree.Collector } + +func (v *NeighborsNeighborsHasSBOM) UnmarshalJSON(b []byte) error { if string(b) == "null" { return nil } var firstPass struct { - *NodesNodesArtifact + *NeighborsNeighborsHasSBOM graphql.NoUnmarshalJSON } - firstPass.NodesNodesArtifact = v + firstPass.NeighborsNeighborsHasSBOM = v err := json.Unmarshal(b, &firstPass) if err != nil { @@ -12434,24 +12338,34 @@ func (v *NodesNodesArtifact) UnmarshalJSON(b []byte) error { } err = json.Unmarshal( - b, &v.AllArtifactTree) + b, &v.AllHasSBOMTree) if err != nil { return err } return nil } -type __premarshalNodesNodesArtifact struct { +type __premarshalNeighborsNeighborsHasSBOM struct { Typename *string `json:"__typename"` - Id string `json:"id"` + Id string `json:"id"` + + Subject json.RawMessage `json:"subject"` + + Uri string `json:"uri"` Algorithm string `json:"algorithm"` Digest string `json:"digest"` + + DownloadLocation string `json:"downloadLocation"` + + Origin string `json:"origin"` + + Collector string `json:"collector"` } -func (v *NodesNodesArtifact) MarshalJSON() ([]byte, error) { +func (v *NeighborsNeighborsHasSBOM) MarshalJSON() ([]byte, error) { premarshaled, err := v.__premarshalJSON() if err != nil { return nil, err @@ -12459,47 +12373,66 @@ func (v *NodesNodesArtifact) MarshalJSON() ([]byte, error) { return json.Marshal(premarshaled) } -func (v *NodesNodesArtifact) __premarshalJSON() (*__premarshalNodesNodesArtifact, error) { - var retval __premarshalNodesNodesArtifact +func (v *NeighborsNeighborsHasSBOM) __premarshalJSON() (*__premarshalNeighborsNeighborsHasSBOM, error) { + var retval __premarshalNeighborsNeighborsHasSBOM retval.Typename = v.Typename - retval.Id = v.AllArtifactTree.Id - retval.Algorithm = v.AllArtifactTree.Algorithm - retval.Digest = v.AllArtifactTree.Digest + retval.Id = v.AllHasSBOMTree.Id + { + + dst := &retval.Subject + src := v.AllHasSBOMTree.Subject + var err error + *dst, err = __marshalAllHasSBOMTreeSubjectPackageOrArtifact( + &src) + if err != nil { + return nil, fmt.Errorf( + "unable to marshal NeighborsNeighborsHasSBOM.AllHasSBOMTree.Subject: %w", err) + } + } + retval.Uri = v.AllHasSBOMTree.Uri + retval.Algorithm = v.AllHasSBOMTree.Algorithm + retval.Digest = v.AllHasSBOMTree.Digest + retval.DownloadLocation = v.AllHasSBOMTree.DownloadLocation + retval.Origin = v.AllHasSBOMTree.Origin + retval.Collector = v.AllHasSBOMTree.Collector return &retval, nil } -// NodesNodesBuilder includes the requested fields of the GraphQL type Builder. +// NeighborsNeighborsHasSLSA includes the requested fields of the GraphQL type HasSLSA. // The GraphQL type's documentation follows. // -// Builder represents the builder (e.g., FRSCA or GitHub Actions). -// -// Currently builders are identified by the uri field. -type NodesNodesBuilder struct { - Typename *string `json:"__typename"` - allBuilderTree `json:"-"` +// HasSLSA records that a subject node has a SLSA attestation. +type NeighborsNeighborsHasSLSA struct { + Typename *string `json:"__typename"` + AllSLSATree `json:"-"` } -// GetTypename returns NodesNodesBuilder.Typename, and is useful for accessing the field via an interface. -func (v *NodesNodesBuilder) GetTypename() *string { return v.Typename } +// GetTypename returns NeighborsNeighborsHasSLSA.Typename, and is useful for accessing the field via an interface. +func (v *NeighborsNeighborsHasSLSA) GetTypename() *string { return v.Typename } -// GetId returns NodesNodesBuilder.Id, and is useful for accessing the field via an interface. -func (v *NodesNodesBuilder) GetId() string { return v.allBuilderTree.Id } +// GetId returns NeighborsNeighborsHasSLSA.Id, and is useful for accessing the field via an interface. +func (v *NeighborsNeighborsHasSLSA) GetId() string { return v.AllSLSATree.Id } -// GetUri returns NodesNodesBuilder.Uri, and is useful for accessing the field via an interface. -func (v *NodesNodesBuilder) GetUri() string { return v.allBuilderTree.Uri } +// GetSubject returns NeighborsNeighborsHasSLSA.Subject, and is useful for accessing the field via an interface. +func (v *NeighborsNeighborsHasSLSA) GetSubject() AllSLSATreeSubjectArtifact { + return v.AllSLSATree.Subject +} -func (v *NodesNodesBuilder) UnmarshalJSON(b []byte) error { +// GetSlsa returns NeighborsNeighborsHasSLSA.Slsa, and is useful for accessing the field via an interface. +func (v *NeighborsNeighborsHasSLSA) GetSlsa() AllSLSATreeSlsaSLSA { return v.AllSLSATree.Slsa } + +func (v *NeighborsNeighborsHasSLSA) UnmarshalJSON(b []byte) error { if string(b) == "null" { return nil } var firstPass struct { - *NodesNodesBuilder + *NeighborsNeighborsHasSLSA graphql.NoUnmarshalJSON } - firstPass.NodesNodesBuilder = v + firstPass.NeighborsNeighborsHasSLSA = v err := json.Unmarshal(b, &firstPass) if err != nil { @@ -12507,22 +12440,24 @@ func (v *NodesNodesBuilder) UnmarshalJSON(b []byte) error { } err = json.Unmarshal( - b, &v.allBuilderTree) + b, &v.AllSLSATree) if err != nil { return err } return nil } -type __premarshalNodesNodesBuilder struct { +type __premarshalNeighborsNeighborsHasSLSA struct { Typename *string `json:"__typename"` Id string `json:"id"` - Uri string `json:"uri"` + Subject AllSLSATreeSubjectArtifact `json:"subject"` + + Slsa AllSLSATreeSlsaSLSA `json:"slsa"` } -func (v *NodesNodesBuilder) MarshalJSON() ([]byte, error) { +func (v *NeighborsNeighborsHasSLSA) MarshalJSON() ([]byte, error) { premarshaled, err := v.__premarshalJSON() if err != nil { return nil, err @@ -12530,56 +12465,66 @@ func (v *NodesNodesBuilder) MarshalJSON() ([]byte, error) { return json.Marshal(premarshaled) } -func (v *NodesNodesBuilder) __premarshalJSON() (*__premarshalNodesNodesBuilder, error) { - var retval __premarshalNodesNodesBuilder +func (v *NeighborsNeighborsHasSLSA) __premarshalJSON() (*__premarshalNeighborsNeighborsHasSLSA, error) { + var retval __premarshalNeighborsNeighborsHasSLSA retval.Typename = v.Typename - retval.Id = v.allBuilderTree.Id - retval.Uri = v.allBuilderTree.Uri + retval.Id = v.AllSLSATree.Id + retval.Subject = v.AllSLSATree.Subject + retval.Slsa = v.AllSLSATree.Slsa return &retval, nil } -// NodesNodesCVE includes the requested fields of the GraphQL type CVE. +// NeighborsNeighborsHasSourceAt includes the requested fields of the GraphQL type HasSourceAt. // The GraphQL type's documentation follows. // -// CVE represents a vulnerability in the Common Vulnerabilities and Exposures -// schema. -// -// The vulnerability identifier contains a year field, so we are extracting that -// to allow matching for vulnerabilities found in a given year. -// -// The vulnerability identifier field is mandatory and canonicalized to be -// lowercase. -// -// This node can be referred to by other parts of GUAC. -type NodesNodesCVE struct { - Typename *string `json:"__typename"` - AllCveTree `json:"-"` +// HasSourceAt records that a package's repository is a given source. +type NeighborsNeighborsHasSourceAt struct { + Typename *string `json:"__typename"` + AllHasSourceAt `json:"-"` } -// GetTypename returns NodesNodesCVE.Typename, and is useful for accessing the field via an interface. -func (v *NodesNodesCVE) GetTypename() *string { return v.Typename } +// GetTypename returns NeighborsNeighborsHasSourceAt.Typename, and is useful for accessing the field via an interface. +func (v *NeighborsNeighborsHasSourceAt) GetTypename() *string { return v.Typename } -// GetId returns NodesNodesCVE.Id, and is useful for accessing the field via an interface. -func (v *NodesNodesCVE) GetId() string { return v.AllCveTree.Id } +// GetId returns NeighborsNeighborsHasSourceAt.Id, and is useful for accessing the field via an interface. +func (v *NeighborsNeighborsHasSourceAt) GetId() string { return v.AllHasSourceAt.Id } -// GetYear returns NodesNodesCVE.Year, and is useful for accessing the field via an interface. -func (v *NodesNodesCVE) GetYear() int { return v.AllCveTree.Year } +// GetJustification returns NeighborsNeighborsHasSourceAt.Justification, and is useful for accessing the field via an interface. +func (v *NeighborsNeighborsHasSourceAt) GetJustification() string { + return v.AllHasSourceAt.Justification +} -// GetCveId returns NodesNodesCVE.CveId, and is useful for accessing the field via an interface. -func (v *NodesNodesCVE) GetCveId() string { return v.AllCveTree.CveId } +// GetKnownSince returns NeighborsNeighborsHasSourceAt.KnownSince, and is useful for accessing the field via an interface. +func (v *NeighborsNeighborsHasSourceAt) GetKnownSince() time.Time { return v.AllHasSourceAt.KnownSince } -func (v *NodesNodesCVE) UnmarshalJSON(b []byte) error { +// GetPackage returns NeighborsNeighborsHasSourceAt.Package, and is useful for accessing the field via an interface. +func (v *NeighborsNeighborsHasSourceAt) GetPackage() AllHasSourceAtPackage { + return v.AllHasSourceAt.Package +} + +// GetSource returns NeighborsNeighborsHasSourceAt.Source, and is useful for accessing the field via an interface. +func (v *NeighborsNeighborsHasSourceAt) GetSource() AllHasSourceAtSource { + return v.AllHasSourceAt.Source +} + +// GetOrigin returns NeighborsNeighborsHasSourceAt.Origin, and is useful for accessing the field via an interface. +func (v *NeighborsNeighborsHasSourceAt) GetOrigin() string { return v.AllHasSourceAt.Origin } + +// GetCollector returns NeighborsNeighborsHasSourceAt.Collector, and is useful for accessing the field via an interface. +func (v *NeighborsNeighborsHasSourceAt) GetCollector() string { return v.AllHasSourceAt.Collector } + +func (v *NeighborsNeighborsHasSourceAt) UnmarshalJSON(b []byte) error { if string(b) == "null" { return nil } var firstPass struct { - *NodesNodesCVE + *NeighborsNeighborsHasSourceAt graphql.NoUnmarshalJSON } - firstPass.NodesNodesCVE = v + firstPass.NeighborsNeighborsHasSourceAt = v err := json.Unmarshal(b, &firstPass) if err != nil { @@ -12587,24 +12532,32 @@ func (v *NodesNodesCVE) UnmarshalJSON(b []byte) error { } err = json.Unmarshal( - b, &v.AllCveTree) + b, &v.AllHasSourceAt) if err != nil { return err } return nil } -type __premarshalNodesNodesCVE struct { +type __premarshalNeighborsNeighborsHasSourceAt struct { Typename *string `json:"__typename"` Id string `json:"id"` - Year int `json:"year"` + Justification string `json:"justification"` - CveId string `json:"cveId"` + KnownSince time.Time `json:"knownSince"` + + Package AllHasSourceAtPackage `json:"package"` + + Source AllHasSourceAtSource `json:"source"` + + Origin string `json:"origin"` + + Collector string `json:"collector"` } -func (v *NodesNodesCVE) MarshalJSON() ([]byte, error) { +func (v *NeighborsNeighborsHasSourceAt) MarshalJSON() ([]byte, error) { premarshaled, err := v.__premarshalJSON() if err != nil { return nil, err @@ -12612,66 +12565,62 @@ func (v *NodesNodesCVE) MarshalJSON() ([]byte, error) { return json.Marshal(premarshaled) } -func (v *NodesNodesCVE) __premarshalJSON() (*__premarshalNodesNodesCVE, error) { - var retval __premarshalNodesNodesCVE +func (v *NeighborsNeighborsHasSourceAt) __premarshalJSON() (*__premarshalNeighborsNeighborsHasSourceAt, error) { + var retval __premarshalNeighborsNeighborsHasSourceAt retval.Typename = v.Typename - retval.Id = v.AllCveTree.Id - retval.Year = v.AllCveTree.Year - retval.CveId = v.AllCveTree.CveId + retval.Id = v.AllHasSourceAt.Id + retval.Justification = v.AllHasSourceAt.Justification + retval.KnownSince = v.AllHasSourceAt.KnownSince + retval.Package = v.AllHasSourceAt.Package + retval.Source = v.AllHasSourceAt.Source + retval.Origin = v.AllHasSourceAt.Origin + retval.Collector = v.AllHasSourceAt.Collector return &retval, nil } -// NodesNodesCertifyBad includes the requested fields of the GraphQL type CertifyBad. +// NeighborsNeighborsHashEqual includes the requested fields of the GraphQL type HashEqual. // The GraphQL type's documentation follows. // -// CertifyBad is an attestation that a package, source, or artifact is considered -// bad. -// -// All evidence trees record a justification for the property they represent as -// well as the document that contains the attestation (origin) and the collector -// that collected the document (collector). -// -// The certification applies to a subject which is a package, source, or artifact. -// If the attestation targets a package, it must target a PackageName or a -// PackageVersion. If the attestation targets a source, it must target a -// SourceName. -type NodesNodesCertifyBad struct { - Typename *string `json:"__typename"` - AllCertifyBad `json:"-"` +// HashEqual is an attestation that a set of artifacts are identical. +type NeighborsNeighborsHashEqual struct { + Typename *string `json:"__typename"` + AllHashEqualTree `json:"-"` } -// GetTypename returns NodesNodesCertifyBad.Typename, and is useful for accessing the field via an interface. -func (v *NodesNodesCertifyBad) GetTypename() *string { return v.Typename } +// GetTypename returns NeighborsNeighborsHashEqual.Typename, and is useful for accessing the field via an interface. +func (v *NeighborsNeighborsHashEqual) GetTypename() *string { return v.Typename } -// GetId returns NodesNodesCertifyBad.Id, and is useful for accessing the field via an interface. -func (v *NodesNodesCertifyBad) GetId() string { return v.AllCertifyBad.Id } +// GetId returns NeighborsNeighborsHashEqual.Id, and is useful for accessing the field via an interface. +func (v *NeighborsNeighborsHashEqual) GetId() string { return v.AllHashEqualTree.Id } -// GetJustification returns NodesNodesCertifyBad.Justification, and is useful for accessing the field via an interface. -func (v *NodesNodesCertifyBad) GetJustification() string { return v.AllCertifyBad.Justification } +// GetJustification returns NeighborsNeighborsHashEqual.Justification, and is useful for accessing the field via an interface. +func (v *NeighborsNeighborsHashEqual) GetJustification() string { + return v.AllHashEqualTree.Justification +} -// GetSubject returns NodesNodesCertifyBad.Subject, and is useful for accessing the field via an interface. -func (v *NodesNodesCertifyBad) GetSubject() AllCertifyBadSubjectPackageSourceOrArtifact { - return v.AllCertifyBad.Subject +// GetArtifacts returns NeighborsNeighborsHashEqual.Artifacts, and is useful for accessing the field via an interface. +func (v *NeighborsNeighborsHashEqual) GetArtifacts() []AllHashEqualTreeArtifactsArtifact { + return v.AllHashEqualTree.Artifacts } -// GetOrigin returns NodesNodesCertifyBad.Origin, and is useful for accessing the field via an interface. -func (v *NodesNodesCertifyBad) GetOrigin() string { return v.AllCertifyBad.Origin } +// GetOrigin returns NeighborsNeighborsHashEqual.Origin, and is useful for accessing the field via an interface. +func (v *NeighborsNeighborsHashEqual) GetOrigin() string { return v.AllHashEqualTree.Origin } -// GetCollector returns NodesNodesCertifyBad.Collector, and is useful for accessing the field via an interface. -func (v *NodesNodesCertifyBad) GetCollector() string { return v.AllCertifyBad.Collector } +// GetCollector returns NeighborsNeighborsHashEqual.Collector, and is useful for accessing the field via an interface. +func (v *NeighborsNeighborsHashEqual) GetCollector() string { return v.AllHashEqualTree.Collector } -func (v *NodesNodesCertifyBad) UnmarshalJSON(b []byte) error { +func (v *NeighborsNeighborsHashEqual) UnmarshalJSON(b []byte) error { if string(b) == "null" { return nil } var firstPass struct { - *NodesNodesCertifyBad + *NeighborsNeighborsHashEqual graphql.NoUnmarshalJSON } - firstPass.NodesNodesCertifyBad = v + firstPass.NeighborsNeighborsHashEqual = v err := json.Unmarshal(b, &firstPass) if err != nil { @@ -12679,28 +12628,28 @@ func (v *NodesNodesCertifyBad) UnmarshalJSON(b []byte) error { } err = json.Unmarshal( - b, &v.AllCertifyBad) + b, &v.AllHashEqualTree) if err != nil { return err } return nil } -type __premarshalNodesNodesCertifyBad struct { +type __premarshalNeighborsNeighborsHashEqual struct { Typename *string `json:"__typename"` Id string `json:"id"` Justification string `json:"justification"` - Subject json.RawMessage `json:"subject"` + Artifacts []AllHashEqualTreeArtifactsArtifact `json:"artifacts"` Origin string `json:"origin"` Collector string `json:"collector"` } -func (v *NodesNodesCertifyBad) MarshalJSON() ([]byte, error) { +func (v *NeighborsNeighborsHashEqual) MarshalJSON() ([]byte, error) { premarshaled, err := v.__premarshalJSON() if err != nil { return nil, err @@ -12708,79 +12657,77 @@ func (v *NodesNodesCertifyBad) MarshalJSON() ([]byte, error) { return json.Marshal(premarshaled) } -func (v *NodesNodesCertifyBad) __premarshalJSON() (*__premarshalNodesNodesCertifyBad, error) { - var retval __premarshalNodesNodesCertifyBad +func (v *NeighborsNeighborsHashEqual) __premarshalJSON() (*__premarshalNeighborsNeighborsHashEqual, error) { + var retval __premarshalNeighborsNeighborsHashEqual retval.Typename = v.Typename - retval.Id = v.AllCertifyBad.Id - retval.Justification = v.AllCertifyBad.Justification - { - - dst := &retval.Subject - src := v.AllCertifyBad.Subject - var err error - *dst, err = __marshalAllCertifyBadSubjectPackageSourceOrArtifact( - &src) - if err != nil { - return nil, fmt.Errorf( - "unable to marshal NodesNodesCertifyBad.AllCertifyBad.Subject: %w", err) - } - } - retval.Origin = v.AllCertifyBad.Origin - retval.Collector = v.AllCertifyBad.Collector + retval.Id = v.AllHashEqualTree.Id + retval.Justification = v.AllHashEqualTree.Justification + retval.Artifacts = v.AllHashEqualTree.Artifacts + retval.Origin = v.AllHashEqualTree.Origin + retval.Collector = v.AllHashEqualTree.Collector return &retval, nil } -// NodesNodesCertifyGood includes the requested fields of the GraphQL type CertifyGood. +// NeighborsNeighborsIsDependency includes the requested fields of the GraphQL type IsDependency. // The GraphQL type's documentation follows. // -// CertifyGood is an attestation that a package, source, or artifact is considered -// good. -// -// All evidence trees record a justification for the property they represent as -// well as the document that contains the attestation (origin) and the collector -// that collected the document (collector). -// -// The certification applies to a subject which is a package, source, or artifact. -// If the attestation targets a package, it must target a PackageName or a -// PackageVersion. If the attestation targets a source, it must target a -// SourceName. -type NodesNodesCertifyGood struct { - Typename *string `json:"__typename"` - allCertifyGood `json:"-"` +// IsDependency is an attestation to record that a package depends on another. +type NeighborsNeighborsIsDependency struct { + Typename *string `json:"__typename"` + AllIsDependencyTree `json:"-"` } -// GetTypename returns NodesNodesCertifyGood.Typename, and is useful for accessing the field via an interface. -func (v *NodesNodesCertifyGood) GetTypename() *string { return v.Typename } +// GetTypename returns NeighborsNeighborsIsDependency.Typename, and is useful for accessing the field via an interface. +func (v *NeighborsNeighborsIsDependency) GetTypename() *string { return v.Typename } -// GetId returns NodesNodesCertifyGood.Id, and is useful for accessing the field via an interface. -func (v *NodesNodesCertifyGood) GetId() string { return v.allCertifyGood.Id } +// GetId returns NeighborsNeighborsIsDependency.Id, and is useful for accessing the field via an interface. +func (v *NeighborsNeighborsIsDependency) GetId() string { return v.AllIsDependencyTree.Id } -// GetJustification returns NodesNodesCertifyGood.Justification, and is useful for accessing the field via an interface. -func (v *NodesNodesCertifyGood) GetJustification() string { return v.allCertifyGood.Justification } +// GetJustification returns NeighborsNeighborsIsDependency.Justification, and is useful for accessing the field via an interface. +func (v *NeighborsNeighborsIsDependency) GetJustification() string { + return v.AllIsDependencyTree.Justification +} -// GetSubject returns NodesNodesCertifyGood.Subject, and is useful for accessing the field via an interface. -func (v *NodesNodesCertifyGood) GetSubject() allCertifyGoodSubjectPackageSourceOrArtifact { - return v.allCertifyGood.Subject +// GetPackage returns NeighborsNeighborsIsDependency.Package, and is useful for accessing the field via an interface. +func (v *NeighborsNeighborsIsDependency) GetPackage() AllIsDependencyTreePackage { + return v.AllIsDependencyTree.Package } -// GetOrigin returns NodesNodesCertifyGood.Origin, and is useful for accessing the field via an interface. -func (v *NodesNodesCertifyGood) GetOrigin() string { return v.allCertifyGood.Origin } +// GetDependentPackage returns NeighborsNeighborsIsDependency.DependentPackage, and is useful for accessing the field via an interface. +func (v *NeighborsNeighborsIsDependency) GetDependentPackage() AllIsDependencyTreeDependentPackage { + return v.AllIsDependencyTree.DependentPackage +} -// GetCollector returns NodesNodesCertifyGood.Collector, and is useful for accessing the field via an interface. -func (v *NodesNodesCertifyGood) GetCollector() string { return v.allCertifyGood.Collector } +// GetDependencyType returns NeighborsNeighborsIsDependency.DependencyType, and is useful for accessing the field via an interface. +func (v *NeighborsNeighborsIsDependency) GetDependencyType() DependencyType { + return v.AllIsDependencyTree.DependencyType +} -func (v *NodesNodesCertifyGood) UnmarshalJSON(b []byte) error { +// GetVersionRange returns NeighborsNeighborsIsDependency.VersionRange, and is useful for accessing the field via an interface. +func (v *NeighborsNeighborsIsDependency) GetVersionRange() string { + return v.AllIsDependencyTree.VersionRange +} + +// GetOrigin returns NeighborsNeighborsIsDependency.Origin, and is useful for accessing the field via an interface. +func (v *NeighborsNeighborsIsDependency) GetOrigin() string { return v.AllIsDependencyTree.Origin } + +// GetCollector returns NeighborsNeighborsIsDependency.Collector, and is useful for accessing the field via an interface. +func (v *NeighborsNeighborsIsDependency) GetCollector() string { + return v.AllIsDependencyTree.Collector +} + +func (v *NeighborsNeighborsIsDependency) UnmarshalJSON(b []byte) error { if string(b) == "null" { return nil } var firstPass struct { - *NodesNodesCertifyGood + *NeighborsNeighborsIsDependency graphql.NoUnmarshalJSON } - firstPass.NodesNodesCertifyGood = v + firstPass.NeighborsNeighborsIsDependency = v err := json.Unmarshal(b, &firstPass) if err != nil { @@ -12788,28 +12735,34 @@ func (v *NodesNodesCertifyGood) UnmarshalJSON(b []byte) error { } err = json.Unmarshal( - b, &v.allCertifyGood) + b, &v.AllIsDependencyTree) if err != nil { return err } return nil } -type __premarshalNodesNodesCertifyGood struct { +type __premarshalNeighborsNeighborsIsDependency struct { Typename *string `json:"__typename"` Id string `json:"id"` Justification string `json:"justification"` - Subject json.RawMessage `json:"subject"` + Package AllIsDependencyTreePackage `json:"package"` + + DependentPackage AllIsDependencyTreeDependentPackage `json:"dependentPackage"` + + DependencyType DependencyType `json:"dependencyType"` + + VersionRange string `json:"versionRange"` Origin string `json:"origin"` Collector string `json:"collector"` } -func (v *NodesNodesCertifyGood) MarshalJSON() ([]byte, error) { +func (v *NeighborsNeighborsIsDependency) MarshalJSON() ([]byte, error) { premarshaled, err := v.__premarshalJSON() if err != nil { return nil, err @@ -12817,66 +12770,72 @@ func (v *NodesNodesCertifyGood) MarshalJSON() ([]byte, error) { return json.Marshal(premarshaled) } -func (v *NodesNodesCertifyGood) __premarshalJSON() (*__premarshalNodesNodesCertifyGood, error) { - var retval __premarshalNodesNodesCertifyGood +func (v *NeighborsNeighborsIsDependency) __premarshalJSON() (*__premarshalNeighborsNeighborsIsDependency, error) { + var retval __premarshalNeighborsNeighborsIsDependency retval.Typename = v.Typename - retval.Id = v.allCertifyGood.Id - retval.Justification = v.allCertifyGood.Justification - { - - dst := &retval.Subject - src := v.allCertifyGood.Subject - var err error - *dst, err = __marshalallCertifyGoodSubjectPackageSourceOrArtifact( - &src) - if err != nil { - return nil, fmt.Errorf( - "unable to marshal NodesNodesCertifyGood.allCertifyGood.Subject: %w", err) - } - } - retval.Origin = v.allCertifyGood.Origin - retval.Collector = v.allCertifyGood.Collector + retval.Id = v.AllIsDependencyTree.Id + retval.Justification = v.AllIsDependencyTree.Justification + retval.Package = v.AllIsDependencyTree.Package + retval.DependentPackage = v.AllIsDependencyTree.DependentPackage + retval.DependencyType = v.AllIsDependencyTree.DependencyType + retval.VersionRange = v.AllIsDependencyTree.VersionRange + retval.Origin = v.AllIsDependencyTree.Origin + retval.Collector = v.AllIsDependencyTree.Collector return &retval, nil } -// NodesNodesCertifyScorecard includes the requested fields of the GraphQL type CertifyScorecard. +// NeighborsNeighborsIsOccurrence includes the requested fields of the GraphQL type IsOccurrence. // The GraphQL type's documentation follows. // -// CertifyScorecard is an attestation to attach a Scorecard analysis to a -// particular source repository. -type NodesNodesCertifyScorecard struct { - Typename *string `json:"__typename"` - AllCertifyScorecard `json:"-"` +// IsOccurrence is an attestation to link an artifact to a package or source. +// +// Attestation must occur at the PackageVersion or at the SourceName. +type NeighborsNeighborsIsOccurrence struct { + Typename *string `json:"__typename"` + AllIsOccurrencesTree `json:"-"` } -// GetTypename returns NodesNodesCertifyScorecard.Typename, and is useful for accessing the field via an interface. -func (v *NodesNodesCertifyScorecard) GetTypename() *string { return v.Typename } +// GetTypename returns NeighborsNeighborsIsOccurrence.Typename, and is useful for accessing the field via an interface. +func (v *NeighborsNeighborsIsOccurrence) GetTypename() *string { return v.Typename } -// GetId returns NodesNodesCertifyScorecard.Id, and is useful for accessing the field via an interface. -func (v *NodesNodesCertifyScorecard) GetId() string { return v.AllCertifyScorecard.Id } +// GetId returns NeighborsNeighborsIsOccurrence.Id, and is useful for accessing the field via an interface. +func (v *NeighborsNeighborsIsOccurrence) GetId() string { return v.AllIsOccurrencesTree.Id } -// GetSource returns NodesNodesCertifyScorecard.Source, and is useful for accessing the field via an interface. -func (v *NodesNodesCertifyScorecard) GetSource() AllCertifyScorecardSource { - return v.AllCertifyScorecard.Source +// GetSubject returns NeighborsNeighborsIsOccurrence.Subject, and is useful for accessing the field via an interface. +func (v *NeighborsNeighborsIsOccurrence) GetSubject() AllIsOccurrencesTreeSubjectPackageOrSource { + return v.AllIsOccurrencesTree.Subject } -// GetScorecard returns NodesNodesCertifyScorecard.Scorecard, and is useful for accessing the field via an interface. -func (v *NodesNodesCertifyScorecard) GetScorecard() AllCertifyScorecardScorecard { - return v.AllCertifyScorecard.Scorecard +// GetArtifact returns NeighborsNeighborsIsOccurrence.Artifact, and is useful for accessing the field via an interface. +func (v *NeighborsNeighborsIsOccurrence) GetArtifact() AllIsOccurrencesTreeArtifact { + return v.AllIsOccurrencesTree.Artifact } -func (v *NodesNodesCertifyScorecard) UnmarshalJSON(b []byte) error { +// GetJustification returns NeighborsNeighborsIsOccurrence.Justification, and is useful for accessing the field via an interface. +func (v *NeighborsNeighborsIsOccurrence) GetJustification() string { + return v.AllIsOccurrencesTree.Justification +} + +// GetOrigin returns NeighborsNeighborsIsOccurrence.Origin, and is useful for accessing the field via an interface. +func (v *NeighborsNeighborsIsOccurrence) GetOrigin() string { return v.AllIsOccurrencesTree.Origin } + +// GetCollector returns NeighborsNeighborsIsOccurrence.Collector, and is useful for accessing the field via an interface. +func (v *NeighborsNeighborsIsOccurrence) GetCollector() string { + return v.AllIsOccurrencesTree.Collector +} + +func (v *NeighborsNeighborsIsOccurrence) UnmarshalJSON(b []byte) error { if string(b) == "null" { return nil } var firstPass struct { - *NodesNodesCertifyScorecard + *NeighborsNeighborsIsOccurrence graphql.NoUnmarshalJSON } - firstPass.NodesNodesCertifyScorecard = v + firstPass.NeighborsNeighborsIsOccurrence = v err := json.Unmarshal(b, &firstPass) if err != nil { @@ -12884,24 +12843,30 @@ func (v *NodesNodesCertifyScorecard) UnmarshalJSON(b []byte) error { } err = json.Unmarshal( - b, &v.AllCertifyScorecard) + b, &v.AllIsOccurrencesTree) if err != nil { return err } return nil } -type __premarshalNodesNodesCertifyScorecard struct { +type __premarshalNeighborsNeighborsIsOccurrence struct { Typename *string `json:"__typename"` Id string `json:"id"` - Source AllCertifyScorecardSource `json:"source"` + Subject json.RawMessage `json:"subject"` - Scorecard AllCertifyScorecardScorecard `json:"scorecard"` + Artifact AllIsOccurrencesTreeArtifact `json:"artifact"` + + Justification string `json:"justification"` + + Origin string `json:"origin"` + + Collector string `json:"collector"` } -func (v *NodesNodesCertifyScorecard) MarshalJSON() ([]byte, error) { +func (v *NeighborsNeighborsIsOccurrence) MarshalJSON() ([]byte, error) { premarshaled, err := v.__premarshalJSON() if err != nil { return nil, err @@ -12909,84 +12874,79 @@ func (v *NodesNodesCertifyScorecard) MarshalJSON() ([]byte, error) { return json.Marshal(premarshaled) } -func (v *NodesNodesCertifyScorecard) __premarshalJSON() (*__premarshalNodesNodesCertifyScorecard, error) { - var retval __premarshalNodesNodesCertifyScorecard +func (v *NeighborsNeighborsIsOccurrence) __premarshalJSON() (*__premarshalNeighborsNeighborsIsOccurrence, error) { + var retval __premarshalNeighborsNeighborsIsOccurrence retval.Typename = v.Typename - retval.Id = v.AllCertifyScorecard.Id - retval.Source = v.AllCertifyScorecard.Source - retval.Scorecard = v.AllCertifyScorecard.Scorecard + retval.Id = v.AllIsOccurrencesTree.Id + { + + dst := &retval.Subject + src := v.AllIsOccurrencesTree.Subject + var err error + *dst, err = __marshalAllIsOccurrencesTreeSubjectPackageOrSource( + &src) + if err != nil { + return nil, fmt.Errorf( + "unable to marshal NeighborsNeighborsIsOccurrence.AllIsOccurrencesTree.Subject: %w", err) + } + } + retval.Artifact = v.AllIsOccurrencesTree.Artifact + retval.Justification = v.AllIsOccurrencesTree.Justification + retval.Origin = v.AllIsOccurrencesTree.Origin + retval.Collector = v.AllIsOccurrencesTree.Collector return &retval, nil } -// NodesNodesCertifyVEXStatement includes the requested fields of the GraphQL type CertifyVEXStatement. +// NeighborsNeighborsIsVulnerability includes the requested fields of the GraphQL type IsVulnerability. // The GraphQL type's documentation follows. // -// CertifyVEXStatement is an attestation to attach VEX statements to a package or -// artifact to clarify the impact of a specific vulnerability (CVE, GHSA or OSV). -type NodesNodesCertifyVEXStatement struct { - Typename *string `json:"__typename"` - allCertifyVEXStatement `json:"-"` -} - -// GetTypename returns NodesNodesCertifyVEXStatement.Typename, and is useful for accessing the field via an interface. -func (v *NodesNodesCertifyVEXStatement) GetTypename() *string { return v.Typename } - -// GetId returns NodesNodesCertifyVEXStatement.Id, and is useful for accessing the field via an interface. -func (v *NodesNodesCertifyVEXStatement) GetId() string { return v.allCertifyVEXStatement.Id } - -// GetSubject returns NodesNodesCertifyVEXStatement.Subject, and is useful for accessing the field via an interface. -func (v *NodesNodesCertifyVEXStatement) GetSubject() allCertifyVEXStatementSubjectPackageOrArtifact { - return v.allCertifyVEXStatement.Subject -} - -// GetVulnerability returns NodesNodesCertifyVEXStatement.Vulnerability, and is useful for accessing the field via an interface. -func (v *NodesNodesCertifyVEXStatement) GetVulnerability() allCertifyVEXStatementVulnerability { - return v.allCertifyVEXStatement.Vulnerability +// IsVulnerability is an attestation to link CVE/GHSA with data in OSV. +type NeighborsNeighborsIsVulnerability struct { + Typename *string `json:"__typename"` + AllIsVulnerability `json:"-"` } -// GetStatus returns NodesNodesCertifyVEXStatement.Status, and is useful for accessing the field via an interface. -func (v *NodesNodesCertifyVEXStatement) GetStatus() VexStatus { return v.allCertifyVEXStatement.Status } +// GetTypename returns NeighborsNeighborsIsVulnerability.Typename, and is useful for accessing the field via an interface. +func (v *NeighborsNeighborsIsVulnerability) GetTypename() *string { return v.Typename } -// GetVexJustification returns NodesNodesCertifyVEXStatement.VexJustification, and is useful for accessing the field via an interface. -func (v *NodesNodesCertifyVEXStatement) GetVexJustification() VexJustification { - return v.allCertifyVEXStatement.VexJustification -} +// GetId returns NeighborsNeighborsIsVulnerability.Id, and is useful for accessing the field via an interface. +func (v *NeighborsNeighborsIsVulnerability) GetId() string { return v.AllIsVulnerability.Id } -// GetStatement returns NodesNodesCertifyVEXStatement.Statement, and is useful for accessing the field via an interface. -func (v *NodesNodesCertifyVEXStatement) GetStatement() string { - return v.allCertifyVEXStatement.Statement +// GetOsv returns NeighborsNeighborsIsVulnerability.Osv, and is useful for accessing the field via an interface. +func (v *NeighborsNeighborsIsVulnerability) GetOsv() AllIsVulnerabilityOsvOSV { + return v.AllIsVulnerability.Osv } -// GetStatusNotes returns NodesNodesCertifyVEXStatement.StatusNotes, and is useful for accessing the field via an interface. -func (v *NodesNodesCertifyVEXStatement) GetStatusNotes() string { - return v.allCertifyVEXStatement.StatusNotes +// GetVulnerability returns NeighborsNeighborsIsVulnerability.Vulnerability, and is useful for accessing the field via an interface. +func (v *NeighborsNeighborsIsVulnerability) GetVulnerability() AllIsVulnerabilityVulnerabilityCveOrGhsa { + return v.AllIsVulnerability.Vulnerability } -// GetKnownSince returns NodesNodesCertifyVEXStatement.KnownSince, and is useful for accessing the field via an interface. -func (v *NodesNodesCertifyVEXStatement) GetKnownSince() time.Time { - return v.allCertifyVEXStatement.KnownSince +// GetJustification returns NeighborsNeighborsIsVulnerability.Justification, and is useful for accessing the field via an interface. +func (v *NeighborsNeighborsIsVulnerability) GetJustification() string { + return v.AllIsVulnerability.Justification } -// GetOrigin returns NodesNodesCertifyVEXStatement.Origin, and is useful for accessing the field via an interface. -func (v *NodesNodesCertifyVEXStatement) GetOrigin() string { return v.allCertifyVEXStatement.Origin } +// GetOrigin returns NeighborsNeighborsIsVulnerability.Origin, and is useful for accessing the field via an interface. +func (v *NeighborsNeighborsIsVulnerability) GetOrigin() string { return v.AllIsVulnerability.Origin } -// GetCollector returns NodesNodesCertifyVEXStatement.Collector, and is useful for accessing the field via an interface. -func (v *NodesNodesCertifyVEXStatement) GetCollector() string { - return v.allCertifyVEXStatement.Collector +// GetCollector returns NeighborsNeighborsIsVulnerability.Collector, and is useful for accessing the field via an interface. +func (v *NeighborsNeighborsIsVulnerability) GetCollector() string { + return v.AllIsVulnerability.Collector } -func (v *NodesNodesCertifyVEXStatement) UnmarshalJSON(b []byte) error { +func (v *NeighborsNeighborsIsVulnerability) UnmarshalJSON(b []byte) error { if string(b) == "null" { return nil } var firstPass struct { - *NodesNodesCertifyVEXStatement + *NeighborsNeighborsIsVulnerability graphql.NoUnmarshalJSON } - firstPass.NodesNodesCertifyVEXStatement = v + firstPass.NeighborsNeighborsIsVulnerability = v err := json.Unmarshal(b, &firstPass) if err != nil { @@ -12994,38 +12954,30 @@ func (v *NodesNodesCertifyVEXStatement) UnmarshalJSON(b []byte) error { } err = json.Unmarshal( - b, &v.allCertifyVEXStatement) + b, &v.AllIsVulnerability) if err != nil { return err } return nil } -type __premarshalNodesNodesCertifyVEXStatement struct { +type __premarshalNeighborsNeighborsIsVulnerability struct { Typename *string `json:"__typename"` Id string `json:"id"` - Subject json.RawMessage `json:"subject"` + Osv AllIsVulnerabilityOsvOSV `json:"osv"` Vulnerability json.RawMessage `json:"vulnerability"` - Status VexStatus `json:"status"` - - VexJustification VexJustification `json:"vexJustification"` - - Statement string `json:"statement"` - - StatusNotes string `json:"statusNotes"` - - KnownSince time.Time `json:"knownSince"` + Justification string `json:"justification"` Origin string `json:"origin"` Collector string `json:"collector"` } -func (v *NodesNodesCertifyVEXStatement) MarshalJSON() ([]byte, error) { +func (v *NeighborsNeighborsIsVulnerability) MarshalJSON() ([]byte, error) { premarshaled, err := v.__premarshalJSON() if err != nil { return nil, err @@ -13033,285 +12985,515 @@ func (v *NodesNodesCertifyVEXStatement) MarshalJSON() ([]byte, error) { return json.Marshal(premarshaled) } -func (v *NodesNodesCertifyVEXStatement) __premarshalJSON() (*__premarshalNodesNodesCertifyVEXStatement, error) { - var retval __premarshalNodesNodesCertifyVEXStatement +func (v *NeighborsNeighborsIsVulnerability) __premarshalJSON() (*__premarshalNeighborsNeighborsIsVulnerability, error) { + var retval __premarshalNeighborsNeighborsIsVulnerability retval.Typename = v.Typename - retval.Id = v.allCertifyVEXStatement.Id - { - - dst := &retval.Subject - src := v.allCertifyVEXStatement.Subject - var err error - *dst, err = __marshalallCertifyVEXStatementSubjectPackageOrArtifact( - &src) - if err != nil { - return nil, fmt.Errorf( - "unable to marshal NodesNodesCertifyVEXStatement.allCertifyVEXStatement.Subject: %w", err) - } - } + retval.Id = v.AllIsVulnerability.Id + retval.Osv = v.AllIsVulnerability.Osv { dst := &retval.Vulnerability - src := v.allCertifyVEXStatement.Vulnerability + src := v.AllIsVulnerability.Vulnerability var err error - *dst, err = __marshalallCertifyVEXStatementVulnerability( + *dst, err = __marshalAllIsVulnerabilityVulnerabilityCveOrGhsa( &src) if err != nil { return nil, fmt.Errorf( - "unable to marshal NodesNodesCertifyVEXStatement.allCertifyVEXStatement.Vulnerability: %w", err) + "unable to marshal NeighborsNeighborsIsVulnerability.AllIsVulnerability.Vulnerability: %w", err) } } - retval.Status = v.allCertifyVEXStatement.Status - retval.VexJustification = v.allCertifyVEXStatement.VexJustification - retval.Statement = v.allCertifyVEXStatement.Statement - retval.StatusNotes = v.allCertifyVEXStatement.StatusNotes - retval.KnownSince = v.allCertifyVEXStatement.KnownSince - retval.Origin = v.allCertifyVEXStatement.Origin - retval.Collector = v.allCertifyVEXStatement.Collector + retval.Justification = v.AllIsVulnerability.Justification + retval.Origin = v.AllIsVulnerability.Origin + retval.Collector = v.AllIsVulnerability.Collector return &retval, nil } -// NodesNodesCertifyVuln includes the requested fields of the GraphQL type CertifyVuln. +// NeighborsNeighborsNoVuln includes the requested fields of the GraphQL type NoVuln. // The GraphQL type's documentation follows. // -// CertifyVuln is an attestation to attach vulnerability information to a package. +// NoVuln is a special vulnerability node to attest that no vulnerability has been +// found during a vulnerability scan. // -// This information is obtained via a scanner. If there is no vulnerability -// detected (no OSV, CVE, or GHSA), we attach the special NoVuln node. -type NodesNodesCertifyVuln struct { - Typename *string `json:"__typename"` - AllCertifyVuln `json:"-"` +// Backends guarantee that this is a singleton node. +type NeighborsNeighborsNoVuln struct { + Typename *string `json:"__typename"` + Id string `json:"id"` } -// GetTypename returns NodesNodesCertifyVuln.Typename, and is useful for accessing the field via an interface. -func (v *NodesNodesCertifyVuln) GetTypename() *string { return v.Typename } - -// GetId returns NodesNodesCertifyVuln.Id, and is useful for accessing the field via an interface. -func (v *NodesNodesCertifyVuln) GetId() string { return v.AllCertifyVuln.Id } - -// GetPackage returns NodesNodesCertifyVuln.Package, and is useful for accessing the field via an interface. -func (v *NodesNodesCertifyVuln) GetPackage() AllCertifyVulnPackage { return v.AllCertifyVuln.Package } +// GetTypename returns NeighborsNeighborsNoVuln.Typename, and is useful for accessing the field via an interface. +func (v *NeighborsNeighborsNoVuln) GetTypename() *string { return v.Typename } -// GetVulnerability returns NodesNodesCertifyVuln.Vulnerability, and is useful for accessing the field via an interface. -func (v *NodesNodesCertifyVuln) GetVulnerability() AllCertifyVulnVulnerability { - return v.AllCertifyVuln.Vulnerability -} +// GetId returns NeighborsNeighborsNoVuln.Id, and is useful for accessing the field via an interface. +func (v *NeighborsNeighborsNoVuln) GetId() string { return v.Id } -// GetMetadata returns NodesNodesCertifyVuln.Metadata, and is useful for accessing the field via an interface. -func (v *NodesNodesCertifyVuln) GetMetadata() AllCertifyVulnMetadataVulnerabilityMetaData { - return v.AllCertifyVuln.Metadata +// NeighborsNeighborsNode includes the requested fields of the GraphQL interface Node. +// +// NeighborsNeighborsNode is implemented by the following types: +// NeighborsNeighborsArtifact +// NeighborsNeighborsBuilder +// NeighborsNeighborsCVE +// NeighborsNeighborsCertifyBad +// NeighborsNeighborsCertifyGood +// NeighborsNeighborsCertifyScorecard +// NeighborsNeighborsCertifyVEXStatement +// NeighborsNeighborsCertifyVuln +// NeighborsNeighborsGHSA +// NeighborsNeighborsHasMetadata +// NeighborsNeighborsHasSBOM +// NeighborsNeighborsHasSLSA +// NeighborsNeighborsHasSourceAt +// NeighborsNeighborsHashEqual +// NeighborsNeighborsIsDependency +// NeighborsNeighborsIsOccurrence +// NeighborsNeighborsIsVulnerability +// NeighborsNeighborsNoVuln +// NeighborsNeighborsOSV +// NeighborsNeighborsPackage +// NeighborsNeighborsPkgEqual +// NeighborsNeighborsPointOfContact +// NeighborsNeighborsSource +// The GraphQL type's documentation follows. +// +// Node is a union type of all the possible nodes. +// +// It encapsulates the software tree nodes along with the evidence nodes. In a +// path query, all connecting evidence nodes along with their intermediate subject +// nodes need to be returned in order to create a complete graph. +type NeighborsNeighborsNode interface { + implementsGraphQLInterfaceNeighborsNeighborsNode() + // GetTypename returns the receiver's concrete GraphQL type-name (see interface doc for possible values). + GetTypename() *string } -func (v *NodesNodesCertifyVuln) UnmarshalJSON(b []byte) error { +func (v *NeighborsNeighborsArtifact) implementsGraphQLInterfaceNeighborsNeighborsNode() {} +func (v *NeighborsNeighborsBuilder) implementsGraphQLInterfaceNeighborsNeighborsNode() {} +func (v *NeighborsNeighborsCVE) implementsGraphQLInterfaceNeighborsNeighborsNode() {} +func (v *NeighborsNeighborsCertifyBad) implementsGraphQLInterfaceNeighborsNeighborsNode() {} +func (v *NeighborsNeighborsCertifyGood) implementsGraphQLInterfaceNeighborsNeighborsNode() {} +func (v *NeighborsNeighborsCertifyScorecard) implementsGraphQLInterfaceNeighborsNeighborsNode() {} +func (v *NeighborsNeighborsCertifyVEXStatement) implementsGraphQLInterfaceNeighborsNeighborsNode() {} +func (v *NeighborsNeighborsCertifyVuln) implementsGraphQLInterfaceNeighborsNeighborsNode() {} +func (v *NeighborsNeighborsGHSA) implementsGraphQLInterfaceNeighborsNeighborsNode() {} +func (v *NeighborsNeighborsHasMetadata) implementsGraphQLInterfaceNeighborsNeighborsNode() {} +func (v *NeighborsNeighborsHasSBOM) implementsGraphQLInterfaceNeighborsNeighborsNode() {} +func (v *NeighborsNeighborsHasSLSA) implementsGraphQLInterfaceNeighborsNeighborsNode() {} +func (v *NeighborsNeighborsHasSourceAt) implementsGraphQLInterfaceNeighborsNeighborsNode() {} +func (v *NeighborsNeighborsHashEqual) implementsGraphQLInterfaceNeighborsNeighborsNode() {} +func (v *NeighborsNeighborsIsDependency) implementsGraphQLInterfaceNeighborsNeighborsNode() {} +func (v *NeighborsNeighborsIsOccurrence) implementsGraphQLInterfaceNeighborsNeighborsNode() {} +func (v *NeighborsNeighborsIsVulnerability) implementsGraphQLInterfaceNeighborsNeighborsNode() {} +func (v *NeighborsNeighborsNoVuln) implementsGraphQLInterfaceNeighborsNeighborsNode() {} +func (v *NeighborsNeighborsOSV) implementsGraphQLInterfaceNeighborsNeighborsNode() {} +func (v *NeighborsNeighborsPackage) implementsGraphQLInterfaceNeighborsNeighborsNode() {} +func (v *NeighborsNeighborsPkgEqual) implementsGraphQLInterfaceNeighborsNeighborsNode() {} +func (v *NeighborsNeighborsPointOfContact) implementsGraphQLInterfaceNeighborsNeighborsNode() {} +func (v *NeighborsNeighborsSource) implementsGraphQLInterfaceNeighborsNeighborsNode() {} +func __unmarshalNeighborsNeighborsNode(b []byte, v *NeighborsNeighborsNode) error { if string(b) == "null" { return nil } - var firstPass struct { - *NodesNodesCertifyVuln - graphql.NoUnmarshalJSON + var tn struct { + TypeName string `json:"__typename"` } - firstPass.NodesNodesCertifyVuln = v - - err := json.Unmarshal(b, &firstPass) + err := json.Unmarshal(b, &tn) if err != nil { return err } - err = json.Unmarshal( - b, &v.AllCertifyVuln) - if err != nil { - return err + switch tn.TypeName { + case "Artifact": + *v = new(NeighborsNeighborsArtifact) + return json.Unmarshal(b, *v) + case "Builder": + *v = new(NeighborsNeighborsBuilder) + return json.Unmarshal(b, *v) + case "CVE": + *v = new(NeighborsNeighborsCVE) + return json.Unmarshal(b, *v) + case "CertifyBad": + *v = new(NeighborsNeighborsCertifyBad) + return json.Unmarshal(b, *v) + case "CertifyGood": + *v = new(NeighborsNeighborsCertifyGood) + return json.Unmarshal(b, *v) + case "CertifyScorecard": + *v = new(NeighborsNeighborsCertifyScorecard) + return json.Unmarshal(b, *v) + case "CertifyVEXStatement": + *v = new(NeighborsNeighborsCertifyVEXStatement) + return json.Unmarshal(b, *v) + case "CertifyVuln": + *v = new(NeighborsNeighborsCertifyVuln) + return json.Unmarshal(b, *v) + case "GHSA": + *v = new(NeighborsNeighborsGHSA) + return json.Unmarshal(b, *v) + case "HasMetadata": + *v = new(NeighborsNeighborsHasMetadata) + return json.Unmarshal(b, *v) + case "HasSBOM": + *v = new(NeighborsNeighborsHasSBOM) + return json.Unmarshal(b, *v) + case "HasSLSA": + *v = new(NeighborsNeighborsHasSLSA) + return json.Unmarshal(b, *v) + case "HasSourceAt": + *v = new(NeighborsNeighborsHasSourceAt) + return json.Unmarshal(b, *v) + case "HashEqual": + *v = new(NeighborsNeighborsHashEqual) + return json.Unmarshal(b, *v) + case "IsDependency": + *v = new(NeighborsNeighborsIsDependency) + return json.Unmarshal(b, *v) + case "IsOccurrence": + *v = new(NeighborsNeighborsIsOccurrence) + return json.Unmarshal(b, *v) + case "IsVulnerability": + *v = new(NeighborsNeighborsIsVulnerability) + return json.Unmarshal(b, *v) + case "NoVuln": + *v = new(NeighborsNeighborsNoVuln) + return json.Unmarshal(b, *v) + case "OSV": + *v = new(NeighborsNeighborsOSV) + return json.Unmarshal(b, *v) + case "Package": + *v = new(NeighborsNeighborsPackage) + return json.Unmarshal(b, *v) + case "PkgEqual": + *v = new(NeighborsNeighborsPkgEqual) + return json.Unmarshal(b, *v) + case "PointOfContact": + *v = new(NeighborsNeighborsPointOfContact) + return json.Unmarshal(b, *v) + case "Source": + *v = new(NeighborsNeighborsSource) + return json.Unmarshal(b, *v) + case "": + return fmt.Errorf( + "response was missing Node.__typename") + default: + return fmt.Errorf( + `unexpected concrete type for NeighborsNeighborsNode: "%v"`, tn.TypeName) } - return nil } -type __premarshalNodesNodesCertifyVuln struct { - Typename *string `json:"__typename"` +func __marshalNeighborsNeighborsNode(v *NeighborsNeighborsNode) ([]byte, error) { - Id string `json:"id"` + var typename string + switch v := (*v).(type) { + case *NeighborsNeighborsArtifact: + typename = "Artifact" - Package AllCertifyVulnPackage `json:"package"` + premarshaled, err := v.__premarshalJSON() + if err != nil { + return nil, err + } + result := struct { + TypeName string `json:"__typename"` + *__premarshalNeighborsNeighborsArtifact + }{typename, premarshaled} + return json.Marshal(result) + case *NeighborsNeighborsBuilder: + typename = "Builder" - Vulnerability json.RawMessage `json:"vulnerability"` + premarshaled, err := v.__premarshalJSON() + if err != nil { + return nil, err + } + result := struct { + TypeName string `json:"__typename"` + *__premarshalNeighborsNeighborsBuilder + }{typename, premarshaled} + return json.Marshal(result) + case *NeighborsNeighborsCVE: + typename = "CVE" - Metadata AllCertifyVulnMetadataVulnerabilityMetaData `json:"metadata"` -} + premarshaled, err := v.__premarshalJSON() + if err != nil { + return nil, err + } + result := struct { + TypeName string `json:"__typename"` + *__premarshalNeighborsNeighborsCVE + }{typename, premarshaled} + return json.Marshal(result) + case *NeighborsNeighborsCertifyBad: + typename = "CertifyBad" -func (v *NodesNodesCertifyVuln) MarshalJSON() ([]byte, error) { - premarshaled, err := v.__premarshalJSON() - if err != nil { - return nil, err - } - return json.Marshal(premarshaled) -} + premarshaled, err := v.__premarshalJSON() + if err != nil { + return nil, err + } + result := struct { + TypeName string `json:"__typename"` + *__premarshalNeighborsNeighborsCertifyBad + }{typename, premarshaled} + return json.Marshal(result) + case *NeighborsNeighborsCertifyGood: + typename = "CertifyGood" -func (v *NodesNodesCertifyVuln) __premarshalJSON() (*__premarshalNodesNodesCertifyVuln, error) { - var retval __premarshalNodesNodesCertifyVuln + premarshaled, err := v.__premarshalJSON() + if err != nil { + return nil, err + } + result := struct { + TypeName string `json:"__typename"` + *__premarshalNeighborsNeighborsCertifyGood + }{typename, premarshaled} + return json.Marshal(result) + case *NeighborsNeighborsCertifyScorecard: + typename = "CertifyScorecard" - retval.Typename = v.Typename - retval.Id = v.AllCertifyVuln.Id - retval.Package = v.AllCertifyVuln.Package - { + premarshaled, err := v.__premarshalJSON() + if err != nil { + return nil, err + } + result := struct { + TypeName string `json:"__typename"` + *__premarshalNeighborsNeighborsCertifyScorecard + }{typename, premarshaled} + return json.Marshal(result) + case *NeighborsNeighborsCertifyVEXStatement: + typename = "CertifyVEXStatement" + + premarshaled, err := v.__premarshalJSON() + if err != nil { + return nil, err + } + result := struct { + TypeName string `json:"__typename"` + *__premarshalNeighborsNeighborsCertifyVEXStatement + }{typename, premarshaled} + return json.Marshal(result) + case *NeighborsNeighborsCertifyVuln: + typename = "CertifyVuln" + + premarshaled, err := v.__premarshalJSON() + if err != nil { + return nil, err + } + result := struct { + TypeName string `json:"__typename"` + *__premarshalNeighborsNeighborsCertifyVuln + }{typename, premarshaled} + return json.Marshal(result) + case *NeighborsNeighborsGHSA: + typename = "GHSA" + + premarshaled, err := v.__premarshalJSON() + if err != nil { + return nil, err + } + result := struct { + TypeName string `json:"__typename"` + *__premarshalNeighborsNeighborsGHSA + }{typename, premarshaled} + return json.Marshal(result) + case *NeighborsNeighborsHasMetadata: + typename = "HasMetadata" + + result := struct { + TypeName string `json:"__typename"` + *NeighborsNeighborsHasMetadata + }{typename, v} + return json.Marshal(result) + case *NeighborsNeighborsHasSBOM: + typename = "HasSBOM" - dst := &retval.Vulnerability - src := v.AllCertifyVuln.Vulnerability - var err error - *dst, err = __marshalAllCertifyVulnVulnerability( - &src) + premarshaled, err := v.__premarshalJSON() if err != nil { - return nil, fmt.Errorf( - "unable to marshal NodesNodesCertifyVuln.AllCertifyVuln.Vulnerability: %w", err) + return nil, err } - } - retval.Metadata = v.AllCertifyVuln.Metadata - return &retval, nil -} - -// NodesNodesGHSA includes the requested fields of the GraphQL type GHSA. -// The GraphQL type's documentation follows. -// -// GHSA represents GitHub security advisories. -// -// The advisory id field is mandatory and canonicalized to be lowercase. -// -// This node can be referred to by other parts of GUAC. -type NodesNodesGHSA struct { - Typename *string `json:"__typename"` - AllGHSATree `json:"-"` -} + result := struct { + TypeName string `json:"__typename"` + *__premarshalNeighborsNeighborsHasSBOM + }{typename, premarshaled} + return json.Marshal(result) + case *NeighborsNeighborsHasSLSA: + typename = "HasSLSA" -// GetTypename returns NodesNodesGHSA.Typename, and is useful for accessing the field via an interface. -func (v *NodesNodesGHSA) GetTypename() *string { return v.Typename } + premarshaled, err := v.__premarshalJSON() + if err != nil { + return nil, err + } + result := struct { + TypeName string `json:"__typename"` + *__premarshalNeighborsNeighborsHasSLSA + }{typename, premarshaled} + return json.Marshal(result) + case *NeighborsNeighborsHasSourceAt: + typename = "HasSourceAt" -// GetId returns NodesNodesGHSA.Id, and is useful for accessing the field via an interface. -func (v *NodesNodesGHSA) GetId() string { return v.AllGHSATree.Id } + premarshaled, err := v.__premarshalJSON() + if err != nil { + return nil, err + } + result := struct { + TypeName string `json:"__typename"` + *__premarshalNeighborsNeighborsHasSourceAt + }{typename, premarshaled} + return json.Marshal(result) + case *NeighborsNeighborsHashEqual: + typename = "HashEqual" -// GetGhsaId returns NodesNodesGHSA.GhsaId, and is useful for accessing the field via an interface. -func (v *NodesNodesGHSA) GetGhsaId() string { return v.AllGHSATree.GhsaId } + premarshaled, err := v.__premarshalJSON() + if err != nil { + return nil, err + } + result := struct { + TypeName string `json:"__typename"` + *__premarshalNeighborsNeighborsHashEqual + }{typename, premarshaled} + return json.Marshal(result) + case *NeighborsNeighborsIsDependency: + typename = "IsDependency" -func (v *NodesNodesGHSA) UnmarshalJSON(b []byte) error { + premarshaled, err := v.__premarshalJSON() + if err != nil { + return nil, err + } + result := struct { + TypeName string `json:"__typename"` + *__premarshalNeighborsNeighborsIsDependency + }{typename, premarshaled} + return json.Marshal(result) + case *NeighborsNeighborsIsOccurrence: + typename = "IsOccurrence" - if string(b) == "null" { - return nil - } + premarshaled, err := v.__premarshalJSON() + if err != nil { + return nil, err + } + result := struct { + TypeName string `json:"__typename"` + *__premarshalNeighborsNeighborsIsOccurrence + }{typename, premarshaled} + return json.Marshal(result) + case *NeighborsNeighborsIsVulnerability: + typename = "IsVulnerability" - var firstPass struct { - *NodesNodesGHSA - graphql.NoUnmarshalJSON - } - firstPass.NodesNodesGHSA = v + premarshaled, err := v.__premarshalJSON() + if err != nil { + return nil, err + } + result := struct { + TypeName string `json:"__typename"` + *__premarshalNeighborsNeighborsIsVulnerability + }{typename, premarshaled} + return json.Marshal(result) + case *NeighborsNeighborsNoVuln: + typename = "NoVuln" - err := json.Unmarshal(b, &firstPass) - if err != nil { - return err - } + result := struct { + TypeName string `json:"__typename"` + *NeighborsNeighborsNoVuln + }{typename, v} + return json.Marshal(result) + case *NeighborsNeighborsOSV: + typename = "OSV" - err = json.Unmarshal( - b, &v.AllGHSATree) - if err != nil { - return err - } - return nil -} + premarshaled, err := v.__premarshalJSON() + if err != nil { + return nil, err + } + result := struct { + TypeName string `json:"__typename"` + *__premarshalNeighborsNeighborsOSV + }{typename, premarshaled} + return json.Marshal(result) + case *NeighborsNeighborsPackage: + typename = "Package" -type __premarshalNodesNodesGHSA struct { - Typename *string `json:"__typename"` + premarshaled, err := v.__premarshalJSON() + if err != nil { + return nil, err + } + result := struct { + TypeName string `json:"__typename"` + *__premarshalNeighborsNeighborsPackage + }{typename, premarshaled} + return json.Marshal(result) + case *NeighborsNeighborsPkgEqual: + typename = "PkgEqual" - Id string `json:"id"` + premarshaled, err := v.__premarshalJSON() + if err != nil { + return nil, err + } + result := struct { + TypeName string `json:"__typename"` + *__premarshalNeighborsNeighborsPkgEqual + }{typename, premarshaled} + return json.Marshal(result) + case *NeighborsNeighborsPointOfContact: + typename = "PointOfContact" - GhsaId string `json:"ghsaId"` -} + result := struct { + TypeName string `json:"__typename"` + *NeighborsNeighborsPointOfContact + }{typename, v} + return json.Marshal(result) + case *NeighborsNeighborsSource: + typename = "Source" -func (v *NodesNodesGHSA) MarshalJSON() ([]byte, error) { - premarshaled, err := v.__premarshalJSON() - if err != nil { - return nil, err + premarshaled, err := v.__premarshalJSON() + if err != nil { + return nil, err + } + result := struct { + TypeName string `json:"__typename"` + *__premarshalNeighborsNeighborsSource + }{typename, premarshaled} + return json.Marshal(result) + case nil: + return []byte("null"), nil + default: + return nil, fmt.Errorf( + `unexpected concrete type for NeighborsNeighborsNode: "%T"`, v) } - return json.Marshal(premarshaled) -} - -func (v *NodesNodesGHSA) __premarshalJSON() (*__premarshalNodesNodesGHSA, error) { - var retval __premarshalNodesNodesGHSA - - retval.Typename = v.Typename - retval.Id = v.AllGHSATree.Id - retval.GhsaId = v.AllGHSATree.GhsaId - return &retval, nil } -// NodesNodesHasMetadata includes the requested fields of the GraphQL type HasMetadata. +// NeighborsNeighborsOSV includes the requested fields of the GraphQL type OSV. // The GraphQL type's documentation follows. // -// HasMetadata is an attestation that a package, source, or artifact has a certain -// attested property (key) with value (value). For example, a source may have -// metadata "SourceRepo2FAEnabled=true". +// OSV represents an Open Source Vulnerability. // -// The intent of this evidence tree predicate is to allow extensibility of metadata -// expressible within the GUAC ontology. Metadata that is commonly used will then -// be promoted to a predicate on its own. +// The osvId field is mandatory and canonicalized to be lowercase. // -// Justification indicates how the metadata was determined. +// This maps to a vulnerability ID specific to the environment (e.g., GHSA ID or +// CVE ID). // -// The metadata applies to a subject which is a package, source, or artifact. -// If the attestation targets a package, it must target a PackageName or a -// PackageVersion. If the attestation targets a source, it must target a -// SourceName. -type NodesNodesHasMetadata struct { - Typename *string `json:"__typename"` -} - -// GetTypename returns NodesNodesHasMetadata.Typename, and is useful for accessing the field via an interface. -func (v *NodesNodesHasMetadata) GetTypename() *string { return v.Typename } - -// NodesNodesHasSBOM includes the requested fields of the GraphQL type HasSBOM. -type NodesNodesHasSBOM struct { - Typename *string `json:"__typename"` - allHasSBOMTree `json:"-"` -} - -// GetTypename returns NodesNodesHasSBOM.Typename, and is useful for accessing the field via an interface. -func (v *NodesNodesHasSBOM) GetTypename() *string { return v.Typename } - -// GetId returns NodesNodesHasSBOM.Id, and is useful for accessing the field via an interface. -func (v *NodesNodesHasSBOM) GetId() string { return v.allHasSBOMTree.Id } - -// GetSubject returns NodesNodesHasSBOM.Subject, and is useful for accessing the field via an interface. -func (v *NodesNodesHasSBOM) GetSubject() allHasSBOMTreeSubjectPackageOrArtifact { - return v.allHasSBOMTree.Subject +// This node can be referred to by other parts of GUAC. +type NeighborsNeighborsOSV struct { + Typename *string `json:"__typename"` + AllOSVTree `json:"-"` } -// GetUri returns NodesNodesHasSBOM.Uri, and is useful for accessing the field via an interface. -func (v *NodesNodesHasSBOM) GetUri() string { return v.allHasSBOMTree.Uri } - -// GetAlgorithm returns NodesNodesHasSBOM.Algorithm, and is useful for accessing the field via an interface. -func (v *NodesNodesHasSBOM) GetAlgorithm() string { return v.allHasSBOMTree.Algorithm } - -// GetDigest returns NodesNodesHasSBOM.Digest, and is useful for accessing the field via an interface. -func (v *NodesNodesHasSBOM) GetDigest() string { return v.allHasSBOMTree.Digest } - -// GetDownloadLocation returns NodesNodesHasSBOM.DownloadLocation, and is useful for accessing the field via an interface. -func (v *NodesNodesHasSBOM) GetDownloadLocation() string { return v.allHasSBOMTree.DownloadLocation } +// GetTypename returns NeighborsNeighborsOSV.Typename, and is useful for accessing the field via an interface. +func (v *NeighborsNeighborsOSV) GetTypename() *string { return v.Typename } -// GetOrigin returns NodesNodesHasSBOM.Origin, and is useful for accessing the field via an interface. -func (v *NodesNodesHasSBOM) GetOrigin() string { return v.allHasSBOMTree.Origin } +// GetId returns NeighborsNeighborsOSV.Id, and is useful for accessing the field via an interface. +func (v *NeighborsNeighborsOSV) GetId() string { return v.AllOSVTree.Id } -// GetCollector returns NodesNodesHasSBOM.Collector, and is useful for accessing the field via an interface. -func (v *NodesNodesHasSBOM) GetCollector() string { return v.allHasSBOMTree.Collector } +// GetOsvId returns NeighborsNeighborsOSV.OsvId, and is useful for accessing the field via an interface. +func (v *NeighborsNeighborsOSV) GetOsvId() string { return v.AllOSVTree.OsvId } -func (v *NodesNodesHasSBOM) UnmarshalJSON(b []byte) error { +func (v *NeighborsNeighborsOSV) UnmarshalJSON(b []byte) error { if string(b) == "null" { return nil } var firstPass struct { - *NodesNodesHasSBOM + *NeighborsNeighborsOSV graphql.NoUnmarshalJSON } - firstPass.NodesNodesHasSBOM = v + firstPass.NeighborsNeighborsOSV = v err := json.Unmarshal(b, &firstPass) if err != nil { @@ -13319,34 +13501,22 @@ func (v *NodesNodesHasSBOM) UnmarshalJSON(b []byte) error { } err = json.Unmarshal( - b, &v.allHasSBOMTree) + b, &v.AllOSVTree) if err != nil { return err } return nil } -type __premarshalNodesNodesHasSBOM struct { +type __premarshalNeighborsNeighborsOSV struct { Typename *string `json:"__typename"` Id string `json:"id"` - Subject json.RawMessage `json:"subject"` - - Uri string `json:"uri"` - - Algorithm string `json:"algorithm"` - - Digest string `json:"digest"` - - DownloadLocation string `json:"downloadLocation"` - - Origin string `json:"origin"` - - Collector string `json:"collector"` + OsvId string `json:"osvId"` } -func (v *NodesNodesHasSBOM) MarshalJSON() ([]byte, error) { +func (v *NeighborsNeighborsOSV) MarshalJSON() ([]byte, error) { premarshaled, err := v.__premarshalJSON() if err != nil { return nil, err @@ -13354,64 +13524,62 @@ func (v *NodesNodesHasSBOM) MarshalJSON() ([]byte, error) { return json.Marshal(premarshaled) } -func (v *NodesNodesHasSBOM) __premarshalJSON() (*__premarshalNodesNodesHasSBOM, error) { - var retval __premarshalNodesNodesHasSBOM +func (v *NeighborsNeighborsOSV) __premarshalJSON() (*__premarshalNeighborsNeighborsOSV, error) { + var retval __premarshalNeighborsNeighborsOSV retval.Typename = v.Typename - retval.Id = v.allHasSBOMTree.Id - { - - dst := &retval.Subject - src := v.allHasSBOMTree.Subject - var err error - *dst, err = __marshalallHasSBOMTreeSubjectPackageOrArtifact( - &src) - if err != nil { - return nil, fmt.Errorf( - "unable to marshal NodesNodesHasSBOM.allHasSBOMTree.Subject: %w", err) - } - } - retval.Uri = v.allHasSBOMTree.Uri - retval.Algorithm = v.allHasSBOMTree.Algorithm - retval.Digest = v.allHasSBOMTree.Digest - retval.DownloadLocation = v.allHasSBOMTree.DownloadLocation - retval.Origin = v.allHasSBOMTree.Origin - retval.Collector = v.allHasSBOMTree.Collector + retval.Id = v.AllOSVTree.Id + retval.OsvId = v.AllOSVTree.OsvId return &retval, nil } -// NodesNodesHasSLSA includes the requested fields of the GraphQL type HasSLSA. +// NeighborsNeighborsPackage includes the requested fields of the GraphQL type Package. // The GraphQL type's documentation follows. // -// HasSLSA records that a subject node has a SLSA attestation. -type NodesNodesHasSLSA struct { - Typename *string `json:"__typename"` - allSLSATree `json:"-"` +// Package represents the root of the package trie/tree. +// +// We map package information to a trie, closely matching the pURL specification +// (https://github.com/package-url/purl-spec/blob/0dd92f26f8bb11956ffdf5e8acfcee71e8560407/README.rst), +// but deviating from it where GUAC heuristics allow for better representation of +// package information. Each path in the trie fully represents a package; we split +// the trie based on the pURL components. +// +// This node matches a pkg: partial pURL. The type field matches the +// pURL types but we might also use "guac" for the cases where the pURL +// representation is not complete or when we have custom rules. +// +// Since this node is at the root of the package trie, it is named Package, not +// PackageType. +type NeighborsNeighborsPackage struct { + Typename *string `json:"__typename"` + AllPkgTree `json:"-"` } -// GetTypename returns NodesNodesHasSLSA.Typename, and is useful for accessing the field via an interface. -func (v *NodesNodesHasSLSA) GetTypename() *string { return v.Typename } +// GetTypename returns NeighborsNeighborsPackage.Typename, and is useful for accessing the field via an interface. +func (v *NeighborsNeighborsPackage) GetTypename() *string { return v.Typename } -// GetId returns NodesNodesHasSLSA.Id, and is useful for accessing the field via an interface. -func (v *NodesNodesHasSLSA) GetId() string { return v.allSLSATree.Id } +// GetId returns NeighborsNeighborsPackage.Id, and is useful for accessing the field via an interface. +func (v *NeighborsNeighborsPackage) GetId() string { return v.AllPkgTree.Id } -// GetSubject returns NodesNodesHasSLSA.Subject, and is useful for accessing the field via an interface. -func (v *NodesNodesHasSLSA) GetSubject() allSLSATreeSubjectArtifact { return v.allSLSATree.Subject } +// GetType returns NeighborsNeighborsPackage.Type, and is useful for accessing the field via an interface. +func (v *NeighborsNeighborsPackage) GetType() string { return v.AllPkgTree.Type } -// GetSlsa returns NodesNodesHasSLSA.Slsa, and is useful for accessing the field via an interface. -func (v *NodesNodesHasSLSA) GetSlsa() allSLSATreeSlsaSLSA { return v.allSLSATree.Slsa } +// GetNamespaces returns NeighborsNeighborsPackage.Namespaces, and is useful for accessing the field via an interface. +func (v *NeighborsNeighborsPackage) GetNamespaces() []AllPkgTreeNamespacesPackageNamespace { + return v.AllPkgTree.Namespaces +} -func (v *NodesNodesHasSLSA) UnmarshalJSON(b []byte) error { +func (v *NeighborsNeighborsPackage) UnmarshalJSON(b []byte) error { if string(b) == "null" { return nil } var firstPass struct { - *NodesNodesHasSLSA + *NeighborsNeighborsPackage graphql.NoUnmarshalJSON } - firstPass.NodesNodesHasSLSA = v + firstPass.NeighborsNeighborsPackage = v err := json.Unmarshal(b, &firstPass) if err != nil { @@ -13419,24 +13587,24 @@ func (v *NodesNodesHasSLSA) UnmarshalJSON(b []byte) error { } err = json.Unmarshal( - b, &v.allSLSATree) + b, &v.AllPkgTree) if err != nil { return err } return nil } -type __premarshalNodesNodesHasSLSA struct { +type __premarshalNeighborsNeighborsPackage struct { Typename *string `json:"__typename"` Id string `json:"id"` - Subject allSLSATreeSubjectArtifact `json:"subject"` + Type string `json:"type"` - Slsa allSLSATreeSlsaSLSA `json:"slsa"` + Namespaces []AllPkgTreeNamespacesPackageNamespace `json:"namespaces"` } -func (v *NodesNodesHasSLSA) MarshalJSON() ([]byte, error) { +func (v *NeighborsNeighborsPackage) MarshalJSON() ([]byte, error) { premarshaled, err := v.__premarshalJSON() if err != nil { return nil, err @@ -13444,60 +13612,56 @@ func (v *NodesNodesHasSLSA) MarshalJSON() ([]byte, error) { return json.Marshal(premarshaled) } -func (v *NodesNodesHasSLSA) __premarshalJSON() (*__premarshalNodesNodesHasSLSA, error) { - var retval __premarshalNodesNodesHasSLSA +func (v *NeighborsNeighborsPackage) __premarshalJSON() (*__premarshalNeighborsNeighborsPackage, error) { + var retval __premarshalNeighborsNeighborsPackage retval.Typename = v.Typename - retval.Id = v.allSLSATree.Id - retval.Subject = v.allSLSATree.Subject - retval.Slsa = v.allSLSATree.Slsa + retval.Id = v.AllPkgTree.Id + retval.Type = v.AllPkgTree.Type + retval.Namespaces = v.AllPkgTree.Namespaces return &retval, nil } -// NodesNodesHasSourceAt includes the requested fields of the GraphQL type HasSourceAt. +// NeighborsNeighborsPkgEqual includes the requested fields of the GraphQL type PkgEqual. // The GraphQL type's documentation follows. // -// HasSourceAt records that a package's repository is a given source. -type NodesNodesHasSourceAt struct { - Typename *string `json:"__typename"` - allHasSourceAt `json:"-"` +// PkgEqual is an attestation that a set of packages are similar. +type NeighborsNeighborsPkgEqual struct { + Typename *string `json:"__typename"` + AllPkgEqual `json:"-"` } -// GetTypename returns NodesNodesHasSourceAt.Typename, and is useful for accessing the field via an interface. -func (v *NodesNodesHasSourceAt) GetTypename() *string { return v.Typename } - -// GetId returns NodesNodesHasSourceAt.Id, and is useful for accessing the field via an interface. -func (v *NodesNodesHasSourceAt) GetId() string { return v.allHasSourceAt.Id } - -// GetJustification returns NodesNodesHasSourceAt.Justification, and is useful for accessing the field via an interface. -func (v *NodesNodesHasSourceAt) GetJustification() string { return v.allHasSourceAt.Justification } +// GetTypename returns NeighborsNeighborsPkgEqual.Typename, and is useful for accessing the field via an interface. +func (v *NeighborsNeighborsPkgEqual) GetTypename() *string { return v.Typename } -// GetKnownSince returns NodesNodesHasSourceAt.KnownSince, and is useful for accessing the field via an interface. -func (v *NodesNodesHasSourceAt) GetKnownSince() time.Time { return v.allHasSourceAt.KnownSince } +// GetId returns NeighborsNeighborsPkgEqual.Id, and is useful for accessing the field via an interface. +func (v *NeighborsNeighborsPkgEqual) GetId() string { return v.AllPkgEqual.Id } -// GetPackage returns NodesNodesHasSourceAt.Package, and is useful for accessing the field via an interface. -func (v *NodesNodesHasSourceAt) GetPackage() allHasSourceAtPackage { return v.allHasSourceAt.Package } +// GetJustification returns NeighborsNeighborsPkgEqual.Justification, and is useful for accessing the field via an interface. +func (v *NeighborsNeighborsPkgEqual) GetJustification() string { return v.AllPkgEqual.Justification } -// GetSource returns NodesNodesHasSourceAt.Source, and is useful for accessing the field via an interface. -func (v *NodesNodesHasSourceAt) GetSource() allHasSourceAtSource { return v.allHasSourceAt.Source } +// GetPackages returns NeighborsNeighborsPkgEqual.Packages, and is useful for accessing the field via an interface. +func (v *NeighborsNeighborsPkgEqual) GetPackages() []AllPkgEqualPackagesPackage { + return v.AllPkgEqual.Packages +} -// GetOrigin returns NodesNodesHasSourceAt.Origin, and is useful for accessing the field via an interface. -func (v *NodesNodesHasSourceAt) GetOrigin() string { return v.allHasSourceAt.Origin } +// GetOrigin returns NeighborsNeighborsPkgEqual.Origin, and is useful for accessing the field via an interface. +func (v *NeighborsNeighborsPkgEqual) GetOrigin() string { return v.AllPkgEqual.Origin } -// GetCollector returns NodesNodesHasSourceAt.Collector, and is useful for accessing the field via an interface. -func (v *NodesNodesHasSourceAt) GetCollector() string { return v.allHasSourceAt.Collector } +// GetCollector returns NeighborsNeighborsPkgEqual.Collector, and is useful for accessing the field via an interface. +func (v *NeighborsNeighborsPkgEqual) GetCollector() string { return v.AllPkgEqual.Collector } -func (v *NodesNodesHasSourceAt) UnmarshalJSON(b []byte) error { +func (v *NeighborsNeighborsPkgEqual) UnmarshalJSON(b []byte) error { if string(b) == "null" { return nil } var firstPass struct { - *NodesNodesHasSourceAt + *NeighborsNeighborsPkgEqual graphql.NoUnmarshalJSON } - firstPass.NodesNodesHasSourceAt = v + firstPass.NeighborsNeighborsPkgEqual = v err := json.Unmarshal(b, &firstPass) if err != nil { @@ -13505,32 +13669,28 @@ func (v *NodesNodesHasSourceAt) UnmarshalJSON(b []byte) error { } err = json.Unmarshal( - b, &v.allHasSourceAt) + b, &v.AllPkgEqual) if err != nil { return err } return nil } -type __premarshalNodesNodesHasSourceAt struct { +type __premarshalNeighborsNeighborsPkgEqual struct { Typename *string `json:"__typename"` Id string `json:"id"` Justification string `json:"justification"` - KnownSince time.Time `json:"knownSince"` - - Package allHasSourceAtPackage `json:"package"` - - Source allHasSourceAtSource `json:"source"` + Packages []AllPkgEqualPackagesPackage `json:"packages"` Origin string `json:"origin"` Collector string `json:"collector"` } -func (v *NodesNodesHasSourceAt) MarshalJSON() ([]byte, error) { +func (v *NeighborsNeighborsPkgEqual) MarshalJSON() ([]byte, error) { premarshaled, err := v.__premarshalJSON() if err != nil { return nil, err @@ -13538,89 +13698,193 @@ func (v *NodesNodesHasSourceAt) MarshalJSON() ([]byte, error) { return json.Marshal(premarshaled) } -func (v *NodesNodesHasSourceAt) __premarshalJSON() (*__premarshalNodesNodesHasSourceAt, error) { - var retval __premarshalNodesNodesHasSourceAt +func (v *NeighborsNeighborsPkgEqual) __premarshalJSON() (*__premarshalNeighborsNeighborsPkgEqual, error) { + var retval __premarshalNeighborsNeighborsPkgEqual retval.Typename = v.Typename - retval.Id = v.allHasSourceAt.Id - retval.Justification = v.allHasSourceAt.Justification - retval.KnownSince = v.allHasSourceAt.KnownSince - retval.Package = v.allHasSourceAt.Package - retval.Source = v.allHasSourceAt.Source - retval.Origin = v.allHasSourceAt.Origin - retval.Collector = v.allHasSourceAt.Collector + retval.Id = v.AllPkgEqual.Id + retval.Justification = v.AllPkgEqual.Justification + retval.Packages = v.AllPkgEqual.Packages + retval.Origin = v.AllPkgEqual.Origin + retval.Collector = v.AllPkgEqual.Collector return &retval, nil } -// NodesNodesHashEqual includes the requested fields of the GraphQL type HashEqual. +// NeighborsNeighborsPointOfContact includes the requested fields of the GraphQL type PointOfContact. // The GraphQL type's documentation follows. // -// HashEqual is an attestation that a set of artifacts are identical. -type NodesNodesHashEqual struct { - Typename *string `json:"__typename"` - allHashEqualTree `json:"-"` +// PointOfContact is an attestation of how to get in touch with the person(s) responsible +// for a package, source, or artifact. +// +// All evidence trees record a justification for the property they represent as +// well as the document that contains the attestation (origin) and the collector +// that collected the document (collector). +// +// The attestation applies to a subject which is a package, source, or artifact. +// If the attestation targets a package, it must target a PackageName or a +// PackageVersion. If the attestation targets a source, it must target a +// SourceName. +// +// email is the email address (singular) of the point of contact. +// +// info is additional contact information other than email address. This is free +// form. +// +// NOTE: the identifiers for point of contact should be part of software trees. +// This will benefit from identifier look up and traversal as well as organization +// hierarchy. However, until the use case arises, PointOfContact will be a flat +// reference to the contact details. +type NeighborsNeighborsPointOfContact struct { + Typename *string `json:"__typename"` } -// GetTypename returns NodesNodesHashEqual.Typename, and is useful for accessing the field via an interface. -func (v *NodesNodesHashEqual) GetTypename() *string { return v.Typename } +// GetTypename returns NeighborsNeighborsPointOfContact.Typename, and is useful for accessing the field via an interface. +func (v *NeighborsNeighborsPointOfContact) GetTypename() *string { return v.Typename } -// GetId returns NodesNodesHashEqual.Id, and is useful for accessing the field via an interface. -func (v *NodesNodesHashEqual) GetId() string { return v.allHashEqualTree.Id } +// NeighborsNeighborsSource includes the requested fields of the GraphQL type Source. +// The GraphQL type's documentation follows. +// +// Source represents the root of the source trie/tree. +// +// We map source information to a trie, as a derivative of the pURL specification: +// each path in the trie represents a type, namespace, name and an optional +// qualifier that stands for tag/commit information. +// +// This node represents the type part of the trie path. It is used to represent +// the version control system that is being used. +// +// Since this node is at the root of the source trie, it is named Source, not +// SourceType. +type NeighborsNeighborsSource struct { + Typename *string `json:"__typename"` + AllSourceTree `json:"-"` +} + +// GetTypename returns NeighborsNeighborsSource.Typename, and is useful for accessing the field via an interface. +func (v *NeighborsNeighborsSource) GetTypename() *string { return v.Typename } + +// GetId returns NeighborsNeighborsSource.Id, and is useful for accessing the field via an interface. +func (v *NeighborsNeighborsSource) GetId() string { return v.AllSourceTree.Id } + +// GetType returns NeighborsNeighborsSource.Type, and is useful for accessing the field via an interface. +func (v *NeighborsNeighborsSource) GetType() string { return v.AllSourceTree.Type } + +// GetNamespaces returns NeighborsNeighborsSource.Namespaces, and is useful for accessing the field via an interface. +func (v *NeighborsNeighborsSource) GetNamespaces() []AllSourceTreeNamespacesSourceNamespace { + return v.AllSourceTree.Namespaces +} + +func (v *NeighborsNeighborsSource) UnmarshalJSON(b []byte) error { + + if string(b) == "null" { + return nil + } + + var firstPass struct { + *NeighborsNeighborsSource + graphql.NoUnmarshalJSON + } + firstPass.NeighborsNeighborsSource = v + + err := json.Unmarshal(b, &firstPass) + if err != nil { + return err + } + + err = json.Unmarshal( + b, &v.AllSourceTree) + if err != nil { + return err + } + return nil +} + +type __premarshalNeighborsNeighborsSource struct { + Typename *string `json:"__typename"` + + Id string `json:"id"` + + Type string `json:"type"` + + Namespaces []AllSourceTreeNamespacesSourceNamespace `json:"namespaces"` +} + +func (v *NeighborsNeighborsSource) MarshalJSON() ([]byte, error) { + premarshaled, err := v.__premarshalJSON() + if err != nil { + return nil, err + } + return json.Marshal(premarshaled) +} -// GetJustification returns NodesNodesHashEqual.Justification, and is useful for accessing the field via an interface. -func (v *NodesNodesHashEqual) GetJustification() string { return v.allHashEqualTree.Justification } +func (v *NeighborsNeighborsSource) __premarshalJSON() (*__premarshalNeighborsNeighborsSource, error) { + var retval __premarshalNeighborsNeighborsSource -// GetArtifacts returns NodesNodesHashEqual.Artifacts, and is useful for accessing the field via an interface. -func (v *NodesNodesHashEqual) GetArtifacts() []allHashEqualTreeArtifactsArtifact { - return v.allHashEqualTree.Artifacts + retval.Typename = v.Typename + retval.Id = v.AllSourceTree.Id + retval.Type = v.AllSourceTree.Type + retval.Namespaces = v.AllSourceTree.Namespaces + return &retval, nil } -// GetOrigin returns NodesNodesHashEqual.Origin, and is useful for accessing the field via an interface. -func (v *NodesNodesHashEqual) GetOrigin() string { return v.allHashEqualTree.Origin } +// NeighborsResponse is returned by Neighbors on success. +type NeighborsResponse struct { + // neighbors returns all the direct neighbors of a node. + // + // Similarly, the input is only specified by its ID. + // + // Specifying any Edge value in `usingOnly` will make the neighbors list only + // contain the corresponding GUAC evidence trees (GUAC verbs). + Neighbors []NeighborsNeighborsNode `json:"-"` +} -// GetCollector returns NodesNodesHashEqual.Collector, and is useful for accessing the field via an interface. -func (v *NodesNodesHashEqual) GetCollector() string { return v.allHashEqualTree.Collector } +// GetNeighbors returns NeighborsResponse.Neighbors, and is useful for accessing the field via an interface. +func (v *NeighborsResponse) GetNeighbors() []NeighborsNeighborsNode { return v.Neighbors } -func (v *NodesNodesHashEqual) UnmarshalJSON(b []byte) error { +func (v *NeighborsResponse) UnmarshalJSON(b []byte) error { if string(b) == "null" { return nil } var firstPass struct { - *NodesNodesHashEqual + *NeighborsResponse + Neighbors []json.RawMessage `json:"neighbors"` graphql.NoUnmarshalJSON } - firstPass.NodesNodesHashEqual = v + firstPass.NeighborsResponse = v err := json.Unmarshal(b, &firstPass) if err != nil { return err } - err = json.Unmarshal( - b, &v.allHashEqualTree) - if err != nil { - return err + { + dst := &v.Neighbors + src := firstPass.Neighbors + *dst = make( + []NeighborsNeighborsNode, + len(src)) + for i, src := range src { + dst := &(*dst)[i] + if len(src) != 0 && string(src) != "null" { + err = __unmarshalNeighborsNeighborsNode( + src, dst) + if err != nil { + return fmt.Errorf( + "unable to unmarshal NeighborsResponse.Neighbors: %w", err) + } + } + } } return nil } -type __premarshalNodesNodesHashEqual struct { - Typename *string `json:"__typename"` - - Id string `json:"id"` - - Justification string `json:"justification"` - - Artifacts []allHashEqualTreeArtifactsArtifact `json:"artifacts"` - - Origin string `json:"origin"` - - Collector string `json:"collector"` +type __premarshalNeighborsResponse struct { + Neighbors []json.RawMessage `json:"neighbors"` } -func (v *NodesNodesHashEqual) MarshalJSON() ([]byte, error) { +func (v *NeighborsResponse) MarshalJSON() ([]byte, error) { premarshaled, err := v.__premarshalJSON() if err != nil { return nil, err @@ -13628,179 +13892,499 @@ func (v *NodesNodesHashEqual) MarshalJSON() ([]byte, error) { return json.Marshal(premarshaled) } -func (v *NodesNodesHashEqual) __premarshalJSON() (*__premarshalNodesNodesHashEqual, error) { - var retval __premarshalNodesNodesHashEqual +func (v *NeighborsResponse) __premarshalJSON() (*__premarshalNeighborsResponse, error) { + var retval __premarshalNeighborsResponse - retval.Typename = v.Typename - retval.Id = v.allHashEqualTree.Id - retval.Justification = v.allHashEqualTree.Justification - retval.Artifacts = v.allHashEqualTree.Artifacts - retval.Origin = v.allHashEqualTree.Origin - retval.Collector = v.allHashEqualTree.Collector + { + + dst := &retval.Neighbors + src := v.Neighbors + *dst = make( + []json.RawMessage, + len(src)) + for i, src := range src { + dst := &(*dst)[i] + var err error + *dst, err = __marshalNeighborsNeighborsNode( + &src) + if err != nil { + return nil, fmt.Errorf( + "unable to marshal NeighborsResponse.Neighbors: %w", err) + } + } + } return &retval, nil } -// NodesNodesIsDependency includes the requested fields of the GraphQL type IsDependency. +// NodeNode includes the requested fields of the GraphQL interface Node. +// +// NodeNode is implemented by the following types: +// NodeNodeArtifact +// NodeNodeBuilder +// NodeNodeCVE +// NodeNodeCertifyBad +// NodeNodeCertifyGood +// NodeNodeCertifyScorecard +// NodeNodeCertifyVEXStatement +// NodeNodeCertifyVuln +// NodeNodeGHSA +// NodeNodeHasMetadata +// NodeNodeHasSBOM +// NodeNodeHasSLSA +// NodeNodeHasSourceAt +// NodeNodeHashEqual +// NodeNodeIsDependency +// NodeNodeIsOccurrence +// NodeNodeIsVulnerability +// NodeNodeNoVuln +// NodeNodeOSV +// NodeNodePackage +// NodeNodePkgEqual +// NodeNodePointOfContact +// NodeNodeSource // The GraphQL type's documentation follows. // -// IsDependency is an attestation to record that a package depends on another. -type NodesNodesIsDependency struct { - Typename *string `json:"__typename"` - allIsDependencyTree `json:"-"` +// Node is a union type of all the possible nodes. +// +// It encapsulates the software tree nodes along with the evidence nodes. In a +// path query, all connecting evidence nodes along with their intermediate subject +// nodes need to be returned in order to create a complete graph. +type NodeNode interface { + implementsGraphQLInterfaceNodeNode() + // GetTypename returns the receiver's concrete GraphQL type-name (see interface doc for possible values). + GetTypename() *string } -// GetTypename returns NodesNodesIsDependency.Typename, and is useful for accessing the field via an interface. -func (v *NodesNodesIsDependency) GetTypename() *string { return v.Typename } +func (v *NodeNodeArtifact) implementsGraphQLInterfaceNodeNode() {} +func (v *NodeNodeBuilder) implementsGraphQLInterfaceNodeNode() {} +func (v *NodeNodeCVE) implementsGraphQLInterfaceNodeNode() {} +func (v *NodeNodeCertifyBad) implementsGraphQLInterfaceNodeNode() {} +func (v *NodeNodeCertifyGood) implementsGraphQLInterfaceNodeNode() {} +func (v *NodeNodeCertifyScorecard) implementsGraphQLInterfaceNodeNode() {} +func (v *NodeNodeCertifyVEXStatement) implementsGraphQLInterfaceNodeNode() {} +func (v *NodeNodeCertifyVuln) implementsGraphQLInterfaceNodeNode() {} +func (v *NodeNodeGHSA) implementsGraphQLInterfaceNodeNode() {} +func (v *NodeNodeHasMetadata) implementsGraphQLInterfaceNodeNode() {} +func (v *NodeNodeHasSBOM) implementsGraphQLInterfaceNodeNode() {} +func (v *NodeNodeHasSLSA) implementsGraphQLInterfaceNodeNode() {} +func (v *NodeNodeHasSourceAt) implementsGraphQLInterfaceNodeNode() {} +func (v *NodeNodeHashEqual) implementsGraphQLInterfaceNodeNode() {} +func (v *NodeNodeIsDependency) implementsGraphQLInterfaceNodeNode() {} +func (v *NodeNodeIsOccurrence) implementsGraphQLInterfaceNodeNode() {} +func (v *NodeNodeIsVulnerability) implementsGraphQLInterfaceNodeNode() {} +func (v *NodeNodeNoVuln) implementsGraphQLInterfaceNodeNode() {} +func (v *NodeNodeOSV) implementsGraphQLInterfaceNodeNode() {} +func (v *NodeNodePackage) implementsGraphQLInterfaceNodeNode() {} +func (v *NodeNodePkgEqual) implementsGraphQLInterfaceNodeNode() {} +func (v *NodeNodePointOfContact) implementsGraphQLInterfaceNodeNode() {} +func (v *NodeNodeSource) implementsGraphQLInterfaceNodeNode() {} -// GetId returns NodesNodesIsDependency.Id, and is useful for accessing the field via an interface. -func (v *NodesNodesIsDependency) GetId() string { return v.allIsDependencyTree.Id } +func __unmarshalNodeNode(b []byte, v *NodeNode) error { + if string(b) == "null" { + return nil + } -// GetJustification returns NodesNodesIsDependency.Justification, and is useful for accessing the field via an interface. -func (v *NodesNodesIsDependency) GetJustification() string { - return v.allIsDependencyTree.Justification -} + var tn struct { + TypeName string `json:"__typename"` + } + err := json.Unmarshal(b, &tn) + if err != nil { + return err + } -// GetPackage returns NodesNodesIsDependency.Package, and is useful for accessing the field via an interface. -func (v *NodesNodesIsDependency) GetPackage() allIsDependencyTreePackage { - return v.allIsDependencyTree.Package + switch tn.TypeName { + case "Artifact": + *v = new(NodeNodeArtifact) + return json.Unmarshal(b, *v) + case "Builder": + *v = new(NodeNodeBuilder) + return json.Unmarshal(b, *v) + case "CVE": + *v = new(NodeNodeCVE) + return json.Unmarshal(b, *v) + case "CertifyBad": + *v = new(NodeNodeCertifyBad) + return json.Unmarshal(b, *v) + case "CertifyGood": + *v = new(NodeNodeCertifyGood) + return json.Unmarshal(b, *v) + case "CertifyScorecard": + *v = new(NodeNodeCertifyScorecard) + return json.Unmarshal(b, *v) + case "CertifyVEXStatement": + *v = new(NodeNodeCertifyVEXStatement) + return json.Unmarshal(b, *v) + case "CertifyVuln": + *v = new(NodeNodeCertifyVuln) + return json.Unmarshal(b, *v) + case "GHSA": + *v = new(NodeNodeGHSA) + return json.Unmarshal(b, *v) + case "HasMetadata": + *v = new(NodeNodeHasMetadata) + return json.Unmarshal(b, *v) + case "HasSBOM": + *v = new(NodeNodeHasSBOM) + return json.Unmarshal(b, *v) + case "HasSLSA": + *v = new(NodeNodeHasSLSA) + return json.Unmarshal(b, *v) + case "HasSourceAt": + *v = new(NodeNodeHasSourceAt) + return json.Unmarshal(b, *v) + case "HashEqual": + *v = new(NodeNodeHashEqual) + return json.Unmarshal(b, *v) + case "IsDependency": + *v = new(NodeNodeIsDependency) + return json.Unmarshal(b, *v) + case "IsOccurrence": + *v = new(NodeNodeIsOccurrence) + return json.Unmarshal(b, *v) + case "IsVulnerability": + *v = new(NodeNodeIsVulnerability) + return json.Unmarshal(b, *v) + case "NoVuln": + *v = new(NodeNodeNoVuln) + return json.Unmarshal(b, *v) + case "OSV": + *v = new(NodeNodeOSV) + return json.Unmarshal(b, *v) + case "Package": + *v = new(NodeNodePackage) + return json.Unmarshal(b, *v) + case "PkgEqual": + *v = new(NodeNodePkgEqual) + return json.Unmarshal(b, *v) + case "PointOfContact": + *v = new(NodeNodePointOfContact) + return json.Unmarshal(b, *v) + case "Source": + *v = new(NodeNodeSource) + return json.Unmarshal(b, *v) + case "": + return fmt.Errorf( + "response was missing Node.__typename") + default: + return fmt.Errorf( + `unexpected concrete type for NodeNode: "%v"`, tn.TypeName) + } } -// GetDependentPackage returns NodesNodesIsDependency.DependentPackage, and is useful for accessing the field via an interface. -func (v *NodesNodesIsDependency) GetDependentPackage() allIsDependencyTreeDependentPackage { - return v.allIsDependencyTree.DependentPackage -} +func __marshalNodeNode(v *NodeNode) ([]byte, error) { + + var typename string + switch v := (*v).(type) { + case *NodeNodeArtifact: + typename = "Artifact" + + premarshaled, err := v.__premarshalJSON() + if err != nil { + return nil, err + } + result := struct { + TypeName string `json:"__typename"` + *__premarshalNodeNodeArtifact + }{typename, premarshaled} + return json.Marshal(result) + case *NodeNodeBuilder: + typename = "Builder" + + premarshaled, err := v.__premarshalJSON() + if err != nil { + return nil, err + } + result := struct { + TypeName string `json:"__typename"` + *__premarshalNodeNodeBuilder + }{typename, premarshaled} + return json.Marshal(result) + case *NodeNodeCVE: + typename = "CVE" -// GetDependencyType returns NodesNodesIsDependency.DependencyType, and is useful for accessing the field via an interface. -func (v *NodesNodesIsDependency) GetDependencyType() DependencyType { - return v.allIsDependencyTree.DependencyType -} + premarshaled, err := v.__premarshalJSON() + if err != nil { + return nil, err + } + result := struct { + TypeName string `json:"__typename"` + *__premarshalNodeNodeCVE + }{typename, premarshaled} + return json.Marshal(result) + case *NodeNodeCertifyBad: + typename = "CertifyBad" -// GetVersionRange returns NodesNodesIsDependency.VersionRange, and is useful for accessing the field via an interface. -func (v *NodesNodesIsDependency) GetVersionRange() string { return v.allIsDependencyTree.VersionRange } + premarshaled, err := v.__premarshalJSON() + if err != nil { + return nil, err + } + result := struct { + TypeName string `json:"__typename"` + *__premarshalNodeNodeCertifyBad + }{typename, premarshaled} + return json.Marshal(result) + case *NodeNodeCertifyGood: + typename = "CertifyGood" -// GetOrigin returns NodesNodesIsDependency.Origin, and is useful for accessing the field via an interface. -func (v *NodesNodesIsDependency) GetOrigin() string { return v.allIsDependencyTree.Origin } + premarshaled, err := v.__premarshalJSON() + if err != nil { + return nil, err + } + result := struct { + TypeName string `json:"__typename"` + *__premarshalNodeNodeCertifyGood + }{typename, premarshaled} + return json.Marshal(result) + case *NodeNodeCertifyScorecard: + typename = "CertifyScorecard" -// GetCollector returns NodesNodesIsDependency.Collector, and is useful for accessing the field via an interface. -func (v *NodesNodesIsDependency) GetCollector() string { return v.allIsDependencyTree.Collector } + premarshaled, err := v.__premarshalJSON() + if err != nil { + return nil, err + } + result := struct { + TypeName string `json:"__typename"` + *__premarshalNodeNodeCertifyScorecard + }{typename, premarshaled} + return json.Marshal(result) + case *NodeNodeCertifyVEXStatement: + typename = "CertifyVEXStatement" -func (v *NodesNodesIsDependency) UnmarshalJSON(b []byte) error { + premarshaled, err := v.__premarshalJSON() + if err != nil { + return nil, err + } + result := struct { + TypeName string `json:"__typename"` + *__premarshalNodeNodeCertifyVEXStatement + }{typename, premarshaled} + return json.Marshal(result) + case *NodeNodeCertifyVuln: + typename = "CertifyVuln" - if string(b) == "null" { - return nil - } + premarshaled, err := v.__premarshalJSON() + if err != nil { + return nil, err + } + result := struct { + TypeName string `json:"__typename"` + *__premarshalNodeNodeCertifyVuln + }{typename, premarshaled} + return json.Marshal(result) + case *NodeNodeGHSA: + typename = "GHSA" - var firstPass struct { - *NodesNodesIsDependency - graphql.NoUnmarshalJSON - } - firstPass.NodesNodesIsDependency = v + premarshaled, err := v.__premarshalJSON() + if err != nil { + return nil, err + } + result := struct { + TypeName string `json:"__typename"` + *__premarshalNodeNodeGHSA + }{typename, premarshaled} + return json.Marshal(result) + case *NodeNodeHasMetadata: + typename = "HasMetadata" - err := json.Unmarshal(b, &firstPass) - if err != nil { - return err - } + result := struct { + TypeName string `json:"__typename"` + *NodeNodeHasMetadata + }{typename, v} + return json.Marshal(result) + case *NodeNodeHasSBOM: + typename = "HasSBOM" - err = json.Unmarshal( - b, &v.allIsDependencyTree) - if err != nil { - return err - } - return nil -} + premarshaled, err := v.__premarshalJSON() + if err != nil { + return nil, err + } + result := struct { + TypeName string `json:"__typename"` + *__premarshalNodeNodeHasSBOM + }{typename, premarshaled} + return json.Marshal(result) + case *NodeNodeHasSLSA: + typename = "HasSLSA" -type __premarshalNodesNodesIsDependency struct { - Typename *string `json:"__typename"` + premarshaled, err := v.__premarshalJSON() + if err != nil { + return nil, err + } + result := struct { + TypeName string `json:"__typename"` + *__premarshalNodeNodeHasSLSA + }{typename, premarshaled} + return json.Marshal(result) + case *NodeNodeHasSourceAt: + typename = "HasSourceAt" - Id string `json:"id"` + premarshaled, err := v.__premarshalJSON() + if err != nil { + return nil, err + } + result := struct { + TypeName string `json:"__typename"` + *__premarshalNodeNodeHasSourceAt + }{typename, premarshaled} + return json.Marshal(result) + case *NodeNodeHashEqual: + typename = "HashEqual" - Justification string `json:"justification"` + premarshaled, err := v.__premarshalJSON() + if err != nil { + return nil, err + } + result := struct { + TypeName string `json:"__typename"` + *__premarshalNodeNodeHashEqual + }{typename, premarshaled} + return json.Marshal(result) + case *NodeNodeIsDependency: + typename = "IsDependency" - Package allIsDependencyTreePackage `json:"package"` + premarshaled, err := v.__premarshalJSON() + if err != nil { + return nil, err + } + result := struct { + TypeName string `json:"__typename"` + *__premarshalNodeNodeIsDependency + }{typename, premarshaled} + return json.Marshal(result) + case *NodeNodeIsOccurrence: + typename = "IsOccurrence" - DependentPackage allIsDependencyTreeDependentPackage `json:"dependentPackage"` + premarshaled, err := v.__premarshalJSON() + if err != nil { + return nil, err + } + result := struct { + TypeName string `json:"__typename"` + *__premarshalNodeNodeIsOccurrence + }{typename, premarshaled} + return json.Marshal(result) + case *NodeNodeIsVulnerability: + typename = "IsVulnerability" - DependencyType DependencyType `json:"dependencyType"` + premarshaled, err := v.__premarshalJSON() + if err != nil { + return nil, err + } + result := struct { + TypeName string `json:"__typename"` + *__premarshalNodeNodeIsVulnerability + }{typename, premarshaled} + return json.Marshal(result) + case *NodeNodeNoVuln: + typename = "NoVuln" - VersionRange string `json:"versionRange"` + result := struct { + TypeName string `json:"__typename"` + *NodeNodeNoVuln + }{typename, v} + return json.Marshal(result) + case *NodeNodeOSV: + typename = "OSV" - Origin string `json:"origin"` + premarshaled, err := v.__premarshalJSON() + if err != nil { + return nil, err + } + result := struct { + TypeName string `json:"__typename"` + *__premarshalNodeNodeOSV + }{typename, premarshaled} + return json.Marshal(result) + case *NodeNodePackage: + typename = "Package" - Collector string `json:"collector"` -} + premarshaled, err := v.__premarshalJSON() + if err != nil { + return nil, err + } + result := struct { + TypeName string `json:"__typename"` + *__premarshalNodeNodePackage + }{typename, premarshaled} + return json.Marshal(result) + case *NodeNodePkgEqual: + typename = "PkgEqual" -func (v *NodesNodesIsDependency) MarshalJSON() ([]byte, error) { - premarshaled, err := v.__premarshalJSON() - if err != nil { - return nil, err - } - return json.Marshal(premarshaled) -} + premarshaled, err := v.__premarshalJSON() + if err != nil { + return nil, err + } + result := struct { + TypeName string `json:"__typename"` + *__premarshalNodeNodePkgEqual + }{typename, premarshaled} + return json.Marshal(result) + case *NodeNodePointOfContact: + typename = "PointOfContact" -func (v *NodesNodesIsDependency) __premarshalJSON() (*__premarshalNodesNodesIsDependency, error) { - var retval __premarshalNodesNodesIsDependency + result := struct { + TypeName string `json:"__typename"` + *NodeNodePointOfContact + }{typename, v} + return json.Marshal(result) + case *NodeNodeSource: + typename = "Source" - retval.Typename = v.Typename - retval.Id = v.allIsDependencyTree.Id - retval.Justification = v.allIsDependencyTree.Justification - retval.Package = v.allIsDependencyTree.Package - retval.DependentPackage = v.allIsDependencyTree.DependentPackage - retval.DependencyType = v.allIsDependencyTree.DependencyType - retval.VersionRange = v.allIsDependencyTree.VersionRange - retval.Origin = v.allIsDependencyTree.Origin - retval.Collector = v.allIsDependencyTree.Collector - return &retval, nil + premarshaled, err := v.__premarshalJSON() + if err != nil { + return nil, err + } + result := struct { + TypeName string `json:"__typename"` + *__premarshalNodeNodeSource + }{typename, premarshaled} + return json.Marshal(result) + case nil: + return []byte("null"), nil + default: + return nil, fmt.Errorf( + `unexpected concrete type for NodeNode: "%T"`, v) + } } -// NodesNodesIsOccurrence includes the requested fields of the GraphQL type IsOccurrence. +// NodeNodeArtifact includes the requested fields of the GraphQL type Artifact. // The GraphQL type's documentation follows. // -// IsOccurrence is an attestation to link an artifact to a package or source. +// Artifact represents an artifact identified by a checksum hash. // -// Attestation must occur at the PackageVersion or at the SourceName. -type NodesNodesIsOccurrence struct { - Typename *string `json:"__typename"` - AllIsOccurrencesTree `json:"-"` -} - -// GetTypename returns NodesNodesIsOccurrence.Typename, and is useful for accessing the field via an interface. -func (v *NodesNodesIsOccurrence) GetTypename() *string { return v.Typename } - -// GetId returns NodesNodesIsOccurrence.Id, and is useful for accessing the field via an interface. -func (v *NodesNodesIsOccurrence) GetId() string { return v.AllIsOccurrencesTree.Id } - -// GetSubject returns NodesNodesIsOccurrence.Subject, and is useful for accessing the field via an interface. -func (v *NodesNodesIsOccurrence) GetSubject() AllIsOccurrencesTreeSubjectPackageOrSource { - return v.AllIsOccurrencesTree.Subject +// The checksum is split into the digest value and the algorithm used to generate +// it. Both fields are mandatory and canonicalized to be lowercase. +// +// If having a checksum Go object, algorithm can be +// strings.ToLower(string(checksum.Algorithm)) and digest can be checksum.Value. +type NodeNodeArtifact struct { + Typename *string `json:"__typename"` + AllArtifactTree `json:"-"` } -// GetArtifact returns NodesNodesIsOccurrence.Artifact, and is useful for accessing the field via an interface. -func (v *NodesNodesIsOccurrence) GetArtifact() AllIsOccurrencesTreeArtifact { - return v.AllIsOccurrencesTree.Artifact -} +// GetTypename returns NodeNodeArtifact.Typename, and is useful for accessing the field via an interface. +func (v *NodeNodeArtifact) GetTypename() *string { return v.Typename } -// GetJustification returns NodesNodesIsOccurrence.Justification, and is useful for accessing the field via an interface. -func (v *NodesNodesIsOccurrence) GetJustification() string { - return v.AllIsOccurrencesTree.Justification -} +// GetId returns NodeNodeArtifact.Id, and is useful for accessing the field via an interface. +func (v *NodeNodeArtifact) GetId() string { return v.AllArtifactTree.Id } -// GetOrigin returns NodesNodesIsOccurrence.Origin, and is useful for accessing the field via an interface. -func (v *NodesNodesIsOccurrence) GetOrigin() string { return v.AllIsOccurrencesTree.Origin } +// GetAlgorithm returns NodeNodeArtifact.Algorithm, and is useful for accessing the field via an interface. +func (v *NodeNodeArtifact) GetAlgorithm() string { return v.AllArtifactTree.Algorithm } -// GetCollector returns NodesNodesIsOccurrence.Collector, and is useful for accessing the field via an interface. -func (v *NodesNodesIsOccurrence) GetCollector() string { return v.AllIsOccurrencesTree.Collector } +// GetDigest returns NodeNodeArtifact.Digest, and is useful for accessing the field via an interface. +func (v *NodeNodeArtifact) GetDigest() string { return v.AllArtifactTree.Digest } -func (v *NodesNodesIsOccurrence) UnmarshalJSON(b []byte) error { +func (v *NodeNodeArtifact) UnmarshalJSON(b []byte) error { if string(b) == "null" { return nil } var firstPass struct { - *NodesNodesIsOccurrence + *NodeNodeArtifact graphql.NoUnmarshalJSON } - firstPass.NodesNodesIsOccurrence = v + firstPass.NodeNodeArtifact = v err := json.Unmarshal(b, &firstPass) if err != nil { @@ -13808,30 +14392,24 @@ func (v *NodesNodesIsOccurrence) UnmarshalJSON(b []byte) error { } err = json.Unmarshal( - b, &v.AllIsOccurrencesTree) + b, &v.AllArtifactTree) if err != nil { return err } return nil } -type __premarshalNodesNodesIsOccurrence struct { +type __premarshalNodeNodeArtifact struct { Typename *string `json:"__typename"` Id string `json:"id"` - Subject json.RawMessage `json:"subject"` - - Artifact AllIsOccurrencesTreeArtifact `json:"artifact"` - - Justification string `json:"justification"` - - Origin string `json:"origin"` + Algorithm string `json:"algorithm"` - Collector string `json:"collector"` + Digest string `json:"digest"` } -func (v *NodesNodesIsOccurrence) MarshalJSON() ([]byte, error) { +func (v *NodeNodeArtifact) MarshalJSON() ([]byte, error) { premarshaled, err := v.__premarshalJSON() if err != nil { return nil, err @@ -13839,77 +14417,47 @@ func (v *NodesNodesIsOccurrence) MarshalJSON() ([]byte, error) { return json.Marshal(premarshaled) } -func (v *NodesNodesIsOccurrence) __premarshalJSON() (*__premarshalNodesNodesIsOccurrence, error) { - var retval __premarshalNodesNodesIsOccurrence +func (v *NodeNodeArtifact) __premarshalJSON() (*__premarshalNodeNodeArtifact, error) { + var retval __premarshalNodeNodeArtifact retval.Typename = v.Typename - retval.Id = v.AllIsOccurrencesTree.Id - { - - dst := &retval.Subject - src := v.AllIsOccurrencesTree.Subject - var err error - *dst, err = __marshalAllIsOccurrencesTreeSubjectPackageOrSource( - &src) - if err != nil { - return nil, fmt.Errorf( - "unable to marshal NodesNodesIsOccurrence.AllIsOccurrencesTree.Subject: %w", err) - } - } - retval.Artifact = v.AllIsOccurrencesTree.Artifact - retval.Justification = v.AllIsOccurrencesTree.Justification - retval.Origin = v.AllIsOccurrencesTree.Origin - retval.Collector = v.AllIsOccurrencesTree.Collector + retval.Id = v.AllArtifactTree.Id + retval.Algorithm = v.AllArtifactTree.Algorithm + retval.Digest = v.AllArtifactTree.Digest return &retval, nil } -// NodesNodesIsVulnerability includes the requested fields of the GraphQL type IsVulnerability. +// NodeNodeBuilder includes the requested fields of the GraphQL type Builder. // The GraphQL type's documentation follows. // -// IsVulnerability is an attestation to link CVE/GHSA with data in OSV. -type NodesNodesIsVulnerability struct { - Typename *string `json:"__typename"` - allIsVulnerability `json:"-"` -} - -// GetTypename returns NodesNodesIsVulnerability.Typename, and is useful for accessing the field via an interface. -func (v *NodesNodesIsVulnerability) GetTypename() *string { return v.Typename } - -// GetId returns NodesNodesIsVulnerability.Id, and is useful for accessing the field via an interface. -func (v *NodesNodesIsVulnerability) GetId() string { return v.allIsVulnerability.Id } - -// GetOsv returns NodesNodesIsVulnerability.Osv, and is useful for accessing the field via an interface. -func (v *NodesNodesIsVulnerability) GetOsv() allIsVulnerabilityOsvOSV { - return v.allIsVulnerability.Osv -} - -// GetVulnerability returns NodesNodesIsVulnerability.Vulnerability, and is useful for accessing the field via an interface. -func (v *NodesNodesIsVulnerability) GetVulnerability() allIsVulnerabilityVulnerabilityCveOrGhsa { - return v.allIsVulnerability.Vulnerability +// Builder represents the builder (e.g., FRSCA or GitHub Actions). +// +// Currently builders are identified by the uri field. +type NodeNodeBuilder struct { + Typename *string `json:"__typename"` + AllBuilderTree `json:"-"` } -// GetJustification returns NodesNodesIsVulnerability.Justification, and is useful for accessing the field via an interface. -func (v *NodesNodesIsVulnerability) GetJustification() string { - return v.allIsVulnerability.Justification -} +// GetTypename returns NodeNodeBuilder.Typename, and is useful for accessing the field via an interface. +func (v *NodeNodeBuilder) GetTypename() *string { return v.Typename } -// GetOrigin returns NodesNodesIsVulnerability.Origin, and is useful for accessing the field via an interface. -func (v *NodesNodesIsVulnerability) GetOrigin() string { return v.allIsVulnerability.Origin } +// GetId returns NodeNodeBuilder.Id, and is useful for accessing the field via an interface. +func (v *NodeNodeBuilder) GetId() string { return v.AllBuilderTree.Id } -// GetCollector returns NodesNodesIsVulnerability.Collector, and is useful for accessing the field via an interface. -func (v *NodesNodesIsVulnerability) GetCollector() string { return v.allIsVulnerability.Collector } +// GetUri returns NodeNodeBuilder.Uri, and is useful for accessing the field via an interface. +func (v *NodeNodeBuilder) GetUri() string { return v.AllBuilderTree.Uri } -func (v *NodesNodesIsVulnerability) UnmarshalJSON(b []byte) error { +func (v *NodeNodeBuilder) UnmarshalJSON(b []byte) error { if string(b) == "null" { return nil } var firstPass struct { - *NodesNodesIsVulnerability + *NodeNodeBuilder graphql.NoUnmarshalJSON } - firstPass.NodesNodesIsVulnerability = v + firstPass.NodeNodeBuilder = v err := json.Unmarshal(b, &firstPass) if err != nil { @@ -13917,30 +14465,22 @@ func (v *NodesNodesIsVulnerability) UnmarshalJSON(b []byte) error { } err = json.Unmarshal( - b, &v.allIsVulnerability) + b, &v.AllBuilderTree) if err != nil { return err } return nil } -type __premarshalNodesNodesIsVulnerability struct { +type __premarshalNodeNodeBuilder struct { Typename *string `json:"__typename"` Id string `json:"id"` - Osv allIsVulnerabilityOsvOSV `json:"osv"` - - Vulnerability json.RawMessage `json:"vulnerability"` - - Justification string `json:"justification"` - - Origin string `json:"origin"` - - Collector string `json:"collector"` + Uri string `json:"uri"` } -func (v *NodesNodesIsVulnerability) MarshalJSON() ([]byte, error) { +func (v *NodeNodeBuilder) MarshalJSON() ([]byte, error) { premarshaled, err := v.__premarshalJSON() if err != nil { return nil, err @@ -13948,515 +14488,257 @@ func (v *NodesNodesIsVulnerability) MarshalJSON() ([]byte, error) { return json.Marshal(premarshaled) } -func (v *NodesNodesIsVulnerability) __premarshalJSON() (*__premarshalNodesNodesIsVulnerability, error) { - var retval __premarshalNodesNodesIsVulnerability +func (v *NodeNodeBuilder) __premarshalJSON() (*__premarshalNodeNodeBuilder, error) { + var retval __premarshalNodeNodeBuilder retval.Typename = v.Typename - retval.Id = v.allIsVulnerability.Id - retval.Osv = v.allIsVulnerability.Osv - { - - dst := &retval.Vulnerability - src := v.allIsVulnerability.Vulnerability - var err error - *dst, err = __marshalallIsVulnerabilityVulnerabilityCveOrGhsa( - &src) - if err != nil { - return nil, fmt.Errorf( - "unable to marshal NodesNodesIsVulnerability.allIsVulnerability.Vulnerability: %w", err) - } - } - retval.Justification = v.allIsVulnerability.Justification - retval.Origin = v.allIsVulnerability.Origin - retval.Collector = v.allIsVulnerability.Collector + retval.Id = v.AllBuilderTree.Id + retval.Uri = v.AllBuilderTree.Uri return &retval, nil } -// NodesNodesNoVuln includes the requested fields of the GraphQL type NoVuln. +// NodeNodeCVE includes the requested fields of the GraphQL type CVE. // The GraphQL type's documentation follows. // -// NoVuln is a special vulnerability node to attest that no vulnerability has been -// found during a vulnerability scan. -// -// Backends guarantee that this is a singleton node. -type NodesNodesNoVuln struct { - Typename *string `json:"__typename"` - Id string `json:"id"` -} - -// GetTypename returns NodesNodesNoVuln.Typename, and is useful for accessing the field via an interface. -func (v *NodesNodesNoVuln) GetTypename() *string { return v.Typename } - -// GetId returns NodesNodesNoVuln.Id, and is useful for accessing the field via an interface. -func (v *NodesNodesNoVuln) GetId() string { return v.Id } - -// NodesNodesNode includes the requested fields of the GraphQL interface Node. +// CVE represents a vulnerability in the Common Vulnerabilities and Exposures +// schema. // -// NodesNodesNode is implemented by the following types: -// NodesNodesArtifact -// NodesNodesBuilder -// NodesNodesCVE -// NodesNodesCertifyBad -// NodesNodesCertifyGood -// NodesNodesCertifyScorecard -// NodesNodesCertifyVEXStatement -// NodesNodesCertifyVuln -// NodesNodesGHSA -// NodesNodesHasMetadata -// NodesNodesHasSBOM -// NodesNodesHasSLSA -// NodesNodesHasSourceAt -// NodesNodesHashEqual -// NodesNodesIsDependency -// NodesNodesIsOccurrence -// NodesNodesIsVulnerability -// NodesNodesNoVuln -// NodesNodesOSV -// NodesNodesPackage -// NodesNodesPkgEqual -// NodesNodesPointOfContact -// NodesNodesSource -// The GraphQL type's documentation follows. +// The vulnerability identifier contains a year field, so we are extracting that +// to allow matching for vulnerabilities found in a given year. // -// Node is a union type of all the possible nodes. +// The vulnerability identifier field is mandatory and canonicalized to be +// lowercase. // -// It encapsulates the software tree nodes along with the evidence nodes. In a -// path query, all connecting evidence nodes along with their intermediate subject -// nodes need to be returned in order to create a complete graph. -type NodesNodesNode interface { - implementsGraphQLInterfaceNodesNodesNode() - // GetTypename returns the receiver's concrete GraphQL type-name (see interface doc for possible values). - GetTypename() *string +// This node can be referred to by other parts of GUAC. +type NodeNodeCVE struct { + Typename *string `json:"__typename"` + AllCveTree `json:"-"` } -func (v *NodesNodesArtifact) implementsGraphQLInterfaceNodesNodesNode() {} -func (v *NodesNodesBuilder) implementsGraphQLInterfaceNodesNodesNode() {} -func (v *NodesNodesCVE) implementsGraphQLInterfaceNodesNodesNode() {} -func (v *NodesNodesCertifyBad) implementsGraphQLInterfaceNodesNodesNode() {} -func (v *NodesNodesCertifyGood) implementsGraphQLInterfaceNodesNodesNode() {} -func (v *NodesNodesCertifyScorecard) implementsGraphQLInterfaceNodesNodesNode() {} -func (v *NodesNodesCertifyVEXStatement) implementsGraphQLInterfaceNodesNodesNode() {} -func (v *NodesNodesCertifyVuln) implementsGraphQLInterfaceNodesNodesNode() {} -func (v *NodesNodesGHSA) implementsGraphQLInterfaceNodesNodesNode() {} -func (v *NodesNodesHasMetadata) implementsGraphQLInterfaceNodesNodesNode() {} -func (v *NodesNodesHasSBOM) implementsGraphQLInterfaceNodesNodesNode() {} -func (v *NodesNodesHasSLSA) implementsGraphQLInterfaceNodesNodesNode() {} -func (v *NodesNodesHasSourceAt) implementsGraphQLInterfaceNodesNodesNode() {} -func (v *NodesNodesHashEqual) implementsGraphQLInterfaceNodesNodesNode() {} -func (v *NodesNodesIsDependency) implementsGraphQLInterfaceNodesNodesNode() {} -func (v *NodesNodesIsOccurrence) implementsGraphQLInterfaceNodesNodesNode() {} -func (v *NodesNodesIsVulnerability) implementsGraphQLInterfaceNodesNodesNode() {} -func (v *NodesNodesNoVuln) implementsGraphQLInterfaceNodesNodesNode() {} -func (v *NodesNodesOSV) implementsGraphQLInterfaceNodesNodesNode() {} -func (v *NodesNodesPackage) implementsGraphQLInterfaceNodesNodesNode() {} -func (v *NodesNodesPkgEqual) implementsGraphQLInterfaceNodesNodesNode() {} -func (v *NodesNodesPointOfContact) implementsGraphQLInterfaceNodesNodesNode() {} -func (v *NodesNodesSource) implementsGraphQLInterfaceNodesNodesNode() {} +// GetTypename returns NodeNodeCVE.Typename, and is useful for accessing the field via an interface. +func (v *NodeNodeCVE) GetTypename() *string { return v.Typename } + +// GetId returns NodeNodeCVE.Id, and is useful for accessing the field via an interface. +func (v *NodeNodeCVE) GetId() string { return v.AllCveTree.Id } + +// GetYear returns NodeNodeCVE.Year, and is useful for accessing the field via an interface. +func (v *NodeNodeCVE) GetYear() int { return v.AllCveTree.Year } + +// GetCveId returns NodeNodeCVE.CveId, and is useful for accessing the field via an interface. +func (v *NodeNodeCVE) GetCveId() string { return v.AllCveTree.CveId } + +func (v *NodeNodeCVE) UnmarshalJSON(b []byte) error { -func __unmarshalNodesNodesNode(b []byte, v *NodesNodesNode) error { if string(b) == "null" { return nil } - var tn struct { - TypeName string `json:"__typename"` + var firstPass struct { + *NodeNodeCVE + graphql.NoUnmarshalJSON } - err := json.Unmarshal(b, &tn) + firstPass.NodeNodeCVE = v + + err := json.Unmarshal(b, &firstPass) if err != nil { return err } - switch tn.TypeName { - case "Artifact": - *v = new(NodesNodesArtifact) - return json.Unmarshal(b, *v) - case "Builder": - *v = new(NodesNodesBuilder) - return json.Unmarshal(b, *v) - case "CVE": - *v = new(NodesNodesCVE) - return json.Unmarshal(b, *v) - case "CertifyBad": - *v = new(NodesNodesCertifyBad) - return json.Unmarshal(b, *v) - case "CertifyGood": - *v = new(NodesNodesCertifyGood) - return json.Unmarshal(b, *v) - case "CertifyScorecard": - *v = new(NodesNodesCertifyScorecard) - return json.Unmarshal(b, *v) - case "CertifyVEXStatement": - *v = new(NodesNodesCertifyVEXStatement) - return json.Unmarshal(b, *v) - case "CertifyVuln": - *v = new(NodesNodesCertifyVuln) - return json.Unmarshal(b, *v) - case "GHSA": - *v = new(NodesNodesGHSA) - return json.Unmarshal(b, *v) - case "HasMetadata": - *v = new(NodesNodesHasMetadata) - return json.Unmarshal(b, *v) - case "HasSBOM": - *v = new(NodesNodesHasSBOM) - return json.Unmarshal(b, *v) - case "HasSLSA": - *v = new(NodesNodesHasSLSA) - return json.Unmarshal(b, *v) - case "HasSourceAt": - *v = new(NodesNodesHasSourceAt) - return json.Unmarshal(b, *v) - case "HashEqual": - *v = new(NodesNodesHashEqual) - return json.Unmarshal(b, *v) - case "IsDependency": - *v = new(NodesNodesIsDependency) - return json.Unmarshal(b, *v) - case "IsOccurrence": - *v = new(NodesNodesIsOccurrence) - return json.Unmarshal(b, *v) - case "IsVulnerability": - *v = new(NodesNodesIsVulnerability) - return json.Unmarshal(b, *v) - case "NoVuln": - *v = new(NodesNodesNoVuln) - return json.Unmarshal(b, *v) - case "OSV": - *v = new(NodesNodesOSV) - return json.Unmarshal(b, *v) - case "Package": - *v = new(NodesNodesPackage) - return json.Unmarshal(b, *v) - case "PkgEqual": - *v = new(NodesNodesPkgEqual) - return json.Unmarshal(b, *v) - case "PointOfContact": - *v = new(NodesNodesPointOfContact) - return json.Unmarshal(b, *v) - case "Source": - *v = new(NodesNodesSource) - return json.Unmarshal(b, *v) - case "": - return fmt.Errorf( - "response was missing Node.__typename") - default: - return fmt.Errorf( - `unexpected concrete type for NodesNodesNode: "%v"`, tn.TypeName) + err = json.Unmarshal( + b, &v.AllCveTree) + if err != nil { + return err } + return nil } -func __marshalNodesNodesNode(v *NodesNodesNode) ([]byte, error) { +type __premarshalNodeNodeCVE struct { + Typename *string `json:"__typename"` - var typename string - switch v := (*v).(type) { - case *NodesNodesArtifact: - typename = "Artifact" + Id string `json:"id"` - premarshaled, err := v.__premarshalJSON() - if err != nil { - return nil, err - } - result := struct { - TypeName string `json:"__typename"` - *__premarshalNodesNodesArtifact - }{typename, premarshaled} - return json.Marshal(result) - case *NodesNodesBuilder: - typename = "Builder" + Year int `json:"year"` - premarshaled, err := v.__premarshalJSON() - if err != nil { - return nil, err - } - result := struct { - TypeName string `json:"__typename"` - *__premarshalNodesNodesBuilder - }{typename, premarshaled} - return json.Marshal(result) - case *NodesNodesCVE: - typename = "CVE" + CveId string `json:"cveId"` +} - premarshaled, err := v.__premarshalJSON() - if err != nil { - return nil, err - } - result := struct { - TypeName string `json:"__typename"` - *__premarshalNodesNodesCVE - }{typename, premarshaled} - return json.Marshal(result) - case *NodesNodesCertifyBad: - typename = "CertifyBad" +func (v *NodeNodeCVE) MarshalJSON() ([]byte, error) { + premarshaled, err := v.__premarshalJSON() + if err != nil { + return nil, err + } + return json.Marshal(premarshaled) +} - premarshaled, err := v.__premarshalJSON() - if err != nil { - return nil, err - } - result := struct { - TypeName string `json:"__typename"` - *__premarshalNodesNodesCertifyBad - }{typename, premarshaled} - return json.Marshal(result) - case *NodesNodesCertifyGood: - typename = "CertifyGood" +func (v *NodeNodeCVE) __premarshalJSON() (*__premarshalNodeNodeCVE, error) { + var retval __premarshalNodeNodeCVE - premarshaled, err := v.__premarshalJSON() - if err != nil { - return nil, err - } - result := struct { - TypeName string `json:"__typename"` - *__premarshalNodesNodesCertifyGood - }{typename, premarshaled} - return json.Marshal(result) - case *NodesNodesCertifyScorecard: - typename = "CertifyScorecard" + retval.Typename = v.Typename + retval.Id = v.AllCveTree.Id + retval.Year = v.AllCveTree.Year + retval.CveId = v.AllCveTree.CveId + return &retval, nil +} - premarshaled, err := v.__premarshalJSON() - if err != nil { - return nil, err - } - result := struct { - TypeName string `json:"__typename"` - *__premarshalNodesNodesCertifyScorecard - }{typename, premarshaled} - return json.Marshal(result) - case *NodesNodesCertifyVEXStatement: - typename = "CertifyVEXStatement" +// NodeNodeCertifyBad includes the requested fields of the GraphQL type CertifyBad. +// The GraphQL type's documentation follows. +// +// CertifyBad is an attestation that a package, source, or artifact is considered +// bad. +// +// All evidence trees record a justification for the property they represent as +// well as the document that contains the attestation (origin) and the collector +// that collected the document (collector). +// +// The certification applies to a subject which is a package, source, or artifact. +// If the attestation targets a package, it must target a PackageName or a +// PackageVersion. If the attestation targets a source, it must target a +// SourceName. +type NodeNodeCertifyBad struct { + Typename *string `json:"__typename"` + AllCertifyBad `json:"-"` +} - premarshaled, err := v.__premarshalJSON() - if err != nil { - return nil, err - } - result := struct { - TypeName string `json:"__typename"` - *__premarshalNodesNodesCertifyVEXStatement - }{typename, premarshaled} - return json.Marshal(result) - case *NodesNodesCertifyVuln: - typename = "CertifyVuln" +// GetTypename returns NodeNodeCertifyBad.Typename, and is useful for accessing the field via an interface. +func (v *NodeNodeCertifyBad) GetTypename() *string { return v.Typename } + +// GetId returns NodeNodeCertifyBad.Id, and is useful for accessing the field via an interface. +func (v *NodeNodeCertifyBad) GetId() string { return v.AllCertifyBad.Id } + +// GetJustification returns NodeNodeCertifyBad.Justification, and is useful for accessing the field via an interface. +func (v *NodeNodeCertifyBad) GetJustification() string { return v.AllCertifyBad.Justification } + +// GetSubject returns NodeNodeCertifyBad.Subject, and is useful for accessing the field via an interface. +func (v *NodeNodeCertifyBad) GetSubject() AllCertifyBadSubjectPackageSourceOrArtifact { + return v.AllCertifyBad.Subject +} + +// GetOrigin returns NodeNodeCertifyBad.Origin, and is useful for accessing the field via an interface. +func (v *NodeNodeCertifyBad) GetOrigin() string { return v.AllCertifyBad.Origin } - premarshaled, err := v.__premarshalJSON() - if err != nil { - return nil, err - } - result := struct { - TypeName string `json:"__typename"` - *__premarshalNodesNodesCertifyVuln - }{typename, premarshaled} - return json.Marshal(result) - case *NodesNodesGHSA: - typename = "GHSA" +// GetCollector returns NodeNodeCertifyBad.Collector, and is useful for accessing the field via an interface. +func (v *NodeNodeCertifyBad) GetCollector() string { return v.AllCertifyBad.Collector } - premarshaled, err := v.__premarshalJSON() - if err != nil { - return nil, err - } - result := struct { - TypeName string `json:"__typename"` - *__premarshalNodesNodesGHSA - }{typename, premarshaled} - return json.Marshal(result) - case *NodesNodesHasMetadata: - typename = "HasMetadata" +func (v *NodeNodeCertifyBad) UnmarshalJSON(b []byte) error { - result := struct { - TypeName string `json:"__typename"` - *NodesNodesHasMetadata - }{typename, v} - return json.Marshal(result) - case *NodesNodesHasSBOM: - typename = "HasSBOM" + if string(b) == "null" { + return nil + } - premarshaled, err := v.__premarshalJSON() - if err != nil { - return nil, err - } - result := struct { - TypeName string `json:"__typename"` - *__premarshalNodesNodesHasSBOM - }{typename, premarshaled} - return json.Marshal(result) - case *NodesNodesHasSLSA: - typename = "HasSLSA" + var firstPass struct { + *NodeNodeCertifyBad + graphql.NoUnmarshalJSON + } + firstPass.NodeNodeCertifyBad = v - premarshaled, err := v.__premarshalJSON() - if err != nil { - return nil, err - } - result := struct { - TypeName string `json:"__typename"` - *__premarshalNodesNodesHasSLSA - }{typename, premarshaled} - return json.Marshal(result) - case *NodesNodesHasSourceAt: - typename = "HasSourceAt" + err := json.Unmarshal(b, &firstPass) + if err != nil { + return err + } - premarshaled, err := v.__premarshalJSON() - if err != nil { - return nil, err - } - result := struct { - TypeName string `json:"__typename"` - *__premarshalNodesNodesHasSourceAt - }{typename, premarshaled} - return json.Marshal(result) - case *NodesNodesHashEqual: - typename = "HashEqual" + err = json.Unmarshal( + b, &v.AllCertifyBad) + if err != nil { + return err + } + return nil +} - premarshaled, err := v.__premarshalJSON() - if err != nil { - return nil, err - } - result := struct { - TypeName string `json:"__typename"` - *__premarshalNodesNodesHashEqual - }{typename, premarshaled} - return json.Marshal(result) - case *NodesNodesIsDependency: - typename = "IsDependency" +type __premarshalNodeNodeCertifyBad struct { + Typename *string `json:"__typename"` - premarshaled, err := v.__premarshalJSON() - if err != nil { - return nil, err - } - result := struct { - TypeName string `json:"__typename"` - *__premarshalNodesNodesIsDependency - }{typename, premarshaled} - return json.Marshal(result) - case *NodesNodesIsOccurrence: - typename = "IsOccurrence" + Id string `json:"id"` - premarshaled, err := v.__premarshalJSON() - if err != nil { - return nil, err - } - result := struct { - TypeName string `json:"__typename"` - *__premarshalNodesNodesIsOccurrence - }{typename, premarshaled} - return json.Marshal(result) - case *NodesNodesIsVulnerability: - typename = "IsVulnerability" + Justification string `json:"justification"` - premarshaled, err := v.__premarshalJSON() - if err != nil { - return nil, err - } - result := struct { - TypeName string `json:"__typename"` - *__premarshalNodesNodesIsVulnerability - }{typename, premarshaled} - return json.Marshal(result) - case *NodesNodesNoVuln: - typename = "NoVuln" + Subject json.RawMessage `json:"subject"` - result := struct { - TypeName string `json:"__typename"` - *NodesNodesNoVuln - }{typename, v} - return json.Marshal(result) - case *NodesNodesOSV: - typename = "OSV" + Origin string `json:"origin"` - premarshaled, err := v.__premarshalJSON() - if err != nil { - return nil, err - } - result := struct { - TypeName string `json:"__typename"` - *__premarshalNodesNodesOSV - }{typename, premarshaled} - return json.Marshal(result) - case *NodesNodesPackage: - typename = "Package" + Collector string `json:"collector"` +} - premarshaled, err := v.__premarshalJSON() - if err != nil { - return nil, err - } - result := struct { - TypeName string `json:"__typename"` - *__premarshalNodesNodesPackage - }{typename, premarshaled} - return json.Marshal(result) - case *NodesNodesPkgEqual: - typename = "PkgEqual" +func (v *NodeNodeCertifyBad) MarshalJSON() ([]byte, error) { + premarshaled, err := v.__premarshalJSON() + if err != nil { + return nil, err + } + return json.Marshal(premarshaled) +} - premarshaled, err := v.__premarshalJSON() - if err != nil { - return nil, err - } - result := struct { - TypeName string `json:"__typename"` - *__premarshalNodesNodesPkgEqual - }{typename, premarshaled} - return json.Marshal(result) - case *NodesNodesPointOfContact: - typename = "PointOfContact" +func (v *NodeNodeCertifyBad) __premarshalJSON() (*__premarshalNodeNodeCertifyBad, error) { + var retval __premarshalNodeNodeCertifyBad - result := struct { - TypeName string `json:"__typename"` - *NodesNodesPointOfContact - }{typename, v} - return json.Marshal(result) - case *NodesNodesSource: - typename = "Source" + retval.Typename = v.Typename + retval.Id = v.AllCertifyBad.Id + retval.Justification = v.AllCertifyBad.Justification + { - premarshaled, err := v.__premarshalJSON() + dst := &retval.Subject + src := v.AllCertifyBad.Subject + var err error + *dst, err = __marshalAllCertifyBadSubjectPackageSourceOrArtifact( + &src) if err != nil { - return nil, err + return nil, fmt.Errorf( + "unable to marshal NodeNodeCertifyBad.AllCertifyBad.Subject: %w", err) } - result := struct { - TypeName string `json:"__typename"` - *__premarshalNodesNodesSource - }{typename, premarshaled} - return json.Marshal(result) - case nil: - return []byte("null"), nil - default: - return nil, fmt.Errorf( - `unexpected concrete type for NodesNodesNode: "%T"`, v) } + retval.Origin = v.AllCertifyBad.Origin + retval.Collector = v.AllCertifyBad.Collector + return &retval, nil } -// NodesNodesOSV includes the requested fields of the GraphQL type OSV. +// NodeNodeCertifyGood includes the requested fields of the GraphQL type CertifyGood. // The GraphQL type's documentation follows. // -// OSV represents an Open Source Vulnerability. -// -// The osvId field is mandatory and canonicalized to be lowercase. +// CertifyGood is an attestation that a package, source, or artifact is considered +// good. // -// This maps to a vulnerability ID specific to the environment (e.g., GHSA ID or -// CVE ID). +// All evidence trees record a justification for the property they represent as +// well as the document that contains the attestation (origin) and the collector +// that collected the document (collector). // -// This node can be referred to by other parts of GUAC. -type NodesNodesOSV struct { - Typename *string `json:"__typename"` - AllOSVTree `json:"-"` +// The certification applies to a subject which is a package, source, or artifact. +// If the attestation targets a package, it must target a PackageName or a +// PackageVersion. If the attestation targets a source, it must target a +// SourceName. +type NodeNodeCertifyGood struct { + Typename *string `json:"__typename"` + AllCertifyGood `json:"-"` } -// GetTypename returns NodesNodesOSV.Typename, and is useful for accessing the field via an interface. -func (v *NodesNodesOSV) GetTypename() *string { return v.Typename } +// GetTypename returns NodeNodeCertifyGood.Typename, and is useful for accessing the field via an interface. +func (v *NodeNodeCertifyGood) GetTypename() *string { return v.Typename } -// GetId returns NodesNodesOSV.Id, and is useful for accessing the field via an interface. -func (v *NodesNodesOSV) GetId() string { return v.AllOSVTree.Id } +// GetId returns NodeNodeCertifyGood.Id, and is useful for accessing the field via an interface. +func (v *NodeNodeCertifyGood) GetId() string { return v.AllCertifyGood.Id } + +// GetJustification returns NodeNodeCertifyGood.Justification, and is useful for accessing the field via an interface. +func (v *NodeNodeCertifyGood) GetJustification() string { return v.AllCertifyGood.Justification } + +// GetSubject returns NodeNodeCertifyGood.Subject, and is useful for accessing the field via an interface. +func (v *NodeNodeCertifyGood) GetSubject() AllCertifyGoodSubjectPackageSourceOrArtifact { + return v.AllCertifyGood.Subject +} + +// GetOrigin returns NodeNodeCertifyGood.Origin, and is useful for accessing the field via an interface. +func (v *NodeNodeCertifyGood) GetOrigin() string { return v.AllCertifyGood.Origin } -// GetOsvId returns NodesNodesOSV.OsvId, and is useful for accessing the field via an interface. -func (v *NodesNodesOSV) GetOsvId() string { return v.AllOSVTree.OsvId } +// GetCollector returns NodeNodeCertifyGood.Collector, and is useful for accessing the field via an interface. +func (v *NodeNodeCertifyGood) GetCollector() string { return v.AllCertifyGood.Collector } -func (v *NodesNodesOSV) UnmarshalJSON(b []byte) error { +func (v *NodeNodeCertifyGood) UnmarshalJSON(b []byte) error { if string(b) == "null" { return nil } var firstPass struct { - *NodesNodesOSV + *NodeNodeCertifyGood graphql.NoUnmarshalJSON } - firstPass.NodesNodesOSV = v + firstPass.NodeNodeCertifyGood = v err := json.Unmarshal(b, &firstPass) if err != nil { @@ -14464,22 +14746,28 @@ func (v *NodesNodesOSV) UnmarshalJSON(b []byte) error { } err = json.Unmarshal( - b, &v.AllOSVTree) + b, &v.AllCertifyGood) if err != nil { return err } return nil } -type __premarshalNodesNodesOSV struct { +type __premarshalNodeNodeCertifyGood struct { Typename *string `json:"__typename"` Id string `json:"id"` - OsvId string `json:"osvId"` + Justification string `json:"justification"` + + Subject json.RawMessage `json:"subject"` + + Origin string `json:"origin"` + + Collector string `json:"collector"` } -func (v *NodesNodesOSV) MarshalJSON() ([]byte, error) { +func (v *NodeNodeCertifyGood) MarshalJSON() ([]byte, error) { premarshaled, err := v.__premarshalJSON() if err != nil { return nil, err @@ -14487,62 +14775,66 @@ func (v *NodesNodesOSV) MarshalJSON() ([]byte, error) { return json.Marshal(premarshaled) } -func (v *NodesNodesOSV) __premarshalJSON() (*__premarshalNodesNodesOSV, error) { - var retval __premarshalNodesNodesOSV +func (v *NodeNodeCertifyGood) __premarshalJSON() (*__premarshalNodeNodeCertifyGood, error) { + var retval __premarshalNodeNodeCertifyGood retval.Typename = v.Typename - retval.Id = v.AllOSVTree.Id - retval.OsvId = v.AllOSVTree.OsvId + retval.Id = v.AllCertifyGood.Id + retval.Justification = v.AllCertifyGood.Justification + { + + dst := &retval.Subject + src := v.AllCertifyGood.Subject + var err error + *dst, err = __marshalAllCertifyGoodSubjectPackageSourceOrArtifact( + &src) + if err != nil { + return nil, fmt.Errorf( + "unable to marshal NodeNodeCertifyGood.AllCertifyGood.Subject: %w", err) + } + } + retval.Origin = v.AllCertifyGood.Origin + retval.Collector = v.AllCertifyGood.Collector return &retval, nil } -// NodesNodesPackage includes the requested fields of the GraphQL type Package. +// NodeNodeCertifyScorecard includes the requested fields of the GraphQL type CertifyScorecard. // The GraphQL type's documentation follows. // -// Package represents the root of the package trie/tree. -// -// We map package information to a trie, closely matching the pURL specification -// (https://github.com/package-url/purl-spec/blob/0dd92f26f8bb11956ffdf5e8acfcee71e8560407/README.rst), -// but deviating from it where GUAC heuristics allow for better representation of -// package information. Each path in the trie fully represents a package; we split -// the trie based on the pURL components. -// -// This node matches a pkg: partial pURL. The type field matches the -// pURL types but we might also use "guac" for the cases where the pURL -// representation is not complete or when we have custom rules. -// -// Since this node is at the root of the package trie, it is named Package, not -// PackageType. -type NodesNodesPackage struct { - Typename *string `json:"__typename"` - AllPkgTree `json:"-"` +// CertifyScorecard is an attestation to attach a Scorecard analysis to a +// particular source repository. +type NodeNodeCertifyScorecard struct { + Typename *string `json:"__typename"` + AllCertifyScorecard `json:"-"` } -// GetTypename returns NodesNodesPackage.Typename, and is useful for accessing the field via an interface. -func (v *NodesNodesPackage) GetTypename() *string { return v.Typename } +// GetTypename returns NodeNodeCertifyScorecard.Typename, and is useful for accessing the field via an interface. +func (v *NodeNodeCertifyScorecard) GetTypename() *string { return v.Typename } -// GetId returns NodesNodesPackage.Id, and is useful for accessing the field via an interface. -func (v *NodesNodesPackage) GetId() string { return v.AllPkgTree.Id } +// GetId returns NodeNodeCertifyScorecard.Id, and is useful for accessing the field via an interface. +func (v *NodeNodeCertifyScorecard) GetId() string { return v.AllCertifyScorecard.Id } -// GetType returns NodesNodesPackage.Type, and is useful for accessing the field via an interface. -func (v *NodesNodesPackage) GetType() string { return v.AllPkgTree.Type } +// GetSource returns NodeNodeCertifyScorecard.Source, and is useful for accessing the field via an interface. +func (v *NodeNodeCertifyScorecard) GetSource() AllCertifyScorecardSource { + return v.AllCertifyScorecard.Source +} -// GetNamespaces returns NodesNodesPackage.Namespaces, and is useful for accessing the field via an interface. -func (v *NodesNodesPackage) GetNamespaces() []AllPkgTreeNamespacesPackageNamespace { - return v.AllPkgTree.Namespaces +// GetScorecard returns NodeNodeCertifyScorecard.Scorecard, and is useful for accessing the field via an interface. +func (v *NodeNodeCertifyScorecard) GetScorecard() AllCertifyScorecardScorecard { + return v.AllCertifyScorecard.Scorecard } -func (v *NodesNodesPackage) UnmarshalJSON(b []byte) error { +func (v *NodeNodeCertifyScorecard) UnmarshalJSON(b []byte) error { if string(b) == "null" { return nil } var firstPass struct { - *NodesNodesPackage + *NodeNodeCertifyScorecard graphql.NoUnmarshalJSON } - firstPass.NodesNodesPackage = v + firstPass.NodeNodeCertifyScorecard = v err := json.Unmarshal(b, &firstPass) if err != nil { @@ -14550,24 +14842,24 @@ func (v *NodesNodesPackage) UnmarshalJSON(b []byte) error { } err = json.Unmarshal( - b, &v.AllPkgTree) + b, &v.AllCertifyScorecard) if err != nil { return err } return nil } -type __premarshalNodesNodesPackage struct { +type __premarshalNodeNodeCertifyScorecard struct { Typename *string `json:"__typename"` Id string `json:"id"` - Type string `json:"type"` + Source AllCertifyScorecardSource `json:"source"` - Namespaces []AllPkgTreeNamespacesPackageNamespace `json:"namespaces"` + Scorecard AllCertifyScorecardScorecard `json:"scorecard"` } -func (v *NodesNodesPackage) MarshalJSON() ([]byte, error) { +func (v *NodeNodeCertifyScorecard) MarshalJSON() ([]byte, error) { premarshaled, err := v.__premarshalJSON() if err != nil { return nil, err @@ -14575,56 +14867,84 @@ func (v *NodesNodesPackage) MarshalJSON() ([]byte, error) { return json.Marshal(premarshaled) } -func (v *NodesNodesPackage) __premarshalJSON() (*__premarshalNodesNodesPackage, error) { - var retval __premarshalNodesNodesPackage +func (v *NodeNodeCertifyScorecard) __premarshalJSON() (*__premarshalNodeNodeCertifyScorecard, error) { + var retval __premarshalNodeNodeCertifyScorecard retval.Typename = v.Typename - retval.Id = v.AllPkgTree.Id - retval.Type = v.AllPkgTree.Type - retval.Namespaces = v.AllPkgTree.Namespaces + retval.Id = v.AllCertifyScorecard.Id + retval.Source = v.AllCertifyScorecard.Source + retval.Scorecard = v.AllCertifyScorecard.Scorecard return &retval, nil } -// NodesNodesPkgEqual includes the requested fields of the GraphQL type PkgEqual. +// NodeNodeCertifyVEXStatement includes the requested fields of the GraphQL type CertifyVEXStatement. // The GraphQL type's documentation follows. // -// PkgEqual is an attestation that a set of packages are similar. -type NodesNodesPkgEqual struct { - Typename *string `json:"__typename"` - allPkgEqual `json:"-"` +// CertifyVEXStatement is an attestation to attach VEX statements to a package or +// artifact to clarify the impact of a specific vulnerability (CVE, GHSA or OSV). +type NodeNodeCertifyVEXStatement struct { + Typename *string `json:"__typename"` + AllCertifyVEXStatement `json:"-"` } -// GetTypename returns NodesNodesPkgEqual.Typename, and is useful for accessing the field via an interface. -func (v *NodesNodesPkgEqual) GetTypename() *string { return v.Typename } +// GetTypename returns NodeNodeCertifyVEXStatement.Typename, and is useful for accessing the field via an interface. +func (v *NodeNodeCertifyVEXStatement) GetTypename() *string { return v.Typename } -// GetId returns NodesNodesPkgEqual.Id, and is useful for accessing the field via an interface. -func (v *NodesNodesPkgEqual) GetId() string { return v.allPkgEqual.Id } +// GetId returns NodeNodeCertifyVEXStatement.Id, and is useful for accessing the field via an interface. +func (v *NodeNodeCertifyVEXStatement) GetId() string { return v.AllCertifyVEXStatement.Id } -// GetJustification returns NodesNodesPkgEqual.Justification, and is useful for accessing the field via an interface. -func (v *NodesNodesPkgEqual) GetJustification() string { return v.allPkgEqual.Justification } +// GetSubject returns NodeNodeCertifyVEXStatement.Subject, and is useful for accessing the field via an interface. +func (v *NodeNodeCertifyVEXStatement) GetSubject() AllCertifyVEXStatementSubjectPackageOrArtifact { + return v.AllCertifyVEXStatement.Subject +} -// GetPackages returns NodesNodesPkgEqual.Packages, and is useful for accessing the field via an interface. -func (v *NodesNodesPkgEqual) GetPackages() []allPkgEqualPackagesPackage { - return v.allPkgEqual.Packages +// GetVulnerability returns NodeNodeCertifyVEXStatement.Vulnerability, and is useful for accessing the field via an interface. +func (v *NodeNodeCertifyVEXStatement) GetVulnerability() AllCertifyVEXStatementVulnerability { + return v.AllCertifyVEXStatement.Vulnerability } -// GetOrigin returns NodesNodesPkgEqual.Origin, and is useful for accessing the field via an interface. -func (v *NodesNodesPkgEqual) GetOrigin() string { return v.allPkgEqual.Origin } +// GetStatus returns NodeNodeCertifyVEXStatement.Status, and is useful for accessing the field via an interface. +func (v *NodeNodeCertifyVEXStatement) GetStatus() VexStatus { return v.AllCertifyVEXStatement.Status } -// GetCollector returns NodesNodesPkgEqual.Collector, and is useful for accessing the field via an interface. -func (v *NodesNodesPkgEqual) GetCollector() string { return v.allPkgEqual.Collector } +// GetVexJustification returns NodeNodeCertifyVEXStatement.VexJustification, and is useful for accessing the field via an interface. +func (v *NodeNodeCertifyVEXStatement) GetVexJustification() VexJustification { + return v.AllCertifyVEXStatement.VexJustification +} -func (v *NodesNodesPkgEqual) UnmarshalJSON(b []byte) error { +// GetStatement returns NodeNodeCertifyVEXStatement.Statement, and is useful for accessing the field via an interface. +func (v *NodeNodeCertifyVEXStatement) GetStatement() string { + return v.AllCertifyVEXStatement.Statement +} + +// GetStatusNotes returns NodeNodeCertifyVEXStatement.StatusNotes, and is useful for accessing the field via an interface. +func (v *NodeNodeCertifyVEXStatement) GetStatusNotes() string { + return v.AllCertifyVEXStatement.StatusNotes +} + +// GetKnownSince returns NodeNodeCertifyVEXStatement.KnownSince, and is useful for accessing the field via an interface. +func (v *NodeNodeCertifyVEXStatement) GetKnownSince() time.Time { + return v.AllCertifyVEXStatement.KnownSince +} + +// GetOrigin returns NodeNodeCertifyVEXStatement.Origin, and is useful for accessing the field via an interface. +func (v *NodeNodeCertifyVEXStatement) GetOrigin() string { return v.AllCertifyVEXStatement.Origin } + +// GetCollector returns NodeNodeCertifyVEXStatement.Collector, and is useful for accessing the field via an interface. +func (v *NodeNodeCertifyVEXStatement) GetCollector() string { + return v.AllCertifyVEXStatement.Collector +} + +func (v *NodeNodeCertifyVEXStatement) UnmarshalJSON(b []byte) error { if string(b) == "null" { return nil } var firstPass struct { - *NodesNodesPkgEqual + *NodeNodeCertifyVEXStatement graphql.NoUnmarshalJSON } - firstPass.NodesNodesPkgEqual = v + firstPass.NodeNodeCertifyVEXStatement = v err := json.Unmarshal(b, &firstPass) if err != nil { @@ -14632,28 +14952,38 @@ func (v *NodesNodesPkgEqual) UnmarshalJSON(b []byte) error { } err = json.Unmarshal( - b, &v.allPkgEqual) + b, &v.AllCertifyVEXStatement) if err != nil { return err } return nil } -type __premarshalNodesNodesPkgEqual struct { +type __premarshalNodeNodeCertifyVEXStatement struct { Typename *string `json:"__typename"` Id string `json:"id"` - Justification string `json:"justification"` + Subject json.RawMessage `json:"subject"` + + Vulnerability json.RawMessage `json:"vulnerability"` + + Status VexStatus `json:"status"` + + VexJustification VexJustification `json:"vexJustification"` + + Statement string `json:"statement"` + + StatusNotes string `json:"statusNotes"` - Packages []allPkgEqualPackagesPackage `json:"packages"` + KnownSince time.Time `json:"knownSince"` Origin string `json:"origin"` Collector string `json:"collector"` } -func (v *NodesNodesPkgEqual) MarshalJSON() ([]byte, error) { +func (v *NodeNodeCertifyVEXStatement) MarshalJSON() ([]byte, error) { premarshaled, err := v.__premarshalJSON() if err != nil { return nil, err @@ -14661,93 +14991,87 @@ func (v *NodesNodesPkgEqual) MarshalJSON() ([]byte, error) { return json.Marshal(premarshaled) } -func (v *NodesNodesPkgEqual) __premarshalJSON() (*__premarshalNodesNodesPkgEqual, error) { - var retval __premarshalNodesNodesPkgEqual +func (v *NodeNodeCertifyVEXStatement) __premarshalJSON() (*__premarshalNodeNodeCertifyVEXStatement, error) { + var retval __premarshalNodeNodeCertifyVEXStatement retval.Typename = v.Typename - retval.Id = v.allPkgEqual.Id - retval.Justification = v.allPkgEqual.Justification - retval.Packages = v.allPkgEqual.Packages - retval.Origin = v.allPkgEqual.Origin - retval.Collector = v.allPkgEqual.Collector + retval.Id = v.AllCertifyVEXStatement.Id + { + + dst := &retval.Subject + src := v.AllCertifyVEXStatement.Subject + var err error + *dst, err = __marshalAllCertifyVEXStatementSubjectPackageOrArtifact( + &src) + if err != nil { + return nil, fmt.Errorf( + "unable to marshal NodeNodeCertifyVEXStatement.AllCertifyVEXStatement.Subject: %w", err) + } + } + { + + dst := &retval.Vulnerability + src := v.AllCertifyVEXStatement.Vulnerability + var err error + *dst, err = __marshalAllCertifyVEXStatementVulnerability( + &src) + if err != nil { + return nil, fmt.Errorf( + "unable to marshal NodeNodeCertifyVEXStatement.AllCertifyVEXStatement.Vulnerability: %w", err) + } + } + retval.Status = v.AllCertifyVEXStatement.Status + retval.VexJustification = v.AllCertifyVEXStatement.VexJustification + retval.Statement = v.AllCertifyVEXStatement.Statement + retval.StatusNotes = v.AllCertifyVEXStatement.StatusNotes + retval.KnownSince = v.AllCertifyVEXStatement.KnownSince + retval.Origin = v.AllCertifyVEXStatement.Origin + retval.Collector = v.AllCertifyVEXStatement.Collector return &retval, nil } -// NodesNodesPointOfContact includes the requested fields of the GraphQL type PointOfContact. +// NodeNodeCertifyVuln includes the requested fields of the GraphQL type CertifyVuln. // The GraphQL type's documentation follows. // -// PointOfContact is an attestation of how to get in touch with the person(s) responsible -// for a package, source, or artifact. -// -// All evidence trees record a justification for the property they represent as -// well as the document that contains the attestation (origin) and the collector -// that collected the document (collector). -// -// The attestation applies to a subject which is a package, source, or artifact. -// If the attestation targets a package, it must target a PackageName or a -// PackageVersion. If the attestation targets a source, it must target a -// SourceName. -// -// email is the email address (singular) of the point of contact. -// -// info is additional contact information other than email address. This is free -// form. +// CertifyVuln is an attestation to attach vulnerability information to a package. // -// NOTE: the identifiers for point of contact should be part of software trees. -// This will benefit from identifier look up and traversal as well as organization -// hierarchy. However, until the use case arises, PointOfContact will be a flat -// reference to the contact details. -type NodesNodesPointOfContact struct { - Typename *string `json:"__typename"` +// This information is obtained via a scanner. If there is no vulnerability +// detected (no OSV, CVE, or GHSA), we attach the special NoVuln node. +type NodeNodeCertifyVuln struct { + Typename *string `json:"__typename"` + AllCertifyVuln `json:"-"` } -// GetTypename returns NodesNodesPointOfContact.Typename, and is useful for accessing the field via an interface. -func (v *NodesNodesPointOfContact) GetTypename() *string { return v.Typename } - -// NodesNodesSource includes the requested fields of the GraphQL type Source. -// The GraphQL type's documentation follows. -// -// Source represents the root of the source trie/tree. -// -// We map source information to a trie, as a derivative of the pURL specification: -// each path in the trie represents a type, namespace, name and an optional -// qualifier that stands for tag/commit information. -// -// This node represents the type part of the trie path. It is used to represent -// the version control system that is being used. -// -// Since this node is at the root of the source trie, it is named Source, not -// SourceType. -type NodesNodesSource struct { - Typename *string `json:"__typename"` - AllSourceTree `json:"-"` -} +// GetTypename returns NodeNodeCertifyVuln.Typename, and is useful for accessing the field via an interface. +func (v *NodeNodeCertifyVuln) GetTypename() *string { return v.Typename } -// GetTypename returns NodesNodesSource.Typename, and is useful for accessing the field via an interface. -func (v *NodesNodesSource) GetTypename() *string { return v.Typename } +// GetId returns NodeNodeCertifyVuln.Id, and is useful for accessing the field via an interface. +func (v *NodeNodeCertifyVuln) GetId() string { return v.AllCertifyVuln.Id } -// GetId returns NodesNodesSource.Id, and is useful for accessing the field via an interface. -func (v *NodesNodesSource) GetId() string { return v.AllSourceTree.Id } +// GetPackage returns NodeNodeCertifyVuln.Package, and is useful for accessing the field via an interface. +func (v *NodeNodeCertifyVuln) GetPackage() AllCertifyVulnPackage { return v.AllCertifyVuln.Package } -// GetType returns NodesNodesSource.Type, and is useful for accessing the field via an interface. -func (v *NodesNodesSource) GetType() string { return v.AllSourceTree.Type } +// GetVulnerability returns NodeNodeCertifyVuln.Vulnerability, and is useful for accessing the field via an interface. +func (v *NodeNodeCertifyVuln) GetVulnerability() AllCertifyVulnVulnerability { + return v.AllCertifyVuln.Vulnerability +} -// GetNamespaces returns NodesNodesSource.Namespaces, and is useful for accessing the field via an interface. -func (v *NodesNodesSource) GetNamespaces() []AllSourceTreeNamespacesSourceNamespace { - return v.AllSourceTree.Namespaces +// GetMetadata returns NodeNodeCertifyVuln.Metadata, and is useful for accessing the field via an interface. +func (v *NodeNodeCertifyVuln) GetMetadata() AllCertifyVulnMetadataVulnerabilityMetaData { + return v.AllCertifyVuln.Metadata } -func (v *NodesNodesSource) UnmarshalJSON(b []byte) error { +func (v *NodeNodeCertifyVuln) UnmarshalJSON(b []byte) error { if string(b) == "null" { return nil } var firstPass struct { - *NodesNodesSource + *NodeNodeCertifyVuln graphql.NoUnmarshalJSON } - firstPass.NodesNodesSource = v + firstPass.NodeNodeCertifyVuln = v err := json.Unmarshal(b, &firstPass) if err != nil { @@ -14755,24 +15079,26 @@ func (v *NodesNodesSource) UnmarshalJSON(b []byte) error { } err = json.Unmarshal( - b, &v.AllSourceTree) + b, &v.AllCertifyVuln) if err != nil { return err } return nil } -type __premarshalNodesNodesSource struct { +type __premarshalNodeNodeCertifyVuln struct { Typename *string `json:"__typename"` Id string `json:"id"` - Type string `json:"type"` + Package AllCertifyVulnPackage `json:"package"` - Namespaces []AllSourceTreeNamespacesSourceNamespace `json:"namespaces"` + Vulnerability json.RawMessage `json:"vulnerability"` + + Metadata AllCertifyVulnMetadataVulnerabilityMetaData `json:"metadata"` } -func (v *NodesNodesSource) MarshalJSON() ([]byte, error) { +func (v *NodeNodeCertifyVuln) MarshalJSON() ([]byte, error) { premarshaled, err := v.__premarshalJSON() if err != nil { return nil, err @@ -14780,71 +15106,84 @@ func (v *NodesNodesSource) MarshalJSON() ([]byte, error) { return json.Marshal(premarshaled) } -func (v *NodesNodesSource) __premarshalJSON() (*__premarshalNodesNodesSource, error) { - var retval __premarshalNodesNodesSource +func (v *NodeNodeCertifyVuln) __premarshalJSON() (*__premarshalNodeNodeCertifyVuln, error) { + var retval __premarshalNodeNodeCertifyVuln retval.Typename = v.Typename - retval.Id = v.AllSourceTree.Id - retval.Type = v.AllSourceTree.Type - retval.Namespaces = v.AllSourceTree.Namespaces + retval.Id = v.AllCertifyVuln.Id + retval.Package = v.AllCertifyVuln.Package + { + + dst := &retval.Vulnerability + src := v.AllCertifyVuln.Vulnerability + var err error + *dst, err = __marshalAllCertifyVulnVulnerability( + &src) + if err != nil { + return nil, fmt.Errorf( + "unable to marshal NodeNodeCertifyVuln.AllCertifyVuln.Vulnerability: %w", err) + } + } + retval.Metadata = v.AllCertifyVuln.Metadata return &retval, nil } -// NodesResponse is returned by Nodes on success. -type NodesResponse struct { - // nodes returns an array of nodes, regardless of type. - // - // The input is an array of IDs to retrieve. - Nodes []NodesNodesNode `json:"-"` +// NodeNodeGHSA includes the requested fields of the GraphQL type GHSA. +// The GraphQL type's documentation follows. +// +// GHSA represents GitHub security advisories. +// +// The advisory id field is mandatory and canonicalized to be lowercase. +// +// This node can be referred to by other parts of GUAC. +type NodeNodeGHSA struct { + Typename *string `json:"__typename"` + AllGHSATree `json:"-"` } -// GetNodes returns NodesResponse.Nodes, and is useful for accessing the field via an interface. -func (v *NodesResponse) GetNodes() []NodesNodesNode { return v.Nodes } +// GetTypename returns NodeNodeGHSA.Typename, and is useful for accessing the field via an interface. +func (v *NodeNodeGHSA) GetTypename() *string { return v.Typename } -func (v *NodesResponse) UnmarshalJSON(b []byte) error { +// GetId returns NodeNodeGHSA.Id, and is useful for accessing the field via an interface. +func (v *NodeNodeGHSA) GetId() string { return v.AllGHSATree.Id } + +// GetGhsaId returns NodeNodeGHSA.GhsaId, and is useful for accessing the field via an interface. +func (v *NodeNodeGHSA) GetGhsaId() string { return v.AllGHSATree.GhsaId } + +func (v *NodeNodeGHSA) UnmarshalJSON(b []byte) error { if string(b) == "null" { return nil } var firstPass struct { - *NodesResponse - Nodes []json.RawMessage `json:"nodes"` + *NodeNodeGHSA graphql.NoUnmarshalJSON } - firstPass.NodesResponse = v + firstPass.NodeNodeGHSA = v err := json.Unmarshal(b, &firstPass) if err != nil { return err } - { - dst := &v.Nodes - src := firstPass.Nodes - *dst = make( - []NodesNodesNode, - len(src)) - for i, src := range src { - dst := &(*dst)[i] - if len(src) != 0 && string(src) != "null" { - err = __unmarshalNodesNodesNode( - src, dst) - if err != nil { - return fmt.Errorf( - "unable to unmarshal NodesResponse.Nodes: %w", err) - } - } - } + err = json.Unmarshal( + b, &v.AllGHSATree) + if err != nil { + return err } return nil } -type __premarshalNodesResponse struct { - Nodes []json.RawMessage `json:"nodes"` +type __premarshalNodeNodeGHSA struct { + Typename *string `json:"__typename"` + + Id string `json:"id"` + + GhsaId string `json:"ghsaId"` } -func (v *NodesResponse) MarshalJSON() ([]byte, error) { +func (v *NodeNodeGHSA) MarshalJSON() ([]byte, error) { premarshaled, err := v.__premarshalJSON() if err != nil { return nil, err @@ -14852,82 +15191,85 @@ func (v *NodesResponse) MarshalJSON() ([]byte, error) { return json.Marshal(premarshaled) } -func (v *NodesResponse) __premarshalJSON() (*__premarshalNodesResponse, error) { - var retval __premarshalNodesResponse - - { +func (v *NodeNodeGHSA) __premarshalJSON() (*__premarshalNodeNodeGHSA, error) { + var retval __premarshalNodeNodeGHSA - dst := &retval.Nodes - src := v.Nodes - *dst = make( - []json.RawMessage, - len(src)) - for i, src := range src { - dst := &(*dst)[i] - var err error - *dst, err = __marshalNodesNodesNode( - &src) - if err != nil { - return nil, fmt.Errorf( - "unable to marshal NodesResponse.Nodes: %w", err) - } - } - } + retval.Typename = v.Typename + retval.Id = v.AllGHSATree.Id + retval.GhsaId = v.AllGHSATree.GhsaId return &retval, nil } -// OSVInputSpec specifies a OSV vulnerability for mutations. -type OSVInputSpec struct { - OsvId string `json:"osvId"` +// NodeNodeHasMetadata includes the requested fields of the GraphQL type HasMetadata. +// The GraphQL type's documentation follows. +// +// HasMetadata is an attestation that a package, source, or artifact has a certain +// attested property (key) with value (value). For example, a source may have +// metadata "SourceRepo2FAEnabled=true". +// +// The intent of this evidence tree predicate is to allow extensibility of metadata +// expressible within the GUAC ontology. Metadata that is commonly used will then +// be promoted to a predicate on its own. +// +// Justification indicates how the metadata was determined. +// +// The metadata applies to a subject which is a package, source, or artifact. +// If the attestation targets a package, it must target a PackageName or a +// PackageVersion. If the attestation targets a source, it must target a +// SourceName. +type NodeNodeHasMetadata struct { + Typename *string `json:"__typename"` } -// GetOsvId returns OSVInputSpec.OsvId, and is useful for accessing the field via an interface. -func (v *OSVInputSpec) GetOsvId() string { return v.OsvId } +// GetTypename returns NodeNodeHasMetadata.Typename, and is useful for accessing the field via an interface. +func (v *NodeNodeHasMetadata) GetTypename() *string { return v.Typename } -// OSVSpec allows filtering the list of advisories to return in a query. -type OSVSpec struct { - Id *string `json:"id"` - OsvId *string `json:"osvId"` +// NodeNodeHasSBOM includes the requested fields of the GraphQL type HasSBOM. +type NodeNodeHasSBOM struct { + Typename *string `json:"__typename"` + AllHasSBOMTree `json:"-"` } -// GetId returns OSVSpec.Id, and is useful for accessing the field via an interface. -func (v *OSVSpec) GetId() *string { return v.Id } +// GetTypename returns NodeNodeHasSBOM.Typename, and is useful for accessing the field via an interface. +func (v *NodeNodeHasSBOM) GetTypename() *string { return v.Typename } -// GetOsvId returns OSVSpec.OsvId, and is useful for accessing the field via an interface. -func (v *OSVSpec) GetOsvId() *string { return v.OsvId } +// GetId returns NodeNodeHasSBOM.Id, and is useful for accessing the field via an interface. +func (v *NodeNodeHasSBOM) GetId() string { return v.AllHasSBOMTree.Id } -// OSVsOsvOSV includes the requested fields of the GraphQL type OSV. -// The GraphQL type's documentation follows. -// -// OSV represents an Open Source Vulnerability. -// -// The osvId field is mandatory and canonicalized to be lowercase. -// -// This maps to a vulnerability ID specific to the environment (e.g., GHSA ID or -// CVE ID). -// -// This node can be referred to by other parts of GUAC. -type OSVsOsvOSV struct { - AllOSVTree `json:"-"` +// GetSubject returns NodeNodeHasSBOM.Subject, and is useful for accessing the field via an interface. +func (v *NodeNodeHasSBOM) GetSubject() AllHasSBOMTreeSubjectPackageOrArtifact { + return v.AllHasSBOMTree.Subject } -// GetId returns OSVsOsvOSV.Id, and is useful for accessing the field via an interface. -func (v *OSVsOsvOSV) GetId() string { return v.AllOSVTree.Id } +// GetUri returns NodeNodeHasSBOM.Uri, and is useful for accessing the field via an interface. +func (v *NodeNodeHasSBOM) GetUri() string { return v.AllHasSBOMTree.Uri } -// GetOsvId returns OSVsOsvOSV.OsvId, and is useful for accessing the field via an interface. -func (v *OSVsOsvOSV) GetOsvId() string { return v.AllOSVTree.OsvId } +// GetAlgorithm returns NodeNodeHasSBOM.Algorithm, and is useful for accessing the field via an interface. +func (v *NodeNodeHasSBOM) GetAlgorithm() string { return v.AllHasSBOMTree.Algorithm } -func (v *OSVsOsvOSV) UnmarshalJSON(b []byte) error { +// GetDigest returns NodeNodeHasSBOM.Digest, and is useful for accessing the field via an interface. +func (v *NodeNodeHasSBOM) GetDigest() string { return v.AllHasSBOMTree.Digest } + +// GetDownloadLocation returns NodeNodeHasSBOM.DownloadLocation, and is useful for accessing the field via an interface. +func (v *NodeNodeHasSBOM) GetDownloadLocation() string { return v.AllHasSBOMTree.DownloadLocation } + +// GetOrigin returns NodeNodeHasSBOM.Origin, and is useful for accessing the field via an interface. +func (v *NodeNodeHasSBOM) GetOrigin() string { return v.AllHasSBOMTree.Origin } + +// GetCollector returns NodeNodeHasSBOM.Collector, and is useful for accessing the field via an interface. +func (v *NodeNodeHasSBOM) GetCollector() string { return v.AllHasSBOMTree.Collector } + +func (v *NodeNodeHasSBOM) UnmarshalJSON(b []byte) error { if string(b) == "null" { return nil } var firstPass struct { - *OSVsOsvOSV + *NodeNodeHasSBOM graphql.NoUnmarshalJSON } - firstPass.OSVsOsvOSV = v + firstPass.NodeNodeHasSBOM = v err := json.Unmarshal(b, &firstPass) if err != nil { @@ -14935,136 +15277,99 @@ func (v *OSVsOsvOSV) UnmarshalJSON(b []byte) error { } err = json.Unmarshal( - b, &v.AllOSVTree) + b, &v.AllHasSBOMTree) if err != nil { return err } return nil } -type __premarshalOSVsOsvOSV struct { - Id string `json:"id"` - - OsvId string `json:"osvId"` -} - -func (v *OSVsOsvOSV) MarshalJSON() ([]byte, error) { - premarshaled, err := v.__premarshalJSON() - if err != nil { - return nil, err - } - return json.Marshal(premarshaled) -} - -func (v *OSVsOsvOSV) __premarshalJSON() (*__premarshalOSVsOsvOSV, error) { - var retval __premarshalOSVsOsvOSV - - retval.Id = v.AllOSVTree.Id - retval.OsvId = v.AllOSVTree.OsvId - return &retval, nil -} - -// OSVsResponse is returned by OSVs on success. -type OSVsResponse struct { - // Returns all OSV vulnerabilities matching a filter. - Osv []OSVsOsvOSV `json:"osv"` -} - -// GetOsv returns OSVsResponse.Osv, and is useful for accessing the field via an interface. -func (v *OSVsResponse) GetOsv() []OSVsOsvOSV { return v.Osv } +type __premarshalNodeNodeHasSBOM struct { + Typename *string `json:"__typename"` -// PackageQualifierInputSpec allows specifying package qualifiers in mutations. -type PackageQualifierInputSpec struct { - Key string `json:"key"` - Value string `json:"value"` -} + Id string `json:"id"` -// GetKey returns PackageQualifierInputSpec.Key, and is useful for accessing the field via an interface. -func (v *PackageQualifierInputSpec) GetKey() string { return v.Key } + Subject json.RawMessage `json:"subject"` -// GetValue returns PackageQualifierInputSpec.Value, and is useful for accessing the field via an interface. -func (v *PackageQualifierInputSpec) GetValue() string { return v.Value } + Uri string `json:"uri"` -// PackageQualifierSpec allows filtering package qualifiers in a query. -// -// Keys are mandatory, but values could also be null if we want to match all -// values for a specific key. -// -// NOTE: Before the schema becomes stable, we might change the nulability -// requirements of these fields. -type PackageQualifierSpec struct { - Key string `json:"key"` - Value *string `json:"value"` -} + Algorithm string `json:"algorithm"` -// GetKey returns PackageQualifierSpec.Key, and is useful for accessing the field via an interface. -func (v *PackageQualifierSpec) GetKey() string { return v.Key } + Digest string `json:"digest"` -// GetValue returns PackageQualifierSpec.Value, and is useful for accessing the field via an interface. -func (v *PackageQualifierSpec) GetValue() *string { return v.Value } + DownloadLocation string `json:"downloadLocation"` -// PackageSourceOrArtifactSpec allows using PackageSourceOrArtifact union as -// input type to be used in read queries. -// -// Exactly one of the value must be set to non-nil. -type PackageSourceOrArtifactSpec struct { - Package *PkgSpec `json:"package"` - Source *SourceSpec `json:"source"` - Artifact *ArtifactSpec `json:"artifact"` + Origin string `json:"origin"` + + Collector string `json:"collector"` } -// GetPackage returns PackageSourceOrArtifactSpec.Package, and is useful for accessing the field via an interface. -func (v *PackageSourceOrArtifactSpec) GetPackage() *PkgSpec { return v.Package } +func (v *NodeNodeHasSBOM) MarshalJSON() ([]byte, error) { + premarshaled, err := v.__premarshalJSON() + if err != nil { + return nil, err + } + return json.Marshal(premarshaled) +} -// GetSource returns PackageSourceOrArtifactSpec.Source, and is useful for accessing the field via an interface. -func (v *PackageSourceOrArtifactSpec) GetSource() *SourceSpec { return v.Source } +func (v *NodeNodeHasSBOM) __premarshalJSON() (*__premarshalNodeNodeHasSBOM, error) { + var retval __premarshalNodeNodeHasSBOM -// GetArtifact returns PackageSourceOrArtifactSpec.Artifact, and is useful for accessing the field via an interface. -func (v *PackageSourceOrArtifactSpec) GetArtifact() *ArtifactSpec { return v.Artifact } + retval.Typename = v.Typename + retval.Id = v.AllHasSBOMTree.Id + { -// PackagesPackagesPackage includes the requested fields of the GraphQL type Package. + dst := &retval.Subject + src := v.AllHasSBOMTree.Subject + var err error + *dst, err = __marshalAllHasSBOMTreeSubjectPackageOrArtifact( + &src) + if err != nil { + return nil, fmt.Errorf( + "unable to marshal NodeNodeHasSBOM.AllHasSBOMTree.Subject: %w", err) + } + } + retval.Uri = v.AllHasSBOMTree.Uri + retval.Algorithm = v.AllHasSBOMTree.Algorithm + retval.Digest = v.AllHasSBOMTree.Digest + retval.DownloadLocation = v.AllHasSBOMTree.DownloadLocation + retval.Origin = v.AllHasSBOMTree.Origin + retval.Collector = v.AllHasSBOMTree.Collector + return &retval, nil +} + +// NodeNodeHasSLSA includes the requested fields of the GraphQL type HasSLSA. // The GraphQL type's documentation follows. // -// Package represents the root of the package trie/tree. -// -// We map package information to a trie, closely matching the pURL specification -// (https://github.com/package-url/purl-spec/blob/0dd92f26f8bb11956ffdf5e8acfcee71e8560407/README.rst), -// but deviating from it where GUAC heuristics allow for better representation of -// package information. Each path in the trie fully represents a package; we split -// the trie based on the pURL components. -// -// This node matches a pkg: partial pURL. The type field matches the -// pURL types but we might also use "guac" for the cases where the pURL -// representation is not complete or when we have custom rules. -// -// Since this node is at the root of the package trie, it is named Package, not -// PackageType. -type PackagesPackagesPackage struct { - AllPkgTree `json:"-"` +// HasSLSA records that a subject node has a SLSA attestation. +type NodeNodeHasSLSA struct { + Typename *string `json:"__typename"` + AllSLSATree `json:"-"` } -// GetId returns PackagesPackagesPackage.Id, and is useful for accessing the field via an interface. -func (v *PackagesPackagesPackage) GetId() string { return v.AllPkgTree.Id } +// GetTypename returns NodeNodeHasSLSA.Typename, and is useful for accessing the field via an interface. +func (v *NodeNodeHasSLSA) GetTypename() *string { return v.Typename } -// GetType returns PackagesPackagesPackage.Type, and is useful for accessing the field via an interface. -func (v *PackagesPackagesPackage) GetType() string { return v.AllPkgTree.Type } +// GetId returns NodeNodeHasSLSA.Id, and is useful for accessing the field via an interface. +func (v *NodeNodeHasSLSA) GetId() string { return v.AllSLSATree.Id } -// GetNamespaces returns PackagesPackagesPackage.Namespaces, and is useful for accessing the field via an interface. -func (v *PackagesPackagesPackage) GetNamespaces() []AllPkgTreeNamespacesPackageNamespace { - return v.AllPkgTree.Namespaces -} +// GetSubject returns NodeNodeHasSLSA.Subject, and is useful for accessing the field via an interface. +func (v *NodeNodeHasSLSA) GetSubject() AllSLSATreeSubjectArtifact { return v.AllSLSATree.Subject } -func (v *PackagesPackagesPackage) UnmarshalJSON(b []byte) error { +// GetSlsa returns NodeNodeHasSLSA.Slsa, and is useful for accessing the field via an interface. +func (v *NodeNodeHasSLSA) GetSlsa() AllSLSATreeSlsaSLSA { return v.AllSLSATree.Slsa } + +func (v *NodeNodeHasSLSA) UnmarshalJSON(b []byte) error { if string(b) == "null" { return nil } var firstPass struct { - *PackagesPackagesPackage + *NodeNodeHasSLSA graphql.NoUnmarshalJSON } - firstPass.PackagesPackagesPackage = v + firstPass.NodeNodeHasSLSA = v err := json.Unmarshal(b, &firstPass) if err != nil { @@ -15072,22 +15377,24 @@ func (v *PackagesPackagesPackage) UnmarshalJSON(b []byte) error { } err = json.Unmarshal( - b, &v.AllPkgTree) + b, &v.AllSLSATree) if err != nil { return err } return nil } -type __premarshalPackagesPackagesPackage struct { +type __premarshalNodeNodeHasSLSA struct { + Typename *string `json:"__typename"` + Id string `json:"id"` - Type string `json:"type"` + Subject AllSLSATreeSubjectArtifact `json:"subject"` - Namespaces []AllPkgTreeNamespacesPackageNamespace `json:"namespaces"` + Slsa AllSLSATreeSlsaSLSA `json:"slsa"` } -func (v *PackagesPackagesPackage) MarshalJSON() ([]byte, error) { +func (v *NodeNodeHasSLSA) MarshalJSON() ([]byte, error) { premarshaled, err := v.__premarshalJSON() if err != nil { return nil, err @@ -15095,62 +15402,60 @@ func (v *PackagesPackagesPackage) MarshalJSON() ([]byte, error) { return json.Marshal(premarshaled) } -func (v *PackagesPackagesPackage) __premarshalJSON() (*__premarshalPackagesPackagesPackage, error) { - var retval __premarshalPackagesPackagesPackage +func (v *NodeNodeHasSLSA) __premarshalJSON() (*__premarshalNodeNodeHasSLSA, error) { + var retval __premarshalNodeNodeHasSLSA - retval.Id = v.AllPkgTree.Id - retval.Type = v.AllPkgTree.Type - retval.Namespaces = v.AllPkgTree.Namespaces + retval.Typename = v.Typename + retval.Id = v.AllSLSATree.Id + retval.Subject = v.AllSLSATree.Subject + retval.Slsa = v.AllSLSATree.Slsa return &retval, nil } -// PackagesResponse is returned by Packages on success. -type PackagesResponse struct { - // Returns all packages matching a filter. - Packages []PackagesPackagesPackage `json:"packages"` -} - -// GetPackages returns PackagesResponse.Packages, and is useful for accessing the field via an interface. -func (v *PackagesResponse) GetPackages() []PackagesPackagesPackage { return v.Packages } - -// PathPathArtifact includes the requested fields of the GraphQL type Artifact. +// NodeNodeHasSourceAt includes the requested fields of the GraphQL type HasSourceAt. // The GraphQL type's documentation follows. // -// Artifact represents an artifact identified by a checksum hash. -// -// The checksum is split into the digest value and the algorithm used to generate -// it. Both fields are mandatory and canonicalized to be lowercase. -// -// If having a checksum Go object, algorithm can be -// strings.ToLower(string(checksum.Algorithm)) and digest can be checksum.Value. -type PathPathArtifact struct { - Typename *string `json:"__typename"` - AllArtifactTree `json:"-"` +// HasSourceAt records that a package's repository is a given source. +type NodeNodeHasSourceAt struct { + Typename *string `json:"__typename"` + AllHasSourceAt `json:"-"` } -// GetTypename returns PathPathArtifact.Typename, and is useful for accessing the field via an interface. -func (v *PathPathArtifact) GetTypename() *string { return v.Typename } +// GetTypename returns NodeNodeHasSourceAt.Typename, and is useful for accessing the field via an interface. +func (v *NodeNodeHasSourceAt) GetTypename() *string { return v.Typename } -// GetId returns PathPathArtifact.Id, and is useful for accessing the field via an interface. -func (v *PathPathArtifact) GetId() string { return v.AllArtifactTree.Id } +// GetId returns NodeNodeHasSourceAt.Id, and is useful for accessing the field via an interface. +func (v *NodeNodeHasSourceAt) GetId() string { return v.AllHasSourceAt.Id } -// GetAlgorithm returns PathPathArtifact.Algorithm, and is useful for accessing the field via an interface. -func (v *PathPathArtifact) GetAlgorithm() string { return v.AllArtifactTree.Algorithm } +// GetJustification returns NodeNodeHasSourceAt.Justification, and is useful for accessing the field via an interface. +func (v *NodeNodeHasSourceAt) GetJustification() string { return v.AllHasSourceAt.Justification } -// GetDigest returns PathPathArtifact.Digest, and is useful for accessing the field via an interface. -func (v *PathPathArtifact) GetDigest() string { return v.AllArtifactTree.Digest } +// GetKnownSince returns NodeNodeHasSourceAt.KnownSince, and is useful for accessing the field via an interface. +func (v *NodeNodeHasSourceAt) GetKnownSince() time.Time { return v.AllHasSourceAt.KnownSince } -func (v *PathPathArtifact) UnmarshalJSON(b []byte) error { +// GetPackage returns NodeNodeHasSourceAt.Package, and is useful for accessing the field via an interface. +func (v *NodeNodeHasSourceAt) GetPackage() AllHasSourceAtPackage { return v.AllHasSourceAt.Package } + +// GetSource returns NodeNodeHasSourceAt.Source, and is useful for accessing the field via an interface. +func (v *NodeNodeHasSourceAt) GetSource() AllHasSourceAtSource { return v.AllHasSourceAt.Source } + +// GetOrigin returns NodeNodeHasSourceAt.Origin, and is useful for accessing the field via an interface. +func (v *NodeNodeHasSourceAt) GetOrigin() string { return v.AllHasSourceAt.Origin } + +// GetCollector returns NodeNodeHasSourceAt.Collector, and is useful for accessing the field via an interface. +func (v *NodeNodeHasSourceAt) GetCollector() string { return v.AllHasSourceAt.Collector } + +func (v *NodeNodeHasSourceAt) UnmarshalJSON(b []byte) error { if string(b) == "null" { return nil } var firstPass struct { - *PathPathArtifact + *NodeNodeHasSourceAt graphql.NoUnmarshalJSON } - firstPass.PathPathArtifact = v + firstPass.NodeNodeHasSourceAt = v err := json.Unmarshal(b, &firstPass) if err != nil { @@ -15158,24 +15463,32 @@ func (v *PathPathArtifact) UnmarshalJSON(b []byte) error { } err = json.Unmarshal( - b, &v.AllArtifactTree) + b, &v.AllHasSourceAt) if err != nil { return err } return nil } -type __premarshalPathPathArtifact struct { +type __premarshalNodeNodeHasSourceAt struct { Typename *string `json:"__typename"` Id string `json:"id"` - Algorithm string `json:"algorithm"` + Justification string `json:"justification"` - Digest string `json:"digest"` + KnownSince time.Time `json:"knownSince"` + + Package AllHasSourceAtPackage `json:"package"` + + Source AllHasSourceAtSource `json:"source"` + + Origin string `json:"origin"` + + Collector string `json:"collector"` } -func (v *PathPathArtifact) MarshalJSON() ([]byte, error) { +func (v *NodeNodeHasSourceAt) MarshalJSON() ([]byte, error) { premarshaled, err := v.__premarshalJSON() if err != nil { return nil, err @@ -15183,47 +15496,60 @@ func (v *PathPathArtifact) MarshalJSON() ([]byte, error) { return json.Marshal(premarshaled) } -func (v *PathPathArtifact) __premarshalJSON() (*__premarshalPathPathArtifact, error) { - var retval __premarshalPathPathArtifact +func (v *NodeNodeHasSourceAt) __premarshalJSON() (*__premarshalNodeNodeHasSourceAt, error) { + var retval __premarshalNodeNodeHasSourceAt retval.Typename = v.Typename - retval.Id = v.AllArtifactTree.Id - retval.Algorithm = v.AllArtifactTree.Algorithm - retval.Digest = v.AllArtifactTree.Digest + retval.Id = v.AllHasSourceAt.Id + retval.Justification = v.AllHasSourceAt.Justification + retval.KnownSince = v.AllHasSourceAt.KnownSince + retval.Package = v.AllHasSourceAt.Package + retval.Source = v.AllHasSourceAt.Source + retval.Origin = v.AllHasSourceAt.Origin + retval.Collector = v.AllHasSourceAt.Collector return &retval, nil } -// PathPathBuilder includes the requested fields of the GraphQL type Builder. +// NodeNodeHashEqual includes the requested fields of the GraphQL type HashEqual. // The GraphQL type's documentation follows. // -// Builder represents the builder (e.g., FRSCA or GitHub Actions). -// -// Currently builders are identified by the uri field. -type PathPathBuilder struct { - Typename *string `json:"__typename"` - allBuilderTree `json:"-"` +// HashEqual is an attestation that a set of artifacts are identical. +type NodeNodeHashEqual struct { + Typename *string `json:"__typename"` + AllHashEqualTree `json:"-"` } -// GetTypename returns PathPathBuilder.Typename, and is useful for accessing the field via an interface. -func (v *PathPathBuilder) GetTypename() *string { return v.Typename } +// GetTypename returns NodeNodeHashEqual.Typename, and is useful for accessing the field via an interface. +func (v *NodeNodeHashEqual) GetTypename() *string { return v.Typename } -// GetId returns PathPathBuilder.Id, and is useful for accessing the field via an interface. -func (v *PathPathBuilder) GetId() string { return v.allBuilderTree.Id } +// GetId returns NodeNodeHashEqual.Id, and is useful for accessing the field via an interface. +func (v *NodeNodeHashEqual) GetId() string { return v.AllHashEqualTree.Id } -// GetUri returns PathPathBuilder.Uri, and is useful for accessing the field via an interface. -func (v *PathPathBuilder) GetUri() string { return v.allBuilderTree.Uri } +// GetJustification returns NodeNodeHashEqual.Justification, and is useful for accessing the field via an interface. +func (v *NodeNodeHashEqual) GetJustification() string { return v.AllHashEqualTree.Justification } -func (v *PathPathBuilder) UnmarshalJSON(b []byte) error { +// GetArtifacts returns NodeNodeHashEqual.Artifacts, and is useful for accessing the field via an interface. +func (v *NodeNodeHashEqual) GetArtifacts() []AllHashEqualTreeArtifactsArtifact { + return v.AllHashEqualTree.Artifacts +} + +// GetOrigin returns NodeNodeHashEqual.Origin, and is useful for accessing the field via an interface. +func (v *NodeNodeHashEqual) GetOrigin() string { return v.AllHashEqualTree.Origin } + +// GetCollector returns NodeNodeHashEqual.Collector, and is useful for accessing the field via an interface. +func (v *NodeNodeHashEqual) GetCollector() string { return v.AllHashEqualTree.Collector } + +func (v *NodeNodeHashEqual) UnmarshalJSON(b []byte) error { if string(b) == "null" { return nil } var firstPass struct { - *PathPathBuilder + *NodeNodeHashEqual graphql.NoUnmarshalJSON } - firstPass.PathPathBuilder = v + firstPass.NodeNodeHashEqual = v err := json.Unmarshal(b, &firstPass) if err != nil { @@ -15231,22 +15557,28 @@ func (v *PathPathBuilder) UnmarshalJSON(b []byte) error { } err = json.Unmarshal( - b, &v.allBuilderTree) + b, &v.AllHashEqualTree) if err != nil { return err } return nil } -type __premarshalPathPathBuilder struct { +type __premarshalNodeNodeHashEqual struct { Typename *string `json:"__typename"` Id string `json:"id"` - Uri string `json:"uri"` + Justification string `json:"justification"` + + Artifacts []AllHashEqualTreeArtifactsArtifact `json:"artifacts"` + + Origin string `json:"origin"` + + Collector string `json:"collector"` } -func (v *PathPathBuilder) MarshalJSON() ([]byte, error) { +func (v *NodeNodeHashEqual) MarshalJSON() ([]byte, error) { premarshaled, err := v.__premarshalJSON() if err != nil { return nil, err @@ -15254,56 +15586,71 @@ func (v *PathPathBuilder) MarshalJSON() ([]byte, error) { return json.Marshal(premarshaled) } -func (v *PathPathBuilder) __premarshalJSON() (*__premarshalPathPathBuilder, error) { - var retval __premarshalPathPathBuilder +func (v *NodeNodeHashEqual) __premarshalJSON() (*__premarshalNodeNodeHashEqual, error) { + var retval __premarshalNodeNodeHashEqual + + retval.Typename = v.Typename + retval.Id = v.AllHashEqualTree.Id + retval.Justification = v.AllHashEqualTree.Justification + retval.Artifacts = v.AllHashEqualTree.Artifacts + retval.Origin = v.AllHashEqualTree.Origin + retval.Collector = v.AllHashEqualTree.Collector + return &retval, nil +} + +// NodeNodeIsDependency includes the requested fields of the GraphQL type IsDependency. +// The GraphQL type's documentation follows. +// +// IsDependency is an attestation to record that a package depends on another. +type NodeNodeIsDependency struct { + Typename *string `json:"__typename"` + AllIsDependencyTree `json:"-"` +} + +// GetTypename returns NodeNodeIsDependency.Typename, and is useful for accessing the field via an interface. +func (v *NodeNodeIsDependency) GetTypename() *string { return v.Typename } + +// GetId returns NodeNodeIsDependency.Id, and is useful for accessing the field via an interface. +func (v *NodeNodeIsDependency) GetId() string { return v.AllIsDependencyTree.Id } - retval.Typename = v.Typename - retval.Id = v.allBuilderTree.Id - retval.Uri = v.allBuilderTree.Uri - return &retval, nil +// GetJustification returns NodeNodeIsDependency.Justification, and is useful for accessing the field via an interface. +func (v *NodeNodeIsDependency) GetJustification() string { return v.AllIsDependencyTree.Justification } + +// GetPackage returns NodeNodeIsDependency.Package, and is useful for accessing the field via an interface. +func (v *NodeNodeIsDependency) GetPackage() AllIsDependencyTreePackage { + return v.AllIsDependencyTree.Package } -// PathPathCVE includes the requested fields of the GraphQL type CVE. -// The GraphQL type's documentation follows. -// -// CVE represents a vulnerability in the Common Vulnerabilities and Exposures -// schema. -// -// The vulnerability identifier contains a year field, so we are extracting that -// to allow matching for vulnerabilities found in a given year. -// -// The vulnerability identifier field is mandatory and canonicalized to be -// lowercase. -// -// This node can be referred to by other parts of GUAC. -type PathPathCVE struct { - Typename *string `json:"__typename"` - AllCveTree `json:"-"` +// GetDependentPackage returns NodeNodeIsDependency.DependentPackage, and is useful for accessing the field via an interface. +func (v *NodeNodeIsDependency) GetDependentPackage() AllIsDependencyTreeDependentPackage { + return v.AllIsDependencyTree.DependentPackage } -// GetTypename returns PathPathCVE.Typename, and is useful for accessing the field via an interface. -func (v *PathPathCVE) GetTypename() *string { return v.Typename } +// GetDependencyType returns NodeNodeIsDependency.DependencyType, and is useful for accessing the field via an interface. +func (v *NodeNodeIsDependency) GetDependencyType() DependencyType { + return v.AllIsDependencyTree.DependencyType +} -// GetId returns PathPathCVE.Id, and is useful for accessing the field via an interface. -func (v *PathPathCVE) GetId() string { return v.AllCveTree.Id } +// GetVersionRange returns NodeNodeIsDependency.VersionRange, and is useful for accessing the field via an interface. +func (v *NodeNodeIsDependency) GetVersionRange() string { return v.AllIsDependencyTree.VersionRange } -// GetYear returns PathPathCVE.Year, and is useful for accessing the field via an interface. -func (v *PathPathCVE) GetYear() int { return v.AllCveTree.Year } +// GetOrigin returns NodeNodeIsDependency.Origin, and is useful for accessing the field via an interface. +func (v *NodeNodeIsDependency) GetOrigin() string { return v.AllIsDependencyTree.Origin } -// GetCveId returns PathPathCVE.CveId, and is useful for accessing the field via an interface. -func (v *PathPathCVE) GetCveId() string { return v.AllCveTree.CveId } +// GetCollector returns NodeNodeIsDependency.Collector, and is useful for accessing the field via an interface. +func (v *NodeNodeIsDependency) GetCollector() string { return v.AllIsDependencyTree.Collector } -func (v *PathPathCVE) UnmarshalJSON(b []byte) error { +func (v *NodeNodeIsDependency) UnmarshalJSON(b []byte) error { if string(b) == "null" { return nil } var firstPass struct { - *PathPathCVE + *NodeNodeIsDependency graphql.NoUnmarshalJSON } - firstPass.PathPathCVE = v + firstPass.NodeNodeIsDependency = v err := json.Unmarshal(b, &firstPass) if err != nil { @@ -15311,24 +15658,34 @@ func (v *PathPathCVE) UnmarshalJSON(b []byte) error { } err = json.Unmarshal( - b, &v.AllCveTree) + b, &v.AllIsDependencyTree) if err != nil { return err } return nil } -type __premarshalPathPathCVE struct { +type __premarshalNodeNodeIsDependency struct { Typename *string `json:"__typename"` Id string `json:"id"` - Year int `json:"year"` + Justification string `json:"justification"` - CveId string `json:"cveId"` + Package AllIsDependencyTreePackage `json:"package"` + + DependentPackage AllIsDependencyTreeDependentPackage `json:"dependentPackage"` + + DependencyType DependencyType `json:"dependencyType"` + + VersionRange string `json:"versionRange"` + + Origin string `json:"origin"` + + Collector string `json:"collector"` } -func (v *PathPathCVE) MarshalJSON() ([]byte, error) { +func (v *NodeNodeIsDependency) MarshalJSON() ([]byte, error) { premarshaled, err := v.__premarshalJSON() if err != nil { return nil, err @@ -15336,66 +15693,68 @@ func (v *PathPathCVE) MarshalJSON() ([]byte, error) { return json.Marshal(premarshaled) } -func (v *PathPathCVE) __premarshalJSON() (*__premarshalPathPathCVE, error) { - var retval __premarshalPathPathCVE +func (v *NodeNodeIsDependency) __premarshalJSON() (*__premarshalNodeNodeIsDependency, error) { + var retval __premarshalNodeNodeIsDependency retval.Typename = v.Typename - retval.Id = v.AllCveTree.Id - retval.Year = v.AllCveTree.Year - retval.CveId = v.AllCveTree.CveId + retval.Id = v.AllIsDependencyTree.Id + retval.Justification = v.AllIsDependencyTree.Justification + retval.Package = v.AllIsDependencyTree.Package + retval.DependentPackage = v.AllIsDependencyTree.DependentPackage + retval.DependencyType = v.AllIsDependencyTree.DependencyType + retval.VersionRange = v.AllIsDependencyTree.VersionRange + retval.Origin = v.AllIsDependencyTree.Origin + retval.Collector = v.AllIsDependencyTree.Collector return &retval, nil } -// PathPathCertifyBad includes the requested fields of the GraphQL type CertifyBad. +// NodeNodeIsOccurrence includes the requested fields of the GraphQL type IsOccurrence. // The GraphQL type's documentation follows. // -// CertifyBad is an attestation that a package, source, or artifact is considered -// bad. -// -// All evidence trees record a justification for the property they represent as -// well as the document that contains the attestation (origin) and the collector -// that collected the document (collector). +// IsOccurrence is an attestation to link an artifact to a package or source. // -// The certification applies to a subject which is a package, source, or artifact. -// If the attestation targets a package, it must target a PackageName or a -// PackageVersion. If the attestation targets a source, it must target a -// SourceName. -type PathPathCertifyBad struct { - Typename *string `json:"__typename"` - AllCertifyBad `json:"-"` +// Attestation must occur at the PackageVersion or at the SourceName. +type NodeNodeIsOccurrence struct { + Typename *string `json:"__typename"` + AllIsOccurrencesTree `json:"-"` } -// GetTypename returns PathPathCertifyBad.Typename, and is useful for accessing the field via an interface. -func (v *PathPathCertifyBad) GetTypename() *string { return v.Typename } +// GetTypename returns NodeNodeIsOccurrence.Typename, and is useful for accessing the field via an interface. +func (v *NodeNodeIsOccurrence) GetTypename() *string { return v.Typename } -// GetId returns PathPathCertifyBad.Id, and is useful for accessing the field via an interface. -func (v *PathPathCertifyBad) GetId() string { return v.AllCertifyBad.Id } +// GetId returns NodeNodeIsOccurrence.Id, and is useful for accessing the field via an interface. +func (v *NodeNodeIsOccurrence) GetId() string { return v.AllIsOccurrencesTree.Id } -// GetJustification returns PathPathCertifyBad.Justification, and is useful for accessing the field via an interface. -func (v *PathPathCertifyBad) GetJustification() string { return v.AllCertifyBad.Justification } +// GetSubject returns NodeNodeIsOccurrence.Subject, and is useful for accessing the field via an interface. +func (v *NodeNodeIsOccurrence) GetSubject() AllIsOccurrencesTreeSubjectPackageOrSource { + return v.AllIsOccurrencesTree.Subject +} -// GetSubject returns PathPathCertifyBad.Subject, and is useful for accessing the field via an interface. -func (v *PathPathCertifyBad) GetSubject() AllCertifyBadSubjectPackageSourceOrArtifact { - return v.AllCertifyBad.Subject +// GetArtifact returns NodeNodeIsOccurrence.Artifact, and is useful for accessing the field via an interface. +func (v *NodeNodeIsOccurrence) GetArtifact() AllIsOccurrencesTreeArtifact { + return v.AllIsOccurrencesTree.Artifact } -// GetOrigin returns PathPathCertifyBad.Origin, and is useful for accessing the field via an interface. -func (v *PathPathCertifyBad) GetOrigin() string { return v.AllCertifyBad.Origin } +// GetJustification returns NodeNodeIsOccurrence.Justification, and is useful for accessing the field via an interface. +func (v *NodeNodeIsOccurrence) GetJustification() string { return v.AllIsOccurrencesTree.Justification } -// GetCollector returns PathPathCertifyBad.Collector, and is useful for accessing the field via an interface. -func (v *PathPathCertifyBad) GetCollector() string { return v.AllCertifyBad.Collector } +// GetOrigin returns NodeNodeIsOccurrence.Origin, and is useful for accessing the field via an interface. +func (v *NodeNodeIsOccurrence) GetOrigin() string { return v.AllIsOccurrencesTree.Origin } -func (v *PathPathCertifyBad) UnmarshalJSON(b []byte) error { +// GetCollector returns NodeNodeIsOccurrence.Collector, and is useful for accessing the field via an interface. +func (v *NodeNodeIsOccurrence) GetCollector() string { return v.AllIsOccurrencesTree.Collector } + +func (v *NodeNodeIsOccurrence) UnmarshalJSON(b []byte) error { if string(b) == "null" { return nil } var firstPass struct { - *PathPathCertifyBad + *NodeNodeIsOccurrence graphql.NoUnmarshalJSON } - firstPass.PathPathCertifyBad = v + firstPass.NodeNodeIsOccurrence = v err := json.Unmarshal(b, &firstPass) if err != nil { @@ -15403,28 +15762,30 @@ func (v *PathPathCertifyBad) UnmarshalJSON(b []byte) error { } err = json.Unmarshal( - b, &v.AllCertifyBad) + b, &v.AllIsOccurrencesTree) if err != nil { return err } return nil } -type __premarshalPathPathCertifyBad struct { +type __premarshalNodeNodeIsOccurrence struct { Typename *string `json:"__typename"` Id string `json:"id"` - Justification string `json:"justification"` - Subject json.RawMessage `json:"subject"` + Artifact AllIsOccurrencesTreeArtifact `json:"artifact"` + + Justification string `json:"justification"` + Origin string `json:"origin"` Collector string `json:"collector"` } -func (v *PathPathCertifyBad) MarshalJSON() ([]byte, error) { +func (v *NodeNodeIsOccurrence) MarshalJSON() ([]byte, error) { premarshaled, err := v.__premarshalJSON() if err != nil { return nil, err @@ -15432,79 +15793,75 @@ func (v *PathPathCertifyBad) MarshalJSON() ([]byte, error) { return json.Marshal(premarshaled) } -func (v *PathPathCertifyBad) __premarshalJSON() (*__premarshalPathPathCertifyBad, error) { - var retval __premarshalPathPathCertifyBad +func (v *NodeNodeIsOccurrence) __premarshalJSON() (*__premarshalNodeNodeIsOccurrence, error) { + var retval __premarshalNodeNodeIsOccurrence retval.Typename = v.Typename - retval.Id = v.AllCertifyBad.Id - retval.Justification = v.AllCertifyBad.Justification + retval.Id = v.AllIsOccurrencesTree.Id { dst := &retval.Subject - src := v.AllCertifyBad.Subject + src := v.AllIsOccurrencesTree.Subject var err error - *dst, err = __marshalAllCertifyBadSubjectPackageSourceOrArtifact( + *dst, err = __marshalAllIsOccurrencesTreeSubjectPackageOrSource( &src) if err != nil { return nil, fmt.Errorf( - "unable to marshal PathPathCertifyBad.AllCertifyBad.Subject: %w", err) + "unable to marshal NodeNodeIsOccurrence.AllIsOccurrencesTree.Subject: %w", err) } } - retval.Origin = v.AllCertifyBad.Origin - retval.Collector = v.AllCertifyBad.Collector + retval.Artifact = v.AllIsOccurrencesTree.Artifact + retval.Justification = v.AllIsOccurrencesTree.Justification + retval.Origin = v.AllIsOccurrencesTree.Origin + retval.Collector = v.AllIsOccurrencesTree.Collector return &retval, nil } -// PathPathCertifyGood includes the requested fields of the GraphQL type CertifyGood. +// NodeNodeIsVulnerability includes the requested fields of the GraphQL type IsVulnerability. // The GraphQL type's documentation follows. // -// CertifyGood is an attestation that a package, source, or artifact is considered -// good. -// -// All evidence trees record a justification for the property they represent as -// well as the document that contains the attestation (origin) and the collector -// that collected the document (collector). -// -// The certification applies to a subject which is a package, source, or artifact. -// If the attestation targets a package, it must target a PackageName or a -// PackageVersion. If the attestation targets a source, it must target a -// SourceName. -type PathPathCertifyGood struct { - Typename *string `json:"__typename"` - allCertifyGood `json:"-"` +// IsVulnerability is an attestation to link CVE/GHSA with data in OSV. +type NodeNodeIsVulnerability struct { + Typename *string `json:"__typename"` + AllIsVulnerability `json:"-"` } -// GetTypename returns PathPathCertifyGood.Typename, and is useful for accessing the field via an interface. -func (v *PathPathCertifyGood) GetTypename() *string { return v.Typename } +// GetTypename returns NodeNodeIsVulnerability.Typename, and is useful for accessing the field via an interface. +func (v *NodeNodeIsVulnerability) GetTypename() *string { return v.Typename } -// GetId returns PathPathCertifyGood.Id, and is useful for accessing the field via an interface. -func (v *PathPathCertifyGood) GetId() string { return v.allCertifyGood.Id } +// GetId returns NodeNodeIsVulnerability.Id, and is useful for accessing the field via an interface. +func (v *NodeNodeIsVulnerability) GetId() string { return v.AllIsVulnerability.Id } -// GetJustification returns PathPathCertifyGood.Justification, and is useful for accessing the field via an interface. -func (v *PathPathCertifyGood) GetJustification() string { return v.allCertifyGood.Justification } +// GetOsv returns NodeNodeIsVulnerability.Osv, and is useful for accessing the field via an interface. +func (v *NodeNodeIsVulnerability) GetOsv() AllIsVulnerabilityOsvOSV { return v.AllIsVulnerability.Osv } -// GetSubject returns PathPathCertifyGood.Subject, and is useful for accessing the field via an interface. -func (v *PathPathCertifyGood) GetSubject() allCertifyGoodSubjectPackageSourceOrArtifact { - return v.allCertifyGood.Subject +// GetVulnerability returns NodeNodeIsVulnerability.Vulnerability, and is useful for accessing the field via an interface. +func (v *NodeNodeIsVulnerability) GetVulnerability() AllIsVulnerabilityVulnerabilityCveOrGhsa { + return v.AllIsVulnerability.Vulnerability } -// GetOrigin returns PathPathCertifyGood.Origin, and is useful for accessing the field via an interface. -func (v *PathPathCertifyGood) GetOrigin() string { return v.allCertifyGood.Origin } +// GetJustification returns NodeNodeIsVulnerability.Justification, and is useful for accessing the field via an interface. +func (v *NodeNodeIsVulnerability) GetJustification() string { + return v.AllIsVulnerability.Justification +} -// GetCollector returns PathPathCertifyGood.Collector, and is useful for accessing the field via an interface. -func (v *PathPathCertifyGood) GetCollector() string { return v.allCertifyGood.Collector } +// GetOrigin returns NodeNodeIsVulnerability.Origin, and is useful for accessing the field via an interface. +func (v *NodeNodeIsVulnerability) GetOrigin() string { return v.AllIsVulnerability.Origin } -func (v *PathPathCertifyGood) UnmarshalJSON(b []byte) error { +// GetCollector returns NodeNodeIsVulnerability.Collector, and is useful for accessing the field via an interface. +func (v *NodeNodeIsVulnerability) GetCollector() string { return v.AllIsVulnerability.Collector } + +func (v *NodeNodeIsVulnerability) UnmarshalJSON(b []byte) error { if string(b) == "null" { return nil } var firstPass struct { - *PathPathCertifyGood + *NodeNodeIsVulnerability graphql.NoUnmarshalJSON } - firstPass.PathPathCertifyGood = v + firstPass.NodeNodeIsVulnerability = v err := json.Unmarshal(b, &firstPass) if err != nil { @@ -15512,28 +15869,30 @@ func (v *PathPathCertifyGood) UnmarshalJSON(b []byte) error { } err = json.Unmarshal( - b, &v.allCertifyGood) + b, &v.AllIsVulnerability) if err != nil { return err } return nil } -type __premarshalPathPathCertifyGood struct { +type __premarshalNodeNodeIsVulnerability struct { Typename *string `json:"__typename"` Id string `json:"id"` - Justification string `json:"justification"` + Osv AllIsVulnerabilityOsvOSV `json:"osv"` - Subject json.RawMessage `json:"subject"` + Vulnerability json.RawMessage `json:"vulnerability"` + + Justification string `json:"justification"` Origin string `json:"origin"` Collector string `json:"collector"` } -func (v *PathPathCertifyGood) MarshalJSON() ([]byte, error) { +func (v *NodeNodeIsVulnerability) MarshalJSON() ([]byte, error) { premarshaled, err := v.__premarshalJSON() if err != nil { return nil, err @@ -15541,66 +15900,84 @@ func (v *PathPathCertifyGood) MarshalJSON() ([]byte, error) { return json.Marshal(premarshaled) } -func (v *PathPathCertifyGood) __premarshalJSON() (*__premarshalPathPathCertifyGood, error) { - var retval __premarshalPathPathCertifyGood +func (v *NodeNodeIsVulnerability) __premarshalJSON() (*__premarshalNodeNodeIsVulnerability, error) { + var retval __premarshalNodeNodeIsVulnerability retval.Typename = v.Typename - retval.Id = v.allCertifyGood.Id - retval.Justification = v.allCertifyGood.Justification + retval.Id = v.AllIsVulnerability.Id + retval.Osv = v.AllIsVulnerability.Osv { - dst := &retval.Subject - src := v.allCertifyGood.Subject + dst := &retval.Vulnerability + src := v.AllIsVulnerability.Vulnerability var err error - *dst, err = __marshalallCertifyGoodSubjectPackageSourceOrArtifact( + *dst, err = __marshalAllIsVulnerabilityVulnerabilityCveOrGhsa( &src) if err != nil { return nil, fmt.Errorf( - "unable to marshal PathPathCertifyGood.allCertifyGood.Subject: %w", err) + "unable to marshal NodeNodeIsVulnerability.AllIsVulnerability.Vulnerability: %w", err) } } - retval.Origin = v.allCertifyGood.Origin - retval.Collector = v.allCertifyGood.Collector + retval.Justification = v.AllIsVulnerability.Justification + retval.Origin = v.AllIsVulnerability.Origin + retval.Collector = v.AllIsVulnerability.Collector return &retval, nil } -// PathPathCertifyScorecard includes the requested fields of the GraphQL type CertifyScorecard. +// NodeNodeNoVuln includes the requested fields of the GraphQL type NoVuln. // The GraphQL type's documentation follows. // -// CertifyScorecard is an attestation to attach a Scorecard analysis to a -// particular source repository. -type PathPathCertifyScorecard struct { - Typename *string `json:"__typename"` - AllCertifyScorecard `json:"-"` +// NoVuln is a special vulnerability node to attest that no vulnerability has been +// found during a vulnerability scan. +// +// Backends guarantee that this is a singleton node. +type NodeNodeNoVuln struct { + Typename *string `json:"__typename"` + Id string `json:"id"` } -// GetTypename returns PathPathCertifyScorecard.Typename, and is useful for accessing the field via an interface. -func (v *PathPathCertifyScorecard) GetTypename() *string { return v.Typename } +// GetTypename returns NodeNodeNoVuln.Typename, and is useful for accessing the field via an interface. +func (v *NodeNodeNoVuln) GetTypename() *string { return v.Typename } -// GetId returns PathPathCertifyScorecard.Id, and is useful for accessing the field via an interface. -func (v *PathPathCertifyScorecard) GetId() string { return v.AllCertifyScorecard.Id } +// GetId returns NodeNodeNoVuln.Id, and is useful for accessing the field via an interface. +func (v *NodeNodeNoVuln) GetId() string { return v.Id } -// GetSource returns PathPathCertifyScorecard.Source, and is useful for accessing the field via an interface. -func (v *PathPathCertifyScorecard) GetSource() AllCertifyScorecardSource { - return v.AllCertifyScorecard.Source +// NodeNodeOSV includes the requested fields of the GraphQL type OSV. +// The GraphQL type's documentation follows. +// +// OSV represents an Open Source Vulnerability. +// +// The osvId field is mandatory and canonicalized to be lowercase. +// +// This maps to a vulnerability ID specific to the environment (e.g., GHSA ID or +// CVE ID). +// +// This node can be referred to by other parts of GUAC. +type NodeNodeOSV struct { + Typename *string `json:"__typename"` + AllOSVTree `json:"-"` } -// GetScorecard returns PathPathCertifyScorecard.Scorecard, and is useful for accessing the field via an interface. -func (v *PathPathCertifyScorecard) GetScorecard() AllCertifyScorecardScorecard { - return v.AllCertifyScorecard.Scorecard -} +// GetTypename returns NodeNodeOSV.Typename, and is useful for accessing the field via an interface. +func (v *NodeNodeOSV) GetTypename() *string { return v.Typename } + +// GetId returns NodeNodeOSV.Id, and is useful for accessing the field via an interface. +func (v *NodeNodeOSV) GetId() string { return v.AllOSVTree.Id } + +// GetOsvId returns NodeNodeOSV.OsvId, and is useful for accessing the field via an interface. +func (v *NodeNodeOSV) GetOsvId() string { return v.AllOSVTree.OsvId } -func (v *PathPathCertifyScorecard) UnmarshalJSON(b []byte) error { +func (v *NodeNodeOSV) UnmarshalJSON(b []byte) error { if string(b) == "null" { return nil } var firstPass struct { - *PathPathCertifyScorecard + *NodeNodeOSV graphql.NoUnmarshalJSON } - firstPass.PathPathCertifyScorecard = v + firstPass.NodeNodeOSV = v err := json.Unmarshal(b, &firstPass) if err != nil { @@ -15608,24 +15985,22 @@ func (v *PathPathCertifyScorecard) UnmarshalJSON(b []byte) error { } err = json.Unmarshal( - b, &v.AllCertifyScorecard) + b, &v.AllOSVTree) if err != nil { return err } return nil } -type __premarshalPathPathCertifyScorecard struct { +type __premarshalNodeNodeOSV struct { Typename *string `json:"__typename"` Id string `json:"id"` - Source AllCertifyScorecardSource `json:"source"` - - Scorecard AllCertifyScorecardScorecard `json:"scorecard"` + OsvId string `json:"osvId"` } -func (v *PathPathCertifyScorecard) MarshalJSON() ([]byte, error) { +func (v *NodeNodeOSV) MarshalJSON() ([]byte, error) { premarshaled, err := v.__premarshalJSON() if err != nil { return nil, err @@ -15633,84 +16008,62 @@ func (v *PathPathCertifyScorecard) MarshalJSON() ([]byte, error) { return json.Marshal(premarshaled) } -func (v *PathPathCertifyScorecard) __premarshalJSON() (*__premarshalPathPathCertifyScorecard, error) { - var retval __premarshalPathPathCertifyScorecard +func (v *NodeNodeOSV) __premarshalJSON() (*__premarshalNodeNodeOSV, error) { + var retval __premarshalNodeNodeOSV retval.Typename = v.Typename - retval.Id = v.AllCertifyScorecard.Id - retval.Source = v.AllCertifyScorecard.Source - retval.Scorecard = v.AllCertifyScorecard.Scorecard + retval.Id = v.AllOSVTree.Id + retval.OsvId = v.AllOSVTree.OsvId return &retval, nil } -// PathPathCertifyVEXStatement includes the requested fields of the GraphQL type CertifyVEXStatement. +// NodeNodePackage includes the requested fields of the GraphQL type Package. // The GraphQL type's documentation follows. // -// CertifyVEXStatement is an attestation to attach VEX statements to a package or -// artifact to clarify the impact of a specific vulnerability (CVE, GHSA or OSV). -type PathPathCertifyVEXStatement struct { - Typename *string `json:"__typename"` - allCertifyVEXStatement `json:"-"` -} - -// GetTypename returns PathPathCertifyVEXStatement.Typename, and is useful for accessing the field via an interface. -func (v *PathPathCertifyVEXStatement) GetTypename() *string { return v.Typename } - -// GetId returns PathPathCertifyVEXStatement.Id, and is useful for accessing the field via an interface. -func (v *PathPathCertifyVEXStatement) GetId() string { return v.allCertifyVEXStatement.Id } - -// GetSubject returns PathPathCertifyVEXStatement.Subject, and is useful for accessing the field via an interface. -func (v *PathPathCertifyVEXStatement) GetSubject() allCertifyVEXStatementSubjectPackageOrArtifact { - return v.allCertifyVEXStatement.Subject -} - -// GetVulnerability returns PathPathCertifyVEXStatement.Vulnerability, and is useful for accessing the field via an interface. -func (v *PathPathCertifyVEXStatement) GetVulnerability() allCertifyVEXStatementVulnerability { - return v.allCertifyVEXStatement.Vulnerability -} - -// GetStatus returns PathPathCertifyVEXStatement.Status, and is useful for accessing the field via an interface. -func (v *PathPathCertifyVEXStatement) GetStatus() VexStatus { return v.allCertifyVEXStatement.Status } - -// GetVexJustification returns PathPathCertifyVEXStatement.VexJustification, and is useful for accessing the field via an interface. -func (v *PathPathCertifyVEXStatement) GetVexJustification() VexJustification { - return v.allCertifyVEXStatement.VexJustification -} - -// GetStatement returns PathPathCertifyVEXStatement.Statement, and is useful for accessing the field via an interface. -func (v *PathPathCertifyVEXStatement) GetStatement() string { - return v.allCertifyVEXStatement.Statement +// Package represents the root of the package trie/tree. +// +// We map package information to a trie, closely matching the pURL specification +// (https://github.com/package-url/purl-spec/blob/0dd92f26f8bb11956ffdf5e8acfcee71e8560407/README.rst), +// but deviating from it where GUAC heuristics allow for better representation of +// package information. Each path in the trie fully represents a package; we split +// the trie based on the pURL components. +// +// This node matches a pkg: partial pURL. The type field matches the +// pURL types but we might also use "guac" for the cases where the pURL +// representation is not complete or when we have custom rules. +// +// Since this node is at the root of the package trie, it is named Package, not +// PackageType. +type NodeNodePackage struct { + Typename *string `json:"__typename"` + AllPkgTree `json:"-"` } -// GetStatusNotes returns PathPathCertifyVEXStatement.StatusNotes, and is useful for accessing the field via an interface. -func (v *PathPathCertifyVEXStatement) GetStatusNotes() string { - return v.allCertifyVEXStatement.StatusNotes -} +// GetTypename returns NodeNodePackage.Typename, and is useful for accessing the field via an interface. +func (v *NodeNodePackage) GetTypename() *string { return v.Typename } -// GetKnownSince returns PathPathCertifyVEXStatement.KnownSince, and is useful for accessing the field via an interface. -func (v *PathPathCertifyVEXStatement) GetKnownSince() time.Time { - return v.allCertifyVEXStatement.KnownSince -} +// GetId returns NodeNodePackage.Id, and is useful for accessing the field via an interface. +func (v *NodeNodePackage) GetId() string { return v.AllPkgTree.Id } -// GetOrigin returns PathPathCertifyVEXStatement.Origin, and is useful for accessing the field via an interface. -func (v *PathPathCertifyVEXStatement) GetOrigin() string { return v.allCertifyVEXStatement.Origin } +// GetType returns NodeNodePackage.Type, and is useful for accessing the field via an interface. +func (v *NodeNodePackage) GetType() string { return v.AllPkgTree.Type } -// GetCollector returns PathPathCertifyVEXStatement.Collector, and is useful for accessing the field via an interface. -func (v *PathPathCertifyVEXStatement) GetCollector() string { - return v.allCertifyVEXStatement.Collector +// GetNamespaces returns NodeNodePackage.Namespaces, and is useful for accessing the field via an interface. +func (v *NodeNodePackage) GetNamespaces() []AllPkgTreeNamespacesPackageNamespace { + return v.AllPkgTree.Namespaces } -func (v *PathPathCertifyVEXStatement) UnmarshalJSON(b []byte) error { +func (v *NodeNodePackage) UnmarshalJSON(b []byte) error { if string(b) == "null" { return nil } var firstPass struct { - *PathPathCertifyVEXStatement + *NodeNodePackage graphql.NoUnmarshalJSON } - firstPass.PathPathCertifyVEXStatement = v + firstPass.NodeNodePackage = v err := json.Unmarshal(b, &firstPass) if err != nil { @@ -15718,38 +16071,24 @@ func (v *PathPathCertifyVEXStatement) UnmarshalJSON(b []byte) error { } err = json.Unmarshal( - b, &v.allCertifyVEXStatement) + b, &v.AllPkgTree) if err != nil { return err } return nil } -type __premarshalPathPathCertifyVEXStatement struct { +type __premarshalNodeNodePackage struct { Typename *string `json:"__typename"` Id string `json:"id"` - Subject json.RawMessage `json:"subject"` - - Vulnerability json.RawMessage `json:"vulnerability"` - - Status VexStatus `json:"status"` - - VexJustification VexJustification `json:"vexJustification"` - - Statement string `json:"statement"` - - StatusNotes string `json:"statusNotes"` - - KnownSince time.Time `json:"knownSince"` - - Origin string `json:"origin"` + Type string `json:"type"` - Collector string `json:"collector"` + Namespaces []AllPkgTreeNamespacesPackageNamespace `json:"namespaces"` } -func (v *PathPathCertifyVEXStatement) MarshalJSON() ([]byte, error) { +func (v *NodeNodePackage) MarshalJSON() ([]byte, error) { premarshaled, err := v.__premarshalJSON() if err != nil { return nil, err @@ -15757,87 +16096,54 @@ func (v *PathPathCertifyVEXStatement) MarshalJSON() ([]byte, error) { return json.Marshal(premarshaled) } -func (v *PathPathCertifyVEXStatement) __premarshalJSON() (*__premarshalPathPathCertifyVEXStatement, error) { - var retval __premarshalPathPathCertifyVEXStatement +func (v *NodeNodePackage) __premarshalJSON() (*__premarshalNodeNodePackage, error) { + var retval __premarshalNodeNodePackage retval.Typename = v.Typename - retval.Id = v.allCertifyVEXStatement.Id - { - - dst := &retval.Subject - src := v.allCertifyVEXStatement.Subject - var err error - *dst, err = __marshalallCertifyVEXStatementSubjectPackageOrArtifact( - &src) - if err != nil { - return nil, fmt.Errorf( - "unable to marshal PathPathCertifyVEXStatement.allCertifyVEXStatement.Subject: %w", err) - } - } - { - - dst := &retval.Vulnerability - src := v.allCertifyVEXStatement.Vulnerability - var err error - *dst, err = __marshalallCertifyVEXStatementVulnerability( - &src) - if err != nil { - return nil, fmt.Errorf( - "unable to marshal PathPathCertifyVEXStatement.allCertifyVEXStatement.Vulnerability: %w", err) - } - } - retval.Status = v.allCertifyVEXStatement.Status - retval.VexJustification = v.allCertifyVEXStatement.VexJustification - retval.Statement = v.allCertifyVEXStatement.Statement - retval.StatusNotes = v.allCertifyVEXStatement.StatusNotes - retval.KnownSince = v.allCertifyVEXStatement.KnownSince - retval.Origin = v.allCertifyVEXStatement.Origin - retval.Collector = v.allCertifyVEXStatement.Collector + retval.Id = v.AllPkgTree.Id + retval.Type = v.AllPkgTree.Type + retval.Namespaces = v.AllPkgTree.Namespaces return &retval, nil } -// PathPathCertifyVuln includes the requested fields of the GraphQL type CertifyVuln. +// NodeNodePkgEqual includes the requested fields of the GraphQL type PkgEqual. // The GraphQL type's documentation follows. // -// CertifyVuln is an attestation to attach vulnerability information to a package. -// -// This information is obtained via a scanner. If there is no vulnerability -// detected (no OSV, CVE, or GHSA), we attach the special NoVuln node. -type PathPathCertifyVuln struct { - Typename *string `json:"__typename"` - AllCertifyVuln `json:"-"` +// PkgEqual is an attestation that a set of packages are similar. +type NodeNodePkgEqual struct { + Typename *string `json:"__typename"` + AllPkgEqual `json:"-"` } -// GetTypename returns PathPathCertifyVuln.Typename, and is useful for accessing the field via an interface. -func (v *PathPathCertifyVuln) GetTypename() *string { return v.Typename } +// GetTypename returns NodeNodePkgEqual.Typename, and is useful for accessing the field via an interface. +func (v *NodeNodePkgEqual) GetTypename() *string { return v.Typename } -// GetId returns PathPathCertifyVuln.Id, and is useful for accessing the field via an interface. -func (v *PathPathCertifyVuln) GetId() string { return v.AllCertifyVuln.Id } +// GetId returns NodeNodePkgEqual.Id, and is useful for accessing the field via an interface. +func (v *NodeNodePkgEqual) GetId() string { return v.AllPkgEqual.Id } -// GetPackage returns PathPathCertifyVuln.Package, and is useful for accessing the field via an interface. -func (v *PathPathCertifyVuln) GetPackage() AllCertifyVulnPackage { return v.AllCertifyVuln.Package } +// GetJustification returns NodeNodePkgEqual.Justification, and is useful for accessing the field via an interface. +func (v *NodeNodePkgEqual) GetJustification() string { return v.AllPkgEqual.Justification } -// GetVulnerability returns PathPathCertifyVuln.Vulnerability, and is useful for accessing the field via an interface. -func (v *PathPathCertifyVuln) GetVulnerability() AllCertifyVulnVulnerability { - return v.AllCertifyVuln.Vulnerability -} +// GetPackages returns NodeNodePkgEqual.Packages, and is useful for accessing the field via an interface. +func (v *NodeNodePkgEqual) GetPackages() []AllPkgEqualPackagesPackage { return v.AllPkgEqual.Packages } -// GetMetadata returns PathPathCertifyVuln.Metadata, and is useful for accessing the field via an interface. -func (v *PathPathCertifyVuln) GetMetadata() AllCertifyVulnMetadataVulnerabilityMetaData { - return v.AllCertifyVuln.Metadata -} +// GetOrigin returns NodeNodePkgEqual.Origin, and is useful for accessing the field via an interface. +func (v *NodeNodePkgEqual) GetOrigin() string { return v.AllPkgEqual.Origin } -func (v *PathPathCertifyVuln) UnmarshalJSON(b []byte) error { +// GetCollector returns NodeNodePkgEqual.Collector, and is useful for accessing the field via an interface. +func (v *NodeNodePkgEqual) GetCollector() string { return v.AllPkgEqual.Collector } + +func (v *NodeNodePkgEqual) UnmarshalJSON(b []byte) error { if string(b) == "null" { return nil } var firstPass struct { - *PathPathCertifyVuln + *NodeNodePkgEqual graphql.NoUnmarshalJSON } - firstPass.PathPathCertifyVuln = v + firstPass.NodeNodePkgEqual = v err := json.Unmarshal(b, &firstPass) if err != nil { @@ -15845,26 +16151,28 @@ func (v *PathPathCertifyVuln) UnmarshalJSON(b []byte) error { } err = json.Unmarshal( - b, &v.AllCertifyVuln) + b, &v.AllPkgEqual) if err != nil { return err } return nil } -type __premarshalPathPathCertifyVuln struct { +type __premarshalNodeNodePkgEqual struct { Typename *string `json:"__typename"` Id string `json:"id"` - Package AllCertifyVulnPackage `json:"package"` + Justification string `json:"justification"` - Vulnerability json.RawMessage `json:"vulnerability"` + Packages []AllPkgEqualPackagesPackage `json:"packages"` - Metadata AllCertifyVulnMetadataVulnerabilityMetaData `json:"metadata"` + Origin string `json:"origin"` + + Collector string `json:"collector"` } -func (v *PathPathCertifyVuln) MarshalJSON() ([]byte, error) { +func (v *NodeNodePkgEqual) MarshalJSON() ([]byte, error) { premarshaled, err := v.__premarshalJSON() if err != nil { return nil, err @@ -15872,61 +16180,93 @@ func (v *PathPathCertifyVuln) MarshalJSON() ([]byte, error) { return json.Marshal(premarshaled) } -func (v *PathPathCertifyVuln) __premarshalJSON() (*__premarshalPathPathCertifyVuln, error) { - var retval __premarshalPathPathCertifyVuln +func (v *NodeNodePkgEqual) __premarshalJSON() (*__premarshalNodeNodePkgEqual, error) { + var retval __premarshalNodeNodePkgEqual retval.Typename = v.Typename - retval.Id = v.AllCertifyVuln.Id - retval.Package = v.AllCertifyVuln.Package - { - - dst := &retval.Vulnerability - src := v.AllCertifyVuln.Vulnerability - var err error - *dst, err = __marshalAllCertifyVulnVulnerability( - &src) - if err != nil { - return nil, fmt.Errorf( - "unable to marshal PathPathCertifyVuln.AllCertifyVuln.Vulnerability: %w", err) - } - } - retval.Metadata = v.AllCertifyVuln.Metadata + retval.Id = v.AllPkgEqual.Id + retval.Justification = v.AllPkgEqual.Justification + retval.Packages = v.AllPkgEqual.Packages + retval.Origin = v.AllPkgEqual.Origin + retval.Collector = v.AllPkgEqual.Collector return &retval, nil } -// PathPathGHSA includes the requested fields of the GraphQL type GHSA. +// NodeNodePointOfContact includes the requested fields of the GraphQL type PointOfContact. // The GraphQL type's documentation follows. // -// GHSA represents GitHub security advisories. +// PointOfContact is an attestation of how to get in touch with the person(s) responsible +// for a package, source, or artifact. +// +// All evidence trees record a justification for the property they represent as +// well as the document that contains the attestation (origin) and the collector +// that collected the document (collector). +// +// The attestation applies to a subject which is a package, source, or artifact. +// If the attestation targets a package, it must target a PackageName or a +// PackageVersion. If the attestation targets a source, it must target a +// SourceName. +// +// email is the email address (singular) of the point of contact. +// +// info is additional contact information other than email address. This is free +// form. +// +// NOTE: the identifiers for point of contact should be part of software trees. +// This will benefit from identifier look up and traversal as well as organization +// hierarchy. However, until the use case arises, PointOfContact will be a flat +// reference to the contact details. +type NodeNodePointOfContact struct { + Typename *string `json:"__typename"` +} + +// GetTypename returns NodeNodePointOfContact.Typename, and is useful for accessing the field via an interface. +func (v *NodeNodePointOfContact) GetTypename() *string { return v.Typename } + +// NodeNodeSource includes the requested fields of the GraphQL type Source. +// The GraphQL type's documentation follows. +// +// Source represents the root of the source trie/tree. +// +// We map source information to a trie, as a derivative of the pURL specification: +// each path in the trie represents a type, namespace, name and an optional +// qualifier that stands for tag/commit information. // -// The advisory id field is mandatory and canonicalized to be lowercase. +// This node represents the type part of the trie path. It is used to represent +// the version control system that is being used. // -// This node can be referred to by other parts of GUAC. -type PathPathGHSA struct { - Typename *string `json:"__typename"` - AllGHSATree `json:"-"` +// Since this node is at the root of the source trie, it is named Source, not +// SourceType. +type NodeNodeSource struct { + Typename *string `json:"__typename"` + AllSourceTree `json:"-"` } -// GetTypename returns PathPathGHSA.Typename, and is useful for accessing the field via an interface. -func (v *PathPathGHSA) GetTypename() *string { return v.Typename } +// GetTypename returns NodeNodeSource.Typename, and is useful for accessing the field via an interface. +func (v *NodeNodeSource) GetTypename() *string { return v.Typename } -// GetId returns PathPathGHSA.Id, and is useful for accessing the field via an interface. -func (v *PathPathGHSA) GetId() string { return v.AllGHSATree.Id } +// GetId returns NodeNodeSource.Id, and is useful for accessing the field via an interface. +func (v *NodeNodeSource) GetId() string { return v.AllSourceTree.Id } -// GetGhsaId returns PathPathGHSA.GhsaId, and is useful for accessing the field via an interface. -func (v *PathPathGHSA) GetGhsaId() string { return v.AllGHSATree.GhsaId } +// GetType returns NodeNodeSource.Type, and is useful for accessing the field via an interface. +func (v *NodeNodeSource) GetType() string { return v.AllSourceTree.Type } -func (v *PathPathGHSA) UnmarshalJSON(b []byte) error { +// GetNamespaces returns NodeNodeSource.Namespaces, and is useful for accessing the field via an interface. +func (v *NodeNodeSource) GetNamespaces() []AllSourceTreeNamespacesSourceNamespace { + return v.AllSourceTree.Namespaces +} + +func (v *NodeNodeSource) UnmarshalJSON(b []byte) error { if string(b) == "null" { return nil } var firstPass struct { - *PathPathGHSA + *NodeNodeSource graphql.NoUnmarshalJSON } - firstPass.PathPathGHSA = v + firstPass.NodeNodeSource = v err := json.Unmarshal(b, &firstPass) if err != nil { @@ -15934,22 +16274,24 @@ func (v *PathPathGHSA) UnmarshalJSON(b []byte) error { } err = json.Unmarshal( - b, &v.AllGHSATree) + b, &v.AllSourceTree) if err != nil { return err } return nil } -type __premarshalPathPathGHSA struct { +type __premarshalNodeNodeSource struct { Typename *string `json:"__typename"` Id string `json:"id"` - GhsaId string `json:"ghsaId"` + Type string `json:"type"` + + Namespaces []AllSourceTreeNamespacesSourceNamespace `json:"namespaces"` } -func (v *PathPathGHSA) MarshalJSON() ([]byte, error) { +func (v *NodeNodeSource) MarshalJSON() ([]byte, error) { premarshaled, err := v.__premarshalJSON() if err != nil { return nil, err @@ -15957,120 +16299,65 @@ func (v *PathPathGHSA) MarshalJSON() ([]byte, error) { return json.Marshal(premarshaled) } -func (v *PathPathGHSA) __premarshalJSON() (*__premarshalPathPathGHSA, error) { - var retval __premarshalPathPathGHSA +func (v *NodeNodeSource) __premarshalJSON() (*__premarshalNodeNodeSource, error) { + var retval __premarshalNodeNodeSource retval.Typename = v.Typename - retval.Id = v.AllGHSATree.Id - retval.GhsaId = v.AllGHSATree.GhsaId + retval.Id = v.AllSourceTree.Id + retval.Type = v.AllSourceTree.Type + retval.Namespaces = v.AllSourceTree.Namespaces return &retval, nil } -// PathPathHasMetadata includes the requested fields of the GraphQL type HasMetadata. -// The GraphQL type's documentation follows. -// -// HasMetadata is an attestation that a package, source, or artifact has a certain -// attested property (key) with value (value). For example, a source may have -// metadata "SourceRepo2FAEnabled=true". -// -// The intent of this evidence tree predicate is to allow extensibility of metadata -// expressible within the GUAC ontology. Metadata that is commonly used will then -// be promoted to a predicate on its own. -// -// Justification indicates how the metadata was determined. -// -// The metadata applies to a subject which is a package, source, or artifact. -// If the attestation targets a package, it must target a PackageName or a -// PackageVersion. If the attestation targets a source, it must target a -// SourceName. -type PathPathHasMetadata struct { - Typename *string `json:"__typename"` -} - -// GetTypename returns PathPathHasMetadata.Typename, and is useful for accessing the field via an interface. -func (v *PathPathHasMetadata) GetTypename() *string { return v.Typename } - -// PathPathHasSBOM includes the requested fields of the GraphQL type HasSBOM. -type PathPathHasSBOM struct { - Typename *string `json:"__typename"` - allHasSBOMTree `json:"-"` -} - -// GetTypename returns PathPathHasSBOM.Typename, and is useful for accessing the field via an interface. -func (v *PathPathHasSBOM) GetTypename() *string { return v.Typename } - -// GetId returns PathPathHasSBOM.Id, and is useful for accessing the field via an interface. -func (v *PathPathHasSBOM) GetId() string { return v.allHasSBOMTree.Id } - -// GetSubject returns PathPathHasSBOM.Subject, and is useful for accessing the field via an interface. -func (v *PathPathHasSBOM) GetSubject() allHasSBOMTreeSubjectPackageOrArtifact { - return v.allHasSBOMTree.Subject +// NodeResponse is returned by Node on success. +type NodeResponse struct { + // node returns a single node, regardless of type. + // + // The input is only specified by its ID. + Node NodeNode `json:"-"` } -// GetUri returns PathPathHasSBOM.Uri, and is useful for accessing the field via an interface. -func (v *PathPathHasSBOM) GetUri() string { return v.allHasSBOMTree.Uri } - -// GetAlgorithm returns PathPathHasSBOM.Algorithm, and is useful for accessing the field via an interface. -func (v *PathPathHasSBOM) GetAlgorithm() string { return v.allHasSBOMTree.Algorithm } - -// GetDigest returns PathPathHasSBOM.Digest, and is useful for accessing the field via an interface. -func (v *PathPathHasSBOM) GetDigest() string { return v.allHasSBOMTree.Digest } - -// GetDownloadLocation returns PathPathHasSBOM.DownloadLocation, and is useful for accessing the field via an interface. -func (v *PathPathHasSBOM) GetDownloadLocation() string { return v.allHasSBOMTree.DownloadLocation } - -// GetOrigin returns PathPathHasSBOM.Origin, and is useful for accessing the field via an interface. -func (v *PathPathHasSBOM) GetOrigin() string { return v.allHasSBOMTree.Origin } - -// GetCollector returns PathPathHasSBOM.Collector, and is useful for accessing the field via an interface. -func (v *PathPathHasSBOM) GetCollector() string { return v.allHasSBOMTree.Collector } +// GetNode returns NodeResponse.Node, and is useful for accessing the field via an interface. +func (v *NodeResponse) GetNode() NodeNode { return v.Node } -func (v *PathPathHasSBOM) UnmarshalJSON(b []byte) error { +func (v *NodeResponse) UnmarshalJSON(b []byte) error { if string(b) == "null" { return nil } var firstPass struct { - *PathPathHasSBOM + *NodeResponse + Node json.RawMessage `json:"node"` graphql.NoUnmarshalJSON } - firstPass.PathPathHasSBOM = v + firstPass.NodeResponse = v err := json.Unmarshal(b, &firstPass) if err != nil { return err } - err = json.Unmarshal( - b, &v.allHasSBOMTree) - if err != nil { - return err + { + dst := &v.Node + src := firstPass.Node + if len(src) != 0 && string(src) != "null" { + err = __unmarshalNodeNode( + src, dst) + if err != nil { + return fmt.Errorf( + "unable to unmarshal NodeResponse.Node: %w", err) + } + } } return nil } -type __premarshalPathPathHasSBOM struct { - Typename *string `json:"__typename"` - - Id string `json:"id"` - - Subject json.RawMessage `json:"subject"` - - Uri string `json:"uri"` - - Algorithm string `json:"algorithm"` - - Digest string `json:"digest"` - - DownloadLocation string `json:"downloadLocation"` - - Origin string `json:"origin"` - - Collector string `json:"collector"` +type __premarshalNodeResponse struct { + Node json.RawMessage `json:"node"` } -func (v *PathPathHasSBOM) MarshalJSON() ([]byte, error) { +func (v *NodeResponse) MarshalJSON() ([]byte, error) { premarshaled, err := v.__premarshalJSON() if err != nil { return nil, err @@ -16078,64 +16365,62 @@ func (v *PathPathHasSBOM) MarshalJSON() ([]byte, error) { return json.Marshal(premarshaled) } -func (v *PathPathHasSBOM) __premarshalJSON() (*__premarshalPathPathHasSBOM, error) { - var retval __premarshalPathPathHasSBOM +func (v *NodeResponse) __premarshalJSON() (*__premarshalNodeResponse, error) { + var retval __premarshalNodeResponse - retval.Typename = v.Typename - retval.Id = v.allHasSBOMTree.Id { - dst := &retval.Subject - src := v.allHasSBOMTree.Subject + dst := &retval.Node + src := v.Node var err error - *dst, err = __marshalallHasSBOMTreeSubjectPackageOrArtifact( + *dst, err = __marshalNodeNode( &src) if err != nil { return nil, fmt.Errorf( - "unable to marshal PathPathHasSBOM.allHasSBOMTree.Subject: %w", err) + "unable to marshal NodeResponse.Node: %w", err) } } - retval.Uri = v.allHasSBOMTree.Uri - retval.Algorithm = v.allHasSBOMTree.Algorithm - retval.Digest = v.allHasSBOMTree.Digest - retval.DownloadLocation = v.allHasSBOMTree.DownloadLocation - retval.Origin = v.allHasSBOMTree.Origin - retval.Collector = v.allHasSBOMTree.Collector return &retval, nil } -// PathPathHasSLSA includes the requested fields of the GraphQL type HasSLSA. +// NodesNodesArtifact includes the requested fields of the GraphQL type Artifact. // The GraphQL type's documentation follows. // -// HasSLSA records that a subject node has a SLSA attestation. -type PathPathHasSLSA struct { - Typename *string `json:"__typename"` - allSLSATree `json:"-"` +// Artifact represents an artifact identified by a checksum hash. +// +// The checksum is split into the digest value and the algorithm used to generate +// it. Both fields are mandatory and canonicalized to be lowercase. +// +// If having a checksum Go object, algorithm can be +// strings.ToLower(string(checksum.Algorithm)) and digest can be checksum.Value. +type NodesNodesArtifact struct { + Typename *string `json:"__typename"` + AllArtifactTree `json:"-"` } -// GetTypename returns PathPathHasSLSA.Typename, and is useful for accessing the field via an interface. -func (v *PathPathHasSLSA) GetTypename() *string { return v.Typename } +// GetTypename returns NodesNodesArtifact.Typename, and is useful for accessing the field via an interface. +func (v *NodesNodesArtifact) GetTypename() *string { return v.Typename } -// GetId returns PathPathHasSLSA.Id, and is useful for accessing the field via an interface. -func (v *PathPathHasSLSA) GetId() string { return v.allSLSATree.Id } +// GetId returns NodesNodesArtifact.Id, and is useful for accessing the field via an interface. +func (v *NodesNodesArtifact) GetId() string { return v.AllArtifactTree.Id } -// GetSubject returns PathPathHasSLSA.Subject, and is useful for accessing the field via an interface. -func (v *PathPathHasSLSA) GetSubject() allSLSATreeSubjectArtifact { return v.allSLSATree.Subject } +// GetAlgorithm returns NodesNodesArtifact.Algorithm, and is useful for accessing the field via an interface. +func (v *NodesNodesArtifact) GetAlgorithm() string { return v.AllArtifactTree.Algorithm } -// GetSlsa returns PathPathHasSLSA.Slsa, and is useful for accessing the field via an interface. -func (v *PathPathHasSLSA) GetSlsa() allSLSATreeSlsaSLSA { return v.allSLSATree.Slsa } +// GetDigest returns NodesNodesArtifact.Digest, and is useful for accessing the field via an interface. +func (v *NodesNodesArtifact) GetDigest() string { return v.AllArtifactTree.Digest } -func (v *PathPathHasSLSA) UnmarshalJSON(b []byte) error { +func (v *NodesNodesArtifact) UnmarshalJSON(b []byte) error { if string(b) == "null" { return nil } var firstPass struct { - *PathPathHasSLSA + *NodesNodesArtifact graphql.NoUnmarshalJSON } - firstPass.PathPathHasSLSA = v + firstPass.NodesNodesArtifact = v err := json.Unmarshal(b, &firstPass) if err != nil { @@ -16143,24 +16428,24 @@ func (v *PathPathHasSLSA) UnmarshalJSON(b []byte) error { } err = json.Unmarshal( - b, &v.allSLSATree) + b, &v.AllArtifactTree) if err != nil { return err } return nil } -type __premarshalPathPathHasSLSA struct { +type __premarshalNodesNodesArtifact struct { Typename *string `json:"__typename"` Id string `json:"id"` - Subject allSLSATreeSubjectArtifact `json:"subject"` + Algorithm string `json:"algorithm"` - Slsa allSLSATreeSlsaSLSA `json:"slsa"` + Digest string `json:"digest"` } -func (v *PathPathHasSLSA) MarshalJSON() ([]byte, error) { +func (v *NodesNodesArtifact) MarshalJSON() ([]byte, error) { premarshaled, err := v.__premarshalJSON() if err != nil { return nil, err @@ -16168,60 +16453,47 @@ func (v *PathPathHasSLSA) MarshalJSON() ([]byte, error) { return json.Marshal(premarshaled) } -func (v *PathPathHasSLSA) __premarshalJSON() (*__premarshalPathPathHasSLSA, error) { - var retval __premarshalPathPathHasSLSA +func (v *NodesNodesArtifact) __premarshalJSON() (*__premarshalNodesNodesArtifact, error) { + var retval __premarshalNodesNodesArtifact retval.Typename = v.Typename - retval.Id = v.allSLSATree.Id - retval.Subject = v.allSLSATree.Subject - retval.Slsa = v.allSLSATree.Slsa + retval.Id = v.AllArtifactTree.Id + retval.Algorithm = v.AllArtifactTree.Algorithm + retval.Digest = v.AllArtifactTree.Digest return &retval, nil } -// PathPathHasSourceAt includes the requested fields of the GraphQL type HasSourceAt. +// NodesNodesBuilder includes the requested fields of the GraphQL type Builder. // The GraphQL type's documentation follows. // -// HasSourceAt records that a package's repository is a given source. -type PathPathHasSourceAt struct { +// Builder represents the builder (e.g., FRSCA or GitHub Actions). +// +// Currently builders are identified by the uri field. +type NodesNodesBuilder struct { Typename *string `json:"__typename"` - allHasSourceAt `json:"-"` + AllBuilderTree `json:"-"` } -// GetTypename returns PathPathHasSourceAt.Typename, and is useful for accessing the field via an interface. -func (v *PathPathHasSourceAt) GetTypename() *string { return v.Typename } - -// GetId returns PathPathHasSourceAt.Id, and is useful for accessing the field via an interface. -func (v *PathPathHasSourceAt) GetId() string { return v.allHasSourceAt.Id } - -// GetJustification returns PathPathHasSourceAt.Justification, and is useful for accessing the field via an interface. -func (v *PathPathHasSourceAt) GetJustification() string { return v.allHasSourceAt.Justification } - -// GetKnownSince returns PathPathHasSourceAt.KnownSince, and is useful for accessing the field via an interface. -func (v *PathPathHasSourceAt) GetKnownSince() time.Time { return v.allHasSourceAt.KnownSince } - -// GetPackage returns PathPathHasSourceAt.Package, and is useful for accessing the field via an interface. -func (v *PathPathHasSourceAt) GetPackage() allHasSourceAtPackage { return v.allHasSourceAt.Package } - -// GetSource returns PathPathHasSourceAt.Source, and is useful for accessing the field via an interface. -func (v *PathPathHasSourceAt) GetSource() allHasSourceAtSource { return v.allHasSourceAt.Source } +// GetTypename returns NodesNodesBuilder.Typename, and is useful for accessing the field via an interface. +func (v *NodesNodesBuilder) GetTypename() *string { return v.Typename } -// GetOrigin returns PathPathHasSourceAt.Origin, and is useful for accessing the field via an interface. -func (v *PathPathHasSourceAt) GetOrigin() string { return v.allHasSourceAt.Origin } +// GetId returns NodesNodesBuilder.Id, and is useful for accessing the field via an interface. +func (v *NodesNodesBuilder) GetId() string { return v.AllBuilderTree.Id } -// GetCollector returns PathPathHasSourceAt.Collector, and is useful for accessing the field via an interface. -func (v *PathPathHasSourceAt) GetCollector() string { return v.allHasSourceAt.Collector } +// GetUri returns NodesNodesBuilder.Uri, and is useful for accessing the field via an interface. +func (v *NodesNodesBuilder) GetUri() string { return v.AllBuilderTree.Uri } -func (v *PathPathHasSourceAt) UnmarshalJSON(b []byte) error { +func (v *NodesNodesBuilder) UnmarshalJSON(b []byte) error { if string(b) == "null" { return nil } var firstPass struct { - *PathPathHasSourceAt + *NodesNodesBuilder graphql.NoUnmarshalJSON } - firstPass.PathPathHasSourceAt = v + firstPass.NodesNodesBuilder = v err := json.Unmarshal(b, &firstPass) if err != nil { @@ -16229,32 +16501,22 @@ func (v *PathPathHasSourceAt) UnmarshalJSON(b []byte) error { } err = json.Unmarshal( - b, &v.allHasSourceAt) + b, &v.AllBuilderTree) if err != nil { return err } return nil } -type __premarshalPathPathHasSourceAt struct { +type __premarshalNodesNodesBuilder struct { Typename *string `json:"__typename"` Id string `json:"id"` - Justification string `json:"justification"` - - KnownSince time.Time `json:"knownSince"` - - Package allHasSourceAtPackage `json:"package"` - - Source allHasSourceAtSource `json:"source"` - - Origin string `json:"origin"` - - Collector string `json:"collector"` + Uri string `json:"uri"` } -func (v *PathPathHasSourceAt) MarshalJSON() ([]byte, error) { +func (v *NodesNodesBuilder) MarshalJSON() ([]byte, error) { premarshaled, err := v.__premarshalJSON() if err != nil { return nil, err @@ -16262,60 +16524,56 @@ func (v *PathPathHasSourceAt) MarshalJSON() ([]byte, error) { return json.Marshal(premarshaled) } -func (v *PathPathHasSourceAt) __premarshalJSON() (*__premarshalPathPathHasSourceAt, error) { - var retval __premarshalPathPathHasSourceAt +func (v *NodesNodesBuilder) __premarshalJSON() (*__premarshalNodesNodesBuilder, error) { + var retval __premarshalNodesNodesBuilder retval.Typename = v.Typename - retval.Id = v.allHasSourceAt.Id - retval.Justification = v.allHasSourceAt.Justification - retval.KnownSince = v.allHasSourceAt.KnownSince - retval.Package = v.allHasSourceAt.Package - retval.Source = v.allHasSourceAt.Source - retval.Origin = v.allHasSourceAt.Origin - retval.Collector = v.allHasSourceAt.Collector + retval.Id = v.AllBuilderTree.Id + retval.Uri = v.AllBuilderTree.Uri return &retval, nil } -// PathPathHashEqual includes the requested fields of the GraphQL type HashEqual. +// NodesNodesCVE includes the requested fields of the GraphQL type CVE. // The GraphQL type's documentation follows. // -// HashEqual is an attestation that a set of artifacts are identical. -type PathPathHashEqual struct { - Typename *string `json:"__typename"` - allHashEqualTree `json:"-"` +// CVE represents a vulnerability in the Common Vulnerabilities and Exposures +// schema. +// +// The vulnerability identifier contains a year field, so we are extracting that +// to allow matching for vulnerabilities found in a given year. +// +// The vulnerability identifier field is mandatory and canonicalized to be +// lowercase. +// +// This node can be referred to by other parts of GUAC. +type NodesNodesCVE struct { + Typename *string `json:"__typename"` + AllCveTree `json:"-"` } -// GetTypename returns PathPathHashEqual.Typename, and is useful for accessing the field via an interface. -func (v *PathPathHashEqual) GetTypename() *string { return v.Typename } - -// GetId returns PathPathHashEqual.Id, and is useful for accessing the field via an interface. -func (v *PathPathHashEqual) GetId() string { return v.allHashEqualTree.Id } - -// GetJustification returns PathPathHashEqual.Justification, and is useful for accessing the field via an interface. -func (v *PathPathHashEqual) GetJustification() string { return v.allHashEqualTree.Justification } +// GetTypename returns NodesNodesCVE.Typename, and is useful for accessing the field via an interface. +func (v *NodesNodesCVE) GetTypename() *string { return v.Typename } -// GetArtifacts returns PathPathHashEqual.Artifacts, and is useful for accessing the field via an interface. -func (v *PathPathHashEqual) GetArtifacts() []allHashEqualTreeArtifactsArtifact { - return v.allHashEqualTree.Artifacts -} +// GetId returns NodesNodesCVE.Id, and is useful for accessing the field via an interface. +func (v *NodesNodesCVE) GetId() string { return v.AllCveTree.Id } -// GetOrigin returns PathPathHashEqual.Origin, and is useful for accessing the field via an interface. -func (v *PathPathHashEqual) GetOrigin() string { return v.allHashEqualTree.Origin } +// GetYear returns NodesNodesCVE.Year, and is useful for accessing the field via an interface. +func (v *NodesNodesCVE) GetYear() int { return v.AllCveTree.Year } -// GetCollector returns PathPathHashEqual.Collector, and is useful for accessing the field via an interface. -func (v *PathPathHashEqual) GetCollector() string { return v.allHashEqualTree.Collector } +// GetCveId returns NodesNodesCVE.CveId, and is useful for accessing the field via an interface. +func (v *NodesNodesCVE) GetCveId() string { return v.AllCveTree.CveId } -func (v *PathPathHashEqual) UnmarshalJSON(b []byte) error { +func (v *NodesNodesCVE) UnmarshalJSON(b []byte) error { if string(b) == "null" { return nil } var firstPass struct { - *PathPathHashEqual + *NodesNodesCVE graphql.NoUnmarshalJSON } - firstPass.PathPathHashEqual = v + firstPass.NodesNodesCVE = v err := json.Unmarshal(b, &firstPass) if err != nil { @@ -16323,28 +16581,24 @@ func (v *PathPathHashEqual) UnmarshalJSON(b []byte) error { } err = json.Unmarshal( - b, &v.allHashEqualTree) + b, &v.AllCveTree) if err != nil { return err } return nil } -type __premarshalPathPathHashEqual struct { +type __premarshalNodesNodesCVE struct { Typename *string `json:"__typename"` Id string `json:"id"` - Justification string `json:"justification"` - - Artifacts []allHashEqualTreeArtifactsArtifact `json:"artifacts"` - - Origin string `json:"origin"` + Year int `json:"year"` - Collector string `json:"collector"` + CveId string `json:"cveId"` } -func (v *PathPathHashEqual) MarshalJSON() ([]byte, error) { +func (v *NodesNodesCVE) MarshalJSON() ([]byte, error) { premarshaled, err := v.__premarshalJSON() if err != nil { return nil, err @@ -16352,71 +16606,66 @@ func (v *PathPathHashEqual) MarshalJSON() ([]byte, error) { return json.Marshal(premarshaled) } -func (v *PathPathHashEqual) __premarshalJSON() (*__premarshalPathPathHashEqual, error) { - var retval __premarshalPathPathHashEqual +func (v *NodesNodesCVE) __premarshalJSON() (*__premarshalNodesNodesCVE, error) { + var retval __premarshalNodesNodesCVE retval.Typename = v.Typename - retval.Id = v.allHashEqualTree.Id - retval.Justification = v.allHashEqualTree.Justification - retval.Artifacts = v.allHashEqualTree.Artifacts - retval.Origin = v.allHashEqualTree.Origin - retval.Collector = v.allHashEqualTree.Collector + retval.Id = v.AllCveTree.Id + retval.Year = v.AllCveTree.Year + retval.CveId = v.AllCveTree.CveId return &retval, nil } -// PathPathIsDependency includes the requested fields of the GraphQL type IsDependency. +// NodesNodesCertifyBad includes the requested fields of the GraphQL type CertifyBad. // The GraphQL type's documentation follows. // -// IsDependency is an attestation to record that a package depends on another. -type PathPathIsDependency struct { - Typename *string `json:"__typename"` - allIsDependencyTree `json:"-"` +// CertifyBad is an attestation that a package, source, or artifact is considered +// bad. +// +// All evidence trees record a justification for the property they represent as +// well as the document that contains the attestation (origin) and the collector +// that collected the document (collector). +// +// The certification applies to a subject which is a package, source, or artifact. +// If the attestation targets a package, it must target a PackageName or a +// PackageVersion. If the attestation targets a source, it must target a +// SourceName. +type NodesNodesCertifyBad struct { + Typename *string `json:"__typename"` + AllCertifyBad `json:"-"` } -// GetTypename returns PathPathIsDependency.Typename, and is useful for accessing the field via an interface. -func (v *PathPathIsDependency) GetTypename() *string { return v.Typename } - -// GetId returns PathPathIsDependency.Id, and is useful for accessing the field via an interface. -func (v *PathPathIsDependency) GetId() string { return v.allIsDependencyTree.Id } - -// GetJustification returns PathPathIsDependency.Justification, and is useful for accessing the field via an interface. -func (v *PathPathIsDependency) GetJustification() string { return v.allIsDependencyTree.Justification } +// GetTypename returns NodesNodesCertifyBad.Typename, and is useful for accessing the field via an interface. +func (v *NodesNodesCertifyBad) GetTypename() *string { return v.Typename } -// GetPackage returns PathPathIsDependency.Package, and is useful for accessing the field via an interface. -func (v *PathPathIsDependency) GetPackage() allIsDependencyTreePackage { - return v.allIsDependencyTree.Package -} +// GetId returns NodesNodesCertifyBad.Id, and is useful for accessing the field via an interface. +func (v *NodesNodesCertifyBad) GetId() string { return v.AllCertifyBad.Id } -// GetDependentPackage returns PathPathIsDependency.DependentPackage, and is useful for accessing the field via an interface. -func (v *PathPathIsDependency) GetDependentPackage() allIsDependencyTreeDependentPackage { - return v.allIsDependencyTree.DependentPackage -} +// GetJustification returns NodesNodesCertifyBad.Justification, and is useful for accessing the field via an interface. +func (v *NodesNodesCertifyBad) GetJustification() string { return v.AllCertifyBad.Justification } -// GetDependencyType returns PathPathIsDependency.DependencyType, and is useful for accessing the field via an interface. -func (v *PathPathIsDependency) GetDependencyType() DependencyType { - return v.allIsDependencyTree.DependencyType +// GetSubject returns NodesNodesCertifyBad.Subject, and is useful for accessing the field via an interface. +func (v *NodesNodesCertifyBad) GetSubject() AllCertifyBadSubjectPackageSourceOrArtifact { + return v.AllCertifyBad.Subject } -// GetVersionRange returns PathPathIsDependency.VersionRange, and is useful for accessing the field via an interface. -func (v *PathPathIsDependency) GetVersionRange() string { return v.allIsDependencyTree.VersionRange } - -// GetOrigin returns PathPathIsDependency.Origin, and is useful for accessing the field via an interface. -func (v *PathPathIsDependency) GetOrigin() string { return v.allIsDependencyTree.Origin } +// GetOrigin returns NodesNodesCertifyBad.Origin, and is useful for accessing the field via an interface. +func (v *NodesNodesCertifyBad) GetOrigin() string { return v.AllCertifyBad.Origin } -// GetCollector returns PathPathIsDependency.Collector, and is useful for accessing the field via an interface. -func (v *PathPathIsDependency) GetCollector() string { return v.allIsDependencyTree.Collector } +// GetCollector returns NodesNodesCertifyBad.Collector, and is useful for accessing the field via an interface. +func (v *NodesNodesCertifyBad) GetCollector() string { return v.AllCertifyBad.Collector } -func (v *PathPathIsDependency) UnmarshalJSON(b []byte) error { +func (v *NodesNodesCertifyBad) UnmarshalJSON(b []byte) error { if string(b) == "null" { return nil } var firstPass struct { - *PathPathIsDependency + *NodesNodesCertifyBad graphql.NoUnmarshalJSON } - firstPass.PathPathIsDependency = v + firstPass.NodesNodesCertifyBad = v err := json.Unmarshal(b, &firstPass) if err != nil { @@ -16424,34 +16673,28 @@ func (v *PathPathIsDependency) UnmarshalJSON(b []byte) error { } err = json.Unmarshal( - b, &v.allIsDependencyTree) + b, &v.AllCertifyBad) if err != nil { return err } return nil } -type __premarshalPathPathIsDependency struct { +type __premarshalNodesNodesCertifyBad struct { Typename *string `json:"__typename"` Id string `json:"id"` Justification string `json:"justification"` - Package allIsDependencyTreePackage `json:"package"` - - DependentPackage allIsDependencyTreeDependentPackage `json:"dependentPackage"` - - DependencyType DependencyType `json:"dependencyType"` - - VersionRange string `json:"versionRange"` + Subject json.RawMessage `json:"subject"` Origin string `json:"origin"` Collector string `json:"collector"` } -func (v *PathPathIsDependency) MarshalJSON() ([]byte, error) { +func (v *NodesNodesCertifyBad) MarshalJSON() ([]byte, error) { premarshaled, err := v.__premarshalJSON() if err != nil { return nil, err @@ -16459,68 +16702,79 @@ func (v *PathPathIsDependency) MarshalJSON() ([]byte, error) { return json.Marshal(premarshaled) } -func (v *PathPathIsDependency) __premarshalJSON() (*__premarshalPathPathIsDependency, error) { - var retval __premarshalPathPathIsDependency +func (v *NodesNodesCertifyBad) __premarshalJSON() (*__premarshalNodesNodesCertifyBad, error) { + var retval __premarshalNodesNodesCertifyBad retval.Typename = v.Typename - retval.Id = v.allIsDependencyTree.Id - retval.Justification = v.allIsDependencyTree.Justification - retval.Package = v.allIsDependencyTree.Package - retval.DependentPackage = v.allIsDependencyTree.DependentPackage - retval.DependencyType = v.allIsDependencyTree.DependencyType - retval.VersionRange = v.allIsDependencyTree.VersionRange - retval.Origin = v.allIsDependencyTree.Origin - retval.Collector = v.allIsDependencyTree.Collector + retval.Id = v.AllCertifyBad.Id + retval.Justification = v.AllCertifyBad.Justification + { + + dst := &retval.Subject + src := v.AllCertifyBad.Subject + var err error + *dst, err = __marshalAllCertifyBadSubjectPackageSourceOrArtifact( + &src) + if err != nil { + return nil, fmt.Errorf( + "unable to marshal NodesNodesCertifyBad.AllCertifyBad.Subject: %w", err) + } + } + retval.Origin = v.AllCertifyBad.Origin + retval.Collector = v.AllCertifyBad.Collector return &retval, nil } -// PathPathIsOccurrence includes the requested fields of the GraphQL type IsOccurrence. +// NodesNodesCertifyGood includes the requested fields of the GraphQL type CertifyGood. // The GraphQL type's documentation follows. // -// IsOccurrence is an attestation to link an artifact to a package or source. +// CertifyGood is an attestation that a package, source, or artifact is considered +// good. // -// Attestation must occur at the PackageVersion or at the SourceName. -type PathPathIsOccurrence struct { - Typename *string `json:"__typename"` - AllIsOccurrencesTree `json:"-"` +// All evidence trees record a justification for the property they represent as +// well as the document that contains the attestation (origin) and the collector +// that collected the document (collector). +// +// The certification applies to a subject which is a package, source, or artifact. +// If the attestation targets a package, it must target a PackageName or a +// PackageVersion. If the attestation targets a source, it must target a +// SourceName. +type NodesNodesCertifyGood struct { + Typename *string `json:"__typename"` + AllCertifyGood `json:"-"` } -// GetTypename returns PathPathIsOccurrence.Typename, and is useful for accessing the field via an interface. -func (v *PathPathIsOccurrence) GetTypename() *string { return v.Typename } +// GetTypename returns NodesNodesCertifyGood.Typename, and is useful for accessing the field via an interface. +func (v *NodesNodesCertifyGood) GetTypename() *string { return v.Typename } -// GetId returns PathPathIsOccurrence.Id, and is useful for accessing the field via an interface. -func (v *PathPathIsOccurrence) GetId() string { return v.AllIsOccurrencesTree.Id } +// GetId returns NodesNodesCertifyGood.Id, and is useful for accessing the field via an interface. +func (v *NodesNodesCertifyGood) GetId() string { return v.AllCertifyGood.Id } -// GetSubject returns PathPathIsOccurrence.Subject, and is useful for accessing the field via an interface. -func (v *PathPathIsOccurrence) GetSubject() AllIsOccurrencesTreeSubjectPackageOrSource { - return v.AllIsOccurrencesTree.Subject -} +// GetJustification returns NodesNodesCertifyGood.Justification, and is useful for accessing the field via an interface. +func (v *NodesNodesCertifyGood) GetJustification() string { return v.AllCertifyGood.Justification } -// GetArtifact returns PathPathIsOccurrence.Artifact, and is useful for accessing the field via an interface. -func (v *PathPathIsOccurrence) GetArtifact() AllIsOccurrencesTreeArtifact { - return v.AllIsOccurrencesTree.Artifact +// GetSubject returns NodesNodesCertifyGood.Subject, and is useful for accessing the field via an interface. +func (v *NodesNodesCertifyGood) GetSubject() AllCertifyGoodSubjectPackageSourceOrArtifact { + return v.AllCertifyGood.Subject } -// GetJustification returns PathPathIsOccurrence.Justification, and is useful for accessing the field via an interface. -func (v *PathPathIsOccurrence) GetJustification() string { return v.AllIsOccurrencesTree.Justification } - -// GetOrigin returns PathPathIsOccurrence.Origin, and is useful for accessing the field via an interface. -func (v *PathPathIsOccurrence) GetOrigin() string { return v.AllIsOccurrencesTree.Origin } +// GetOrigin returns NodesNodesCertifyGood.Origin, and is useful for accessing the field via an interface. +func (v *NodesNodesCertifyGood) GetOrigin() string { return v.AllCertifyGood.Origin } -// GetCollector returns PathPathIsOccurrence.Collector, and is useful for accessing the field via an interface. -func (v *PathPathIsOccurrence) GetCollector() string { return v.AllIsOccurrencesTree.Collector } +// GetCollector returns NodesNodesCertifyGood.Collector, and is useful for accessing the field via an interface. +func (v *NodesNodesCertifyGood) GetCollector() string { return v.AllCertifyGood.Collector } -func (v *PathPathIsOccurrence) UnmarshalJSON(b []byte) error { +func (v *NodesNodesCertifyGood) UnmarshalJSON(b []byte) error { if string(b) == "null" { return nil } var firstPass struct { - *PathPathIsOccurrence + *NodesNodesCertifyGood graphql.NoUnmarshalJSON } - firstPass.PathPathIsOccurrence = v + firstPass.NodesNodesCertifyGood = v err := json.Unmarshal(b, &firstPass) if err != nil { @@ -16528,30 +16782,28 @@ func (v *PathPathIsOccurrence) UnmarshalJSON(b []byte) error { } err = json.Unmarshal( - b, &v.AllIsOccurrencesTree) + b, &v.AllCertifyGood) if err != nil { return err } return nil } -type __premarshalPathPathIsOccurrence struct { +type __premarshalNodesNodesCertifyGood struct { Typename *string `json:"__typename"` Id string `json:"id"` - Subject json.RawMessage `json:"subject"` - - Artifact AllIsOccurrencesTreeArtifact `json:"artifact"` - Justification string `json:"justification"` + Subject json.RawMessage `json:"subject"` + Origin string `json:"origin"` Collector string `json:"collector"` } -func (v *PathPathIsOccurrence) MarshalJSON() ([]byte, error) { +func (v *NodesNodesCertifyGood) MarshalJSON() ([]byte, error) { premarshaled, err := v.__premarshalJSON() if err != nil { return nil, err @@ -16559,75 +16811,66 @@ func (v *PathPathIsOccurrence) MarshalJSON() ([]byte, error) { return json.Marshal(premarshaled) } -func (v *PathPathIsOccurrence) __premarshalJSON() (*__premarshalPathPathIsOccurrence, error) { - var retval __premarshalPathPathIsOccurrence +func (v *NodesNodesCertifyGood) __premarshalJSON() (*__premarshalNodesNodesCertifyGood, error) { + var retval __premarshalNodesNodesCertifyGood retval.Typename = v.Typename - retval.Id = v.AllIsOccurrencesTree.Id + retval.Id = v.AllCertifyGood.Id + retval.Justification = v.AllCertifyGood.Justification { dst := &retval.Subject - src := v.AllIsOccurrencesTree.Subject + src := v.AllCertifyGood.Subject var err error - *dst, err = __marshalAllIsOccurrencesTreeSubjectPackageOrSource( + *dst, err = __marshalAllCertifyGoodSubjectPackageSourceOrArtifact( &src) if err != nil { return nil, fmt.Errorf( - "unable to marshal PathPathIsOccurrence.AllIsOccurrencesTree.Subject: %w", err) + "unable to marshal NodesNodesCertifyGood.AllCertifyGood.Subject: %w", err) } } - retval.Artifact = v.AllIsOccurrencesTree.Artifact - retval.Justification = v.AllIsOccurrencesTree.Justification - retval.Origin = v.AllIsOccurrencesTree.Origin - retval.Collector = v.AllIsOccurrencesTree.Collector + retval.Origin = v.AllCertifyGood.Origin + retval.Collector = v.AllCertifyGood.Collector return &retval, nil } -// PathPathIsVulnerability includes the requested fields of the GraphQL type IsVulnerability. +// NodesNodesCertifyScorecard includes the requested fields of the GraphQL type CertifyScorecard. // The GraphQL type's documentation follows. // -// IsVulnerability is an attestation to link CVE/GHSA with data in OSV. -type PathPathIsVulnerability struct { - Typename *string `json:"__typename"` - allIsVulnerability `json:"-"` +// CertifyScorecard is an attestation to attach a Scorecard analysis to a +// particular source repository. +type NodesNodesCertifyScorecard struct { + Typename *string `json:"__typename"` + AllCertifyScorecard `json:"-"` } -// GetTypename returns PathPathIsVulnerability.Typename, and is useful for accessing the field via an interface. -func (v *PathPathIsVulnerability) GetTypename() *string { return v.Typename } - -// GetId returns PathPathIsVulnerability.Id, and is useful for accessing the field via an interface. -func (v *PathPathIsVulnerability) GetId() string { return v.allIsVulnerability.Id } - -// GetOsv returns PathPathIsVulnerability.Osv, and is useful for accessing the field via an interface. -func (v *PathPathIsVulnerability) GetOsv() allIsVulnerabilityOsvOSV { return v.allIsVulnerability.Osv } +// GetTypename returns NodesNodesCertifyScorecard.Typename, and is useful for accessing the field via an interface. +func (v *NodesNodesCertifyScorecard) GetTypename() *string { return v.Typename } -// GetVulnerability returns PathPathIsVulnerability.Vulnerability, and is useful for accessing the field via an interface. -func (v *PathPathIsVulnerability) GetVulnerability() allIsVulnerabilityVulnerabilityCveOrGhsa { - return v.allIsVulnerability.Vulnerability -} +// GetId returns NodesNodesCertifyScorecard.Id, and is useful for accessing the field via an interface. +func (v *NodesNodesCertifyScorecard) GetId() string { return v.AllCertifyScorecard.Id } -// GetJustification returns PathPathIsVulnerability.Justification, and is useful for accessing the field via an interface. -func (v *PathPathIsVulnerability) GetJustification() string { - return v.allIsVulnerability.Justification +// GetSource returns NodesNodesCertifyScorecard.Source, and is useful for accessing the field via an interface. +func (v *NodesNodesCertifyScorecard) GetSource() AllCertifyScorecardSource { + return v.AllCertifyScorecard.Source } -// GetOrigin returns PathPathIsVulnerability.Origin, and is useful for accessing the field via an interface. -func (v *PathPathIsVulnerability) GetOrigin() string { return v.allIsVulnerability.Origin } - -// GetCollector returns PathPathIsVulnerability.Collector, and is useful for accessing the field via an interface. -func (v *PathPathIsVulnerability) GetCollector() string { return v.allIsVulnerability.Collector } +// GetScorecard returns NodesNodesCertifyScorecard.Scorecard, and is useful for accessing the field via an interface. +func (v *NodesNodesCertifyScorecard) GetScorecard() AllCertifyScorecardScorecard { + return v.AllCertifyScorecard.Scorecard +} -func (v *PathPathIsVulnerability) UnmarshalJSON(b []byte) error { +func (v *NodesNodesCertifyScorecard) UnmarshalJSON(b []byte) error { if string(b) == "null" { return nil } var firstPass struct { - *PathPathIsVulnerability + *NodesNodesCertifyScorecard graphql.NoUnmarshalJSON } - firstPass.PathPathIsVulnerability = v + firstPass.NodesNodesCertifyScorecard = v err := json.Unmarshal(b, &firstPass) if err != nil { @@ -16635,30 +16878,24 @@ func (v *PathPathIsVulnerability) UnmarshalJSON(b []byte) error { } err = json.Unmarshal( - b, &v.allIsVulnerability) + b, &v.AllCertifyScorecard) if err != nil { return err } return nil } -type __premarshalPathPathIsVulnerability struct { +type __premarshalNodesNodesCertifyScorecard struct { Typename *string `json:"__typename"` Id string `json:"id"` - Osv allIsVulnerabilityOsvOSV `json:"osv"` - - Vulnerability json.RawMessage `json:"vulnerability"` - - Justification string `json:"justification"` - - Origin string `json:"origin"` + Source AllCertifyScorecardSource `json:"source"` - Collector string `json:"collector"` + Scorecard AllCertifyScorecardScorecard `json:"scorecard"` } -func (v *PathPathIsVulnerability) MarshalJSON() ([]byte, error) { +func (v *NodesNodesCertifyScorecard) MarshalJSON() ([]byte, error) { premarshaled, err := v.__premarshalJSON() if err != nil { return nil, err @@ -16666,515 +16903,300 @@ func (v *PathPathIsVulnerability) MarshalJSON() ([]byte, error) { return json.Marshal(premarshaled) } -func (v *PathPathIsVulnerability) __premarshalJSON() (*__premarshalPathPathIsVulnerability, error) { - var retval __premarshalPathPathIsVulnerability +func (v *NodesNodesCertifyScorecard) __premarshalJSON() (*__premarshalNodesNodesCertifyScorecard, error) { + var retval __premarshalNodesNodesCertifyScorecard retval.Typename = v.Typename - retval.Id = v.allIsVulnerability.Id - retval.Osv = v.allIsVulnerability.Osv - { - - dst := &retval.Vulnerability - src := v.allIsVulnerability.Vulnerability - var err error - *dst, err = __marshalallIsVulnerabilityVulnerabilityCveOrGhsa( - &src) - if err != nil { - return nil, fmt.Errorf( - "unable to marshal PathPathIsVulnerability.allIsVulnerability.Vulnerability: %w", err) - } - } - retval.Justification = v.allIsVulnerability.Justification - retval.Origin = v.allIsVulnerability.Origin - retval.Collector = v.allIsVulnerability.Collector + retval.Id = v.AllCertifyScorecard.Id + retval.Source = v.AllCertifyScorecard.Source + retval.Scorecard = v.AllCertifyScorecard.Scorecard return &retval, nil } -// PathPathNoVuln includes the requested fields of the GraphQL type NoVuln. +// NodesNodesCertifyVEXStatement includes the requested fields of the GraphQL type CertifyVEXStatement. // The GraphQL type's documentation follows. // -// NoVuln is a special vulnerability node to attest that no vulnerability has been -// found during a vulnerability scan. -// -// Backends guarantee that this is a singleton node. -type PathPathNoVuln struct { - Typename *string `json:"__typename"` - Id string `json:"id"` +// CertifyVEXStatement is an attestation to attach VEX statements to a package or +// artifact to clarify the impact of a specific vulnerability (CVE, GHSA or OSV). +type NodesNodesCertifyVEXStatement struct { + Typename *string `json:"__typename"` + AllCertifyVEXStatement `json:"-"` } -// GetTypename returns PathPathNoVuln.Typename, and is useful for accessing the field via an interface. -func (v *PathPathNoVuln) GetTypename() *string { return v.Typename } +// GetTypename returns NodesNodesCertifyVEXStatement.Typename, and is useful for accessing the field via an interface. +func (v *NodesNodesCertifyVEXStatement) GetTypename() *string { return v.Typename } -// GetId returns PathPathNoVuln.Id, and is useful for accessing the field via an interface. -func (v *PathPathNoVuln) GetId() string { return v.Id } +// GetId returns NodesNodesCertifyVEXStatement.Id, and is useful for accessing the field via an interface. +func (v *NodesNodesCertifyVEXStatement) GetId() string { return v.AllCertifyVEXStatement.Id } -// PathPathNode includes the requested fields of the GraphQL interface Node. -// -// PathPathNode is implemented by the following types: -// PathPathArtifact -// PathPathBuilder -// PathPathCVE -// PathPathCertifyBad -// PathPathCertifyGood -// PathPathCertifyScorecard -// PathPathCertifyVEXStatement -// PathPathCertifyVuln -// PathPathGHSA -// PathPathHasMetadata -// PathPathHasSBOM -// PathPathHasSLSA -// PathPathHasSourceAt -// PathPathHashEqual -// PathPathIsDependency -// PathPathIsOccurrence -// PathPathIsVulnerability -// PathPathNoVuln -// PathPathOSV -// PathPathPackage -// PathPathPkgEqual -// PathPathPointOfContact -// PathPathSource -// The GraphQL type's documentation follows. -// -// Node is a union type of all the possible nodes. -// -// It encapsulates the software tree nodes along with the evidence nodes. In a -// path query, all connecting evidence nodes along with their intermediate subject -// nodes need to be returned in order to create a complete graph. -type PathPathNode interface { - implementsGraphQLInterfacePathPathNode() - // GetTypename returns the receiver's concrete GraphQL type-name (see interface doc for possible values). - GetTypename() *string +// GetSubject returns NodesNodesCertifyVEXStatement.Subject, and is useful for accessing the field via an interface. +func (v *NodesNodesCertifyVEXStatement) GetSubject() AllCertifyVEXStatementSubjectPackageOrArtifact { + return v.AllCertifyVEXStatement.Subject } -func (v *PathPathArtifact) implementsGraphQLInterfacePathPathNode() {} -func (v *PathPathBuilder) implementsGraphQLInterfacePathPathNode() {} -func (v *PathPathCVE) implementsGraphQLInterfacePathPathNode() {} -func (v *PathPathCertifyBad) implementsGraphQLInterfacePathPathNode() {} -func (v *PathPathCertifyGood) implementsGraphQLInterfacePathPathNode() {} -func (v *PathPathCertifyScorecard) implementsGraphQLInterfacePathPathNode() {} -func (v *PathPathCertifyVEXStatement) implementsGraphQLInterfacePathPathNode() {} -func (v *PathPathCertifyVuln) implementsGraphQLInterfacePathPathNode() {} -func (v *PathPathGHSA) implementsGraphQLInterfacePathPathNode() {} -func (v *PathPathHasMetadata) implementsGraphQLInterfacePathPathNode() {} -func (v *PathPathHasSBOM) implementsGraphQLInterfacePathPathNode() {} -func (v *PathPathHasSLSA) implementsGraphQLInterfacePathPathNode() {} -func (v *PathPathHasSourceAt) implementsGraphQLInterfacePathPathNode() {} -func (v *PathPathHashEqual) implementsGraphQLInterfacePathPathNode() {} -func (v *PathPathIsDependency) implementsGraphQLInterfacePathPathNode() {} -func (v *PathPathIsOccurrence) implementsGraphQLInterfacePathPathNode() {} -func (v *PathPathIsVulnerability) implementsGraphQLInterfacePathPathNode() {} -func (v *PathPathNoVuln) implementsGraphQLInterfacePathPathNode() {} -func (v *PathPathOSV) implementsGraphQLInterfacePathPathNode() {} -func (v *PathPathPackage) implementsGraphQLInterfacePathPathNode() {} -func (v *PathPathPkgEqual) implementsGraphQLInterfacePathPathNode() {} -func (v *PathPathPointOfContact) implementsGraphQLInterfacePathPathNode() {} -func (v *PathPathSource) implementsGraphQLInterfacePathPathNode() {} +// GetVulnerability returns NodesNodesCertifyVEXStatement.Vulnerability, and is useful for accessing the field via an interface. +func (v *NodesNodesCertifyVEXStatement) GetVulnerability() AllCertifyVEXStatementVulnerability { + return v.AllCertifyVEXStatement.Vulnerability +} + +// GetStatus returns NodesNodesCertifyVEXStatement.Status, and is useful for accessing the field via an interface. +func (v *NodesNodesCertifyVEXStatement) GetStatus() VexStatus { return v.AllCertifyVEXStatement.Status } + +// GetVexJustification returns NodesNodesCertifyVEXStatement.VexJustification, and is useful for accessing the field via an interface. +func (v *NodesNodesCertifyVEXStatement) GetVexJustification() VexJustification { + return v.AllCertifyVEXStatement.VexJustification +} + +// GetStatement returns NodesNodesCertifyVEXStatement.Statement, and is useful for accessing the field via an interface. +func (v *NodesNodesCertifyVEXStatement) GetStatement() string { + return v.AllCertifyVEXStatement.Statement +} + +// GetStatusNotes returns NodesNodesCertifyVEXStatement.StatusNotes, and is useful for accessing the field via an interface. +func (v *NodesNodesCertifyVEXStatement) GetStatusNotes() string { + return v.AllCertifyVEXStatement.StatusNotes +} + +// GetKnownSince returns NodesNodesCertifyVEXStatement.KnownSince, and is useful for accessing the field via an interface. +func (v *NodesNodesCertifyVEXStatement) GetKnownSince() time.Time { + return v.AllCertifyVEXStatement.KnownSince +} + +// GetOrigin returns NodesNodesCertifyVEXStatement.Origin, and is useful for accessing the field via an interface. +func (v *NodesNodesCertifyVEXStatement) GetOrigin() string { return v.AllCertifyVEXStatement.Origin } + +// GetCollector returns NodesNodesCertifyVEXStatement.Collector, and is useful for accessing the field via an interface. +func (v *NodesNodesCertifyVEXStatement) GetCollector() string { + return v.AllCertifyVEXStatement.Collector +} + +func (v *NodesNodesCertifyVEXStatement) UnmarshalJSON(b []byte) error { -func __unmarshalPathPathNode(b []byte, v *PathPathNode) error { if string(b) == "null" { return nil } - var tn struct { - TypeName string `json:"__typename"` + var firstPass struct { + *NodesNodesCertifyVEXStatement + graphql.NoUnmarshalJSON } - err := json.Unmarshal(b, &tn) + firstPass.NodesNodesCertifyVEXStatement = v + + err := json.Unmarshal(b, &firstPass) if err != nil { return err } - switch tn.TypeName { - case "Artifact": - *v = new(PathPathArtifact) - return json.Unmarshal(b, *v) - case "Builder": - *v = new(PathPathBuilder) - return json.Unmarshal(b, *v) - case "CVE": - *v = new(PathPathCVE) - return json.Unmarshal(b, *v) - case "CertifyBad": - *v = new(PathPathCertifyBad) - return json.Unmarshal(b, *v) - case "CertifyGood": - *v = new(PathPathCertifyGood) - return json.Unmarshal(b, *v) - case "CertifyScorecard": - *v = new(PathPathCertifyScorecard) - return json.Unmarshal(b, *v) - case "CertifyVEXStatement": - *v = new(PathPathCertifyVEXStatement) - return json.Unmarshal(b, *v) - case "CertifyVuln": - *v = new(PathPathCertifyVuln) - return json.Unmarshal(b, *v) - case "GHSA": - *v = new(PathPathGHSA) - return json.Unmarshal(b, *v) - case "HasMetadata": - *v = new(PathPathHasMetadata) - return json.Unmarshal(b, *v) - case "HasSBOM": - *v = new(PathPathHasSBOM) - return json.Unmarshal(b, *v) - case "HasSLSA": - *v = new(PathPathHasSLSA) - return json.Unmarshal(b, *v) - case "HasSourceAt": - *v = new(PathPathHasSourceAt) - return json.Unmarshal(b, *v) - case "HashEqual": - *v = new(PathPathHashEqual) - return json.Unmarshal(b, *v) - case "IsDependency": - *v = new(PathPathIsDependency) - return json.Unmarshal(b, *v) - case "IsOccurrence": - *v = new(PathPathIsOccurrence) - return json.Unmarshal(b, *v) - case "IsVulnerability": - *v = new(PathPathIsVulnerability) - return json.Unmarshal(b, *v) - case "NoVuln": - *v = new(PathPathNoVuln) - return json.Unmarshal(b, *v) - case "OSV": - *v = new(PathPathOSV) - return json.Unmarshal(b, *v) - case "Package": - *v = new(PathPathPackage) - return json.Unmarshal(b, *v) - case "PkgEqual": - *v = new(PathPathPkgEqual) - return json.Unmarshal(b, *v) - case "PointOfContact": - *v = new(PathPathPointOfContact) - return json.Unmarshal(b, *v) - case "Source": - *v = new(PathPathSource) - return json.Unmarshal(b, *v) - case "": - return fmt.Errorf( - "response was missing Node.__typename") - default: - return fmt.Errorf( - `unexpected concrete type for PathPathNode: "%v"`, tn.TypeName) + err = json.Unmarshal( + b, &v.AllCertifyVEXStatement) + if err != nil { + return err } + return nil } -func __marshalPathPathNode(v *PathPathNode) ([]byte, error) { +type __premarshalNodesNodesCertifyVEXStatement struct { + Typename *string `json:"__typename"` + + Id string `json:"id"` + + Subject json.RawMessage `json:"subject"` + + Vulnerability json.RawMessage `json:"vulnerability"` + + Status VexStatus `json:"status"` + + VexJustification VexJustification `json:"vexJustification"` + + Statement string `json:"statement"` + + StatusNotes string `json:"statusNotes"` + + KnownSince time.Time `json:"knownSince"` + + Origin string `json:"origin"` - var typename string - switch v := (*v).(type) { - case *PathPathArtifact: - typename = "Artifact" + Collector string `json:"collector"` +} - premarshaled, err := v.__premarshalJSON() - if err != nil { - return nil, err - } - result := struct { - TypeName string `json:"__typename"` - *__premarshalPathPathArtifact - }{typename, premarshaled} - return json.Marshal(result) - case *PathPathBuilder: - typename = "Builder" +func (v *NodesNodesCertifyVEXStatement) MarshalJSON() ([]byte, error) { + premarshaled, err := v.__premarshalJSON() + if err != nil { + return nil, err + } + return json.Marshal(premarshaled) +} - premarshaled, err := v.__premarshalJSON() - if err != nil { - return nil, err - } - result := struct { - TypeName string `json:"__typename"` - *__premarshalPathPathBuilder - }{typename, premarshaled} - return json.Marshal(result) - case *PathPathCVE: - typename = "CVE" +func (v *NodesNodesCertifyVEXStatement) __premarshalJSON() (*__premarshalNodesNodesCertifyVEXStatement, error) { + var retval __premarshalNodesNodesCertifyVEXStatement - premarshaled, err := v.__premarshalJSON() - if err != nil { - return nil, err - } - result := struct { - TypeName string `json:"__typename"` - *__premarshalPathPathCVE - }{typename, premarshaled} - return json.Marshal(result) - case *PathPathCertifyBad: - typename = "CertifyBad" + retval.Typename = v.Typename + retval.Id = v.AllCertifyVEXStatement.Id + { - premarshaled, err := v.__premarshalJSON() + dst := &retval.Subject + src := v.AllCertifyVEXStatement.Subject + var err error + *dst, err = __marshalAllCertifyVEXStatementSubjectPackageOrArtifact( + &src) if err != nil { - return nil, err + return nil, fmt.Errorf( + "unable to marshal NodesNodesCertifyVEXStatement.AllCertifyVEXStatement.Subject: %w", err) } - result := struct { - TypeName string `json:"__typename"` - *__premarshalPathPathCertifyBad - }{typename, premarshaled} - return json.Marshal(result) - case *PathPathCertifyGood: - typename = "CertifyGood" + } + { - premarshaled, err := v.__premarshalJSON() + dst := &retval.Vulnerability + src := v.AllCertifyVEXStatement.Vulnerability + var err error + *dst, err = __marshalAllCertifyVEXStatementVulnerability( + &src) if err != nil { - return nil, err + return nil, fmt.Errorf( + "unable to marshal NodesNodesCertifyVEXStatement.AllCertifyVEXStatement.Vulnerability: %w", err) } - result := struct { - TypeName string `json:"__typename"` - *__premarshalPathPathCertifyGood - }{typename, premarshaled} - return json.Marshal(result) - case *PathPathCertifyScorecard: - typename = "CertifyScorecard" + } + retval.Status = v.AllCertifyVEXStatement.Status + retval.VexJustification = v.AllCertifyVEXStatement.VexJustification + retval.Statement = v.AllCertifyVEXStatement.Statement + retval.StatusNotes = v.AllCertifyVEXStatement.StatusNotes + retval.KnownSince = v.AllCertifyVEXStatement.KnownSince + retval.Origin = v.AllCertifyVEXStatement.Origin + retval.Collector = v.AllCertifyVEXStatement.Collector + return &retval, nil +} - premarshaled, err := v.__premarshalJSON() - if err != nil { - return nil, err - } - result := struct { - TypeName string `json:"__typename"` - *__premarshalPathPathCertifyScorecard - }{typename, premarshaled} - return json.Marshal(result) - case *PathPathCertifyVEXStatement: - typename = "CertifyVEXStatement" +// NodesNodesCertifyVuln includes the requested fields of the GraphQL type CertifyVuln. +// The GraphQL type's documentation follows. +// +// CertifyVuln is an attestation to attach vulnerability information to a package. +// +// This information is obtained via a scanner. If there is no vulnerability +// detected (no OSV, CVE, or GHSA), we attach the special NoVuln node. +type NodesNodesCertifyVuln struct { + Typename *string `json:"__typename"` + AllCertifyVuln `json:"-"` +} - premarshaled, err := v.__premarshalJSON() - if err != nil { - return nil, err - } - result := struct { - TypeName string `json:"__typename"` - *__premarshalPathPathCertifyVEXStatement - }{typename, premarshaled} - return json.Marshal(result) - case *PathPathCertifyVuln: - typename = "CertifyVuln" +// GetTypename returns NodesNodesCertifyVuln.Typename, and is useful for accessing the field via an interface. +func (v *NodesNodesCertifyVuln) GetTypename() *string { return v.Typename } - premarshaled, err := v.__premarshalJSON() - if err != nil { - return nil, err - } - result := struct { - TypeName string `json:"__typename"` - *__premarshalPathPathCertifyVuln - }{typename, premarshaled} - return json.Marshal(result) - case *PathPathGHSA: - typename = "GHSA" +// GetId returns NodesNodesCertifyVuln.Id, and is useful for accessing the field via an interface. +func (v *NodesNodesCertifyVuln) GetId() string { return v.AllCertifyVuln.Id } - premarshaled, err := v.__premarshalJSON() - if err != nil { - return nil, err - } - result := struct { - TypeName string `json:"__typename"` - *__premarshalPathPathGHSA - }{typename, premarshaled} - return json.Marshal(result) - case *PathPathHasMetadata: - typename = "HasMetadata" +// GetPackage returns NodesNodesCertifyVuln.Package, and is useful for accessing the field via an interface. +func (v *NodesNodesCertifyVuln) GetPackage() AllCertifyVulnPackage { return v.AllCertifyVuln.Package } - result := struct { - TypeName string `json:"__typename"` - *PathPathHasMetadata - }{typename, v} - return json.Marshal(result) - case *PathPathHasSBOM: - typename = "HasSBOM" +// GetVulnerability returns NodesNodesCertifyVuln.Vulnerability, and is useful for accessing the field via an interface. +func (v *NodesNodesCertifyVuln) GetVulnerability() AllCertifyVulnVulnerability { + return v.AllCertifyVuln.Vulnerability +} - premarshaled, err := v.__premarshalJSON() - if err != nil { - return nil, err - } - result := struct { - TypeName string `json:"__typename"` - *__premarshalPathPathHasSBOM - }{typename, premarshaled} - return json.Marshal(result) - case *PathPathHasSLSA: - typename = "HasSLSA" +// GetMetadata returns NodesNodesCertifyVuln.Metadata, and is useful for accessing the field via an interface. +func (v *NodesNodesCertifyVuln) GetMetadata() AllCertifyVulnMetadataVulnerabilityMetaData { + return v.AllCertifyVuln.Metadata +} - premarshaled, err := v.__premarshalJSON() - if err != nil { - return nil, err - } - result := struct { - TypeName string `json:"__typename"` - *__premarshalPathPathHasSLSA - }{typename, premarshaled} - return json.Marshal(result) - case *PathPathHasSourceAt: - typename = "HasSourceAt" +func (v *NodesNodesCertifyVuln) UnmarshalJSON(b []byte) error { - premarshaled, err := v.__premarshalJSON() - if err != nil { - return nil, err - } - result := struct { - TypeName string `json:"__typename"` - *__premarshalPathPathHasSourceAt - }{typename, premarshaled} - return json.Marshal(result) - case *PathPathHashEqual: - typename = "HashEqual" + if string(b) == "null" { + return nil + } - premarshaled, err := v.__premarshalJSON() - if err != nil { - return nil, err - } - result := struct { - TypeName string `json:"__typename"` - *__premarshalPathPathHashEqual - }{typename, premarshaled} - return json.Marshal(result) - case *PathPathIsDependency: - typename = "IsDependency" + var firstPass struct { + *NodesNodesCertifyVuln + graphql.NoUnmarshalJSON + } + firstPass.NodesNodesCertifyVuln = v - premarshaled, err := v.__premarshalJSON() - if err != nil { - return nil, err - } - result := struct { - TypeName string `json:"__typename"` - *__premarshalPathPathIsDependency - }{typename, premarshaled} - return json.Marshal(result) - case *PathPathIsOccurrence: - typename = "IsOccurrence" + err := json.Unmarshal(b, &firstPass) + if err != nil { + return err + } - premarshaled, err := v.__premarshalJSON() - if err != nil { - return nil, err - } - result := struct { - TypeName string `json:"__typename"` - *__premarshalPathPathIsOccurrence - }{typename, premarshaled} - return json.Marshal(result) - case *PathPathIsVulnerability: - typename = "IsVulnerability" + err = json.Unmarshal( + b, &v.AllCertifyVuln) + if err != nil { + return err + } + return nil +} - premarshaled, err := v.__premarshalJSON() - if err != nil { - return nil, err - } - result := struct { - TypeName string `json:"__typename"` - *__premarshalPathPathIsVulnerability - }{typename, premarshaled} - return json.Marshal(result) - case *PathPathNoVuln: - typename = "NoVuln" +type __premarshalNodesNodesCertifyVuln struct { + Typename *string `json:"__typename"` - result := struct { - TypeName string `json:"__typename"` - *PathPathNoVuln - }{typename, v} - return json.Marshal(result) - case *PathPathOSV: - typename = "OSV" + Id string `json:"id"` - premarshaled, err := v.__premarshalJSON() - if err != nil { - return nil, err - } - result := struct { - TypeName string `json:"__typename"` - *__premarshalPathPathOSV - }{typename, premarshaled} - return json.Marshal(result) - case *PathPathPackage: - typename = "Package" + Package AllCertifyVulnPackage `json:"package"` - premarshaled, err := v.__premarshalJSON() - if err != nil { - return nil, err - } - result := struct { - TypeName string `json:"__typename"` - *__premarshalPathPathPackage - }{typename, premarshaled} - return json.Marshal(result) - case *PathPathPkgEqual: - typename = "PkgEqual" + Vulnerability json.RawMessage `json:"vulnerability"` - premarshaled, err := v.__premarshalJSON() - if err != nil { - return nil, err - } - result := struct { - TypeName string `json:"__typename"` - *__premarshalPathPathPkgEqual - }{typename, premarshaled} - return json.Marshal(result) - case *PathPathPointOfContact: - typename = "PointOfContact" + Metadata AllCertifyVulnMetadataVulnerabilityMetaData `json:"metadata"` +} - result := struct { - TypeName string `json:"__typename"` - *PathPathPointOfContact - }{typename, v} - return json.Marshal(result) - case *PathPathSource: - typename = "Source" +func (v *NodesNodesCertifyVuln) MarshalJSON() ([]byte, error) { + premarshaled, err := v.__premarshalJSON() + if err != nil { + return nil, err + } + return json.Marshal(premarshaled) +} - premarshaled, err := v.__premarshalJSON() +func (v *NodesNodesCertifyVuln) __premarshalJSON() (*__premarshalNodesNodesCertifyVuln, error) { + var retval __premarshalNodesNodesCertifyVuln + + retval.Typename = v.Typename + retval.Id = v.AllCertifyVuln.Id + retval.Package = v.AllCertifyVuln.Package + { + + dst := &retval.Vulnerability + src := v.AllCertifyVuln.Vulnerability + var err error + *dst, err = __marshalAllCertifyVulnVulnerability( + &src) if err != nil { - return nil, err + return nil, fmt.Errorf( + "unable to marshal NodesNodesCertifyVuln.AllCertifyVuln.Vulnerability: %w", err) } - result := struct { - TypeName string `json:"__typename"` - *__premarshalPathPathSource - }{typename, premarshaled} - return json.Marshal(result) - case nil: - return []byte("null"), nil - default: - return nil, fmt.Errorf( - `unexpected concrete type for PathPathNode: "%T"`, v) } + retval.Metadata = v.AllCertifyVuln.Metadata + return &retval, nil } -// PathPathOSV includes the requested fields of the GraphQL type OSV. +// NodesNodesGHSA includes the requested fields of the GraphQL type GHSA. // The GraphQL type's documentation follows. // -// OSV represents an Open Source Vulnerability. -// -// The osvId field is mandatory and canonicalized to be lowercase. +// GHSA represents GitHub security advisories. // -// This maps to a vulnerability ID specific to the environment (e.g., GHSA ID or -// CVE ID). +// The advisory id field is mandatory and canonicalized to be lowercase. // // This node can be referred to by other parts of GUAC. -type PathPathOSV struct { - Typename *string `json:"__typename"` - AllOSVTree `json:"-"` +type NodesNodesGHSA struct { + Typename *string `json:"__typename"` + AllGHSATree `json:"-"` } -// GetTypename returns PathPathOSV.Typename, and is useful for accessing the field via an interface. -func (v *PathPathOSV) GetTypename() *string { return v.Typename } +// GetTypename returns NodesNodesGHSA.Typename, and is useful for accessing the field via an interface. +func (v *NodesNodesGHSA) GetTypename() *string { return v.Typename } -// GetId returns PathPathOSV.Id, and is useful for accessing the field via an interface. -func (v *PathPathOSV) GetId() string { return v.AllOSVTree.Id } +// GetId returns NodesNodesGHSA.Id, and is useful for accessing the field via an interface. +func (v *NodesNodesGHSA) GetId() string { return v.AllGHSATree.Id } -// GetOsvId returns PathPathOSV.OsvId, and is useful for accessing the field via an interface. -func (v *PathPathOSV) GetOsvId() string { return v.AllOSVTree.OsvId } +// GetGhsaId returns NodesNodesGHSA.GhsaId, and is useful for accessing the field via an interface. +func (v *NodesNodesGHSA) GetGhsaId() string { return v.AllGHSATree.GhsaId } -func (v *PathPathOSV) UnmarshalJSON(b []byte) error { +func (v *NodesNodesGHSA) UnmarshalJSON(b []byte) error { if string(b) == "null" { return nil } var firstPass struct { - *PathPathOSV + *NodesNodesGHSA graphql.NoUnmarshalJSON } - firstPass.PathPathOSV = v + firstPass.NodesNodesGHSA = v err := json.Unmarshal(b, &firstPass) if err != nil { @@ -17182,22 +17204,22 @@ func (v *PathPathOSV) UnmarshalJSON(b []byte) error { } err = json.Unmarshal( - b, &v.AllOSVTree) + b, &v.AllGHSATree) if err != nil { return err } return nil } -type __premarshalPathPathOSV struct { +type __premarshalNodesNodesGHSA struct { Typename *string `json:"__typename"` Id string `json:"id"` - OsvId string `json:"osvId"` + GhsaId string `json:"ghsaId"` } -func (v *PathPathOSV) MarshalJSON() ([]byte, error) { +func (v *NodesNodesGHSA) MarshalJSON() ([]byte, error) { premarshaled, err := v.__premarshalJSON() if err != nil { return nil, err @@ -17205,62 +17227,185 @@ func (v *PathPathOSV) MarshalJSON() ([]byte, error) { return json.Marshal(premarshaled) } -func (v *PathPathOSV) __premarshalJSON() (*__premarshalPathPathOSV, error) { - var retval __premarshalPathPathOSV +func (v *NodesNodesGHSA) __premarshalJSON() (*__premarshalNodesNodesGHSA, error) { + var retval __premarshalNodesNodesGHSA retval.Typename = v.Typename - retval.Id = v.AllOSVTree.Id - retval.OsvId = v.AllOSVTree.OsvId + retval.Id = v.AllGHSATree.Id + retval.GhsaId = v.AllGHSATree.GhsaId return &retval, nil } -// PathPathPackage includes the requested fields of the GraphQL type Package. +// NodesNodesHasMetadata includes the requested fields of the GraphQL type HasMetadata. // The GraphQL type's documentation follows. // -// Package represents the root of the package trie/tree. +// HasMetadata is an attestation that a package, source, or artifact has a certain +// attested property (key) with value (value). For example, a source may have +// metadata "SourceRepo2FAEnabled=true". // -// We map package information to a trie, closely matching the pURL specification -// (https://github.com/package-url/purl-spec/blob/0dd92f26f8bb11956ffdf5e8acfcee71e8560407/README.rst), -// but deviating from it where GUAC heuristics allow for better representation of -// package information. Each path in the trie fully represents a package; we split -// the trie based on the pURL components. +// The intent of this evidence tree predicate is to allow extensibility of metadata +// expressible within the GUAC ontology. Metadata that is commonly used will then +// be promoted to a predicate on its own. // -// This node matches a pkg: partial pURL. The type field matches the -// pURL types but we might also use "guac" for the cases where the pURL -// representation is not complete or when we have custom rules. +// Justification indicates how the metadata was determined. +// +// The metadata applies to a subject which is a package, source, or artifact. +// If the attestation targets a package, it must target a PackageName or a +// PackageVersion. If the attestation targets a source, it must target a +// SourceName. +type NodesNodesHasMetadata struct { + Typename *string `json:"__typename"` +} + +// GetTypename returns NodesNodesHasMetadata.Typename, and is useful for accessing the field via an interface. +func (v *NodesNodesHasMetadata) GetTypename() *string { return v.Typename } + +// NodesNodesHasSBOM includes the requested fields of the GraphQL type HasSBOM. +type NodesNodesHasSBOM struct { + Typename *string `json:"__typename"` + AllHasSBOMTree `json:"-"` +} + +// GetTypename returns NodesNodesHasSBOM.Typename, and is useful for accessing the field via an interface. +func (v *NodesNodesHasSBOM) GetTypename() *string { return v.Typename } + +// GetId returns NodesNodesHasSBOM.Id, and is useful for accessing the field via an interface. +func (v *NodesNodesHasSBOM) GetId() string { return v.AllHasSBOMTree.Id } + +// GetSubject returns NodesNodesHasSBOM.Subject, and is useful for accessing the field via an interface. +func (v *NodesNodesHasSBOM) GetSubject() AllHasSBOMTreeSubjectPackageOrArtifact { + return v.AllHasSBOMTree.Subject +} + +// GetUri returns NodesNodesHasSBOM.Uri, and is useful for accessing the field via an interface. +func (v *NodesNodesHasSBOM) GetUri() string { return v.AllHasSBOMTree.Uri } + +// GetAlgorithm returns NodesNodesHasSBOM.Algorithm, and is useful for accessing the field via an interface. +func (v *NodesNodesHasSBOM) GetAlgorithm() string { return v.AllHasSBOMTree.Algorithm } + +// GetDigest returns NodesNodesHasSBOM.Digest, and is useful for accessing the field via an interface. +func (v *NodesNodesHasSBOM) GetDigest() string { return v.AllHasSBOMTree.Digest } + +// GetDownloadLocation returns NodesNodesHasSBOM.DownloadLocation, and is useful for accessing the field via an interface. +func (v *NodesNodesHasSBOM) GetDownloadLocation() string { return v.AllHasSBOMTree.DownloadLocation } + +// GetOrigin returns NodesNodesHasSBOM.Origin, and is useful for accessing the field via an interface. +func (v *NodesNodesHasSBOM) GetOrigin() string { return v.AllHasSBOMTree.Origin } + +// GetCollector returns NodesNodesHasSBOM.Collector, and is useful for accessing the field via an interface. +func (v *NodesNodesHasSBOM) GetCollector() string { return v.AllHasSBOMTree.Collector } + +func (v *NodesNodesHasSBOM) UnmarshalJSON(b []byte) error { + + if string(b) == "null" { + return nil + } + + var firstPass struct { + *NodesNodesHasSBOM + graphql.NoUnmarshalJSON + } + firstPass.NodesNodesHasSBOM = v + + err := json.Unmarshal(b, &firstPass) + if err != nil { + return err + } + + err = json.Unmarshal( + b, &v.AllHasSBOMTree) + if err != nil { + return err + } + return nil +} + +type __premarshalNodesNodesHasSBOM struct { + Typename *string `json:"__typename"` + + Id string `json:"id"` + + Subject json.RawMessage `json:"subject"` + + Uri string `json:"uri"` + + Algorithm string `json:"algorithm"` + + Digest string `json:"digest"` + + DownloadLocation string `json:"downloadLocation"` + + Origin string `json:"origin"` + + Collector string `json:"collector"` +} + +func (v *NodesNodesHasSBOM) MarshalJSON() ([]byte, error) { + premarshaled, err := v.__premarshalJSON() + if err != nil { + return nil, err + } + return json.Marshal(premarshaled) +} + +func (v *NodesNodesHasSBOM) __premarshalJSON() (*__premarshalNodesNodesHasSBOM, error) { + var retval __premarshalNodesNodesHasSBOM + + retval.Typename = v.Typename + retval.Id = v.AllHasSBOMTree.Id + { + + dst := &retval.Subject + src := v.AllHasSBOMTree.Subject + var err error + *dst, err = __marshalAllHasSBOMTreeSubjectPackageOrArtifact( + &src) + if err != nil { + return nil, fmt.Errorf( + "unable to marshal NodesNodesHasSBOM.AllHasSBOMTree.Subject: %w", err) + } + } + retval.Uri = v.AllHasSBOMTree.Uri + retval.Algorithm = v.AllHasSBOMTree.Algorithm + retval.Digest = v.AllHasSBOMTree.Digest + retval.DownloadLocation = v.AllHasSBOMTree.DownloadLocation + retval.Origin = v.AllHasSBOMTree.Origin + retval.Collector = v.AllHasSBOMTree.Collector + return &retval, nil +} + +// NodesNodesHasSLSA includes the requested fields of the GraphQL type HasSLSA. +// The GraphQL type's documentation follows. // -// Since this node is at the root of the package trie, it is named Package, not -// PackageType. -type PathPathPackage struct { - Typename *string `json:"__typename"` - AllPkgTree `json:"-"` +// HasSLSA records that a subject node has a SLSA attestation. +type NodesNodesHasSLSA struct { + Typename *string `json:"__typename"` + AllSLSATree `json:"-"` } -// GetTypename returns PathPathPackage.Typename, and is useful for accessing the field via an interface. -func (v *PathPathPackage) GetTypename() *string { return v.Typename } +// GetTypename returns NodesNodesHasSLSA.Typename, and is useful for accessing the field via an interface. +func (v *NodesNodesHasSLSA) GetTypename() *string { return v.Typename } -// GetId returns PathPathPackage.Id, and is useful for accessing the field via an interface. -func (v *PathPathPackage) GetId() string { return v.AllPkgTree.Id } +// GetId returns NodesNodesHasSLSA.Id, and is useful for accessing the field via an interface. +func (v *NodesNodesHasSLSA) GetId() string { return v.AllSLSATree.Id } -// GetType returns PathPathPackage.Type, and is useful for accessing the field via an interface. -func (v *PathPathPackage) GetType() string { return v.AllPkgTree.Type } +// GetSubject returns NodesNodesHasSLSA.Subject, and is useful for accessing the field via an interface. +func (v *NodesNodesHasSLSA) GetSubject() AllSLSATreeSubjectArtifact { return v.AllSLSATree.Subject } -// GetNamespaces returns PathPathPackage.Namespaces, and is useful for accessing the field via an interface. -func (v *PathPathPackage) GetNamespaces() []AllPkgTreeNamespacesPackageNamespace { - return v.AllPkgTree.Namespaces -} +// GetSlsa returns NodesNodesHasSLSA.Slsa, and is useful for accessing the field via an interface. +func (v *NodesNodesHasSLSA) GetSlsa() AllSLSATreeSlsaSLSA { return v.AllSLSATree.Slsa } -func (v *PathPathPackage) UnmarshalJSON(b []byte) error { +func (v *NodesNodesHasSLSA) UnmarshalJSON(b []byte) error { if string(b) == "null" { return nil } var firstPass struct { - *PathPathPackage + *NodesNodesHasSLSA graphql.NoUnmarshalJSON } - firstPass.PathPathPackage = v + firstPass.NodesNodesHasSLSA = v err := json.Unmarshal(b, &firstPass) if err != nil { @@ -17268,24 +17413,24 @@ func (v *PathPathPackage) UnmarshalJSON(b []byte) error { } err = json.Unmarshal( - b, &v.AllPkgTree) + b, &v.AllSLSATree) if err != nil { return err } return nil } -type __premarshalPathPathPackage struct { +type __premarshalNodesNodesHasSLSA struct { Typename *string `json:"__typename"` Id string `json:"id"` - Type string `json:"type"` + Subject AllSLSATreeSubjectArtifact `json:"subject"` - Namespaces []AllPkgTreeNamespacesPackageNamespace `json:"namespaces"` + Slsa AllSLSATreeSlsaSLSA `json:"slsa"` } -func (v *PathPathPackage) MarshalJSON() ([]byte, error) { +func (v *NodesNodesHasSLSA) MarshalJSON() ([]byte, error) { premarshaled, err := v.__premarshalJSON() if err != nil { return nil, err @@ -17293,54 +17438,60 @@ func (v *PathPathPackage) MarshalJSON() ([]byte, error) { return json.Marshal(premarshaled) } -func (v *PathPathPackage) __premarshalJSON() (*__premarshalPathPathPackage, error) { - var retval __premarshalPathPathPackage +func (v *NodesNodesHasSLSA) __premarshalJSON() (*__premarshalNodesNodesHasSLSA, error) { + var retval __premarshalNodesNodesHasSLSA retval.Typename = v.Typename - retval.Id = v.AllPkgTree.Id - retval.Type = v.AllPkgTree.Type - retval.Namespaces = v.AllPkgTree.Namespaces + retval.Id = v.AllSLSATree.Id + retval.Subject = v.AllSLSATree.Subject + retval.Slsa = v.AllSLSATree.Slsa return &retval, nil } -// PathPathPkgEqual includes the requested fields of the GraphQL type PkgEqual. +// NodesNodesHasSourceAt includes the requested fields of the GraphQL type HasSourceAt. // The GraphQL type's documentation follows. // -// PkgEqual is an attestation that a set of packages are similar. -type PathPathPkgEqual struct { - Typename *string `json:"__typename"` - allPkgEqual `json:"-"` +// HasSourceAt records that a package's repository is a given source. +type NodesNodesHasSourceAt struct { + Typename *string `json:"__typename"` + AllHasSourceAt `json:"-"` } -// GetTypename returns PathPathPkgEqual.Typename, and is useful for accessing the field via an interface. -func (v *PathPathPkgEqual) GetTypename() *string { return v.Typename } +// GetTypename returns NodesNodesHasSourceAt.Typename, and is useful for accessing the field via an interface. +func (v *NodesNodesHasSourceAt) GetTypename() *string { return v.Typename } -// GetId returns PathPathPkgEqual.Id, and is useful for accessing the field via an interface. -func (v *PathPathPkgEqual) GetId() string { return v.allPkgEqual.Id } +// GetId returns NodesNodesHasSourceAt.Id, and is useful for accessing the field via an interface. +func (v *NodesNodesHasSourceAt) GetId() string { return v.AllHasSourceAt.Id } -// GetJustification returns PathPathPkgEqual.Justification, and is useful for accessing the field via an interface. -func (v *PathPathPkgEqual) GetJustification() string { return v.allPkgEqual.Justification } +// GetJustification returns NodesNodesHasSourceAt.Justification, and is useful for accessing the field via an interface. +func (v *NodesNodesHasSourceAt) GetJustification() string { return v.AllHasSourceAt.Justification } -// GetPackages returns PathPathPkgEqual.Packages, and is useful for accessing the field via an interface. -func (v *PathPathPkgEqual) GetPackages() []allPkgEqualPackagesPackage { return v.allPkgEqual.Packages } +// GetKnownSince returns NodesNodesHasSourceAt.KnownSince, and is useful for accessing the field via an interface. +func (v *NodesNodesHasSourceAt) GetKnownSince() time.Time { return v.AllHasSourceAt.KnownSince } -// GetOrigin returns PathPathPkgEqual.Origin, and is useful for accessing the field via an interface. -func (v *PathPathPkgEqual) GetOrigin() string { return v.allPkgEqual.Origin } +// GetPackage returns NodesNodesHasSourceAt.Package, and is useful for accessing the field via an interface. +func (v *NodesNodesHasSourceAt) GetPackage() AllHasSourceAtPackage { return v.AllHasSourceAt.Package } -// GetCollector returns PathPathPkgEqual.Collector, and is useful for accessing the field via an interface. -func (v *PathPathPkgEqual) GetCollector() string { return v.allPkgEqual.Collector } +// GetSource returns NodesNodesHasSourceAt.Source, and is useful for accessing the field via an interface. +func (v *NodesNodesHasSourceAt) GetSource() AllHasSourceAtSource { return v.AllHasSourceAt.Source } -func (v *PathPathPkgEqual) UnmarshalJSON(b []byte) error { +// GetOrigin returns NodesNodesHasSourceAt.Origin, and is useful for accessing the field via an interface. +func (v *NodesNodesHasSourceAt) GetOrigin() string { return v.AllHasSourceAt.Origin } + +// GetCollector returns NodesNodesHasSourceAt.Collector, and is useful for accessing the field via an interface. +func (v *NodesNodesHasSourceAt) GetCollector() string { return v.AllHasSourceAt.Collector } + +func (v *NodesNodesHasSourceAt) UnmarshalJSON(b []byte) error { if string(b) == "null" { return nil } var firstPass struct { - *PathPathPkgEqual + *NodesNodesHasSourceAt graphql.NoUnmarshalJSON } - firstPass.PathPathPkgEqual = v + firstPass.NodesNodesHasSourceAt = v err := json.Unmarshal(b, &firstPass) if err != nil { @@ -17348,28 +17499,32 @@ func (v *PathPathPkgEqual) UnmarshalJSON(b []byte) error { } err = json.Unmarshal( - b, &v.allPkgEqual) + b, &v.AllHasSourceAt) if err != nil { return err } return nil } -type __premarshalPathPathPkgEqual struct { +type __premarshalNodesNodesHasSourceAt struct { Typename *string `json:"__typename"` Id string `json:"id"` Justification string `json:"justification"` - Packages []allPkgEqualPackagesPackage `json:"packages"` + KnownSince time.Time `json:"knownSince"` + + Package AllHasSourceAtPackage `json:"package"` + + Source AllHasSourceAtSource `json:"source"` Origin string `json:"origin"` Collector string `json:"collector"` } -func (v *PathPathPkgEqual) MarshalJSON() ([]byte, error) { +func (v *NodesNodesHasSourceAt) MarshalJSON() ([]byte, error) { premarshaled, err := v.__premarshalJSON() if err != nil { return nil, err @@ -17377,93 +17532,60 @@ func (v *PathPathPkgEqual) MarshalJSON() ([]byte, error) { return json.Marshal(premarshaled) } -func (v *PathPathPkgEqual) __premarshalJSON() (*__premarshalPathPathPkgEqual, error) { - var retval __premarshalPathPathPkgEqual +func (v *NodesNodesHasSourceAt) __premarshalJSON() (*__premarshalNodesNodesHasSourceAt, error) { + var retval __premarshalNodesNodesHasSourceAt retval.Typename = v.Typename - retval.Id = v.allPkgEqual.Id - retval.Justification = v.allPkgEqual.Justification - retval.Packages = v.allPkgEqual.Packages - retval.Origin = v.allPkgEqual.Origin - retval.Collector = v.allPkgEqual.Collector + retval.Id = v.AllHasSourceAt.Id + retval.Justification = v.AllHasSourceAt.Justification + retval.KnownSince = v.AllHasSourceAt.KnownSince + retval.Package = v.AllHasSourceAt.Package + retval.Source = v.AllHasSourceAt.Source + retval.Origin = v.AllHasSourceAt.Origin + retval.Collector = v.AllHasSourceAt.Collector return &retval, nil } -// PathPathPointOfContact includes the requested fields of the GraphQL type PointOfContact. +// NodesNodesHashEqual includes the requested fields of the GraphQL type HashEqual. // The GraphQL type's documentation follows. // -// PointOfContact is an attestation of how to get in touch with the person(s) responsible -// for a package, source, or artifact. -// -// All evidence trees record a justification for the property they represent as -// well as the document that contains the attestation (origin) and the collector -// that collected the document (collector). -// -// The attestation applies to a subject which is a package, source, or artifact. -// If the attestation targets a package, it must target a PackageName or a -// PackageVersion. If the attestation targets a source, it must target a -// SourceName. -// -// email is the email address (singular) of the point of contact. -// -// info is additional contact information other than email address. This is free -// form. -// -// NOTE: the identifiers for point of contact should be part of software trees. -// This will benefit from identifier look up and traversal as well as organization -// hierarchy. However, until the use case arises, PointOfContact will be a flat -// reference to the contact details. -type PathPathPointOfContact struct { - Typename *string `json:"__typename"` +// HashEqual is an attestation that a set of artifacts are identical. +type NodesNodesHashEqual struct { + Typename *string `json:"__typename"` + AllHashEqualTree `json:"-"` } -// GetTypename returns PathPathPointOfContact.Typename, and is useful for accessing the field via an interface. -func (v *PathPathPointOfContact) GetTypename() *string { return v.Typename } +// GetTypename returns NodesNodesHashEqual.Typename, and is useful for accessing the field via an interface. +func (v *NodesNodesHashEqual) GetTypename() *string { return v.Typename } -// PathPathSource includes the requested fields of the GraphQL type Source. -// The GraphQL type's documentation follows. -// -// Source represents the root of the source trie/tree. -// -// We map source information to a trie, as a derivative of the pURL specification: -// each path in the trie represents a type, namespace, name and an optional -// qualifier that stands for tag/commit information. -// -// This node represents the type part of the trie path. It is used to represent -// the version control system that is being used. -// -// Since this node is at the root of the source trie, it is named Source, not -// SourceType. -type PathPathSource struct { - Typename *string `json:"__typename"` - AllSourceTree `json:"-"` -} +// GetId returns NodesNodesHashEqual.Id, and is useful for accessing the field via an interface. +func (v *NodesNodesHashEqual) GetId() string { return v.AllHashEqualTree.Id } -// GetTypename returns PathPathSource.Typename, and is useful for accessing the field via an interface. -func (v *PathPathSource) GetTypename() *string { return v.Typename } +// GetJustification returns NodesNodesHashEqual.Justification, and is useful for accessing the field via an interface. +func (v *NodesNodesHashEqual) GetJustification() string { return v.AllHashEqualTree.Justification } -// GetId returns PathPathSource.Id, and is useful for accessing the field via an interface. -func (v *PathPathSource) GetId() string { return v.AllSourceTree.Id } +// GetArtifacts returns NodesNodesHashEqual.Artifacts, and is useful for accessing the field via an interface. +func (v *NodesNodesHashEqual) GetArtifacts() []AllHashEqualTreeArtifactsArtifact { + return v.AllHashEqualTree.Artifacts +} -// GetType returns PathPathSource.Type, and is useful for accessing the field via an interface. -func (v *PathPathSource) GetType() string { return v.AllSourceTree.Type } +// GetOrigin returns NodesNodesHashEqual.Origin, and is useful for accessing the field via an interface. +func (v *NodesNodesHashEqual) GetOrigin() string { return v.AllHashEqualTree.Origin } -// GetNamespaces returns PathPathSource.Namespaces, and is useful for accessing the field via an interface. -func (v *PathPathSource) GetNamespaces() []AllSourceTreeNamespacesSourceNamespace { - return v.AllSourceTree.Namespaces -} +// GetCollector returns NodesNodesHashEqual.Collector, and is useful for accessing the field via an interface. +func (v *NodesNodesHashEqual) GetCollector() string { return v.AllHashEqualTree.Collector } -func (v *PathPathSource) UnmarshalJSON(b []byte) error { +func (v *NodesNodesHashEqual) UnmarshalJSON(b []byte) error { if string(b) == "null" { return nil } var firstPass struct { - *PathPathSource + *NodesNodesHashEqual graphql.NoUnmarshalJSON } - firstPass.PathPathSource = v + firstPass.NodesNodesHashEqual = v err := json.Unmarshal(b, &firstPass) if err != nil { @@ -17471,24 +17593,28 @@ func (v *PathPathSource) UnmarshalJSON(b []byte) error { } err = json.Unmarshal( - b, &v.AllSourceTree) + b, &v.AllHashEqualTree) if err != nil { return err } return nil } -type __premarshalPathPathSource struct { +type __premarshalNodesNodesHashEqual struct { Typename *string `json:"__typename"` Id string `json:"id"` - Type string `json:"type"` + Justification string `json:"justification"` - Namespaces []AllSourceTreeNamespacesSourceNamespace `json:"namespaces"` + Artifacts []AllHashEqualTreeArtifactsArtifact `json:"artifacts"` + + Origin string `json:"origin"` + + Collector string `json:"collector"` } -func (v *PathPathSource) MarshalJSON() ([]byte, error) { +func (v *NodesNodesHashEqual) MarshalJSON() ([]byte, error) { premarshaled, err := v.__premarshalJSON() if err != nil { return nil, err @@ -17496,75 +17622,108 @@ func (v *PathPathSource) MarshalJSON() ([]byte, error) { return json.Marshal(premarshaled) } -func (v *PathPathSource) __premarshalJSON() (*__premarshalPathPathSource, error) { - var retval __premarshalPathPathSource +func (v *NodesNodesHashEqual) __premarshalJSON() (*__premarshalNodesNodesHashEqual, error) { + var retval __premarshalNodesNodesHashEqual retval.Typename = v.Typename - retval.Id = v.AllSourceTree.Id - retval.Type = v.AllSourceTree.Type - retval.Namespaces = v.AllSourceTree.Namespaces + retval.Id = v.AllHashEqualTree.Id + retval.Justification = v.AllHashEqualTree.Justification + retval.Artifacts = v.AllHashEqualTree.Artifacts + retval.Origin = v.AllHashEqualTree.Origin + retval.Collector = v.AllHashEqualTree.Collector return &retval, nil } -// PathResponse is returned by Path on success. -type PathResponse struct { - // path query returns a path between subject and target, of a maximum length. - // - // Since we want to uniquely identify endpoints, nodes must be specified by - // valid IDs only (instead of using filters/input spec structs). - // - // Specifying any Edge value in `usingOnly` will make the path only contain the - // corresponding GUAC evidence trees (GUAC verbs). - Path []PathPathNode `json:"-"` +// NodesNodesIsDependency includes the requested fields of the GraphQL type IsDependency. +// The GraphQL type's documentation follows. +// +// IsDependency is an attestation to record that a package depends on another. +type NodesNodesIsDependency struct { + Typename *string `json:"__typename"` + AllIsDependencyTree `json:"-"` } -// GetPath returns PathResponse.Path, and is useful for accessing the field via an interface. -func (v *PathResponse) GetPath() []PathPathNode { return v.Path } +// GetTypename returns NodesNodesIsDependency.Typename, and is useful for accessing the field via an interface. +func (v *NodesNodesIsDependency) GetTypename() *string { return v.Typename } -func (v *PathResponse) UnmarshalJSON(b []byte) error { +// GetId returns NodesNodesIsDependency.Id, and is useful for accessing the field via an interface. +func (v *NodesNodesIsDependency) GetId() string { return v.AllIsDependencyTree.Id } + +// GetJustification returns NodesNodesIsDependency.Justification, and is useful for accessing the field via an interface. +func (v *NodesNodesIsDependency) GetJustification() string { + return v.AllIsDependencyTree.Justification +} + +// GetPackage returns NodesNodesIsDependency.Package, and is useful for accessing the field via an interface. +func (v *NodesNodesIsDependency) GetPackage() AllIsDependencyTreePackage { + return v.AllIsDependencyTree.Package +} + +// GetDependentPackage returns NodesNodesIsDependency.DependentPackage, and is useful for accessing the field via an interface. +func (v *NodesNodesIsDependency) GetDependentPackage() AllIsDependencyTreeDependentPackage { + return v.AllIsDependencyTree.DependentPackage +} + +// GetDependencyType returns NodesNodesIsDependency.DependencyType, and is useful for accessing the field via an interface. +func (v *NodesNodesIsDependency) GetDependencyType() DependencyType { + return v.AllIsDependencyTree.DependencyType +} + +// GetVersionRange returns NodesNodesIsDependency.VersionRange, and is useful for accessing the field via an interface. +func (v *NodesNodesIsDependency) GetVersionRange() string { return v.AllIsDependencyTree.VersionRange } + +// GetOrigin returns NodesNodesIsDependency.Origin, and is useful for accessing the field via an interface. +func (v *NodesNodesIsDependency) GetOrigin() string { return v.AllIsDependencyTree.Origin } + +// GetCollector returns NodesNodesIsDependency.Collector, and is useful for accessing the field via an interface. +func (v *NodesNodesIsDependency) GetCollector() string { return v.AllIsDependencyTree.Collector } + +func (v *NodesNodesIsDependency) UnmarshalJSON(b []byte) error { if string(b) == "null" { return nil } var firstPass struct { - *PathResponse - Path []json.RawMessage `json:"path"` + *NodesNodesIsDependency graphql.NoUnmarshalJSON } - firstPass.PathResponse = v - - err := json.Unmarshal(b, &firstPass) - if err != nil { - return err - } - - { - dst := &v.Path - src := firstPass.Path - *dst = make( - []PathPathNode, - len(src)) - for i, src := range src { - dst := &(*dst)[i] - if len(src) != 0 && string(src) != "null" { - err = __unmarshalPathPathNode( - src, dst) - if err != nil { - return fmt.Errorf( - "unable to unmarshal PathResponse.Path: %w", err) - } - } - } + firstPass.NodesNodesIsDependency = v + + err := json.Unmarshal(b, &firstPass) + if err != nil { + return err + } + + err = json.Unmarshal( + b, &v.AllIsDependencyTree) + if err != nil { + return err } return nil } -type __premarshalPathResponse struct { - Path []json.RawMessage `json:"path"` +type __premarshalNodesNodesIsDependency struct { + Typename *string `json:"__typename"` + + Id string `json:"id"` + + Justification string `json:"justification"` + + Package AllIsDependencyTreePackage `json:"package"` + + DependentPackage AllIsDependencyTreeDependentPackage `json:"dependentPackage"` + + DependencyType DependencyType `json:"dependencyType"` + + VersionRange string `json:"versionRange"` + + Origin string `json:"origin"` + + Collector string `json:"collector"` } -func (v *PathResponse) MarshalJSON() ([]byte, error) { +func (v *NodesNodesIsDependency) MarshalJSON() ([]byte, error) { premarshaled, err := v.__premarshalJSON() if err != nil { return nil, err @@ -17572,66 +17731,70 @@ func (v *PathResponse) MarshalJSON() ([]byte, error) { return json.Marshal(premarshaled) } -func (v *PathResponse) __premarshalJSON() (*__premarshalPathResponse, error) { - var retval __premarshalPathResponse - - { +func (v *NodesNodesIsDependency) __premarshalJSON() (*__premarshalNodesNodesIsDependency, error) { + var retval __premarshalNodesNodesIsDependency - dst := &retval.Path - src := v.Path - *dst = make( - []json.RawMessage, - len(src)) - for i, src := range src { - dst := &(*dst)[i] - var err error - *dst, err = __marshalPathPathNode( - &src) - if err != nil { - return nil, fmt.Errorf( - "unable to marshal PathResponse.Path: %w", err) - } - } - } + retval.Typename = v.Typename + retval.Id = v.AllIsDependencyTree.Id + retval.Justification = v.AllIsDependencyTree.Justification + retval.Package = v.AllIsDependencyTree.Package + retval.DependentPackage = v.AllIsDependencyTree.DependentPackage + retval.DependencyType = v.AllIsDependencyTree.DependencyType + retval.VersionRange = v.AllIsDependencyTree.VersionRange + retval.Origin = v.AllIsDependencyTree.Origin + retval.Collector = v.AllIsDependencyTree.Collector return &retval, nil } -// PkgEqualIngestPkgEqual includes the requested fields of the GraphQL type PkgEqual. +// NodesNodesIsOccurrence includes the requested fields of the GraphQL type IsOccurrence. // The GraphQL type's documentation follows. // -// PkgEqual is an attestation that a set of packages are similar. -type PkgEqualIngestPkgEqual struct { - allPkgEqual `json:"-"` +// IsOccurrence is an attestation to link an artifact to a package or source. +// +// Attestation must occur at the PackageVersion or at the SourceName. +type NodesNodesIsOccurrence struct { + Typename *string `json:"__typename"` + AllIsOccurrencesTree `json:"-"` } -// GetId returns PkgEqualIngestPkgEqual.Id, and is useful for accessing the field via an interface. -func (v *PkgEqualIngestPkgEqual) GetId() string { return v.allPkgEqual.Id } +// GetTypename returns NodesNodesIsOccurrence.Typename, and is useful for accessing the field via an interface. +func (v *NodesNodesIsOccurrence) GetTypename() *string { return v.Typename } -// GetJustification returns PkgEqualIngestPkgEqual.Justification, and is useful for accessing the field via an interface. -func (v *PkgEqualIngestPkgEqual) GetJustification() string { return v.allPkgEqual.Justification } +// GetId returns NodesNodesIsOccurrence.Id, and is useful for accessing the field via an interface. +func (v *NodesNodesIsOccurrence) GetId() string { return v.AllIsOccurrencesTree.Id } -// GetPackages returns PkgEqualIngestPkgEqual.Packages, and is useful for accessing the field via an interface. -func (v *PkgEqualIngestPkgEqual) GetPackages() []allPkgEqualPackagesPackage { - return v.allPkgEqual.Packages +// GetSubject returns NodesNodesIsOccurrence.Subject, and is useful for accessing the field via an interface. +func (v *NodesNodesIsOccurrence) GetSubject() AllIsOccurrencesTreeSubjectPackageOrSource { + return v.AllIsOccurrencesTree.Subject } -// GetOrigin returns PkgEqualIngestPkgEqual.Origin, and is useful for accessing the field via an interface. -func (v *PkgEqualIngestPkgEqual) GetOrigin() string { return v.allPkgEqual.Origin } +// GetArtifact returns NodesNodesIsOccurrence.Artifact, and is useful for accessing the field via an interface. +func (v *NodesNodesIsOccurrence) GetArtifact() AllIsOccurrencesTreeArtifact { + return v.AllIsOccurrencesTree.Artifact +} -// GetCollector returns PkgEqualIngestPkgEqual.Collector, and is useful for accessing the field via an interface. -func (v *PkgEqualIngestPkgEqual) GetCollector() string { return v.allPkgEqual.Collector } +// GetJustification returns NodesNodesIsOccurrence.Justification, and is useful for accessing the field via an interface. +func (v *NodesNodesIsOccurrence) GetJustification() string { + return v.AllIsOccurrencesTree.Justification +} -func (v *PkgEqualIngestPkgEqual) UnmarshalJSON(b []byte) error { +// GetOrigin returns NodesNodesIsOccurrence.Origin, and is useful for accessing the field via an interface. +func (v *NodesNodesIsOccurrence) GetOrigin() string { return v.AllIsOccurrencesTree.Origin } + +// GetCollector returns NodesNodesIsOccurrence.Collector, and is useful for accessing the field via an interface. +func (v *NodesNodesIsOccurrence) GetCollector() string { return v.AllIsOccurrencesTree.Collector } + +func (v *NodesNodesIsOccurrence) UnmarshalJSON(b []byte) error { if string(b) == "null" { return nil } var firstPass struct { - *PkgEqualIngestPkgEqual + *NodesNodesIsOccurrence graphql.NoUnmarshalJSON } - firstPass.PkgEqualIngestPkgEqual = v + firstPass.NodesNodesIsOccurrence = v err := json.Unmarshal(b, &firstPass) if err != nil { @@ -17639,26 +17802,30 @@ func (v *PkgEqualIngestPkgEqual) UnmarshalJSON(b []byte) error { } err = json.Unmarshal( - b, &v.allPkgEqual) + b, &v.AllIsOccurrencesTree) if err != nil { return err } return nil } -type __premarshalPkgEqualIngestPkgEqual struct { +type __premarshalNodesNodesIsOccurrence struct { + Typename *string `json:"__typename"` + Id string `json:"id"` - Justification string `json:"justification"` + Subject json.RawMessage `json:"subject"` + + Artifact AllIsOccurrencesTreeArtifact `json:"artifact"` - Packages []allPkgEqualPackagesPackage `json:"packages"` + Justification string `json:"justification"` Origin string `json:"origin"` Collector string `json:"collector"` } -func (v *PkgEqualIngestPkgEqual) MarshalJSON() ([]byte, error) { +func (v *NodesNodesIsOccurrence) MarshalJSON() ([]byte, error) { premarshaled, err := v.__premarshalJSON() if err != nil { return nil, err @@ -17666,76 +17833,77 @@ func (v *PkgEqualIngestPkgEqual) MarshalJSON() ([]byte, error) { return json.Marshal(premarshaled) } -func (v *PkgEqualIngestPkgEqual) __premarshalJSON() (*__premarshalPkgEqualIngestPkgEqual, error) { - var retval __premarshalPkgEqualIngestPkgEqual +func (v *NodesNodesIsOccurrence) __premarshalJSON() (*__premarshalNodesNodesIsOccurrence, error) { + var retval __premarshalNodesNodesIsOccurrence + + retval.Typename = v.Typename + retval.Id = v.AllIsOccurrencesTree.Id + { - retval.Id = v.allPkgEqual.Id - retval.Justification = v.allPkgEqual.Justification - retval.Packages = v.allPkgEqual.Packages - retval.Origin = v.allPkgEqual.Origin - retval.Collector = v.allPkgEqual.Collector + dst := &retval.Subject + src := v.AllIsOccurrencesTree.Subject + var err error + *dst, err = __marshalAllIsOccurrencesTreeSubjectPackageOrSource( + &src) + if err != nil { + return nil, fmt.Errorf( + "unable to marshal NodesNodesIsOccurrence.AllIsOccurrencesTree.Subject: %w", err) + } + } + retval.Artifact = v.AllIsOccurrencesTree.Artifact + retval.Justification = v.AllIsOccurrencesTree.Justification + retval.Origin = v.AllIsOccurrencesTree.Origin + retval.Collector = v.AllIsOccurrencesTree.Collector return &retval, nil } -// PkgEqualInputSpec represents the input to certify that packages are similar. -type PkgEqualInputSpec struct { - Justification string `json:"justification"` - Origin string `json:"origin"` - Collector string `json:"collector"` +// NodesNodesIsVulnerability includes the requested fields of the GraphQL type IsVulnerability. +// The GraphQL type's documentation follows. +// +// IsVulnerability is an attestation to link CVE/GHSA with data in OSV. +type NodesNodesIsVulnerability struct { + Typename *string `json:"__typename"` + AllIsVulnerability `json:"-"` } -// GetJustification returns PkgEqualInputSpec.Justification, and is useful for accessing the field via an interface. -func (v *PkgEqualInputSpec) GetJustification() string { return v.Justification } +// GetTypename returns NodesNodesIsVulnerability.Typename, and is useful for accessing the field via an interface. +func (v *NodesNodesIsVulnerability) GetTypename() *string { return v.Typename } -// GetOrigin returns PkgEqualInputSpec.Origin, and is useful for accessing the field via an interface. -func (v *PkgEqualInputSpec) GetOrigin() string { return v.Origin } +// GetId returns NodesNodesIsVulnerability.Id, and is useful for accessing the field via an interface. +func (v *NodesNodesIsVulnerability) GetId() string { return v.AllIsVulnerability.Id } -// GetCollector returns PkgEqualInputSpec.Collector, and is useful for accessing the field via an interface. -func (v *PkgEqualInputSpec) GetCollector() string { return v.Collector } +// GetOsv returns NodesNodesIsVulnerability.Osv, and is useful for accessing the field via an interface. +func (v *NodesNodesIsVulnerability) GetOsv() AllIsVulnerabilityOsvOSV { + return v.AllIsVulnerability.Osv +} -// PkgEqualOtherPackage includes the requested fields of the GraphQL type Package. -// The GraphQL type's documentation follows. -// -// Package represents the root of the package trie/tree. -// -// We map package information to a trie, closely matching the pURL specification -// (https://github.com/package-url/purl-spec/blob/0dd92f26f8bb11956ffdf5e8acfcee71e8560407/README.rst), -// but deviating from it where GUAC heuristics allow for better representation of -// package information. Each path in the trie fully represents a package; we split -// the trie based on the pURL components. -// -// This node matches a pkg: partial pURL. The type field matches the -// pURL types but we might also use "guac" for the cases where the pURL -// representation is not complete or when we have custom rules. -// -// Since this node is at the root of the package trie, it is named Package, not -// PackageType. -type PkgEqualOtherPackage struct { - AllPkgTree `json:"-"` +// GetVulnerability returns NodesNodesIsVulnerability.Vulnerability, and is useful for accessing the field via an interface. +func (v *NodesNodesIsVulnerability) GetVulnerability() AllIsVulnerabilityVulnerabilityCveOrGhsa { + return v.AllIsVulnerability.Vulnerability } -// GetId returns PkgEqualOtherPackage.Id, and is useful for accessing the field via an interface. -func (v *PkgEqualOtherPackage) GetId() string { return v.AllPkgTree.Id } +// GetJustification returns NodesNodesIsVulnerability.Justification, and is useful for accessing the field via an interface. +func (v *NodesNodesIsVulnerability) GetJustification() string { + return v.AllIsVulnerability.Justification +} -// GetType returns PkgEqualOtherPackage.Type, and is useful for accessing the field via an interface. -func (v *PkgEqualOtherPackage) GetType() string { return v.AllPkgTree.Type } +// GetOrigin returns NodesNodesIsVulnerability.Origin, and is useful for accessing the field via an interface. +func (v *NodesNodesIsVulnerability) GetOrigin() string { return v.AllIsVulnerability.Origin } -// GetNamespaces returns PkgEqualOtherPackage.Namespaces, and is useful for accessing the field via an interface. -func (v *PkgEqualOtherPackage) GetNamespaces() []AllPkgTreeNamespacesPackageNamespace { - return v.AllPkgTree.Namespaces -} +// GetCollector returns NodesNodesIsVulnerability.Collector, and is useful for accessing the field via an interface. +func (v *NodesNodesIsVulnerability) GetCollector() string { return v.AllIsVulnerability.Collector } -func (v *PkgEqualOtherPackage) UnmarshalJSON(b []byte) error { +func (v *NodesNodesIsVulnerability) UnmarshalJSON(b []byte) error { if string(b) == "null" { return nil } var firstPass struct { - *PkgEqualOtherPackage + *NodesNodesIsVulnerability graphql.NoUnmarshalJSON } - firstPass.PkgEqualOtherPackage = v + firstPass.NodesNodesIsVulnerability = v err := json.Unmarshal(b, &firstPass) if err != nil { @@ -17743,22 +17911,30 @@ func (v *PkgEqualOtherPackage) UnmarshalJSON(b []byte) error { } err = json.Unmarshal( - b, &v.AllPkgTree) + b, &v.AllIsVulnerability) if err != nil { return err } return nil } -type __premarshalPkgEqualOtherPackage struct { +type __premarshalNodesNodesIsVulnerability struct { + Typename *string `json:"__typename"` + Id string `json:"id"` - Type string `json:"type"` + Osv AllIsVulnerabilityOsvOSV `json:"osv"` - Namespaces []AllPkgTreeNamespacesPackageNamespace `json:"namespaces"` + Vulnerability json.RawMessage `json:"vulnerability"` + + Justification string `json:"justification"` + + Origin string `json:"origin"` + + Collector string `json:"collector"` } -func (v *PkgEqualOtherPackage) MarshalJSON() ([]byte, error) { +func (v *NodesNodesIsVulnerability) MarshalJSON() ([]byte, error) { premarshaled, err := v.__premarshalJSON() if err != nil { return nil, err @@ -17766,280 +17942,515 @@ func (v *PkgEqualOtherPackage) MarshalJSON() ([]byte, error) { return json.Marshal(premarshaled) } -func (v *PkgEqualOtherPackage) __premarshalJSON() (*__premarshalPkgEqualOtherPackage, error) { - var retval __premarshalPkgEqualOtherPackage +func (v *NodesNodesIsVulnerability) __premarshalJSON() (*__premarshalNodesNodesIsVulnerability, error) { + var retval __premarshalNodesNodesIsVulnerability - retval.Id = v.AllPkgTree.Id - retval.Type = v.AllPkgTree.Type - retval.Namespaces = v.AllPkgTree.Namespaces + retval.Typename = v.Typename + retval.Id = v.AllIsVulnerability.Id + retval.Osv = v.AllIsVulnerability.Osv + { + + dst := &retval.Vulnerability + src := v.AllIsVulnerability.Vulnerability + var err error + *dst, err = __marshalAllIsVulnerabilityVulnerabilityCveOrGhsa( + &src) + if err != nil { + return nil, fmt.Errorf( + "unable to marshal NodesNodesIsVulnerability.AllIsVulnerability.Vulnerability: %w", err) + } + } + retval.Justification = v.AllIsVulnerability.Justification + retval.Origin = v.AllIsVulnerability.Origin + retval.Collector = v.AllIsVulnerability.Collector return &retval, nil } -// PkgEqualPkgPackage includes the requested fields of the GraphQL type Package. +// NodesNodesNoVuln includes the requested fields of the GraphQL type NoVuln. +// The GraphQL type's documentation follows. +// +// NoVuln is a special vulnerability node to attest that no vulnerability has been +// found during a vulnerability scan. +// +// Backends guarantee that this is a singleton node. +type NodesNodesNoVuln struct { + Typename *string `json:"__typename"` + Id string `json:"id"` +} + +// GetTypename returns NodesNodesNoVuln.Typename, and is useful for accessing the field via an interface. +func (v *NodesNodesNoVuln) GetTypename() *string { return v.Typename } + +// GetId returns NodesNodesNoVuln.Id, and is useful for accessing the field via an interface. +func (v *NodesNodesNoVuln) GetId() string { return v.Id } + +// NodesNodesNode includes the requested fields of the GraphQL interface Node. +// +// NodesNodesNode is implemented by the following types: +// NodesNodesArtifact +// NodesNodesBuilder +// NodesNodesCVE +// NodesNodesCertifyBad +// NodesNodesCertifyGood +// NodesNodesCertifyScorecard +// NodesNodesCertifyVEXStatement +// NodesNodesCertifyVuln +// NodesNodesGHSA +// NodesNodesHasMetadata +// NodesNodesHasSBOM +// NodesNodesHasSLSA +// NodesNodesHasSourceAt +// NodesNodesHashEqual +// NodesNodesIsDependency +// NodesNodesIsOccurrence +// NodesNodesIsVulnerability +// NodesNodesNoVuln +// NodesNodesOSV +// NodesNodesPackage +// NodesNodesPkgEqual +// NodesNodesPointOfContact +// NodesNodesSource // The GraphQL type's documentation follows. // -// Package represents the root of the package trie/tree. -// -// We map package information to a trie, closely matching the pURL specification -// (https://github.com/package-url/purl-spec/blob/0dd92f26f8bb11956ffdf5e8acfcee71e8560407/README.rst), -// but deviating from it where GUAC heuristics allow for better representation of -// package information. Each path in the trie fully represents a package; we split -// the trie based on the pURL components. -// -// This node matches a pkg: partial pURL. The type field matches the -// pURL types but we might also use "guac" for the cases where the pURL -// representation is not complete or when we have custom rules. +// Node is a union type of all the possible nodes. // -// Since this node is at the root of the package trie, it is named Package, not -// PackageType. -type PkgEqualPkgPackage struct { - AllPkgTree `json:"-"` -} - -// GetId returns PkgEqualPkgPackage.Id, and is useful for accessing the field via an interface. -func (v *PkgEqualPkgPackage) GetId() string { return v.AllPkgTree.Id } - -// GetType returns PkgEqualPkgPackage.Type, and is useful for accessing the field via an interface. -func (v *PkgEqualPkgPackage) GetType() string { return v.AllPkgTree.Type } - -// GetNamespaces returns PkgEqualPkgPackage.Namespaces, and is useful for accessing the field via an interface. -func (v *PkgEqualPkgPackage) GetNamespaces() []AllPkgTreeNamespacesPackageNamespace { - return v.AllPkgTree.Namespaces +// It encapsulates the software tree nodes along with the evidence nodes. In a +// path query, all connecting evidence nodes along with their intermediate subject +// nodes need to be returned in order to create a complete graph. +type NodesNodesNode interface { + implementsGraphQLInterfaceNodesNodesNode() + // GetTypename returns the receiver's concrete GraphQL type-name (see interface doc for possible values). + GetTypename() *string } -func (v *PkgEqualPkgPackage) UnmarshalJSON(b []byte) error { +func (v *NodesNodesArtifact) implementsGraphQLInterfaceNodesNodesNode() {} +func (v *NodesNodesBuilder) implementsGraphQLInterfaceNodesNodesNode() {} +func (v *NodesNodesCVE) implementsGraphQLInterfaceNodesNodesNode() {} +func (v *NodesNodesCertifyBad) implementsGraphQLInterfaceNodesNodesNode() {} +func (v *NodesNodesCertifyGood) implementsGraphQLInterfaceNodesNodesNode() {} +func (v *NodesNodesCertifyScorecard) implementsGraphQLInterfaceNodesNodesNode() {} +func (v *NodesNodesCertifyVEXStatement) implementsGraphQLInterfaceNodesNodesNode() {} +func (v *NodesNodesCertifyVuln) implementsGraphQLInterfaceNodesNodesNode() {} +func (v *NodesNodesGHSA) implementsGraphQLInterfaceNodesNodesNode() {} +func (v *NodesNodesHasMetadata) implementsGraphQLInterfaceNodesNodesNode() {} +func (v *NodesNodesHasSBOM) implementsGraphQLInterfaceNodesNodesNode() {} +func (v *NodesNodesHasSLSA) implementsGraphQLInterfaceNodesNodesNode() {} +func (v *NodesNodesHasSourceAt) implementsGraphQLInterfaceNodesNodesNode() {} +func (v *NodesNodesHashEqual) implementsGraphQLInterfaceNodesNodesNode() {} +func (v *NodesNodesIsDependency) implementsGraphQLInterfaceNodesNodesNode() {} +func (v *NodesNodesIsOccurrence) implementsGraphQLInterfaceNodesNodesNode() {} +func (v *NodesNodesIsVulnerability) implementsGraphQLInterfaceNodesNodesNode() {} +func (v *NodesNodesNoVuln) implementsGraphQLInterfaceNodesNodesNode() {} +func (v *NodesNodesOSV) implementsGraphQLInterfaceNodesNodesNode() {} +func (v *NodesNodesPackage) implementsGraphQLInterfaceNodesNodesNode() {} +func (v *NodesNodesPkgEqual) implementsGraphQLInterfaceNodesNodesNode() {} +func (v *NodesNodesPointOfContact) implementsGraphQLInterfaceNodesNodesNode() {} +func (v *NodesNodesSource) implementsGraphQLInterfaceNodesNodesNode() {} +func __unmarshalNodesNodesNode(b []byte, v *NodesNodesNode) error { if string(b) == "null" { return nil } - var firstPass struct { - *PkgEqualPkgPackage - graphql.NoUnmarshalJSON + var tn struct { + TypeName string `json:"__typename"` } - firstPass.PkgEqualPkgPackage = v - - err := json.Unmarshal(b, &firstPass) + err := json.Unmarshal(b, &tn) if err != nil { return err } - err = json.Unmarshal( - b, &v.AllPkgTree) - if err != nil { - return err + switch tn.TypeName { + case "Artifact": + *v = new(NodesNodesArtifact) + return json.Unmarshal(b, *v) + case "Builder": + *v = new(NodesNodesBuilder) + return json.Unmarshal(b, *v) + case "CVE": + *v = new(NodesNodesCVE) + return json.Unmarshal(b, *v) + case "CertifyBad": + *v = new(NodesNodesCertifyBad) + return json.Unmarshal(b, *v) + case "CertifyGood": + *v = new(NodesNodesCertifyGood) + return json.Unmarshal(b, *v) + case "CertifyScorecard": + *v = new(NodesNodesCertifyScorecard) + return json.Unmarshal(b, *v) + case "CertifyVEXStatement": + *v = new(NodesNodesCertifyVEXStatement) + return json.Unmarshal(b, *v) + case "CertifyVuln": + *v = new(NodesNodesCertifyVuln) + return json.Unmarshal(b, *v) + case "GHSA": + *v = new(NodesNodesGHSA) + return json.Unmarshal(b, *v) + case "HasMetadata": + *v = new(NodesNodesHasMetadata) + return json.Unmarshal(b, *v) + case "HasSBOM": + *v = new(NodesNodesHasSBOM) + return json.Unmarshal(b, *v) + case "HasSLSA": + *v = new(NodesNodesHasSLSA) + return json.Unmarshal(b, *v) + case "HasSourceAt": + *v = new(NodesNodesHasSourceAt) + return json.Unmarshal(b, *v) + case "HashEqual": + *v = new(NodesNodesHashEqual) + return json.Unmarshal(b, *v) + case "IsDependency": + *v = new(NodesNodesIsDependency) + return json.Unmarshal(b, *v) + case "IsOccurrence": + *v = new(NodesNodesIsOccurrence) + return json.Unmarshal(b, *v) + case "IsVulnerability": + *v = new(NodesNodesIsVulnerability) + return json.Unmarshal(b, *v) + case "NoVuln": + *v = new(NodesNodesNoVuln) + return json.Unmarshal(b, *v) + case "OSV": + *v = new(NodesNodesOSV) + return json.Unmarshal(b, *v) + case "Package": + *v = new(NodesNodesPackage) + return json.Unmarshal(b, *v) + case "PkgEqual": + *v = new(NodesNodesPkgEqual) + return json.Unmarshal(b, *v) + case "PointOfContact": + *v = new(NodesNodesPointOfContact) + return json.Unmarshal(b, *v) + case "Source": + *v = new(NodesNodesSource) + return json.Unmarshal(b, *v) + case "": + return fmt.Errorf( + "response was missing Node.__typename") + default: + return fmt.Errorf( + `unexpected concrete type for NodesNodesNode: "%v"`, tn.TypeName) } - return nil } -type __premarshalPkgEqualPkgPackage struct { - Id string `json:"id"` - - Type string `json:"type"` - - Namespaces []AllPkgTreeNamespacesPackageNamespace `json:"namespaces"` -} - -func (v *PkgEqualPkgPackage) MarshalJSON() ([]byte, error) { - premarshaled, err := v.__premarshalJSON() - if err != nil { - return nil, err - } - return json.Marshal(premarshaled) -} +func __marshalNodesNodesNode(v *NodesNodesNode) ([]byte, error) { -func (v *PkgEqualPkgPackage) __premarshalJSON() (*__premarshalPkgEqualPkgPackage, error) { - var retval __premarshalPkgEqualPkgPackage + var typename string + switch v := (*v).(type) { + case *NodesNodesArtifact: + typename = "Artifact" - retval.Id = v.AllPkgTree.Id - retval.Type = v.AllPkgTree.Type - retval.Namespaces = v.AllPkgTree.Namespaces - return &retval, nil -} + premarshaled, err := v.__premarshalJSON() + if err != nil { + return nil, err + } + result := struct { + TypeName string `json:"__typename"` + *__premarshalNodesNodesArtifact + }{typename, premarshaled} + return json.Marshal(result) + case *NodesNodesBuilder: + typename = "Builder" -// PkgEqualResponse is returned by PkgEqual on success. -type PkgEqualResponse struct { - // Ingests a new package and returns the corresponding package trie path. - Pkg PkgEqualPkgPackage `json:"pkg"` - // Ingests a new package and returns the corresponding package trie path. - OtherPackage PkgEqualOtherPackage `json:"otherPackage"` - // Adds a certification that two packages are similar. - IngestPkgEqual PkgEqualIngestPkgEqual `json:"ingestPkgEqual"` -} + premarshaled, err := v.__premarshalJSON() + if err != nil { + return nil, err + } + result := struct { + TypeName string `json:"__typename"` + *__premarshalNodesNodesBuilder + }{typename, premarshaled} + return json.Marshal(result) + case *NodesNodesCVE: + typename = "CVE" -// GetPkg returns PkgEqualResponse.Pkg, and is useful for accessing the field via an interface. -func (v *PkgEqualResponse) GetPkg() PkgEqualPkgPackage { return v.Pkg } + premarshaled, err := v.__premarshalJSON() + if err != nil { + return nil, err + } + result := struct { + TypeName string `json:"__typename"` + *__premarshalNodesNodesCVE + }{typename, premarshaled} + return json.Marshal(result) + case *NodesNodesCertifyBad: + typename = "CertifyBad" -// GetOtherPackage returns PkgEqualResponse.OtherPackage, and is useful for accessing the field via an interface. -func (v *PkgEqualResponse) GetOtherPackage() PkgEqualOtherPackage { return v.OtherPackage } + premarshaled, err := v.__premarshalJSON() + if err != nil { + return nil, err + } + result := struct { + TypeName string `json:"__typename"` + *__premarshalNodesNodesCertifyBad + }{typename, premarshaled} + return json.Marshal(result) + case *NodesNodesCertifyGood: + typename = "CertifyGood" -// GetIngestPkgEqual returns PkgEqualResponse.IngestPkgEqual, and is useful for accessing the field via an interface. -func (v *PkgEqualResponse) GetIngestPkgEqual() PkgEqualIngestPkgEqual { return v.IngestPkgEqual } + premarshaled, err := v.__premarshalJSON() + if err != nil { + return nil, err + } + result := struct { + TypeName string `json:"__typename"` + *__premarshalNodesNodesCertifyGood + }{typename, premarshaled} + return json.Marshal(result) + case *NodesNodesCertifyScorecard: + typename = "CertifyScorecard" -// PkgInputSpec specifies a package for mutations. -// -// This is different than PkgSpec because we want to encode mandatory fields: -// type and name. All optional fields are given empty default values. -type PkgInputSpec struct { - Type string `json:"type"` - Namespace *string `json:"namespace"` - Name string `json:"name"` - Version *string `json:"version"` - Qualifiers []PackageQualifierInputSpec `json:"qualifiers"` - Subpath *string `json:"subpath"` -} + premarshaled, err := v.__premarshalJSON() + if err != nil { + return nil, err + } + result := struct { + TypeName string `json:"__typename"` + *__premarshalNodesNodesCertifyScorecard + }{typename, premarshaled} + return json.Marshal(result) + case *NodesNodesCertifyVEXStatement: + typename = "CertifyVEXStatement" -// GetType returns PkgInputSpec.Type, and is useful for accessing the field via an interface. -func (v *PkgInputSpec) GetType() string { return v.Type } + premarshaled, err := v.__premarshalJSON() + if err != nil { + return nil, err + } + result := struct { + TypeName string `json:"__typename"` + *__premarshalNodesNodesCertifyVEXStatement + }{typename, premarshaled} + return json.Marshal(result) + case *NodesNodesCertifyVuln: + typename = "CertifyVuln" -// GetNamespace returns PkgInputSpec.Namespace, and is useful for accessing the field via an interface. -func (v *PkgInputSpec) GetNamespace() *string { return v.Namespace } + premarshaled, err := v.__premarshalJSON() + if err != nil { + return nil, err + } + result := struct { + TypeName string `json:"__typename"` + *__premarshalNodesNodesCertifyVuln + }{typename, premarshaled} + return json.Marshal(result) + case *NodesNodesGHSA: + typename = "GHSA" -// GetName returns PkgInputSpec.Name, and is useful for accessing the field via an interface. -func (v *PkgInputSpec) GetName() string { return v.Name } + premarshaled, err := v.__premarshalJSON() + if err != nil { + return nil, err + } + result := struct { + TypeName string `json:"__typename"` + *__premarshalNodesNodesGHSA + }{typename, premarshaled} + return json.Marshal(result) + case *NodesNodesHasMetadata: + typename = "HasMetadata" -// GetVersion returns PkgInputSpec.Version, and is useful for accessing the field via an interface. -func (v *PkgInputSpec) GetVersion() *string { return v.Version } + result := struct { + TypeName string `json:"__typename"` + *NodesNodesHasMetadata + }{typename, v} + return json.Marshal(result) + case *NodesNodesHasSBOM: + typename = "HasSBOM" -// GetQualifiers returns PkgInputSpec.Qualifiers, and is useful for accessing the field via an interface. -func (v *PkgInputSpec) GetQualifiers() []PackageQualifierInputSpec { return v.Qualifiers } + premarshaled, err := v.__premarshalJSON() + if err != nil { + return nil, err + } + result := struct { + TypeName string `json:"__typename"` + *__premarshalNodesNodesHasSBOM + }{typename, premarshaled} + return json.Marshal(result) + case *NodesNodesHasSLSA: + typename = "HasSLSA" -// GetSubpath returns PkgInputSpec.Subpath, and is useful for accessing the field via an interface. -func (v *PkgInputSpec) GetSubpath() *string { return v.Subpath } + premarshaled, err := v.__premarshalJSON() + if err != nil { + return nil, err + } + result := struct { + TypeName string `json:"__typename"` + *__premarshalNodesNodesHasSLSA + }{typename, premarshaled} + return json.Marshal(result) + case *NodesNodesHasSourceAt: + typename = "HasSourceAt" -// PkgMatchType is an enum to determine if the attestation should be done at the -// specific version or package name. -type PkgMatchType string + premarshaled, err := v.__premarshalJSON() + if err != nil { + return nil, err + } + result := struct { + TypeName string `json:"__typename"` + *__premarshalNodesNodesHasSourceAt + }{typename, premarshaled} + return json.Marshal(result) + case *NodesNodesHashEqual: + typename = "HashEqual" -const ( - PkgMatchTypeAllVersions PkgMatchType = "ALL_VERSIONS" - PkgMatchTypeSpecificVersion PkgMatchType = "SPECIFIC_VERSION" -) + premarshaled, err := v.__premarshalJSON() + if err != nil { + return nil, err + } + result := struct { + TypeName string `json:"__typename"` + *__premarshalNodesNodesHashEqual + }{typename, premarshaled} + return json.Marshal(result) + case *NodesNodesIsDependency: + typename = "IsDependency" -// PkgSpec allows filtering the list of sources to return in a query. -// -// Each field matches a qualifier from pURL. Use null to match on all values at -// that level. For example, to get all packages in GUAC backend, use a PkgSpec -// where every field is null. -// -// Empty string at a field means matching with the empty string. If passing in -// qualifiers, all of the values in the list must match. Since we want to return -// nodes with any number of qualifiers if no qualifiers are passed in the input, -// we must also return the same set of nodes it the qualifiers list is empty. To -// match on nodes that don't contain any qualifier, set matchOnlyEmptyQualifiers -// to true. If this field is true, then the qualifiers argument is ignored. -type PkgSpec struct { - Id *string `json:"id"` - Type *string `json:"type"` - Namespace *string `json:"namespace"` - Name *string `json:"name"` - Version *string `json:"version"` - Qualifiers []PackageQualifierSpec `json:"qualifiers"` - MatchOnlyEmptyQualifiers *bool `json:"matchOnlyEmptyQualifiers"` - Subpath *string `json:"subpath"` -} + premarshaled, err := v.__premarshalJSON() + if err != nil { + return nil, err + } + result := struct { + TypeName string `json:"__typename"` + *__premarshalNodesNodesIsDependency + }{typename, premarshaled} + return json.Marshal(result) + case *NodesNodesIsOccurrence: + typename = "IsOccurrence" -// GetId returns PkgSpec.Id, and is useful for accessing the field via an interface. -func (v *PkgSpec) GetId() *string { return v.Id } + premarshaled, err := v.__premarshalJSON() + if err != nil { + return nil, err + } + result := struct { + TypeName string `json:"__typename"` + *__premarshalNodesNodesIsOccurrence + }{typename, premarshaled} + return json.Marshal(result) + case *NodesNodesIsVulnerability: + typename = "IsVulnerability" -// GetType returns PkgSpec.Type, and is useful for accessing the field via an interface. -func (v *PkgSpec) GetType() *string { return v.Type } + premarshaled, err := v.__premarshalJSON() + if err != nil { + return nil, err + } + result := struct { + TypeName string `json:"__typename"` + *__premarshalNodesNodesIsVulnerability + }{typename, premarshaled} + return json.Marshal(result) + case *NodesNodesNoVuln: + typename = "NoVuln" -// GetNamespace returns PkgSpec.Namespace, and is useful for accessing the field via an interface. -func (v *PkgSpec) GetNamespace() *string { return v.Namespace } + result := struct { + TypeName string `json:"__typename"` + *NodesNodesNoVuln + }{typename, v} + return json.Marshal(result) + case *NodesNodesOSV: + typename = "OSV" -// GetName returns PkgSpec.Name, and is useful for accessing the field via an interface. -func (v *PkgSpec) GetName() *string { return v.Name } + premarshaled, err := v.__premarshalJSON() + if err != nil { + return nil, err + } + result := struct { + TypeName string `json:"__typename"` + *__premarshalNodesNodesOSV + }{typename, premarshaled} + return json.Marshal(result) + case *NodesNodesPackage: + typename = "Package" -// GetVersion returns PkgSpec.Version, and is useful for accessing the field via an interface. -func (v *PkgSpec) GetVersion() *string { return v.Version } + premarshaled, err := v.__premarshalJSON() + if err != nil { + return nil, err + } + result := struct { + TypeName string `json:"__typename"` + *__premarshalNodesNodesPackage + }{typename, premarshaled} + return json.Marshal(result) + case *NodesNodesPkgEqual: + typename = "PkgEqual" -// GetQualifiers returns PkgSpec.Qualifiers, and is useful for accessing the field via an interface. -func (v *PkgSpec) GetQualifiers() []PackageQualifierSpec { return v.Qualifiers } + premarshaled, err := v.__premarshalJSON() + if err != nil { + return nil, err + } + result := struct { + TypeName string `json:"__typename"` + *__premarshalNodesNodesPkgEqual + }{typename, premarshaled} + return json.Marshal(result) + case *NodesNodesPointOfContact: + typename = "PointOfContact" -// GetMatchOnlyEmptyQualifiers returns PkgSpec.MatchOnlyEmptyQualifiers, and is useful for accessing the field via an interface. -func (v *PkgSpec) GetMatchOnlyEmptyQualifiers() *bool { return v.MatchOnlyEmptyQualifiers } + result := struct { + TypeName string `json:"__typename"` + *NodesNodesPointOfContact + }{typename, v} + return json.Marshal(result) + case *NodesNodesSource: + typename = "Source" -// GetSubpath returns PkgSpec.Subpath, and is useful for accessing the field via an interface. -func (v *PkgSpec) GetSubpath() *string { return v.Subpath } + premarshaled, err := v.__premarshalJSON() + if err != nil { + return nil, err + } + result := struct { + TypeName string `json:"__typename"` + *__premarshalNodesNodesSource + }{typename, premarshaled} + return json.Marshal(result) + case nil: + return []byte("null"), nil + default: + return nil, fmt.Errorf( + `unexpected concrete type for NodesNodesNode: "%T"`, v) + } +} -// PointOfContactArtifactIngestPointOfContact includes the requested fields of the GraphQL type PointOfContact. +// NodesNodesOSV includes the requested fields of the GraphQL type OSV. // The GraphQL type's documentation follows. // -// PointOfContact is an attestation of how to get in touch with the person(s) responsible -// for a package, source, or artifact. -// -// All evidence trees record a justification for the property they represent as -// well as the document that contains the attestation (origin) and the collector -// that collected the document (collector). -// -// The attestation applies to a subject which is a package, source, or artifact. -// If the attestation targets a package, it must target a PackageName or a -// PackageVersion. If the attestation targets a source, it must target a -// SourceName. +// OSV represents an Open Source Vulnerability. // -// email is the email address (singular) of the point of contact. +// The osvId field is mandatory and canonicalized to be lowercase. // -// info is additional contact information other than email address. This is free -// form. +// This maps to a vulnerability ID specific to the environment (e.g., GHSA ID or +// CVE ID). // -// NOTE: the identifiers for point of contact should be part of software trees. -// This will benefit from identifier look up and traversal as well as organization -// hierarchy. However, until the use case arises, PointOfContact will be a flat -// reference to the contact details. -type PointOfContactArtifactIngestPointOfContact struct { - allPointOfContact `json:"-"` -} - -// GetId returns PointOfContactArtifactIngestPointOfContact.Id, and is useful for accessing the field via an interface. -func (v *PointOfContactArtifactIngestPointOfContact) GetId() string { return v.allPointOfContact.Id } - -// GetSubject returns PointOfContactArtifactIngestPointOfContact.Subject, and is useful for accessing the field via an interface. -func (v *PointOfContactArtifactIngestPointOfContact) GetSubject() allPointOfContactSubjectPackageSourceOrArtifact { - return v.allPointOfContact.Subject -} - -// GetEmail returns PointOfContactArtifactIngestPointOfContact.Email, and is useful for accessing the field via an interface. -func (v *PointOfContactArtifactIngestPointOfContact) GetEmail() string { - return v.allPointOfContact.Email -} - -// GetInfo returns PointOfContactArtifactIngestPointOfContact.Info, and is useful for accessing the field via an interface. -func (v *PointOfContactArtifactIngestPointOfContact) GetInfo() string { - return v.allPointOfContact.Info -} - -// GetSince returns PointOfContactArtifactIngestPointOfContact.Since, and is useful for accessing the field via an interface. -func (v *PointOfContactArtifactIngestPointOfContact) GetSince() time.Time { - return v.allPointOfContact.Since +// This node can be referred to by other parts of GUAC. +type NodesNodesOSV struct { + Typename *string `json:"__typename"` + AllOSVTree `json:"-"` } -// GetJustification returns PointOfContactArtifactIngestPointOfContact.Justification, and is useful for accessing the field via an interface. -func (v *PointOfContactArtifactIngestPointOfContact) GetJustification() string { - return v.allPointOfContact.Justification -} +// GetTypename returns NodesNodesOSV.Typename, and is useful for accessing the field via an interface. +func (v *NodesNodesOSV) GetTypename() *string { return v.Typename } -// GetOrigin returns PointOfContactArtifactIngestPointOfContact.Origin, and is useful for accessing the field via an interface. -func (v *PointOfContactArtifactIngestPointOfContact) GetOrigin() string { - return v.allPointOfContact.Origin -} +// GetId returns NodesNodesOSV.Id, and is useful for accessing the field via an interface. +func (v *NodesNodesOSV) GetId() string { return v.AllOSVTree.Id } -// GetCollector returns PointOfContactArtifactIngestPointOfContact.Collector, and is useful for accessing the field via an interface. -func (v *PointOfContactArtifactIngestPointOfContact) GetCollector() string { - return v.allPointOfContact.Collector -} +// GetOsvId returns NodesNodesOSV.OsvId, and is useful for accessing the field via an interface. +func (v *NodesNodesOSV) GetOsvId() string { return v.AllOSVTree.OsvId } -func (v *PointOfContactArtifactIngestPointOfContact) UnmarshalJSON(b []byte) error { +func (v *NodesNodesOSV) UnmarshalJSON(b []byte) error { if string(b) == "null" { return nil } var firstPass struct { - *PointOfContactArtifactIngestPointOfContact + *NodesNodesOSV graphql.NoUnmarshalJSON } - firstPass.PointOfContactArtifactIngestPointOfContact = v + firstPass.NodesNodesOSV = v err := json.Unmarshal(b, &firstPass) if err != nil { @@ -18047,32 +18458,22 @@ func (v *PointOfContactArtifactIngestPointOfContact) UnmarshalJSON(b []byte) err } err = json.Unmarshal( - b, &v.allPointOfContact) + b, &v.AllOSVTree) if err != nil { return err } return nil } -type __premarshalPointOfContactArtifactIngestPointOfContact struct { - Id string `json:"id"` - - Subject json.RawMessage `json:"subject"` - - Email string `json:"email"` - - Info string `json:"info"` - - Since time.Time `json:"since"` - - Justification string `json:"justification"` +type __premarshalNodesNodesOSV struct { + Typename *string `json:"__typename"` - Origin string `json:"origin"` + Id string `json:"id"` - Collector string `json:"collector"` + OsvId string `json:"osvId"` } -func (v *PointOfContactArtifactIngestPointOfContact) MarshalJSON() ([]byte, error) { +func (v *NodesNodesOSV) MarshalJSON() ([]byte, error) { premarshaled, err := v.__premarshalJSON() if err != nil { return nil, err @@ -18080,141 +18481,144 @@ func (v *PointOfContactArtifactIngestPointOfContact) MarshalJSON() ([]byte, erro return json.Marshal(premarshaled) } -func (v *PointOfContactArtifactIngestPointOfContact) __premarshalJSON() (*__premarshalPointOfContactArtifactIngestPointOfContact, error) { - var retval __premarshalPointOfContactArtifactIngestPointOfContact - - retval.Id = v.allPointOfContact.Id - { +func (v *NodesNodesOSV) __premarshalJSON() (*__premarshalNodesNodesOSV, error) { + var retval __premarshalNodesNodesOSV - dst := &retval.Subject - src := v.allPointOfContact.Subject - var err error - *dst, err = __marshalallPointOfContactSubjectPackageSourceOrArtifact( - &src) - if err != nil { - return nil, fmt.Errorf( - "unable to marshal PointOfContactArtifactIngestPointOfContact.allPointOfContact.Subject: %w", err) - } - } - retval.Email = v.allPointOfContact.Email - retval.Info = v.allPointOfContact.Info - retval.Since = v.allPointOfContact.Since - retval.Justification = v.allPointOfContact.Justification - retval.Origin = v.allPointOfContact.Origin - retval.Collector = v.allPointOfContact.Collector + retval.Typename = v.Typename + retval.Id = v.AllOSVTree.Id + retval.OsvId = v.AllOSVTree.OsvId return &retval, nil } -// PointOfContactArtifactResponse is returned by PointOfContactArtifact on success. -type PointOfContactArtifactResponse struct { - // Adds a PointOfContact attestation to a package, source or artifact. - IngestPointOfContact PointOfContactArtifactIngestPointOfContact `json:"ingestPointOfContact"` +// NodesNodesPackage includes the requested fields of the GraphQL type Package. +// The GraphQL type's documentation follows. +// +// Package represents the root of the package trie/tree. +// +// We map package information to a trie, closely matching the pURL specification +// (https://github.com/package-url/purl-spec/blob/0dd92f26f8bb11956ffdf5e8acfcee71e8560407/README.rst), +// but deviating from it where GUAC heuristics allow for better representation of +// package information. Each path in the trie fully represents a package; we split +// the trie based on the pURL components. +// +// This node matches a pkg: partial pURL. The type field matches the +// pURL types but we might also use "guac" for the cases where the pURL +// representation is not complete or when we have custom rules. +// +// Since this node is at the root of the package trie, it is named Package, not +// PackageType. +type NodesNodesPackage struct { + Typename *string `json:"__typename"` + AllPkgTree `json:"-"` } -// GetIngestPointOfContact returns PointOfContactArtifactResponse.IngestPointOfContact, and is useful for accessing the field via an interface. -func (v *PointOfContactArtifactResponse) GetIngestPointOfContact() PointOfContactArtifactIngestPointOfContact { - return v.IngestPointOfContact -} +// GetTypename returns NodesNodesPackage.Typename, and is useful for accessing the field via an interface. +func (v *NodesNodesPackage) GetTypename() *string { return v.Typename } -// PointOfContactInputSpec represents the mutation input to ingest a PointOfContact evidence. -type PointOfContactInputSpec struct { - Email string `json:"email"` - Info string `json:"info"` - Since time.Time `json:"since"` - Justification string `json:"justification"` - Origin string `json:"origin"` - Collector string `json:"collector"` -} +// GetId returns NodesNodesPackage.Id, and is useful for accessing the field via an interface. +func (v *NodesNodesPackage) GetId() string { return v.AllPkgTree.Id } -// GetEmail returns PointOfContactInputSpec.Email, and is useful for accessing the field via an interface. -func (v *PointOfContactInputSpec) GetEmail() string { return v.Email } +// GetType returns NodesNodesPackage.Type, and is useful for accessing the field via an interface. +func (v *NodesNodesPackage) GetType() string { return v.AllPkgTree.Type } -// GetInfo returns PointOfContactInputSpec.Info, and is useful for accessing the field via an interface. -func (v *PointOfContactInputSpec) GetInfo() string { return v.Info } +// GetNamespaces returns NodesNodesPackage.Namespaces, and is useful for accessing the field via an interface. +func (v *NodesNodesPackage) GetNamespaces() []AllPkgTreeNamespacesPackageNamespace { + return v.AllPkgTree.Namespaces +} -// GetSince returns PointOfContactInputSpec.Since, and is useful for accessing the field via an interface. -func (v *PointOfContactInputSpec) GetSince() time.Time { return v.Since } +func (v *NodesNodesPackage) UnmarshalJSON(b []byte) error { -// GetJustification returns PointOfContactInputSpec.Justification, and is useful for accessing the field via an interface. -func (v *PointOfContactInputSpec) GetJustification() string { return v.Justification } + if string(b) == "null" { + return nil + } -// GetOrigin returns PointOfContactInputSpec.Origin, and is useful for accessing the field via an interface. -func (v *PointOfContactInputSpec) GetOrigin() string { return v.Origin } + var firstPass struct { + *NodesNodesPackage + graphql.NoUnmarshalJSON + } + firstPass.NodesNodesPackage = v -// GetCollector returns PointOfContactInputSpec.Collector, and is useful for accessing the field via an interface. -func (v *PointOfContactInputSpec) GetCollector() string { return v.Collector } + err := json.Unmarshal(b, &firstPass) + if err != nil { + return err + } -// PointOfContactPkgIngestPointOfContact includes the requested fields of the GraphQL type PointOfContact. -// The GraphQL type's documentation follows. -// -// PointOfContact is an attestation of how to get in touch with the person(s) responsible -// for a package, source, or artifact. -// -// All evidence trees record a justification for the property they represent as -// well as the document that contains the attestation (origin) and the collector -// that collected the document (collector). -// -// The attestation applies to a subject which is a package, source, or artifact. -// If the attestation targets a package, it must target a PackageName or a -// PackageVersion. If the attestation targets a source, it must target a -// SourceName. -// -// email is the email address (singular) of the point of contact. -// -// info is additional contact information other than email address. This is free -// form. -// -// NOTE: the identifiers for point of contact should be part of software trees. -// This will benefit from identifier look up and traversal as well as organization -// hierarchy. However, until the use case arises, PointOfContact will be a flat -// reference to the contact details. -type PointOfContactPkgIngestPointOfContact struct { - allPointOfContact `json:"-"` + err = json.Unmarshal( + b, &v.AllPkgTree) + if err != nil { + return err + } + return nil } -// GetId returns PointOfContactPkgIngestPointOfContact.Id, and is useful for accessing the field via an interface. -func (v *PointOfContactPkgIngestPointOfContact) GetId() string { return v.allPointOfContact.Id } +type __premarshalNodesNodesPackage struct { + Typename *string `json:"__typename"` -// GetSubject returns PointOfContactPkgIngestPointOfContact.Subject, and is useful for accessing the field via an interface. -func (v *PointOfContactPkgIngestPointOfContact) GetSubject() allPointOfContactSubjectPackageSourceOrArtifact { - return v.allPointOfContact.Subject + Id string `json:"id"` + + Type string `json:"type"` + + Namespaces []AllPkgTreeNamespacesPackageNamespace `json:"namespaces"` } -// GetEmail returns PointOfContactPkgIngestPointOfContact.Email, and is useful for accessing the field via an interface. -func (v *PointOfContactPkgIngestPointOfContact) GetEmail() string { return v.allPointOfContact.Email } +func (v *NodesNodesPackage) MarshalJSON() ([]byte, error) { + premarshaled, err := v.__premarshalJSON() + if err != nil { + return nil, err + } + return json.Marshal(premarshaled) +} -// GetInfo returns PointOfContactPkgIngestPointOfContact.Info, and is useful for accessing the field via an interface. -func (v *PointOfContactPkgIngestPointOfContact) GetInfo() string { return v.allPointOfContact.Info } +func (v *NodesNodesPackage) __premarshalJSON() (*__premarshalNodesNodesPackage, error) { + var retval __premarshalNodesNodesPackage -// GetSince returns PointOfContactPkgIngestPointOfContact.Since, and is useful for accessing the field via an interface. -func (v *PointOfContactPkgIngestPointOfContact) GetSince() time.Time { - return v.allPointOfContact.Since + retval.Typename = v.Typename + retval.Id = v.AllPkgTree.Id + retval.Type = v.AllPkgTree.Type + retval.Namespaces = v.AllPkgTree.Namespaces + return &retval, nil } -// GetJustification returns PointOfContactPkgIngestPointOfContact.Justification, and is useful for accessing the field via an interface. -func (v *PointOfContactPkgIngestPointOfContact) GetJustification() string { - return v.allPointOfContact.Justification +// NodesNodesPkgEqual includes the requested fields of the GraphQL type PkgEqual. +// The GraphQL type's documentation follows. +// +// PkgEqual is an attestation that a set of packages are similar. +type NodesNodesPkgEqual struct { + Typename *string `json:"__typename"` + AllPkgEqual `json:"-"` } -// GetOrigin returns PointOfContactPkgIngestPointOfContact.Origin, and is useful for accessing the field via an interface. -func (v *PointOfContactPkgIngestPointOfContact) GetOrigin() string { return v.allPointOfContact.Origin } +// GetTypename returns NodesNodesPkgEqual.Typename, and is useful for accessing the field via an interface. +func (v *NodesNodesPkgEqual) GetTypename() *string { return v.Typename } -// GetCollector returns PointOfContactPkgIngestPointOfContact.Collector, and is useful for accessing the field via an interface. -func (v *PointOfContactPkgIngestPointOfContact) GetCollector() string { - return v.allPointOfContact.Collector +// GetId returns NodesNodesPkgEqual.Id, and is useful for accessing the field via an interface. +func (v *NodesNodesPkgEqual) GetId() string { return v.AllPkgEqual.Id } + +// GetJustification returns NodesNodesPkgEqual.Justification, and is useful for accessing the field via an interface. +func (v *NodesNodesPkgEqual) GetJustification() string { return v.AllPkgEqual.Justification } + +// GetPackages returns NodesNodesPkgEqual.Packages, and is useful for accessing the field via an interface. +func (v *NodesNodesPkgEqual) GetPackages() []AllPkgEqualPackagesPackage { + return v.AllPkgEqual.Packages } -func (v *PointOfContactPkgIngestPointOfContact) UnmarshalJSON(b []byte) error { +// GetOrigin returns NodesNodesPkgEqual.Origin, and is useful for accessing the field via an interface. +func (v *NodesNodesPkgEqual) GetOrigin() string { return v.AllPkgEqual.Origin } + +// GetCollector returns NodesNodesPkgEqual.Collector, and is useful for accessing the field via an interface. +func (v *NodesNodesPkgEqual) GetCollector() string { return v.AllPkgEqual.Collector } + +func (v *NodesNodesPkgEqual) UnmarshalJSON(b []byte) error { if string(b) == "null" { return nil } var firstPass struct { - *PointOfContactPkgIngestPointOfContact + *NodesNodesPkgEqual graphql.NoUnmarshalJSON } - firstPass.PointOfContactPkgIngestPointOfContact = v + firstPass.NodesNodesPkgEqual = v err := json.Unmarshal(b, &firstPass) if err != nil { @@ -18222,32 +18626,28 @@ func (v *PointOfContactPkgIngestPointOfContact) UnmarshalJSON(b []byte) error { } err = json.Unmarshal( - b, &v.allPointOfContact) + b, &v.AllPkgEqual) if err != nil { return err } return nil } -type __premarshalPointOfContactPkgIngestPointOfContact struct { - Id string `json:"id"` - - Subject json.RawMessage `json:"subject"` - - Email string `json:"email"` - - Info string `json:"info"` +type __premarshalNodesNodesPkgEqual struct { + Typename *string `json:"__typename"` - Since time.Time `json:"since"` + Id string `json:"id"` Justification string `json:"justification"` + Packages []AllPkgEqualPackagesPackage `json:"packages"` + Origin string `json:"origin"` Collector string `json:"collector"` } -func (v *PointOfContactPkgIngestPointOfContact) MarshalJSON() ([]byte, error) { +func (v *NodesNodesPkgEqual) MarshalJSON() ([]byte, error) { premarshaled, err := v.__premarshalJSON() if err != nil { return nil, err @@ -18255,43 +18655,19 @@ func (v *PointOfContactPkgIngestPointOfContact) MarshalJSON() ([]byte, error) { return json.Marshal(premarshaled) } -func (v *PointOfContactPkgIngestPointOfContact) __premarshalJSON() (*__premarshalPointOfContactPkgIngestPointOfContact, error) { - var retval __premarshalPointOfContactPkgIngestPointOfContact - - retval.Id = v.allPointOfContact.Id - { +func (v *NodesNodesPkgEqual) __premarshalJSON() (*__premarshalNodesNodesPkgEqual, error) { + var retval __premarshalNodesNodesPkgEqual - dst := &retval.Subject - src := v.allPointOfContact.Subject - var err error - *dst, err = __marshalallPointOfContactSubjectPackageSourceOrArtifact( - &src) - if err != nil { - return nil, fmt.Errorf( - "unable to marshal PointOfContactPkgIngestPointOfContact.allPointOfContact.Subject: %w", err) - } - } - retval.Email = v.allPointOfContact.Email - retval.Info = v.allPointOfContact.Info - retval.Since = v.allPointOfContact.Since - retval.Justification = v.allPointOfContact.Justification - retval.Origin = v.allPointOfContact.Origin - retval.Collector = v.allPointOfContact.Collector + retval.Typename = v.Typename + retval.Id = v.AllPkgEqual.Id + retval.Justification = v.AllPkgEqual.Justification + retval.Packages = v.AllPkgEqual.Packages + retval.Origin = v.AllPkgEqual.Origin + retval.Collector = v.AllPkgEqual.Collector return &retval, nil } -// PointOfContactPkgResponse is returned by PointOfContactPkg on success. -type PointOfContactPkgResponse struct { - // Adds a PointOfContact attestation to a package, source or artifact. - IngestPointOfContact PointOfContactPkgIngestPointOfContact `json:"ingestPointOfContact"` -} - -// GetIngestPointOfContact returns PointOfContactPkgResponse.IngestPointOfContact, and is useful for accessing the field via an interface. -func (v *PointOfContactPkgResponse) GetIngestPointOfContact() PointOfContactPkgIngestPointOfContact { - return v.IngestPointOfContact -} - -// PointOfContactSrcIngestPointOfContact includes the requested fields of the GraphQL type PointOfContact. +// NodesNodesPointOfContact includes the requested fields of the GraphQL type PointOfContact. // The GraphQL type's documentation follows. // // PointOfContact is an attestation of how to get in touch with the person(s) responsible @@ -18315,53 +18691,57 @@ func (v *PointOfContactPkgResponse) GetIngestPointOfContact() PointOfContactPkgI // This will benefit from identifier look up and traversal as well as organization // hierarchy. However, until the use case arises, PointOfContact will be a flat // reference to the contact details. -type PointOfContactSrcIngestPointOfContact struct { - allPointOfContact `json:"-"` +type NodesNodesPointOfContact struct { + Typename *string `json:"__typename"` } -// GetId returns PointOfContactSrcIngestPointOfContact.Id, and is useful for accessing the field via an interface. -func (v *PointOfContactSrcIngestPointOfContact) GetId() string { return v.allPointOfContact.Id } +// GetTypename returns NodesNodesPointOfContact.Typename, and is useful for accessing the field via an interface. +func (v *NodesNodesPointOfContact) GetTypename() *string { return v.Typename } -// GetSubject returns PointOfContactSrcIngestPointOfContact.Subject, and is useful for accessing the field via an interface. -func (v *PointOfContactSrcIngestPointOfContact) GetSubject() allPointOfContactSubjectPackageSourceOrArtifact { - return v.allPointOfContact.Subject +// NodesNodesSource includes the requested fields of the GraphQL type Source. +// The GraphQL type's documentation follows. +// +// Source represents the root of the source trie/tree. +// +// We map source information to a trie, as a derivative of the pURL specification: +// each path in the trie represents a type, namespace, name and an optional +// qualifier that stands for tag/commit information. +// +// This node represents the type part of the trie path. It is used to represent +// the version control system that is being used. +// +// Since this node is at the root of the source trie, it is named Source, not +// SourceType. +type NodesNodesSource struct { + Typename *string `json:"__typename"` + AllSourceTree `json:"-"` } -// GetEmail returns PointOfContactSrcIngestPointOfContact.Email, and is useful for accessing the field via an interface. -func (v *PointOfContactSrcIngestPointOfContact) GetEmail() string { return v.allPointOfContact.Email } - -// GetInfo returns PointOfContactSrcIngestPointOfContact.Info, and is useful for accessing the field via an interface. -func (v *PointOfContactSrcIngestPointOfContact) GetInfo() string { return v.allPointOfContact.Info } - -// GetSince returns PointOfContactSrcIngestPointOfContact.Since, and is useful for accessing the field via an interface. -func (v *PointOfContactSrcIngestPointOfContact) GetSince() time.Time { - return v.allPointOfContact.Since -} +// GetTypename returns NodesNodesSource.Typename, and is useful for accessing the field via an interface. +func (v *NodesNodesSource) GetTypename() *string { return v.Typename } -// GetJustification returns PointOfContactSrcIngestPointOfContact.Justification, and is useful for accessing the field via an interface. -func (v *PointOfContactSrcIngestPointOfContact) GetJustification() string { - return v.allPointOfContact.Justification -} +// GetId returns NodesNodesSource.Id, and is useful for accessing the field via an interface. +func (v *NodesNodesSource) GetId() string { return v.AllSourceTree.Id } -// GetOrigin returns PointOfContactSrcIngestPointOfContact.Origin, and is useful for accessing the field via an interface. -func (v *PointOfContactSrcIngestPointOfContact) GetOrigin() string { return v.allPointOfContact.Origin } +// GetType returns NodesNodesSource.Type, and is useful for accessing the field via an interface. +func (v *NodesNodesSource) GetType() string { return v.AllSourceTree.Type } -// GetCollector returns PointOfContactSrcIngestPointOfContact.Collector, and is useful for accessing the field via an interface. -func (v *PointOfContactSrcIngestPointOfContact) GetCollector() string { - return v.allPointOfContact.Collector +// GetNamespaces returns NodesNodesSource.Namespaces, and is useful for accessing the field via an interface. +func (v *NodesNodesSource) GetNamespaces() []AllSourceTreeNamespacesSourceNamespace { + return v.AllSourceTree.Namespaces } -func (v *PointOfContactSrcIngestPointOfContact) UnmarshalJSON(b []byte) error { +func (v *NodesNodesSource) UnmarshalJSON(b []byte) error { if string(b) == "null" { return nil } var firstPass struct { - *PointOfContactSrcIngestPointOfContact + *NodesNodesSource graphql.NoUnmarshalJSON } - firstPass.PointOfContactSrcIngestPointOfContact = v + firstPass.NodesNodesSource = v err := json.Unmarshal(b, &firstPass) if err != nil { @@ -18369,32 +18749,24 @@ func (v *PointOfContactSrcIngestPointOfContact) UnmarshalJSON(b []byte) error { } err = json.Unmarshal( - b, &v.allPointOfContact) + b, &v.AllSourceTree) if err != nil { return err } return nil } -type __premarshalPointOfContactSrcIngestPointOfContact struct { - Id string `json:"id"` - - Subject json.RawMessage `json:"subject"` - - Email string `json:"email"` - - Info string `json:"info"` - - Since time.Time `json:"since"` +type __premarshalNodesNodesSource struct { + Typename *string `json:"__typename"` - Justification string `json:"justification"` + Id string `json:"id"` - Origin string `json:"origin"` + Type string `json:"type"` - Collector string `json:"collector"` + Namespaces []AllSourceTreeNamespacesSourceNamespace `json:"namespaces"` } -func (v *PointOfContactSrcIngestPointOfContact) MarshalJSON() ([]byte, error) { +func (v *NodesNodesSource) MarshalJSON() ([]byte, error) { premarshaled, err := v.__premarshalJSON() if err != nil { return nil, err @@ -18402,95 +18774,71 @@ func (v *PointOfContactSrcIngestPointOfContact) MarshalJSON() ([]byte, error) { return json.Marshal(premarshaled) } -func (v *PointOfContactSrcIngestPointOfContact) __premarshalJSON() (*__premarshalPointOfContactSrcIngestPointOfContact, error) { - var retval __premarshalPointOfContactSrcIngestPointOfContact - - retval.Id = v.allPointOfContact.Id - { +func (v *NodesNodesSource) __premarshalJSON() (*__premarshalNodesNodesSource, error) { + var retval __premarshalNodesNodesSource - dst := &retval.Subject - src := v.allPointOfContact.Subject - var err error - *dst, err = __marshalallPointOfContactSubjectPackageSourceOrArtifact( - &src) - if err != nil { - return nil, fmt.Errorf( - "unable to marshal PointOfContactSrcIngestPointOfContact.allPointOfContact.Subject: %w", err) - } - } - retval.Email = v.allPointOfContact.Email - retval.Info = v.allPointOfContact.Info - retval.Since = v.allPointOfContact.Since - retval.Justification = v.allPointOfContact.Justification - retval.Origin = v.allPointOfContact.Origin - retval.Collector = v.allPointOfContact.Collector + retval.Typename = v.Typename + retval.Id = v.AllSourceTree.Id + retval.Type = v.AllSourceTree.Type + retval.Namespaces = v.AllSourceTree.Namespaces return &retval, nil } -// PointOfContactSrcResponse is returned by PointOfContactSrc on success. -type PointOfContactSrcResponse struct { - // Adds a PointOfContact attestation to a package, source or artifact. - IngestPointOfContact PointOfContactSrcIngestPointOfContact `json:"ingestPointOfContact"` -} - -// GetIngestPointOfContact returns PointOfContactSrcResponse.IngestPointOfContact, and is useful for accessing the field via an interface. -func (v *PointOfContactSrcResponse) GetIngestPointOfContact() PointOfContactSrcIngestPointOfContact { - return v.IngestPointOfContact -} - -// SLSAForArtifactIngestSLSAHasSLSA includes the requested fields of the GraphQL type HasSLSA. -// The GraphQL type's documentation follows. -// -// HasSLSA records that a subject node has a SLSA attestation. -type SLSAForArtifactIngestSLSAHasSLSA struct { - allSLSATree `json:"-"` -} - -// GetId returns SLSAForArtifactIngestSLSAHasSLSA.Id, and is useful for accessing the field via an interface. -func (v *SLSAForArtifactIngestSLSAHasSLSA) GetId() string { return v.allSLSATree.Id } - -// GetSubject returns SLSAForArtifactIngestSLSAHasSLSA.Subject, and is useful for accessing the field via an interface. -func (v *SLSAForArtifactIngestSLSAHasSLSA) GetSubject() allSLSATreeSubjectArtifact { - return v.allSLSATree.Subject +// NodesResponse is returned by Nodes on success. +type NodesResponse struct { + // nodes returns an array of nodes, regardless of type. + // + // The input is an array of IDs to retrieve. + Nodes []NodesNodesNode `json:"-"` } -// GetSlsa returns SLSAForArtifactIngestSLSAHasSLSA.Slsa, and is useful for accessing the field via an interface. -func (v *SLSAForArtifactIngestSLSAHasSLSA) GetSlsa() allSLSATreeSlsaSLSA { return v.allSLSATree.Slsa } +// GetNodes returns NodesResponse.Nodes, and is useful for accessing the field via an interface. +func (v *NodesResponse) GetNodes() []NodesNodesNode { return v.Nodes } -func (v *SLSAForArtifactIngestSLSAHasSLSA) UnmarshalJSON(b []byte) error { +func (v *NodesResponse) UnmarshalJSON(b []byte) error { if string(b) == "null" { return nil } var firstPass struct { - *SLSAForArtifactIngestSLSAHasSLSA + *NodesResponse + Nodes []json.RawMessage `json:"nodes"` graphql.NoUnmarshalJSON } - firstPass.SLSAForArtifactIngestSLSAHasSLSA = v + firstPass.NodesResponse = v err := json.Unmarshal(b, &firstPass) if err != nil { return err } - err = json.Unmarshal( - b, &v.allSLSATree) - if err != nil { - return err + { + dst := &v.Nodes + src := firstPass.Nodes + *dst = make( + []NodesNodesNode, + len(src)) + for i, src := range src { + dst := &(*dst)[i] + if len(src) != 0 && string(src) != "null" { + err = __unmarshalNodesNodesNode( + src, dst) + if err != nil { + return fmt.Errorf( + "unable to unmarshal NodesResponse.Nodes: %w", err) + } + } + } } return nil } -type __premarshalSLSAForArtifactIngestSLSAHasSLSA struct { - Id string `json:"id"` - - Subject allSLSATreeSubjectArtifact `json:"subject"` - - Slsa allSLSATreeSlsaSLSA `json:"slsa"` +type __premarshalNodesResponse struct { + Nodes []json.RawMessage `json:"nodes"` } -func (v *SLSAForArtifactIngestSLSAHasSLSA) MarshalJSON() ([]byte, error) { +func (v *NodesResponse) MarshalJSON() ([]byte, error) { premarshaled, err := v.__premarshalJSON() if err != nil { return nil, err @@ -18498,56 +18846,82 @@ func (v *SLSAForArtifactIngestSLSAHasSLSA) MarshalJSON() ([]byte, error) { return json.Marshal(premarshaled) } -func (v *SLSAForArtifactIngestSLSAHasSLSA) __premarshalJSON() (*__premarshalSLSAForArtifactIngestSLSAHasSLSA, error) { - var retval __premarshalSLSAForArtifactIngestSLSAHasSLSA +func (v *NodesResponse) __premarshalJSON() (*__premarshalNodesResponse, error) { + var retval __premarshalNodesResponse - retval.Id = v.allSLSATree.Id - retval.Subject = v.allSLSATree.Subject - retval.Slsa = v.allSLSATree.Slsa + { + + dst := &retval.Nodes + src := v.Nodes + *dst = make( + []json.RawMessage, + len(src)) + for i, src := range src { + dst := &(*dst)[i] + var err error + *dst, err = __marshalNodesNodesNode( + &src) + if err != nil { + return nil, fmt.Errorf( + "unable to marshal NodesResponse.Nodes: %w", err) + } + } + } return &retval, nil } -// SLSAForArtifactResponse is returned by SLSAForArtifact on success. -type SLSAForArtifactResponse struct { - // Ingests a SLSA attestation - IngestSLSA SLSAForArtifactIngestSLSAHasSLSA `json:"ingestSLSA"` +// OSVInputSpec specifies a OSV vulnerability for mutations. +type OSVInputSpec struct { + OsvId string `json:"osvId"` } -// GetIngestSLSA returns SLSAForArtifactResponse.IngestSLSA, and is useful for accessing the field via an interface. -func (v *SLSAForArtifactResponse) GetIngestSLSA() SLSAForArtifactIngestSLSAHasSLSA { - return v.IngestSLSA +// GetOsvId returns OSVInputSpec.OsvId, and is useful for accessing the field via an interface. +func (v *OSVInputSpec) GetOsvId() string { return v.OsvId } + +// OSVSpec allows filtering the list of advisories to return in a query. +type OSVSpec struct { + Id *string `json:"id"` + OsvId *string `json:"osvId"` } -// SLSAForArtifactsIngestSLSAsHasSLSA includes the requested fields of the GraphQL type HasSLSA. +// GetId returns OSVSpec.Id, and is useful for accessing the field via an interface. +func (v *OSVSpec) GetId() *string { return v.Id } + +// GetOsvId returns OSVSpec.OsvId, and is useful for accessing the field via an interface. +func (v *OSVSpec) GetOsvId() *string { return v.OsvId } + +// OSVsOsvOSV includes the requested fields of the GraphQL type OSV. // The GraphQL type's documentation follows. // -// HasSLSA records that a subject node has a SLSA attestation. -type SLSAForArtifactsIngestSLSAsHasSLSA struct { - allSLSATree `json:"-"` +// OSV represents an Open Source Vulnerability. +// +// The osvId field is mandatory and canonicalized to be lowercase. +// +// This maps to a vulnerability ID specific to the environment (e.g., GHSA ID or +// CVE ID). +// +// This node can be referred to by other parts of GUAC. +type OSVsOsvOSV struct { + AllOSVTree `json:"-"` } -// GetId returns SLSAForArtifactsIngestSLSAsHasSLSA.Id, and is useful for accessing the field via an interface. -func (v *SLSAForArtifactsIngestSLSAsHasSLSA) GetId() string { return v.allSLSATree.Id } - -// GetSubject returns SLSAForArtifactsIngestSLSAsHasSLSA.Subject, and is useful for accessing the field via an interface. -func (v *SLSAForArtifactsIngestSLSAsHasSLSA) GetSubject() allSLSATreeSubjectArtifact { - return v.allSLSATree.Subject -} +// GetId returns OSVsOsvOSV.Id, and is useful for accessing the field via an interface. +func (v *OSVsOsvOSV) GetId() string { return v.AllOSVTree.Id } -// GetSlsa returns SLSAForArtifactsIngestSLSAsHasSLSA.Slsa, and is useful for accessing the field via an interface. -func (v *SLSAForArtifactsIngestSLSAsHasSLSA) GetSlsa() allSLSATreeSlsaSLSA { return v.allSLSATree.Slsa } +// GetOsvId returns OSVsOsvOSV.OsvId, and is useful for accessing the field via an interface. +func (v *OSVsOsvOSV) GetOsvId() string { return v.AllOSVTree.OsvId } -func (v *SLSAForArtifactsIngestSLSAsHasSLSA) UnmarshalJSON(b []byte) error { +func (v *OSVsOsvOSV) UnmarshalJSON(b []byte) error { if string(b) == "null" { return nil } var firstPass struct { - *SLSAForArtifactsIngestSLSAsHasSLSA + *OSVsOsvOSV graphql.NoUnmarshalJSON } - firstPass.SLSAForArtifactsIngestSLSAsHasSLSA = v + firstPass.OSVsOsvOSV = v err := json.Unmarshal(b, &firstPass) if err != nil { @@ -18555,22 +18929,20 @@ func (v *SLSAForArtifactsIngestSLSAsHasSLSA) UnmarshalJSON(b []byte) error { } err = json.Unmarshal( - b, &v.allSLSATree) + b, &v.AllOSVTree) if err != nil { return err } return nil } -type __premarshalSLSAForArtifactsIngestSLSAsHasSLSA struct { +type __premarshalOSVsOsvOSV struct { Id string `json:"id"` - Subject allSLSATreeSubjectArtifact `json:"subject"` - - Slsa allSLSATreeSlsaSLSA `json:"slsa"` + OsvId string `json:"osvId"` } -func (v *SLSAForArtifactsIngestSLSAsHasSLSA) MarshalJSON() ([]byte, error) { +func (v *OSVsOsvOSV) MarshalJSON() ([]byte, error) { premarshaled, err := v.__premarshalJSON() if err != nil { return nil, err @@ -18578,229 +18950,115 @@ func (v *SLSAForArtifactsIngestSLSAsHasSLSA) MarshalJSON() ([]byte, error) { return json.Marshal(premarshaled) } -func (v *SLSAForArtifactsIngestSLSAsHasSLSA) __premarshalJSON() (*__premarshalSLSAForArtifactsIngestSLSAsHasSLSA, error) { - var retval __premarshalSLSAForArtifactsIngestSLSAsHasSLSA +func (v *OSVsOsvOSV) __premarshalJSON() (*__premarshalOSVsOsvOSV, error) { + var retval __premarshalOSVsOsvOSV - retval.Id = v.allSLSATree.Id - retval.Subject = v.allSLSATree.Subject - retval.Slsa = v.allSLSATree.Slsa + retval.Id = v.AllOSVTree.Id + retval.OsvId = v.AllOSVTree.OsvId return &retval, nil } -// SLSAForArtifactsResponse is returned by SLSAForArtifacts on success. -type SLSAForArtifactsResponse struct { - // Bulk Ingest SLSA attestations - IngestSLSAs []SLSAForArtifactsIngestSLSAsHasSLSA `json:"ingestSLSAs"` -} - -// GetIngestSLSAs returns SLSAForArtifactsResponse.IngestSLSAs, and is useful for accessing the field via an interface. -func (v *SLSAForArtifactsResponse) GetIngestSLSAs() []SLSAForArtifactsIngestSLSAsHasSLSA { - return v.IngestSLSAs -} - -// SLSAInputSpec is the same as SLSA but for mutation input. -type SLSAInputSpec struct { - BuildType string `json:"buildType"` - SlsaPredicate []SLSAPredicateInputSpec `json:"slsaPredicate"` - SlsaVersion string `json:"slsaVersion"` - StartedOn *time.Time `json:"startedOn"` - FinishedOn *time.Time `json:"finishedOn"` - Origin string `json:"origin"` - Collector string `json:"collector"` +// OSVsResponse is returned by OSVs on success. +type OSVsResponse struct { + // Returns all OSV vulnerabilities matching a filter. + Osv []OSVsOsvOSV `json:"osv"` } -// GetBuildType returns SLSAInputSpec.BuildType, and is useful for accessing the field via an interface. -func (v *SLSAInputSpec) GetBuildType() string { return v.BuildType } - -// GetSlsaPredicate returns SLSAInputSpec.SlsaPredicate, and is useful for accessing the field via an interface. -func (v *SLSAInputSpec) GetSlsaPredicate() []SLSAPredicateInputSpec { return v.SlsaPredicate } - -// GetSlsaVersion returns SLSAInputSpec.SlsaVersion, and is useful for accessing the field via an interface. -func (v *SLSAInputSpec) GetSlsaVersion() string { return v.SlsaVersion } - -// GetStartedOn returns SLSAInputSpec.StartedOn, and is useful for accessing the field via an interface. -func (v *SLSAInputSpec) GetStartedOn() *time.Time { return v.StartedOn } - -// GetFinishedOn returns SLSAInputSpec.FinishedOn, and is useful for accessing the field via an interface. -func (v *SLSAInputSpec) GetFinishedOn() *time.Time { return v.FinishedOn } - -// GetOrigin returns SLSAInputSpec.Origin, and is useful for accessing the field via an interface. -func (v *SLSAInputSpec) GetOrigin() string { return v.Origin } - -// GetCollector returns SLSAInputSpec.Collector, and is useful for accessing the field via an interface. -func (v *SLSAInputSpec) GetCollector() string { return v.Collector } +// GetOsv returns OSVsResponse.Osv, and is useful for accessing the field via an interface. +func (v *OSVsResponse) GetOsv() []OSVsOsvOSV { return v.Osv } -// SLSAPredicateInputSpec allows ingesting SLSAPredicateSpec. -type SLSAPredicateInputSpec struct { +// PackageQualifierInputSpec allows specifying package qualifiers in mutations. +type PackageQualifierInputSpec struct { Key string `json:"key"` Value string `json:"value"` } -// GetKey returns SLSAPredicateInputSpec.Key, and is useful for accessing the field via an interface. -func (v *SLSAPredicateInputSpec) GetKey() string { return v.Key } - -// GetValue returns SLSAPredicateInputSpec.Value, and is useful for accessing the field via an interface. -func (v *SLSAPredicateInputSpec) GetValue() string { return v.Value } - -// ScorecardCheckInputSpec represents the mutation input for a Scorecard check. -type ScorecardCheckInputSpec struct { - Check string `json:"check"` - Score int `json:"score"` -} - -// GetCheck returns ScorecardCheckInputSpec.Check, and is useful for accessing the field via an interface. -func (v *ScorecardCheckInputSpec) GetCheck() string { return v.Check } - -// GetScore returns ScorecardCheckInputSpec.Score, and is useful for accessing the field via an interface. -func (v *ScorecardCheckInputSpec) GetScore() int { return v.Score } - -// ScorecardInputSpec represents the mutation input to ingest a Scorecard. -type ScorecardInputSpec struct { - Checks []ScorecardCheckInputSpec `json:"checks"` - AggregateScore float64 `json:"aggregateScore"` - TimeScanned time.Time `json:"timeScanned"` - ScorecardVersion string `json:"scorecardVersion"` - ScorecardCommit string `json:"scorecardCommit"` - Origin string `json:"origin"` - Collector string `json:"collector"` -} - -// GetChecks returns ScorecardInputSpec.Checks, and is useful for accessing the field via an interface. -func (v *ScorecardInputSpec) GetChecks() []ScorecardCheckInputSpec { return v.Checks } - -// GetAggregateScore returns ScorecardInputSpec.AggregateScore, and is useful for accessing the field via an interface. -func (v *ScorecardInputSpec) GetAggregateScore() float64 { return v.AggregateScore } - -// GetTimeScanned returns ScorecardInputSpec.TimeScanned, and is useful for accessing the field via an interface. -func (v *ScorecardInputSpec) GetTimeScanned() time.Time { return v.TimeScanned } - -// GetScorecardVersion returns ScorecardInputSpec.ScorecardVersion, and is useful for accessing the field via an interface. -func (v *ScorecardInputSpec) GetScorecardVersion() string { return v.ScorecardVersion } - -// GetScorecardCommit returns ScorecardInputSpec.ScorecardCommit, and is useful for accessing the field via an interface. -func (v *ScorecardInputSpec) GetScorecardCommit() string { return v.ScorecardCommit } - -// GetOrigin returns ScorecardInputSpec.Origin, and is useful for accessing the field via an interface. -func (v *ScorecardInputSpec) GetOrigin() string { return v.Origin } +// GetKey returns PackageQualifierInputSpec.Key, and is useful for accessing the field via an interface. +func (v *PackageQualifierInputSpec) GetKey() string { return v.Key } -// GetCollector returns ScorecardInputSpec.Collector, and is useful for accessing the field via an interface. -func (v *ScorecardInputSpec) GetCollector() string { return v.Collector } +// GetValue returns PackageQualifierInputSpec.Value, and is useful for accessing the field via an interface. +func (v *PackageQualifierInputSpec) GetValue() string { return v.Value } -// SourceInputSpec specifies a source for mutations. +// PackageQualifierSpec allows filtering package qualifiers in a query. // -// This is different than SourceSpec because we want to encode that all fields -// except tag and commit are mandatory fields. All optional fields are given empty -// default values. +// Keys are mandatory, but values could also be null if we want to match all +// values for a specific key. // -// It is an error to set both tag and commit fields to values different than the -// default. -type SourceInputSpec struct { - Type string `json:"type"` - Namespace string `json:"namespace"` - Name string `json:"name"` - Tag *string `json:"tag"` - Commit *string `json:"commit"` +// NOTE: Before the schema becomes stable, we might change the nulability +// requirements of these fields. +type PackageQualifierSpec struct { + Key string `json:"key"` + Value *string `json:"value"` } -// GetType returns SourceInputSpec.Type, and is useful for accessing the field via an interface. -func (v *SourceInputSpec) GetType() string { return v.Type } - -// GetNamespace returns SourceInputSpec.Namespace, and is useful for accessing the field via an interface. -func (v *SourceInputSpec) GetNamespace() string { return v.Namespace } - -// GetName returns SourceInputSpec.Name, and is useful for accessing the field via an interface. -func (v *SourceInputSpec) GetName() string { return v.Name } - -// GetTag returns SourceInputSpec.Tag, and is useful for accessing the field via an interface. -func (v *SourceInputSpec) GetTag() *string { return v.Tag } +// GetKey returns PackageQualifierSpec.Key, and is useful for accessing the field via an interface. +func (v *PackageQualifierSpec) GetKey() string { return v.Key } -// GetCommit returns SourceInputSpec.Commit, and is useful for accessing the field via an interface. -func (v *SourceInputSpec) GetCommit() *string { return v.Commit } +// GetValue returns PackageQualifierSpec.Value, and is useful for accessing the field via an interface. +func (v *PackageQualifierSpec) GetValue() *string { return v.Value } -// SourceSpec allows filtering the list of sources to return in a query. -// -// Empty string at a field means matching with the empty string. Missing field -// means retrieving all possible matches. +// PackageSourceOrArtifactSpec allows using PackageSourceOrArtifact union as +// input type to be used in read queries. // -// It is an error to specify both tag and commit fields, except it both are set as -// empty string (in which case the returned sources are only those for which there -// is no tag/commit information). -type SourceSpec struct { - Id *string `json:"id"` - Type *string `json:"type"` - Namespace *string `json:"namespace"` - Name *string `json:"name"` - Tag *string `json:"tag"` - Commit *string `json:"commit"` +// Exactly one of the value must be set to non-nil. +type PackageSourceOrArtifactSpec struct { + Package *PkgSpec `json:"package"` + Source *SourceSpec `json:"source"` + Artifact *ArtifactSpec `json:"artifact"` } -// GetId returns SourceSpec.Id, and is useful for accessing the field via an interface. -func (v *SourceSpec) GetId() *string { return v.Id } - -// GetType returns SourceSpec.Type, and is useful for accessing the field via an interface. -func (v *SourceSpec) GetType() *string { return v.Type } - -// GetNamespace returns SourceSpec.Namespace, and is useful for accessing the field via an interface. -func (v *SourceSpec) GetNamespace() *string { return v.Namespace } - -// GetName returns SourceSpec.Name, and is useful for accessing the field via an interface. -func (v *SourceSpec) GetName() *string { return v.Name } - -// GetTag returns SourceSpec.Tag, and is useful for accessing the field via an interface. -func (v *SourceSpec) GetTag() *string { return v.Tag } - -// GetCommit returns SourceSpec.Commit, and is useful for accessing the field via an interface. -func (v *SourceSpec) GetCommit() *string { return v.Commit } +// GetPackage returns PackageSourceOrArtifactSpec.Package, and is useful for accessing the field via an interface. +func (v *PackageSourceOrArtifactSpec) GetPackage() *PkgSpec { return v.Package } -// SourcesResponse is returned by Sources on success. -type SourcesResponse struct { - // Returns all sources matching a filter. - Sources []SourcesSourcesSource `json:"sources"` -} +// GetSource returns PackageSourceOrArtifactSpec.Source, and is useful for accessing the field via an interface. +func (v *PackageSourceOrArtifactSpec) GetSource() *SourceSpec { return v.Source } -// GetSources returns SourcesResponse.Sources, and is useful for accessing the field via an interface. -func (v *SourcesResponse) GetSources() []SourcesSourcesSource { return v.Sources } +// GetArtifact returns PackageSourceOrArtifactSpec.Artifact, and is useful for accessing the field via an interface. +func (v *PackageSourceOrArtifactSpec) GetArtifact() *ArtifactSpec { return v.Artifact } -// SourcesSourcesSource includes the requested fields of the GraphQL type Source. +// PackagesPackagesPackage includes the requested fields of the GraphQL type Package. // The GraphQL type's documentation follows. // -// Source represents the root of the source trie/tree. +// Package represents the root of the package trie/tree. // -// We map source information to a trie, as a derivative of the pURL specification: -// each path in the trie represents a type, namespace, name and an optional -// qualifier that stands for tag/commit information. +// We map package information to a trie, closely matching the pURL specification +// (https://github.com/package-url/purl-spec/blob/0dd92f26f8bb11956ffdf5e8acfcee71e8560407/README.rst), +// but deviating from it where GUAC heuristics allow for better representation of +// package information. Each path in the trie fully represents a package; we split +// the trie based on the pURL components. // -// This node represents the type part of the trie path. It is used to represent -// the version control system that is being used. +// This node matches a pkg: partial pURL. The type field matches the +// pURL types but we might also use "guac" for the cases where the pURL +// representation is not complete or when we have custom rules. // -// Since this node is at the root of the source trie, it is named Source, not -// SourceType. -type SourcesSourcesSource struct { - AllSourceTree `json:"-"` +// Since this node is at the root of the package trie, it is named Package, not +// PackageType. +type PackagesPackagesPackage struct { + AllPkgTree `json:"-"` } -// GetId returns SourcesSourcesSource.Id, and is useful for accessing the field via an interface. -func (v *SourcesSourcesSource) GetId() string { return v.AllSourceTree.Id } +// GetId returns PackagesPackagesPackage.Id, and is useful for accessing the field via an interface. +func (v *PackagesPackagesPackage) GetId() string { return v.AllPkgTree.Id } -// GetType returns SourcesSourcesSource.Type, and is useful for accessing the field via an interface. -func (v *SourcesSourcesSource) GetType() string { return v.AllSourceTree.Type } +// GetType returns PackagesPackagesPackage.Type, and is useful for accessing the field via an interface. +func (v *PackagesPackagesPackage) GetType() string { return v.AllPkgTree.Type } -// GetNamespaces returns SourcesSourcesSource.Namespaces, and is useful for accessing the field via an interface. -func (v *SourcesSourcesSource) GetNamespaces() []AllSourceTreeNamespacesSourceNamespace { - return v.AllSourceTree.Namespaces +// GetNamespaces returns PackagesPackagesPackage.Namespaces, and is useful for accessing the field via an interface. +func (v *PackagesPackagesPackage) GetNamespaces() []AllPkgTreeNamespacesPackageNamespace { + return v.AllPkgTree.Namespaces } -func (v *SourcesSourcesSource) UnmarshalJSON(b []byte) error { +func (v *PackagesPackagesPackage) UnmarshalJSON(b []byte) error { if string(b) == "null" { return nil } var firstPass struct { - *SourcesSourcesSource + *PackagesPackagesPackage graphql.NoUnmarshalJSON } - firstPass.SourcesSourcesSource = v + firstPass.PackagesPackagesPackage = v err := json.Unmarshal(b, &firstPass) if err != nil { @@ -18808,22 +19066,22 @@ func (v *SourcesSourcesSource) UnmarshalJSON(b []byte) error { } err = json.Unmarshal( - b, &v.AllSourceTree) + b, &v.AllPkgTree) if err != nil { return err } return nil } -type __premarshalSourcesSourcesSource struct { +type __premarshalPackagesPackagesPackage struct { Id string `json:"id"` Type string `json:"type"` - Namespaces []AllSourceTreeNamespacesSourceNamespace `json:"namespaces"` + Namespaces []AllPkgTreeNamespacesPackageNamespace `json:"namespaces"` } -func (v *SourcesSourcesSource) MarshalJSON() ([]byte, error) { +func (v *PackagesPackagesPackage) MarshalJSON() ([]byte, error) { premarshaled, err := v.__premarshalJSON() if err != nil { return nil, err @@ -18831,85 +19089,62 @@ func (v *SourcesSourcesSource) MarshalJSON() ([]byte, error) { return json.Marshal(premarshaled) } -func (v *SourcesSourcesSource) __premarshalJSON() (*__premarshalSourcesSourcesSource, error) { - var retval __premarshalSourcesSourcesSource +func (v *PackagesPackagesPackage) __premarshalJSON() (*__premarshalPackagesPackagesPackage, error) { + var retval __premarshalPackagesPackagesPackage - retval.Id = v.AllSourceTree.Id - retval.Type = v.AllSourceTree.Type - retval.Namespaces = v.AllSourceTree.Namespaces + retval.Id = v.AllPkgTree.Id + retval.Type = v.AllPkgTree.Type + retval.Namespaces = v.AllPkgTree.Namespaces return &retval, nil } -// VEXPackageAndGhsaIngestVEXStatementCertifyVEXStatement includes the requested fields of the GraphQL type CertifyVEXStatement. -// The GraphQL type's documentation follows. -// -// CertifyVEXStatement is an attestation to attach VEX statements to a package or -// artifact to clarify the impact of a specific vulnerability (CVE, GHSA or OSV). -type VEXPackageAndGhsaIngestVEXStatementCertifyVEXStatement struct { - allCertifyVEXStatement `json:"-"` -} - -// GetId returns VEXPackageAndGhsaIngestVEXStatementCertifyVEXStatement.Id, and is useful for accessing the field via an interface. -func (v *VEXPackageAndGhsaIngestVEXStatementCertifyVEXStatement) GetId() string { - return v.allCertifyVEXStatement.Id -} - -// GetSubject returns VEXPackageAndGhsaIngestVEXStatementCertifyVEXStatement.Subject, and is useful for accessing the field via an interface. -func (v *VEXPackageAndGhsaIngestVEXStatementCertifyVEXStatement) GetSubject() allCertifyVEXStatementSubjectPackageOrArtifact { - return v.allCertifyVEXStatement.Subject -} - -// GetVulnerability returns VEXPackageAndGhsaIngestVEXStatementCertifyVEXStatement.Vulnerability, and is useful for accessing the field via an interface. -func (v *VEXPackageAndGhsaIngestVEXStatementCertifyVEXStatement) GetVulnerability() allCertifyVEXStatementVulnerability { - return v.allCertifyVEXStatement.Vulnerability -} - -// GetStatus returns VEXPackageAndGhsaIngestVEXStatementCertifyVEXStatement.Status, and is useful for accessing the field via an interface. -func (v *VEXPackageAndGhsaIngestVEXStatementCertifyVEXStatement) GetStatus() VexStatus { - return v.allCertifyVEXStatement.Status +// PackagesResponse is returned by Packages on success. +type PackagesResponse struct { + // Returns all packages matching a filter. + Packages []PackagesPackagesPackage `json:"packages"` } -// GetVexJustification returns VEXPackageAndGhsaIngestVEXStatementCertifyVEXStatement.VexJustification, and is useful for accessing the field via an interface. -func (v *VEXPackageAndGhsaIngestVEXStatementCertifyVEXStatement) GetVexJustification() VexJustification { - return v.allCertifyVEXStatement.VexJustification -} +// GetPackages returns PackagesResponse.Packages, and is useful for accessing the field via an interface. +func (v *PackagesResponse) GetPackages() []PackagesPackagesPackage { return v.Packages } -// GetStatement returns VEXPackageAndGhsaIngestVEXStatementCertifyVEXStatement.Statement, and is useful for accessing the field via an interface. -func (v *VEXPackageAndGhsaIngestVEXStatementCertifyVEXStatement) GetStatement() string { - return v.allCertifyVEXStatement.Statement +// PathPathArtifact includes the requested fields of the GraphQL type Artifact. +// The GraphQL type's documentation follows. +// +// Artifact represents an artifact identified by a checksum hash. +// +// The checksum is split into the digest value and the algorithm used to generate +// it. Both fields are mandatory and canonicalized to be lowercase. +// +// If having a checksum Go object, algorithm can be +// strings.ToLower(string(checksum.Algorithm)) and digest can be checksum.Value. +type PathPathArtifact struct { + Typename *string `json:"__typename"` + AllArtifactTree `json:"-"` } -// GetStatusNotes returns VEXPackageAndGhsaIngestVEXStatementCertifyVEXStatement.StatusNotes, and is useful for accessing the field via an interface. -func (v *VEXPackageAndGhsaIngestVEXStatementCertifyVEXStatement) GetStatusNotes() string { - return v.allCertifyVEXStatement.StatusNotes -} +// GetTypename returns PathPathArtifact.Typename, and is useful for accessing the field via an interface. +func (v *PathPathArtifact) GetTypename() *string { return v.Typename } -// GetKnownSince returns VEXPackageAndGhsaIngestVEXStatementCertifyVEXStatement.KnownSince, and is useful for accessing the field via an interface. -func (v *VEXPackageAndGhsaIngestVEXStatementCertifyVEXStatement) GetKnownSince() time.Time { - return v.allCertifyVEXStatement.KnownSince -} +// GetId returns PathPathArtifact.Id, and is useful for accessing the field via an interface. +func (v *PathPathArtifact) GetId() string { return v.AllArtifactTree.Id } -// GetOrigin returns VEXPackageAndGhsaIngestVEXStatementCertifyVEXStatement.Origin, and is useful for accessing the field via an interface. -func (v *VEXPackageAndGhsaIngestVEXStatementCertifyVEXStatement) GetOrigin() string { - return v.allCertifyVEXStatement.Origin -} +// GetAlgorithm returns PathPathArtifact.Algorithm, and is useful for accessing the field via an interface. +func (v *PathPathArtifact) GetAlgorithm() string { return v.AllArtifactTree.Algorithm } -// GetCollector returns VEXPackageAndGhsaIngestVEXStatementCertifyVEXStatement.Collector, and is useful for accessing the field via an interface. -func (v *VEXPackageAndGhsaIngestVEXStatementCertifyVEXStatement) GetCollector() string { - return v.allCertifyVEXStatement.Collector -} +// GetDigest returns PathPathArtifact.Digest, and is useful for accessing the field via an interface. +func (v *PathPathArtifact) GetDigest() string { return v.AllArtifactTree.Digest } -func (v *VEXPackageAndGhsaIngestVEXStatementCertifyVEXStatement) UnmarshalJSON(b []byte) error { +func (v *PathPathArtifact) UnmarshalJSON(b []byte) error { if string(b) == "null" { return nil } var firstPass struct { - *VEXPackageAndGhsaIngestVEXStatementCertifyVEXStatement + *PathPathArtifact graphql.NoUnmarshalJSON } - firstPass.VEXPackageAndGhsaIngestVEXStatementCertifyVEXStatement = v + firstPass.PathPathArtifact = v err := json.Unmarshal(b, &firstPass) if err != nil { @@ -18917,36 +19152,24 @@ func (v *VEXPackageAndGhsaIngestVEXStatementCertifyVEXStatement) UnmarshalJSON(b } err = json.Unmarshal( - b, &v.allCertifyVEXStatement) + b, &v.AllArtifactTree) if err != nil { return err } return nil } -type __premarshalVEXPackageAndGhsaIngestVEXStatementCertifyVEXStatement struct { - Id string `json:"id"` - - Subject json.RawMessage `json:"subject"` - - Vulnerability json.RawMessage `json:"vulnerability"` - - Status VexStatus `json:"status"` - - VexJustification VexJustification `json:"vexJustification"` - - Statement string `json:"statement"` - - StatusNotes string `json:"statusNotes"` +type __premarshalPathPathArtifact struct { + Typename *string `json:"__typename"` - KnownSince time.Time `json:"knownSince"` + Id string `json:"id"` - Origin string `json:"origin"` + Algorithm string `json:"algorithm"` - Collector string `json:"collector"` + Digest string `json:"digest"` } -func (v *VEXPackageAndGhsaIngestVEXStatementCertifyVEXStatement) MarshalJSON() ([]byte, error) { +func (v *PathPathArtifact) MarshalJSON() ([]byte, error) { premarshaled, err := v.__premarshalJSON() if err != nil { return nil, err @@ -18954,125 +19177,127 @@ func (v *VEXPackageAndGhsaIngestVEXStatementCertifyVEXStatement) MarshalJSON() ( return json.Marshal(premarshaled) } -func (v *VEXPackageAndGhsaIngestVEXStatementCertifyVEXStatement) __premarshalJSON() (*__premarshalVEXPackageAndGhsaIngestVEXStatementCertifyVEXStatement, error) { - var retval __premarshalVEXPackageAndGhsaIngestVEXStatementCertifyVEXStatement - - retval.Id = v.allCertifyVEXStatement.Id - { - - dst := &retval.Subject - src := v.allCertifyVEXStatement.Subject - var err error - *dst, err = __marshalallCertifyVEXStatementSubjectPackageOrArtifact( - &src) - if err != nil { - return nil, fmt.Errorf( - "unable to marshal VEXPackageAndGhsaIngestVEXStatementCertifyVEXStatement.allCertifyVEXStatement.Subject: %w", err) - } - } - { +func (v *PathPathArtifact) __premarshalJSON() (*__premarshalPathPathArtifact, error) { + var retval __premarshalPathPathArtifact - dst := &retval.Vulnerability - src := v.allCertifyVEXStatement.Vulnerability - var err error - *dst, err = __marshalallCertifyVEXStatementVulnerability( - &src) - if err != nil { - return nil, fmt.Errorf( - "unable to marshal VEXPackageAndGhsaIngestVEXStatementCertifyVEXStatement.allCertifyVEXStatement.Vulnerability: %w", err) - } - } - retval.Status = v.allCertifyVEXStatement.Status - retval.VexJustification = v.allCertifyVEXStatement.VexJustification - retval.Statement = v.allCertifyVEXStatement.Statement - retval.StatusNotes = v.allCertifyVEXStatement.StatusNotes - retval.KnownSince = v.allCertifyVEXStatement.KnownSince - retval.Origin = v.allCertifyVEXStatement.Origin - retval.Collector = v.allCertifyVEXStatement.Collector + retval.Typename = v.Typename + retval.Id = v.AllArtifactTree.Id + retval.Algorithm = v.AllArtifactTree.Algorithm + retval.Digest = v.AllArtifactTree.Digest return &retval, nil } -// VEXPackageAndGhsaResponse is returned by VEXPackageAndGhsa on success. -type VEXPackageAndGhsaResponse struct { - // Adds a VEX certification for a package. - IngestVEXStatement VEXPackageAndGhsaIngestVEXStatementCertifyVEXStatement `json:"ingestVEXStatement"` -} - -// GetIngestVEXStatement returns VEXPackageAndGhsaResponse.IngestVEXStatement, and is useful for accessing the field via an interface. -func (v *VEXPackageAndGhsaResponse) GetIngestVEXStatement() VEXPackageAndGhsaIngestVEXStatementCertifyVEXStatement { - return v.IngestVEXStatement -} - -// VexArtifactAndCveIngestVEXStatementCertifyVEXStatement includes the requested fields of the GraphQL type CertifyVEXStatement. +// PathPathBuilder includes the requested fields of the GraphQL type Builder. // The GraphQL type's documentation follows. // -// CertifyVEXStatement is an attestation to attach VEX statements to a package or -// artifact to clarify the impact of a specific vulnerability (CVE, GHSA or OSV). -type VexArtifactAndCveIngestVEXStatementCertifyVEXStatement struct { - allCertifyVEXStatement `json:"-"` +// Builder represents the builder (e.g., FRSCA or GitHub Actions). +// +// Currently builders are identified by the uri field. +type PathPathBuilder struct { + Typename *string `json:"__typename"` + AllBuilderTree `json:"-"` } -// GetId returns VexArtifactAndCveIngestVEXStatementCertifyVEXStatement.Id, and is useful for accessing the field via an interface. -func (v *VexArtifactAndCveIngestVEXStatementCertifyVEXStatement) GetId() string { - return v.allCertifyVEXStatement.Id -} +// GetTypename returns PathPathBuilder.Typename, and is useful for accessing the field via an interface. +func (v *PathPathBuilder) GetTypename() *string { return v.Typename } -// GetSubject returns VexArtifactAndCveIngestVEXStatementCertifyVEXStatement.Subject, and is useful for accessing the field via an interface. -func (v *VexArtifactAndCveIngestVEXStatementCertifyVEXStatement) GetSubject() allCertifyVEXStatementSubjectPackageOrArtifact { - return v.allCertifyVEXStatement.Subject -} +// GetId returns PathPathBuilder.Id, and is useful for accessing the field via an interface. +func (v *PathPathBuilder) GetId() string { return v.AllBuilderTree.Id } -// GetVulnerability returns VexArtifactAndCveIngestVEXStatementCertifyVEXStatement.Vulnerability, and is useful for accessing the field via an interface. -func (v *VexArtifactAndCveIngestVEXStatementCertifyVEXStatement) GetVulnerability() allCertifyVEXStatementVulnerability { - return v.allCertifyVEXStatement.Vulnerability -} +// GetUri returns PathPathBuilder.Uri, and is useful for accessing the field via an interface. +func (v *PathPathBuilder) GetUri() string { return v.AllBuilderTree.Uri } -// GetStatus returns VexArtifactAndCveIngestVEXStatementCertifyVEXStatement.Status, and is useful for accessing the field via an interface. -func (v *VexArtifactAndCveIngestVEXStatementCertifyVEXStatement) GetStatus() VexStatus { - return v.allCertifyVEXStatement.Status -} +func (v *PathPathBuilder) UnmarshalJSON(b []byte) error { -// GetVexJustification returns VexArtifactAndCveIngestVEXStatementCertifyVEXStatement.VexJustification, and is useful for accessing the field via an interface. -func (v *VexArtifactAndCveIngestVEXStatementCertifyVEXStatement) GetVexJustification() VexJustification { - return v.allCertifyVEXStatement.VexJustification + if string(b) == "null" { + return nil + } + + var firstPass struct { + *PathPathBuilder + graphql.NoUnmarshalJSON + } + firstPass.PathPathBuilder = v + + err := json.Unmarshal(b, &firstPass) + if err != nil { + return err + } + + err = json.Unmarshal( + b, &v.AllBuilderTree) + if err != nil { + return err + } + return nil } -// GetStatement returns VexArtifactAndCveIngestVEXStatementCertifyVEXStatement.Statement, and is useful for accessing the field via an interface. -func (v *VexArtifactAndCveIngestVEXStatementCertifyVEXStatement) GetStatement() string { - return v.allCertifyVEXStatement.Statement +type __premarshalPathPathBuilder struct { + Typename *string `json:"__typename"` + + Id string `json:"id"` + + Uri string `json:"uri"` } -// GetStatusNotes returns VexArtifactAndCveIngestVEXStatementCertifyVEXStatement.StatusNotes, and is useful for accessing the field via an interface. -func (v *VexArtifactAndCveIngestVEXStatementCertifyVEXStatement) GetStatusNotes() string { - return v.allCertifyVEXStatement.StatusNotes +func (v *PathPathBuilder) MarshalJSON() ([]byte, error) { + premarshaled, err := v.__premarshalJSON() + if err != nil { + return nil, err + } + return json.Marshal(premarshaled) } -// GetKnownSince returns VexArtifactAndCveIngestVEXStatementCertifyVEXStatement.KnownSince, and is useful for accessing the field via an interface. -func (v *VexArtifactAndCveIngestVEXStatementCertifyVEXStatement) GetKnownSince() time.Time { - return v.allCertifyVEXStatement.KnownSince +func (v *PathPathBuilder) __premarshalJSON() (*__premarshalPathPathBuilder, error) { + var retval __premarshalPathPathBuilder + + retval.Typename = v.Typename + retval.Id = v.AllBuilderTree.Id + retval.Uri = v.AllBuilderTree.Uri + return &retval, nil } -// GetOrigin returns VexArtifactAndCveIngestVEXStatementCertifyVEXStatement.Origin, and is useful for accessing the field via an interface. -func (v *VexArtifactAndCveIngestVEXStatementCertifyVEXStatement) GetOrigin() string { - return v.allCertifyVEXStatement.Origin +// PathPathCVE includes the requested fields of the GraphQL type CVE. +// The GraphQL type's documentation follows. +// +// CVE represents a vulnerability in the Common Vulnerabilities and Exposures +// schema. +// +// The vulnerability identifier contains a year field, so we are extracting that +// to allow matching for vulnerabilities found in a given year. +// +// The vulnerability identifier field is mandatory and canonicalized to be +// lowercase. +// +// This node can be referred to by other parts of GUAC. +type PathPathCVE struct { + Typename *string `json:"__typename"` + AllCveTree `json:"-"` } -// GetCollector returns VexArtifactAndCveIngestVEXStatementCertifyVEXStatement.Collector, and is useful for accessing the field via an interface. -func (v *VexArtifactAndCveIngestVEXStatementCertifyVEXStatement) GetCollector() string { - return v.allCertifyVEXStatement.Collector -} +// GetTypename returns PathPathCVE.Typename, and is useful for accessing the field via an interface. +func (v *PathPathCVE) GetTypename() *string { return v.Typename } -func (v *VexArtifactAndCveIngestVEXStatementCertifyVEXStatement) UnmarshalJSON(b []byte) error { +// GetId returns PathPathCVE.Id, and is useful for accessing the field via an interface. +func (v *PathPathCVE) GetId() string { return v.AllCveTree.Id } + +// GetYear returns PathPathCVE.Year, and is useful for accessing the field via an interface. +func (v *PathPathCVE) GetYear() int { return v.AllCveTree.Year } + +// GetCveId returns PathPathCVE.CveId, and is useful for accessing the field via an interface. +func (v *PathPathCVE) GetCveId() string { return v.AllCveTree.CveId } + +func (v *PathPathCVE) UnmarshalJSON(b []byte) error { if string(b) == "null" { return nil } var firstPass struct { - *VexArtifactAndCveIngestVEXStatementCertifyVEXStatement + *PathPathCVE graphql.NoUnmarshalJSON } - firstPass.VexArtifactAndCveIngestVEXStatementCertifyVEXStatement = v + firstPass.PathPathCVE = v err := json.Unmarshal(b, &firstPass) if err != nil { @@ -19080,36 +19305,24 @@ func (v *VexArtifactAndCveIngestVEXStatementCertifyVEXStatement) UnmarshalJSON(b } err = json.Unmarshal( - b, &v.allCertifyVEXStatement) + b, &v.AllCveTree) if err != nil { return err } return nil } -type __premarshalVexArtifactAndCveIngestVEXStatementCertifyVEXStatement struct { - Id string `json:"id"` - - Subject json.RawMessage `json:"subject"` - - Vulnerability json.RawMessage `json:"vulnerability"` - - Status VexStatus `json:"status"` - - VexJustification VexJustification `json:"vexJustification"` - - Statement string `json:"statement"` - - StatusNotes string `json:"statusNotes"` +type __premarshalPathPathCVE struct { + Typename *string `json:"__typename"` - KnownSince time.Time `json:"knownSince"` + Id string `json:"id"` - Origin string `json:"origin"` + Year int `json:"year"` - Collector string `json:"collector"` + CveId string `json:"cveId"` } -func (v *VexArtifactAndCveIngestVEXStatementCertifyVEXStatement) MarshalJSON() ([]byte, error) { +func (v *PathPathCVE) MarshalJSON() ([]byte, error) { premarshaled, err := v.__premarshalJSON() if err != nil { return nil, err @@ -19117,125 +19330,66 @@ func (v *VexArtifactAndCveIngestVEXStatementCertifyVEXStatement) MarshalJSON() ( return json.Marshal(premarshaled) } -func (v *VexArtifactAndCveIngestVEXStatementCertifyVEXStatement) __premarshalJSON() (*__premarshalVexArtifactAndCveIngestVEXStatementCertifyVEXStatement, error) { - var retval __premarshalVexArtifactAndCveIngestVEXStatementCertifyVEXStatement - - retval.Id = v.allCertifyVEXStatement.Id - { - - dst := &retval.Subject - src := v.allCertifyVEXStatement.Subject - var err error - *dst, err = __marshalallCertifyVEXStatementSubjectPackageOrArtifact( - &src) - if err != nil { - return nil, fmt.Errorf( - "unable to marshal VexArtifactAndCveIngestVEXStatementCertifyVEXStatement.allCertifyVEXStatement.Subject: %w", err) - } - } - { +func (v *PathPathCVE) __premarshalJSON() (*__premarshalPathPathCVE, error) { + var retval __premarshalPathPathCVE - dst := &retval.Vulnerability - src := v.allCertifyVEXStatement.Vulnerability - var err error - *dst, err = __marshalallCertifyVEXStatementVulnerability( - &src) - if err != nil { - return nil, fmt.Errorf( - "unable to marshal VexArtifactAndCveIngestVEXStatementCertifyVEXStatement.allCertifyVEXStatement.Vulnerability: %w", err) - } - } - retval.Status = v.allCertifyVEXStatement.Status - retval.VexJustification = v.allCertifyVEXStatement.VexJustification - retval.Statement = v.allCertifyVEXStatement.Statement - retval.StatusNotes = v.allCertifyVEXStatement.StatusNotes - retval.KnownSince = v.allCertifyVEXStatement.KnownSince - retval.Origin = v.allCertifyVEXStatement.Origin - retval.Collector = v.allCertifyVEXStatement.Collector + retval.Typename = v.Typename + retval.Id = v.AllCveTree.Id + retval.Year = v.AllCveTree.Year + retval.CveId = v.AllCveTree.CveId return &retval, nil } -// VexArtifactAndCveResponse is returned by VexArtifactAndCve on success. -type VexArtifactAndCveResponse struct { - // Adds a VEX certification for a package. - IngestVEXStatement VexArtifactAndCveIngestVEXStatementCertifyVEXStatement `json:"ingestVEXStatement"` -} - -// GetIngestVEXStatement returns VexArtifactAndCveResponse.IngestVEXStatement, and is useful for accessing the field via an interface. -func (v *VexArtifactAndCveResponse) GetIngestVEXStatement() VexArtifactAndCveIngestVEXStatementCertifyVEXStatement { - return v.IngestVEXStatement -} - -// VexArtifactAndGhsaIngestVEXStatementCertifyVEXStatement includes the requested fields of the GraphQL type CertifyVEXStatement. +// PathPathCertifyBad includes the requested fields of the GraphQL type CertifyBad. // The GraphQL type's documentation follows. // -// CertifyVEXStatement is an attestation to attach VEX statements to a package or -// artifact to clarify the impact of a specific vulnerability (CVE, GHSA or OSV). -type VexArtifactAndGhsaIngestVEXStatementCertifyVEXStatement struct { - allCertifyVEXStatement `json:"-"` -} - -// GetId returns VexArtifactAndGhsaIngestVEXStatementCertifyVEXStatement.Id, and is useful for accessing the field via an interface. -func (v *VexArtifactAndGhsaIngestVEXStatementCertifyVEXStatement) GetId() string { - return v.allCertifyVEXStatement.Id -} - -// GetSubject returns VexArtifactAndGhsaIngestVEXStatementCertifyVEXStatement.Subject, and is useful for accessing the field via an interface. -func (v *VexArtifactAndGhsaIngestVEXStatementCertifyVEXStatement) GetSubject() allCertifyVEXStatementSubjectPackageOrArtifact { - return v.allCertifyVEXStatement.Subject -} - -// GetVulnerability returns VexArtifactAndGhsaIngestVEXStatementCertifyVEXStatement.Vulnerability, and is useful for accessing the field via an interface. -func (v *VexArtifactAndGhsaIngestVEXStatementCertifyVEXStatement) GetVulnerability() allCertifyVEXStatementVulnerability { - return v.allCertifyVEXStatement.Vulnerability -} - -// GetStatus returns VexArtifactAndGhsaIngestVEXStatementCertifyVEXStatement.Status, and is useful for accessing the field via an interface. -func (v *VexArtifactAndGhsaIngestVEXStatementCertifyVEXStatement) GetStatus() VexStatus { - return v.allCertifyVEXStatement.Status +// CertifyBad is an attestation that a package, source, or artifact is considered +// bad. +// +// All evidence trees record a justification for the property they represent as +// well as the document that contains the attestation (origin) and the collector +// that collected the document (collector). +// +// The certification applies to a subject which is a package, source, or artifact. +// If the attestation targets a package, it must target a PackageName or a +// PackageVersion. If the attestation targets a source, it must target a +// SourceName. +type PathPathCertifyBad struct { + Typename *string `json:"__typename"` + AllCertifyBad `json:"-"` } -// GetVexJustification returns VexArtifactAndGhsaIngestVEXStatementCertifyVEXStatement.VexJustification, and is useful for accessing the field via an interface. -func (v *VexArtifactAndGhsaIngestVEXStatementCertifyVEXStatement) GetVexJustification() VexJustification { - return v.allCertifyVEXStatement.VexJustification -} +// GetTypename returns PathPathCertifyBad.Typename, and is useful for accessing the field via an interface. +func (v *PathPathCertifyBad) GetTypename() *string { return v.Typename } -// GetStatement returns VexArtifactAndGhsaIngestVEXStatementCertifyVEXStatement.Statement, and is useful for accessing the field via an interface. -func (v *VexArtifactAndGhsaIngestVEXStatementCertifyVEXStatement) GetStatement() string { - return v.allCertifyVEXStatement.Statement -} +// GetId returns PathPathCertifyBad.Id, and is useful for accessing the field via an interface. +func (v *PathPathCertifyBad) GetId() string { return v.AllCertifyBad.Id } -// GetStatusNotes returns VexArtifactAndGhsaIngestVEXStatementCertifyVEXStatement.StatusNotes, and is useful for accessing the field via an interface. -func (v *VexArtifactAndGhsaIngestVEXStatementCertifyVEXStatement) GetStatusNotes() string { - return v.allCertifyVEXStatement.StatusNotes -} +// GetJustification returns PathPathCertifyBad.Justification, and is useful for accessing the field via an interface. +func (v *PathPathCertifyBad) GetJustification() string { return v.AllCertifyBad.Justification } -// GetKnownSince returns VexArtifactAndGhsaIngestVEXStatementCertifyVEXStatement.KnownSince, and is useful for accessing the field via an interface. -func (v *VexArtifactAndGhsaIngestVEXStatementCertifyVEXStatement) GetKnownSince() time.Time { - return v.allCertifyVEXStatement.KnownSince +// GetSubject returns PathPathCertifyBad.Subject, and is useful for accessing the field via an interface. +func (v *PathPathCertifyBad) GetSubject() AllCertifyBadSubjectPackageSourceOrArtifact { + return v.AllCertifyBad.Subject } -// GetOrigin returns VexArtifactAndGhsaIngestVEXStatementCertifyVEXStatement.Origin, and is useful for accessing the field via an interface. -func (v *VexArtifactAndGhsaIngestVEXStatementCertifyVEXStatement) GetOrigin() string { - return v.allCertifyVEXStatement.Origin -} +// GetOrigin returns PathPathCertifyBad.Origin, and is useful for accessing the field via an interface. +func (v *PathPathCertifyBad) GetOrigin() string { return v.AllCertifyBad.Origin } -// GetCollector returns VexArtifactAndGhsaIngestVEXStatementCertifyVEXStatement.Collector, and is useful for accessing the field via an interface. -func (v *VexArtifactAndGhsaIngestVEXStatementCertifyVEXStatement) GetCollector() string { - return v.allCertifyVEXStatement.Collector -} +// GetCollector returns PathPathCertifyBad.Collector, and is useful for accessing the field via an interface. +func (v *PathPathCertifyBad) GetCollector() string { return v.AllCertifyBad.Collector } -func (v *VexArtifactAndGhsaIngestVEXStatementCertifyVEXStatement) UnmarshalJSON(b []byte) error { +func (v *PathPathCertifyBad) UnmarshalJSON(b []byte) error { if string(b) == "null" { return nil } var firstPass struct { - *VexArtifactAndGhsaIngestVEXStatementCertifyVEXStatement + *PathPathCertifyBad graphql.NoUnmarshalJSON } - firstPass.VexArtifactAndGhsaIngestVEXStatementCertifyVEXStatement = v + firstPass.PathPathCertifyBad = v err := json.Unmarshal(b, &firstPass) if err != nil { @@ -19243,36 +19397,28 @@ func (v *VexArtifactAndGhsaIngestVEXStatementCertifyVEXStatement) UnmarshalJSON( } err = json.Unmarshal( - b, &v.allCertifyVEXStatement) + b, &v.AllCertifyBad) if err != nil { return err } return nil } -type __premarshalVexArtifactAndGhsaIngestVEXStatementCertifyVEXStatement struct { - Id string `json:"id"` - - Subject json.RawMessage `json:"subject"` - - Vulnerability json.RawMessage `json:"vulnerability"` - - Status VexStatus `json:"status"` - - VexJustification VexJustification `json:"vexJustification"` +type __premarshalPathPathCertifyBad struct { + Typename *string `json:"__typename"` - Statement string `json:"statement"` + Id string `json:"id"` - StatusNotes string `json:"statusNotes"` + Justification string `json:"justification"` - KnownSince time.Time `json:"knownSince"` + Subject json.RawMessage `json:"subject"` Origin string `json:"origin"` Collector string `json:"collector"` } -func (v *VexArtifactAndGhsaIngestVEXStatementCertifyVEXStatement) MarshalJSON() ([]byte, error) { +func (v *PathPathCertifyBad) MarshalJSON() ([]byte, error) { premarshaled, err := v.__premarshalJSON() if err != nil { return nil, err @@ -19280,125 +19426,79 @@ func (v *VexArtifactAndGhsaIngestVEXStatementCertifyVEXStatement) MarshalJSON() return json.Marshal(premarshaled) } -func (v *VexArtifactAndGhsaIngestVEXStatementCertifyVEXStatement) __premarshalJSON() (*__premarshalVexArtifactAndGhsaIngestVEXStatementCertifyVEXStatement, error) { - var retval __premarshalVexArtifactAndGhsaIngestVEXStatementCertifyVEXStatement +func (v *PathPathCertifyBad) __premarshalJSON() (*__premarshalPathPathCertifyBad, error) { + var retval __premarshalPathPathCertifyBad - retval.Id = v.allCertifyVEXStatement.Id + retval.Typename = v.Typename + retval.Id = v.AllCertifyBad.Id + retval.Justification = v.AllCertifyBad.Justification { dst := &retval.Subject - src := v.allCertifyVEXStatement.Subject - var err error - *dst, err = __marshalallCertifyVEXStatementSubjectPackageOrArtifact( - &src) - if err != nil { - return nil, fmt.Errorf( - "unable to marshal VexArtifactAndGhsaIngestVEXStatementCertifyVEXStatement.allCertifyVEXStatement.Subject: %w", err) - } - } - { - - dst := &retval.Vulnerability - src := v.allCertifyVEXStatement.Vulnerability + src := v.AllCertifyBad.Subject var err error - *dst, err = __marshalallCertifyVEXStatementVulnerability( + *dst, err = __marshalAllCertifyBadSubjectPackageSourceOrArtifact( &src) if err != nil { return nil, fmt.Errorf( - "unable to marshal VexArtifactAndGhsaIngestVEXStatementCertifyVEXStatement.allCertifyVEXStatement.Vulnerability: %w", err) + "unable to marshal PathPathCertifyBad.AllCertifyBad.Subject: %w", err) } } - retval.Status = v.allCertifyVEXStatement.Status - retval.VexJustification = v.allCertifyVEXStatement.VexJustification - retval.Statement = v.allCertifyVEXStatement.Statement - retval.StatusNotes = v.allCertifyVEXStatement.StatusNotes - retval.KnownSince = v.allCertifyVEXStatement.KnownSince - retval.Origin = v.allCertifyVEXStatement.Origin - retval.Collector = v.allCertifyVEXStatement.Collector + retval.Origin = v.AllCertifyBad.Origin + retval.Collector = v.AllCertifyBad.Collector return &retval, nil } -// VexArtifactAndGhsaResponse is returned by VexArtifactAndGhsa on success. -type VexArtifactAndGhsaResponse struct { - // Adds a VEX certification for a package. - IngestVEXStatement VexArtifactAndGhsaIngestVEXStatementCertifyVEXStatement `json:"ingestVEXStatement"` -} - -// GetIngestVEXStatement returns VexArtifactAndGhsaResponse.IngestVEXStatement, and is useful for accessing the field via an interface. -func (v *VexArtifactAndGhsaResponse) GetIngestVEXStatement() VexArtifactAndGhsaIngestVEXStatementCertifyVEXStatement { - return v.IngestVEXStatement -} - -// VexArtifactAndOsvIngestVEXStatementCertifyVEXStatement includes the requested fields of the GraphQL type CertifyVEXStatement. +// PathPathCertifyGood includes the requested fields of the GraphQL type CertifyGood. // The GraphQL type's documentation follows. // -// CertifyVEXStatement is an attestation to attach VEX statements to a package or -// artifact to clarify the impact of a specific vulnerability (CVE, GHSA or OSV). -type VexArtifactAndOsvIngestVEXStatementCertifyVEXStatement struct { - allCertifyVEXStatement `json:"-"` -} - -// GetId returns VexArtifactAndOsvIngestVEXStatementCertifyVEXStatement.Id, and is useful for accessing the field via an interface. -func (v *VexArtifactAndOsvIngestVEXStatementCertifyVEXStatement) GetId() string { - return v.allCertifyVEXStatement.Id -} - -// GetSubject returns VexArtifactAndOsvIngestVEXStatementCertifyVEXStatement.Subject, and is useful for accessing the field via an interface. -func (v *VexArtifactAndOsvIngestVEXStatementCertifyVEXStatement) GetSubject() allCertifyVEXStatementSubjectPackageOrArtifact { - return v.allCertifyVEXStatement.Subject -} - -// GetVulnerability returns VexArtifactAndOsvIngestVEXStatementCertifyVEXStatement.Vulnerability, and is useful for accessing the field via an interface. -func (v *VexArtifactAndOsvIngestVEXStatementCertifyVEXStatement) GetVulnerability() allCertifyVEXStatementVulnerability { - return v.allCertifyVEXStatement.Vulnerability -} - -// GetStatus returns VexArtifactAndOsvIngestVEXStatementCertifyVEXStatement.Status, and is useful for accessing the field via an interface. -func (v *VexArtifactAndOsvIngestVEXStatementCertifyVEXStatement) GetStatus() VexStatus { - return v.allCertifyVEXStatement.Status -} - -// GetVexJustification returns VexArtifactAndOsvIngestVEXStatementCertifyVEXStatement.VexJustification, and is useful for accessing the field via an interface. -func (v *VexArtifactAndOsvIngestVEXStatementCertifyVEXStatement) GetVexJustification() VexJustification { - return v.allCertifyVEXStatement.VexJustification +// CertifyGood is an attestation that a package, source, or artifact is considered +// good. +// +// All evidence trees record a justification for the property they represent as +// well as the document that contains the attestation (origin) and the collector +// that collected the document (collector). +// +// The certification applies to a subject which is a package, source, or artifact. +// If the attestation targets a package, it must target a PackageName or a +// PackageVersion. If the attestation targets a source, it must target a +// SourceName. +type PathPathCertifyGood struct { + Typename *string `json:"__typename"` + AllCertifyGood `json:"-"` } -// GetStatement returns VexArtifactAndOsvIngestVEXStatementCertifyVEXStatement.Statement, and is useful for accessing the field via an interface. -func (v *VexArtifactAndOsvIngestVEXStatementCertifyVEXStatement) GetStatement() string { - return v.allCertifyVEXStatement.Statement -} +// GetTypename returns PathPathCertifyGood.Typename, and is useful for accessing the field via an interface. +func (v *PathPathCertifyGood) GetTypename() *string { return v.Typename } -// GetStatusNotes returns VexArtifactAndOsvIngestVEXStatementCertifyVEXStatement.StatusNotes, and is useful for accessing the field via an interface. -func (v *VexArtifactAndOsvIngestVEXStatementCertifyVEXStatement) GetStatusNotes() string { - return v.allCertifyVEXStatement.StatusNotes -} +// GetId returns PathPathCertifyGood.Id, and is useful for accessing the field via an interface. +func (v *PathPathCertifyGood) GetId() string { return v.AllCertifyGood.Id } -// GetKnownSince returns VexArtifactAndOsvIngestVEXStatementCertifyVEXStatement.KnownSince, and is useful for accessing the field via an interface. -func (v *VexArtifactAndOsvIngestVEXStatementCertifyVEXStatement) GetKnownSince() time.Time { - return v.allCertifyVEXStatement.KnownSince -} +// GetJustification returns PathPathCertifyGood.Justification, and is useful for accessing the field via an interface. +func (v *PathPathCertifyGood) GetJustification() string { return v.AllCertifyGood.Justification } -// GetOrigin returns VexArtifactAndOsvIngestVEXStatementCertifyVEXStatement.Origin, and is useful for accessing the field via an interface. -func (v *VexArtifactAndOsvIngestVEXStatementCertifyVEXStatement) GetOrigin() string { - return v.allCertifyVEXStatement.Origin +// GetSubject returns PathPathCertifyGood.Subject, and is useful for accessing the field via an interface. +func (v *PathPathCertifyGood) GetSubject() AllCertifyGoodSubjectPackageSourceOrArtifact { + return v.AllCertifyGood.Subject } -// GetCollector returns VexArtifactAndOsvIngestVEXStatementCertifyVEXStatement.Collector, and is useful for accessing the field via an interface. -func (v *VexArtifactAndOsvIngestVEXStatementCertifyVEXStatement) GetCollector() string { - return v.allCertifyVEXStatement.Collector -} +// GetOrigin returns PathPathCertifyGood.Origin, and is useful for accessing the field via an interface. +func (v *PathPathCertifyGood) GetOrigin() string { return v.AllCertifyGood.Origin } -func (v *VexArtifactAndOsvIngestVEXStatementCertifyVEXStatement) UnmarshalJSON(b []byte) error { +// GetCollector returns PathPathCertifyGood.Collector, and is useful for accessing the field via an interface. +func (v *PathPathCertifyGood) GetCollector() string { return v.AllCertifyGood.Collector } + +func (v *PathPathCertifyGood) UnmarshalJSON(b []byte) error { if string(b) == "null" { return nil } var firstPass struct { - *VexArtifactAndOsvIngestVEXStatementCertifyVEXStatement + *PathPathCertifyGood graphql.NoUnmarshalJSON } - firstPass.VexArtifactAndOsvIngestVEXStatementCertifyVEXStatement = v + firstPass.PathPathCertifyGood = v err := json.Unmarshal(b, &firstPass) if err != nil { @@ -19406,36 +19506,28 @@ func (v *VexArtifactAndOsvIngestVEXStatementCertifyVEXStatement) UnmarshalJSON(b } err = json.Unmarshal( - b, &v.allCertifyVEXStatement) + b, &v.AllCertifyGood) if err != nil { return err } return nil } -type __premarshalVexArtifactAndOsvIngestVEXStatementCertifyVEXStatement struct { - Id string `json:"id"` - - Subject json.RawMessage `json:"subject"` - - Vulnerability json.RawMessage `json:"vulnerability"` - - Status VexStatus `json:"status"` - - VexJustification VexJustification `json:"vexJustification"` +type __premarshalPathPathCertifyGood struct { + Typename *string `json:"__typename"` - Statement string `json:"statement"` + Id string `json:"id"` - StatusNotes string `json:"statusNotes"` + Justification string `json:"justification"` - KnownSince time.Time `json:"knownSince"` + Subject json.RawMessage `json:"subject"` Origin string `json:"origin"` Collector string `json:"collector"` } -func (v *VexArtifactAndOsvIngestVEXStatementCertifyVEXStatement) MarshalJSON() ([]byte, error) { +func (v *PathPathCertifyGood) MarshalJSON() ([]byte, error) { premarshaled, err := v.__premarshalJSON() if err != nil { return nil, err @@ -19443,137 +19535,176 @@ func (v *VexArtifactAndOsvIngestVEXStatementCertifyVEXStatement) MarshalJSON() ( return json.Marshal(premarshaled) } -func (v *VexArtifactAndOsvIngestVEXStatementCertifyVEXStatement) __premarshalJSON() (*__premarshalVexArtifactAndOsvIngestVEXStatementCertifyVEXStatement, error) { - var retval __premarshalVexArtifactAndOsvIngestVEXStatementCertifyVEXStatement +func (v *PathPathCertifyGood) __premarshalJSON() (*__premarshalPathPathCertifyGood, error) { + var retval __premarshalPathPathCertifyGood - retval.Id = v.allCertifyVEXStatement.Id + retval.Typename = v.Typename + retval.Id = v.AllCertifyGood.Id + retval.Justification = v.AllCertifyGood.Justification { dst := &retval.Subject - src := v.allCertifyVEXStatement.Subject + src := v.AllCertifyGood.Subject var err error - *dst, err = __marshalallCertifyVEXStatementSubjectPackageOrArtifact( + *dst, err = __marshalAllCertifyGoodSubjectPackageSourceOrArtifact( &src) if err != nil { return nil, fmt.Errorf( - "unable to marshal VexArtifactAndOsvIngestVEXStatementCertifyVEXStatement.allCertifyVEXStatement.Subject: %w", err) + "unable to marshal PathPathCertifyGood.AllCertifyGood.Subject: %w", err) } } - { + retval.Origin = v.AllCertifyGood.Origin + retval.Collector = v.AllCertifyGood.Collector + return &retval, nil +} - dst := &retval.Vulnerability - src := v.allCertifyVEXStatement.Vulnerability - var err error - *dst, err = __marshalallCertifyVEXStatementVulnerability( - &src) - if err != nil { - return nil, fmt.Errorf( - "unable to marshal VexArtifactAndOsvIngestVEXStatementCertifyVEXStatement.allCertifyVEXStatement.Vulnerability: %w", err) - } +// PathPathCertifyScorecard includes the requested fields of the GraphQL type CertifyScorecard. +// The GraphQL type's documentation follows. +// +// CertifyScorecard is an attestation to attach a Scorecard analysis to a +// particular source repository. +type PathPathCertifyScorecard struct { + Typename *string `json:"__typename"` + AllCertifyScorecard `json:"-"` +} + +// GetTypename returns PathPathCertifyScorecard.Typename, and is useful for accessing the field via an interface. +func (v *PathPathCertifyScorecard) GetTypename() *string { return v.Typename } + +// GetId returns PathPathCertifyScorecard.Id, and is useful for accessing the field via an interface. +func (v *PathPathCertifyScorecard) GetId() string { return v.AllCertifyScorecard.Id } + +// GetSource returns PathPathCertifyScorecard.Source, and is useful for accessing the field via an interface. +func (v *PathPathCertifyScorecard) GetSource() AllCertifyScorecardSource { + return v.AllCertifyScorecard.Source +} + +// GetScorecard returns PathPathCertifyScorecard.Scorecard, and is useful for accessing the field via an interface. +func (v *PathPathCertifyScorecard) GetScorecard() AllCertifyScorecardScorecard { + return v.AllCertifyScorecard.Scorecard +} + +func (v *PathPathCertifyScorecard) UnmarshalJSON(b []byte) error { + + if string(b) == "null" { + return nil } - retval.Status = v.allCertifyVEXStatement.Status - retval.VexJustification = v.allCertifyVEXStatement.VexJustification - retval.Statement = v.allCertifyVEXStatement.Statement - retval.StatusNotes = v.allCertifyVEXStatement.StatusNotes - retval.KnownSince = v.allCertifyVEXStatement.KnownSince - retval.Origin = v.allCertifyVEXStatement.Origin - retval.Collector = v.allCertifyVEXStatement.Collector - return &retval, nil + + var firstPass struct { + *PathPathCertifyScorecard + graphql.NoUnmarshalJSON + } + firstPass.PathPathCertifyScorecard = v + + err := json.Unmarshal(b, &firstPass) + if err != nil { + return err + } + + err = json.Unmarshal( + b, &v.AllCertifyScorecard) + if err != nil { + return err + } + return nil } -// VexArtifactAndOsvResponse is returned by VexArtifactAndOsv on success. -type VexArtifactAndOsvResponse struct { - // Adds a VEX certification for a package. - IngestVEXStatement VexArtifactAndOsvIngestVEXStatementCertifyVEXStatement `json:"ingestVEXStatement"` +type __premarshalPathPathCertifyScorecard struct { + Typename *string `json:"__typename"` + + Id string `json:"id"` + + Source AllCertifyScorecardSource `json:"source"` + + Scorecard AllCertifyScorecardScorecard `json:"scorecard"` } -// GetIngestVEXStatement returns VexArtifactAndOsvResponse.IngestVEXStatement, and is useful for accessing the field via an interface. -func (v *VexArtifactAndOsvResponse) GetIngestVEXStatement() VexArtifactAndOsvIngestVEXStatementCertifyVEXStatement { - return v.IngestVEXStatement +func (v *PathPathCertifyScorecard) MarshalJSON() ([]byte, error) { + premarshaled, err := v.__premarshalJSON() + if err != nil { + return nil, err + } + return json.Marshal(premarshaled) } -// Records the justification included in the VEX statement. -type VexJustification string +func (v *PathPathCertifyScorecard) __premarshalJSON() (*__premarshalPathPathCertifyScorecard, error) { + var retval __premarshalPathPathCertifyScorecard -const ( - VexJustificationComponentNotPresent VexJustification = "COMPONENT_NOT_PRESENT" - VexJustificationVulnerableCodeNotPresent VexJustification = "VULNERABLE_CODE_NOT_PRESENT" - VexJustificationVulnerableCodeNotInExecutePath VexJustification = "VULNERABLE_CODE_NOT_IN_EXECUTE_PATH" - VexJustificationVulnerableCodeCannotBeControlledByAdversary VexJustification = "VULNERABLE_CODE_CANNOT_BE_CONTROLLED_BY_ADVERSARY" - VexJustificationInlineMitigationsAlreadyExist VexJustification = "INLINE_MITIGATIONS_ALREADY_EXIST" - VexJustificationNotProvided VexJustification = "NOT_PROVIDED" -) + retval.Typename = v.Typename + retval.Id = v.AllCertifyScorecard.Id + retval.Source = v.AllCertifyScorecard.Source + retval.Scorecard = v.AllCertifyScorecard.Scorecard + return &retval, nil +} -// VexPackageAndCveIngestVEXStatementCertifyVEXStatement includes the requested fields of the GraphQL type CertifyVEXStatement. +// PathPathCertifyVEXStatement includes the requested fields of the GraphQL type CertifyVEXStatement. // The GraphQL type's documentation follows. // // CertifyVEXStatement is an attestation to attach VEX statements to a package or // artifact to clarify the impact of a specific vulnerability (CVE, GHSA or OSV). -type VexPackageAndCveIngestVEXStatementCertifyVEXStatement struct { - allCertifyVEXStatement `json:"-"` +type PathPathCertifyVEXStatement struct { + Typename *string `json:"__typename"` + AllCertifyVEXStatement `json:"-"` } -// GetId returns VexPackageAndCveIngestVEXStatementCertifyVEXStatement.Id, and is useful for accessing the field via an interface. -func (v *VexPackageAndCveIngestVEXStatementCertifyVEXStatement) GetId() string { - return v.allCertifyVEXStatement.Id -} +// GetTypename returns PathPathCertifyVEXStatement.Typename, and is useful for accessing the field via an interface. +func (v *PathPathCertifyVEXStatement) GetTypename() *string { return v.Typename } -// GetSubject returns VexPackageAndCveIngestVEXStatementCertifyVEXStatement.Subject, and is useful for accessing the field via an interface. -func (v *VexPackageAndCveIngestVEXStatementCertifyVEXStatement) GetSubject() allCertifyVEXStatementSubjectPackageOrArtifact { - return v.allCertifyVEXStatement.Subject -} +// GetId returns PathPathCertifyVEXStatement.Id, and is useful for accessing the field via an interface. +func (v *PathPathCertifyVEXStatement) GetId() string { return v.AllCertifyVEXStatement.Id } -// GetVulnerability returns VexPackageAndCveIngestVEXStatementCertifyVEXStatement.Vulnerability, and is useful for accessing the field via an interface. -func (v *VexPackageAndCveIngestVEXStatementCertifyVEXStatement) GetVulnerability() allCertifyVEXStatementVulnerability { - return v.allCertifyVEXStatement.Vulnerability +// GetSubject returns PathPathCertifyVEXStatement.Subject, and is useful for accessing the field via an interface. +func (v *PathPathCertifyVEXStatement) GetSubject() AllCertifyVEXStatementSubjectPackageOrArtifact { + return v.AllCertifyVEXStatement.Subject } -// GetStatus returns VexPackageAndCveIngestVEXStatementCertifyVEXStatement.Status, and is useful for accessing the field via an interface. -func (v *VexPackageAndCveIngestVEXStatementCertifyVEXStatement) GetStatus() VexStatus { - return v.allCertifyVEXStatement.Status +// GetVulnerability returns PathPathCertifyVEXStatement.Vulnerability, and is useful for accessing the field via an interface. +func (v *PathPathCertifyVEXStatement) GetVulnerability() AllCertifyVEXStatementVulnerability { + return v.AllCertifyVEXStatement.Vulnerability } -// GetVexJustification returns VexPackageAndCveIngestVEXStatementCertifyVEXStatement.VexJustification, and is useful for accessing the field via an interface. -func (v *VexPackageAndCveIngestVEXStatementCertifyVEXStatement) GetVexJustification() VexJustification { - return v.allCertifyVEXStatement.VexJustification -} +// GetStatus returns PathPathCertifyVEXStatement.Status, and is useful for accessing the field via an interface. +func (v *PathPathCertifyVEXStatement) GetStatus() VexStatus { return v.AllCertifyVEXStatement.Status } -// GetStatement returns VexPackageAndCveIngestVEXStatementCertifyVEXStatement.Statement, and is useful for accessing the field via an interface. -func (v *VexPackageAndCveIngestVEXStatementCertifyVEXStatement) GetStatement() string { - return v.allCertifyVEXStatement.Statement +// GetVexJustification returns PathPathCertifyVEXStatement.VexJustification, and is useful for accessing the field via an interface. +func (v *PathPathCertifyVEXStatement) GetVexJustification() VexJustification { + return v.AllCertifyVEXStatement.VexJustification } -// GetStatusNotes returns VexPackageAndCveIngestVEXStatementCertifyVEXStatement.StatusNotes, and is useful for accessing the field via an interface. -func (v *VexPackageAndCveIngestVEXStatementCertifyVEXStatement) GetStatusNotes() string { - return v.allCertifyVEXStatement.StatusNotes +// GetStatement returns PathPathCertifyVEXStatement.Statement, and is useful for accessing the field via an interface. +func (v *PathPathCertifyVEXStatement) GetStatement() string { + return v.AllCertifyVEXStatement.Statement } -// GetKnownSince returns VexPackageAndCveIngestVEXStatementCertifyVEXStatement.KnownSince, and is useful for accessing the field via an interface. -func (v *VexPackageAndCveIngestVEXStatementCertifyVEXStatement) GetKnownSince() time.Time { - return v.allCertifyVEXStatement.KnownSince +// GetStatusNotes returns PathPathCertifyVEXStatement.StatusNotes, and is useful for accessing the field via an interface. +func (v *PathPathCertifyVEXStatement) GetStatusNotes() string { + return v.AllCertifyVEXStatement.StatusNotes } -// GetOrigin returns VexPackageAndCveIngestVEXStatementCertifyVEXStatement.Origin, and is useful for accessing the field via an interface. -func (v *VexPackageAndCveIngestVEXStatementCertifyVEXStatement) GetOrigin() string { - return v.allCertifyVEXStatement.Origin +// GetKnownSince returns PathPathCertifyVEXStatement.KnownSince, and is useful for accessing the field via an interface. +func (v *PathPathCertifyVEXStatement) GetKnownSince() time.Time { + return v.AllCertifyVEXStatement.KnownSince } -// GetCollector returns VexPackageAndCveIngestVEXStatementCertifyVEXStatement.Collector, and is useful for accessing the field via an interface. -func (v *VexPackageAndCveIngestVEXStatementCertifyVEXStatement) GetCollector() string { - return v.allCertifyVEXStatement.Collector +// GetOrigin returns PathPathCertifyVEXStatement.Origin, and is useful for accessing the field via an interface. +func (v *PathPathCertifyVEXStatement) GetOrigin() string { return v.AllCertifyVEXStatement.Origin } + +// GetCollector returns PathPathCertifyVEXStatement.Collector, and is useful for accessing the field via an interface. +func (v *PathPathCertifyVEXStatement) GetCollector() string { + return v.AllCertifyVEXStatement.Collector } -func (v *VexPackageAndCveIngestVEXStatementCertifyVEXStatement) UnmarshalJSON(b []byte) error { +func (v *PathPathCertifyVEXStatement) UnmarshalJSON(b []byte) error { if string(b) == "null" { return nil } var firstPass struct { - *VexPackageAndCveIngestVEXStatementCertifyVEXStatement + *PathPathCertifyVEXStatement graphql.NoUnmarshalJSON } - firstPass.VexPackageAndCveIngestVEXStatementCertifyVEXStatement = v + firstPass.PathPathCertifyVEXStatement = v err := json.Unmarshal(b, &firstPass) if err != nil { @@ -19581,14 +19712,16 @@ func (v *VexPackageAndCveIngestVEXStatementCertifyVEXStatement) UnmarshalJSON(b } err = json.Unmarshal( - b, &v.allCertifyVEXStatement) + b, &v.AllCertifyVEXStatement) if err != nil { return err } return nil } -type __premarshalVexPackageAndCveIngestVEXStatementCertifyVEXStatement struct { +type __premarshalPathPathCertifyVEXStatement struct { + Typename *string `json:"__typename"` + Id string `json:"id"` Subject json.RawMessage `json:"subject"` @@ -19610,7 +19743,7 @@ type __premarshalVexPackageAndCveIngestVEXStatementCertifyVEXStatement struct { Collector string `json:"collector"` } -func (v *VexPackageAndCveIngestVEXStatementCertifyVEXStatement) MarshalJSON() ([]byte, error) { +func (v *PathPathCertifyVEXStatement) MarshalJSON() ([]byte, error) { premarshaled, err := v.__premarshalJSON() if err != nil { return nil, err @@ -19618,125 +19751,87 @@ func (v *VexPackageAndCveIngestVEXStatementCertifyVEXStatement) MarshalJSON() ([ return json.Marshal(premarshaled) } -func (v *VexPackageAndCveIngestVEXStatementCertifyVEXStatement) __premarshalJSON() (*__premarshalVexPackageAndCveIngestVEXStatementCertifyVEXStatement, error) { - var retval __premarshalVexPackageAndCveIngestVEXStatementCertifyVEXStatement +func (v *PathPathCertifyVEXStatement) __premarshalJSON() (*__premarshalPathPathCertifyVEXStatement, error) { + var retval __premarshalPathPathCertifyVEXStatement - retval.Id = v.allCertifyVEXStatement.Id + retval.Typename = v.Typename + retval.Id = v.AllCertifyVEXStatement.Id { dst := &retval.Subject - src := v.allCertifyVEXStatement.Subject + src := v.AllCertifyVEXStatement.Subject var err error - *dst, err = __marshalallCertifyVEXStatementSubjectPackageOrArtifact( + *dst, err = __marshalAllCertifyVEXStatementSubjectPackageOrArtifact( &src) if err != nil { return nil, fmt.Errorf( - "unable to marshal VexPackageAndCveIngestVEXStatementCertifyVEXStatement.allCertifyVEXStatement.Subject: %w", err) + "unable to marshal PathPathCertifyVEXStatement.AllCertifyVEXStatement.Subject: %w", err) } } { dst := &retval.Vulnerability - src := v.allCertifyVEXStatement.Vulnerability + src := v.AllCertifyVEXStatement.Vulnerability var err error - *dst, err = __marshalallCertifyVEXStatementVulnerability( + *dst, err = __marshalAllCertifyVEXStatementVulnerability( &src) if err != nil { return nil, fmt.Errorf( - "unable to marshal VexPackageAndCveIngestVEXStatementCertifyVEXStatement.allCertifyVEXStatement.Vulnerability: %w", err) + "unable to marshal PathPathCertifyVEXStatement.AllCertifyVEXStatement.Vulnerability: %w", err) } } - retval.Status = v.allCertifyVEXStatement.Status - retval.VexJustification = v.allCertifyVEXStatement.VexJustification - retval.Statement = v.allCertifyVEXStatement.Statement - retval.StatusNotes = v.allCertifyVEXStatement.StatusNotes - retval.KnownSince = v.allCertifyVEXStatement.KnownSince - retval.Origin = v.allCertifyVEXStatement.Origin - retval.Collector = v.allCertifyVEXStatement.Collector + retval.Status = v.AllCertifyVEXStatement.Status + retval.VexJustification = v.AllCertifyVEXStatement.VexJustification + retval.Statement = v.AllCertifyVEXStatement.Statement + retval.StatusNotes = v.AllCertifyVEXStatement.StatusNotes + retval.KnownSince = v.AllCertifyVEXStatement.KnownSince + retval.Origin = v.AllCertifyVEXStatement.Origin + retval.Collector = v.AllCertifyVEXStatement.Collector return &retval, nil } -// VexPackageAndCveResponse is returned by VexPackageAndCve on success. -type VexPackageAndCveResponse struct { - // Adds a VEX certification for a package. - IngestVEXStatement VexPackageAndCveIngestVEXStatementCertifyVEXStatement `json:"ingestVEXStatement"` -} - -// GetIngestVEXStatement returns VexPackageAndCveResponse.IngestVEXStatement, and is useful for accessing the field via an interface. -func (v *VexPackageAndCveResponse) GetIngestVEXStatement() VexPackageAndCveIngestVEXStatementCertifyVEXStatement { - return v.IngestVEXStatement -} - -// VexPackageAndOsvIngestVEXStatementCertifyVEXStatement includes the requested fields of the GraphQL type CertifyVEXStatement. +// PathPathCertifyVuln includes the requested fields of the GraphQL type CertifyVuln. // The GraphQL type's documentation follows. // -// CertifyVEXStatement is an attestation to attach VEX statements to a package or -// artifact to clarify the impact of a specific vulnerability (CVE, GHSA or OSV). -type VexPackageAndOsvIngestVEXStatementCertifyVEXStatement struct { - allCertifyVEXStatement `json:"-"` -} - -// GetId returns VexPackageAndOsvIngestVEXStatementCertifyVEXStatement.Id, and is useful for accessing the field via an interface. -func (v *VexPackageAndOsvIngestVEXStatementCertifyVEXStatement) GetId() string { - return v.allCertifyVEXStatement.Id -} - -// GetSubject returns VexPackageAndOsvIngestVEXStatementCertifyVEXStatement.Subject, and is useful for accessing the field via an interface. -func (v *VexPackageAndOsvIngestVEXStatementCertifyVEXStatement) GetSubject() allCertifyVEXStatementSubjectPackageOrArtifact { - return v.allCertifyVEXStatement.Subject -} - -// GetVulnerability returns VexPackageAndOsvIngestVEXStatementCertifyVEXStatement.Vulnerability, and is useful for accessing the field via an interface. -func (v *VexPackageAndOsvIngestVEXStatementCertifyVEXStatement) GetVulnerability() allCertifyVEXStatementVulnerability { - return v.allCertifyVEXStatement.Vulnerability -} - -// GetStatus returns VexPackageAndOsvIngestVEXStatementCertifyVEXStatement.Status, and is useful for accessing the field via an interface. -func (v *VexPackageAndOsvIngestVEXStatementCertifyVEXStatement) GetStatus() VexStatus { - return v.allCertifyVEXStatement.Status -} - -// GetVexJustification returns VexPackageAndOsvIngestVEXStatementCertifyVEXStatement.VexJustification, and is useful for accessing the field via an interface. -func (v *VexPackageAndOsvIngestVEXStatementCertifyVEXStatement) GetVexJustification() VexJustification { - return v.allCertifyVEXStatement.VexJustification +// CertifyVuln is an attestation to attach vulnerability information to a package. +// +// This information is obtained via a scanner. If there is no vulnerability +// detected (no OSV, CVE, or GHSA), we attach the special NoVuln node. +type PathPathCertifyVuln struct { + Typename *string `json:"__typename"` + AllCertifyVuln `json:"-"` } -// GetStatement returns VexPackageAndOsvIngestVEXStatementCertifyVEXStatement.Statement, and is useful for accessing the field via an interface. -func (v *VexPackageAndOsvIngestVEXStatementCertifyVEXStatement) GetStatement() string { - return v.allCertifyVEXStatement.Statement -} +// GetTypename returns PathPathCertifyVuln.Typename, and is useful for accessing the field via an interface. +func (v *PathPathCertifyVuln) GetTypename() *string { return v.Typename } -// GetStatusNotes returns VexPackageAndOsvIngestVEXStatementCertifyVEXStatement.StatusNotes, and is useful for accessing the field via an interface. -func (v *VexPackageAndOsvIngestVEXStatementCertifyVEXStatement) GetStatusNotes() string { - return v.allCertifyVEXStatement.StatusNotes -} +// GetId returns PathPathCertifyVuln.Id, and is useful for accessing the field via an interface. +func (v *PathPathCertifyVuln) GetId() string { return v.AllCertifyVuln.Id } -// GetKnownSince returns VexPackageAndOsvIngestVEXStatementCertifyVEXStatement.KnownSince, and is useful for accessing the field via an interface. -func (v *VexPackageAndOsvIngestVEXStatementCertifyVEXStatement) GetKnownSince() time.Time { - return v.allCertifyVEXStatement.KnownSince -} +// GetPackage returns PathPathCertifyVuln.Package, and is useful for accessing the field via an interface. +func (v *PathPathCertifyVuln) GetPackage() AllCertifyVulnPackage { return v.AllCertifyVuln.Package } -// GetOrigin returns VexPackageAndOsvIngestVEXStatementCertifyVEXStatement.Origin, and is useful for accessing the field via an interface. -func (v *VexPackageAndOsvIngestVEXStatementCertifyVEXStatement) GetOrigin() string { - return v.allCertifyVEXStatement.Origin +// GetVulnerability returns PathPathCertifyVuln.Vulnerability, and is useful for accessing the field via an interface. +func (v *PathPathCertifyVuln) GetVulnerability() AllCertifyVulnVulnerability { + return v.AllCertifyVuln.Vulnerability } -// GetCollector returns VexPackageAndOsvIngestVEXStatementCertifyVEXStatement.Collector, and is useful for accessing the field via an interface. -func (v *VexPackageAndOsvIngestVEXStatementCertifyVEXStatement) GetCollector() string { - return v.allCertifyVEXStatement.Collector +// GetMetadata returns PathPathCertifyVuln.Metadata, and is useful for accessing the field via an interface. +func (v *PathPathCertifyVuln) GetMetadata() AllCertifyVulnMetadataVulnerabilityMetaData { + return v.AllCertifyVuln.Metadata } -func (v *VexPackageAndOsvIngestVEXStatementCertifyVEXStatement) UnmarshalJSON(b []byte) error { +func (v *PathPathCertifyVuln) UnmarshalJSON(b []byte) error { if string(b) == "null" { return nil } var firstPass struct { - *VexPackageAndOsvIngestVEXStatementCertifyVEXStatement + *PathPathCertifyVuln graphql.NoUnmarshalJSON } - firstPass.VexPackageAndOsvIngestVEXStatementCertifyVEXStatement = v + firstPass.PathPathCertifyVuln = v err := json.Unmarshal(b, &firstPass) if err != nil { @@ -19744,36 +19839,26 @@ func (v *VexPackageAndOsvIngestVEXStatementCertifyVEXStatement) UnmarshalJSON(b } err = json.Unmarshal( - b, &v.allCertifyVEXStatement) + b, &v.AllCertifyVuln) if err != nil { return err } return nil } -type __premarshalVexPackageAndOsvIngestVEXStatementCertifyVEXStatement struct { +type __premarshalPathPathCertifyVuln struct { + Typename *string `json:"__typename"` + Id string `json:"id"` - Subject json.RawMessage `json:"subject"` + Package AllCertifyVulnPackage `json:"package"` Vulnerability json.RawMessage `json:"vulnerability"` - Status VexStatus `json:"status"` - - VexJustification VexJustification `json:"vexJustification"` - - Statement string `json:"statement"` - - StatusNotes string `json:"statusNotes"` - - KnownSince time.Time `json:"knownSince"` - - Origin string `json:"origin"` - - Collector string `json:"collector"` + Metadata AllCertifyVulnMetadataVulnerabilityMetaData `json:"metadata"` } -func (v *VexPackageAndOsvIngestVEXStatementCertifyVEXStatement) MarshalJSON() ([]byte, error) { +func (v *PathPathCertifyVuln) MarshalJSON() ([]byte, error) { premarshaled, err := v.__premarshalJSON() if err != nil { return nil, err @@ -19781,1048 +19866,1332 @@ func (v *VexPackageAndOsvIngestVEXStatementCertifyVEXStatement) MarshalJSON() ([ return json.Marshal(premarshaled) } -func (v *VexPackageAndOsvIngestVEXStatementCertifyVEXStatement) __premarshalJSON() (*__premarshalVexPackageAndOsvIngestVEXStatementCertifyVEXStatement, error) { - var retval __premarshalVexPackageAndOsvIngestVEXStatementCertifyVEXStatement - - retval.Id = v.allCertifyVEXStatement.Id - { +func (v *PathPathCertifyVuln) __premarshalJSON() (*__premarshalPathPathCertifyVuln, error) { + var retval __premarshalPathPathCertifyVuln - dst := &retval.Subject - src := v.allCertifyVEXStatement.Subject - var err error - *dst, err = __marshalallCertifyVEXStatementSubjectPackageOrArtifact( - &src) - if err != nil { - return nil, fmt.Errorf( - "unable to marshal VexPackageAndOsvIngestVEXStatementCertifyVEXStatement.allCertifyVEXStatement.Subject: %w", err) - } - } + retval.Typename = v.Typename + retval.Id = v.AllCertifyVuln.Id + retval.Package = v.AllCertifyVuln.Package { dst := &retval.Vulnerability - src := v.allCertifyVEXStatement.Vulnerability + src := v.AllCertifyVuln.Vulnerability var err error - *dst, err = __marshalallCertifyVEXStatementVulnerability( + *dst, err = __marshalAllCertifyVulnVulnerability( &src) if err != nil { return nil, fmt.Errorf( - "unable to marshal VexPackageAndOsvIngestVEXStatementCertifyVEXStatement.allCertifyVEXStatement.Vulnerability: %w", err) + "unable to marshal PathPathCertifyVuln.AllCertifyVuln.Vulnerability: %w", err) } } - retval.Status = v.allCertifyVEXStatement.Status - retval.VexJustification = v.allCertifyVEXStatement.VexJustification - retval.Statement = v.allCertifyVEXStatement.Statement - retval.StatusNotes = v.allCertifyVEXStatement.StatusNotes - retval.KnownSince = v.allCertifyVEXStatement.KnownSince - retval.Origin = v.allCertifyVEXStatement.Origin - retval.Collector = v.allCertifyVEXStatement.Collector + retval.Metadata = v.AllCertifyVuln.Metadata return &retval, nil } -// VexPackageAndOsvResponse is returned by VexPackageAndOsv on success. -type VexPackageAndOsvResponse struct { - // Adds a VEX certification for a package. - IngestVEXStatement VexPackageAndOsvIngestVEXStatementCertifyVEXStatement `json:"ingestVEXStatement"` -} - -// GetIngestVEXStatement returns VexPackageAndOsvResponse.IngestVEXStatement, and is useful for accessing the field via an interface. -func (v *VexPackageAndOsvResponse) GetIngestVEXStatement() VexPackageAndOsvIngestVEXStatementCertifyVEXStatement { - return v.IngestVEXStatement -} - -// VexStatementInputSpec represents the input to ingest VEX statements. -type VexStatementInputSpec struct { - Status VexStatus `json:"status"` - VexJustification VexJustification `json:"vexJustification"` - Statement string `json:"statement"` - StatusNotes string `json:"statusNotes"` - KnownSince time.Time `json:"knownSince"` - Origin string `json:"origin"` - Collector string `json:"collector"` +// PathPathGHSA includes the requested fields of the GraphQL type GHSA. +// The GraphQL type's documentation follows. +// +// GHSA represents GitHub security advisories. +// +// The advisory id field is mandatory and canonicalized to be lowercase. +// +// This node can be referred to by other parts of GUAC. +type PathPathGHSA struct { + Typename *string `json:"__typename"` + AllGHSATree `json:"-"` } -// GetStatus returns VexStatementInputSpec.Status, and is useful for accessing the field via an interface. -func (v *VexStatementInputSpec) GetStatus() VexStatus { return v.Status } - -// GetVexJustification returns VexStatementInputSpec.VexJustification, and is useful for accessing the field via an interface. -func (v *VexStatementInputSpec) GetVexJustification() VexJustification { return v.VexJustification } - -// GetStatement returns VexStatementInputSpec.Statement, and is useful for accessing the field via an interface. -func (v *VexStatementInputSpec) GetStatement() string { return v.Statement } +// GetTypename returns PathPathGHSA.Typename, and is useful for accessing the field via an interface. +func (v *PathPathGHSA) GetTypename() *string { return v.Typename } -// GetStatusNotes returns VexStatementInputSpec.StatusNotes, and is useful for accessing the field via an interface. -func (v *VexStatementInputSpec) GetStatusNotes() string { return v.StatusNotes } +// GetId returns PathPathGHSA.Id, and is useful for accessing the field via an interface. +func (v *PathPathGHSA) GetId() string { return v.AllGHSATree.Id } -// GetKnownSince returns VexStatementInputSpec.KnownSince, and is useful for accessing the field via an interface. -func (v *VexStatementInputSpec) GetKnownSince() time.Time { return v.KnownSince } +// GetGhsaId returns PathPathGHSA.GhsaId, and is useful for accessing the field via an interface. +func (v *PathPathGHSA) GetGhsaId() string { return v.AllGHSATree.GhsaId } -// GetOrigin returns VexStatementInputSpec.Origin, and is useful for accessing the field via an interface. -func (v *VexStatementInputSpec) GetOrigin() string { return v.Origin } +func (v *PathPathGHSA) UnmarshalJSON(b []byte) error { -// GetCollector returns VexStatementInputSpec.Collector, and is useful for accessing the field via an interface. -func (v *VexStatementInputSpec) GetCollector() string { return v.Collector } + if string(b) == "null" { + return nil + } -// Records the status of a VEX statement subject. -type VexStatus string + var firstPass struct { + *PathPathGHSA + graphql.NoUnmarshalJSON + } + firstPass.PathPathGHSA = v -const ( - VexStatusNotAffected VexStatus = "NOT_AFFECTED" - VexStatusAffected VexStatus = "AFFECTED" - VexStatusFixed VexStatus = "FIXED" - VexStatusUnderInvestigation VexStatus = "UNDER_INVESTIGATION" -) + err := json.Unmarshal(b, &firstPass) + if err != nil { + return err + } -// VulnerabilityMetaDataInput represents the input for certifying vulnerability -// scans in mutations. -type VulnerabilityMetaDataInput struct { - TimeScanned time.Time `json:"timeScanned"` - DbUri string `json:"dbUri"` - DbVersion string `json:"dbVersion"` - ScannerUri string `json:"scannerUri"` - ScannerVersion string `json:"scannerVersion"` - Origin string `json:"origin"` - Collector string `json:"collector"` + err = json.Unmarshal( + b, &v.AllGHSATree) + if err != nil { + return err + } + return nil } -// GetTimeScanned returns VulnerabilityMetaDataInput.TimeScanned, and is useful for accessing the field via an interface. -func (v *VulnerabilityMetaDataInput) GetTimeScanned() time.Time { return v.TimeScanned } - -// GetDbUri returns VulnerabilityMetaDataInput.DbUri, and is useful for accessing the field via an interface. -func (v *VulnerabilityMetaDataInput) GetDbUri() string { return v.DbUri } - -// GetDbVersion returns VulnerabilityMetaDataInput.DbVersion, and is useful for accessing the field via an interface. -func (v *VulnerabilityMetaDataInput) GetDbVersion() string { return v.DbVersion } +type __premarshalPathPathGHSA struct { + Typename *string `json:"__typename"` -// GetScannerUri returns VulnerabilityMetaDataInput.ScannerUri, and is useful for accessing the field via an interface. -func (v *VulnerabilityMetaDataInput) GetScannerUri() string { return v.ScannerUri } + Id string `json:"id"` -// GetScannerVersion returns VulnerabilityMetaDataInput.ScannerVersion, and is useful for accessing the field via an interface. -func (v *VulnerabilityMetaDataInput) GetScannerVersion() string { return v.ScannerVersion } + GhsaId string `json:"ghsaId"` +} -// GetOrigin returns VulnerabilityMetaDataInput.Origin, and is useful for accessing the field via an interface. -func (v *VulnerabilityMetaDataInput) GetOrigin() string { return v.Origin } +func (v *PathPathGHSA) MarshalJSON() ([]byte, error) { + premarshaled, err := v.__premarshalJSON() + if err != nil { + return nil, err + } + return json.Marshal(premarshaled) +} -// GetCollector returns VulnerabilityMetaDataInput.Collector, and is useful for accessing the field via an interface. -func (v *VulnerabilityMetaDataInput) GetCollector() string { return v.Collector } +func (v *PathPathGHSA) __premarshalJSON() (*__premarshalPathPathGHSA, error) { + var retval __premarshalPathPathGHSA -// __ArtifactsInput is used internally by genqlient -type __ArtifactsInput struct { - Filter *ArtifactSpec `json:"filter"` + retval.Typename = v.Typename + retval.Id = v.AllGHSATree.Id + retval.GhsaId = v.AllGHSATree.GhsaId + return &retval, nil } -// GetFilter returns __ArtifactsInput.Filter, and is useful for accessing the field via an interface. -func (v *__ArtifactsInput) GetFilter() *ArtifactSpec { return v.Filter } - -// __CVEsInput is used internally by genqlient -type __CVEsInput struct { - Filter *CVESpec `json:"filter"` +// PathPathHasMetadata includes the requested fields of the GraphQL type HasMetadata. +// The GraphQL type's documentation follows. +// +// HasMetadata is an attestation that a package, source, or artifact has a certain +// attested property (key) with value (value). For example, a source may have +// metadata "SourceRepo2FAEnabled=true". +// +// The intent of this evidence tree predicate is to allow extensibility of metadata +// expressible within the GUAC ontology. Metadata that is commonly used will then +// be promoted to a predicate on its own. +// +// Justification indicates how the metadata was determined. +// +// The metadata applies to a subject which is a package, source, or artifact. +// If the attestation targets a package, it must target a PackageName or a +// PackageVersion. If the attestation targets a source, it must target a +// SourceName. +type PathPathHasMetadata struct { + Typename *string `json:"__typename"` } -// GetFilter returns __CVEsInput.Filter, and is useful for accessing the field via an interface. -func (v *__CVEsInput) GetFilter() *CVESpec { return v.Filter } +// GetTypename returns PathPathHasMetadata.Typename, and is useful for accessing the field via an interface. +func (v *PathPathHasMetadata) GetTypename() *string { return v.Typename } -// __CertifyBadArtifactInput is used internally by genqlient -type __CertifyBadArtifactInput struct { - Artifact ArtifactInputSpec `json:"artifact"` - CertifyBad CertifyBadInputSpec `json:"certifyBad"` +// PathPathHasSBOM includes the requested fields of the GraphQL type HasSBOM. +type PathPathHasSBOM struct { + Typename *string `json:"__typename"` + AllHasSBOMTree `json:"-"` } -// GetArtifact returns __CertifyBadArtifactInput.Artifact, and is useful for accessing the field via an interface. -func (v *__CertifyBadArtifactInput) GetArtifact() ArtifactInputSpec { return v.Artifact } +// GetTypename returns PathPathHasSBOM.Typename, and is useful for accessing the field via an interface. +func (v *PathPathHasSBOM) GetTypename() *string { return v.Typename } -// GetCertifyBad returns __CertifyBadArtifactInput.CertifyBad, and is useful for accessing the field via an interface. -func (v *__CertifyBadArtifactInput) GetCertifyBad() CertifyBadInputSpec { return v.CertifyBad } +// GetId returns PathPathHasSBOM.Id, and is useful for accessing the field via an interface. +func (v *PathPathHasSBOM) GetId() string { return v.AllHasSBOMTree.Id } -// __CertifyBadPkgInput is used internally by genqlient -type __CertifyBadPkgInput struct { - Pkg PkgInputSpec `json:"pkg"` - PkgMatchType *MatchFlags `json:"pkgMatchType"` - CertifyBad CertifyBadInputSpec `json:"certifyBad"` +// GetSubject returns PathPathHasSBOM.Subject, and is useful for accessing the field via an interface. +func (v *PathPathHasSBOM) GetSubject() AllHasSBOMTreeSubjectPackageOrArtifact { + return v.AllHasSBOMTree.Subject } -// GetPkg returns __CertifyBadPkgInput.Pkg, and is useful for accessing the field via an interface. -func (v *__CertifyBadPkgInput) GetPkg() PkgInputSpec { return v.Pkg } - -// GetPkgMatchType returns __CertifyBadPkgInput.PkgMatchType, and is useful for accessing the field via an interface. -func (v *__CertifyBadPkgInput) GetPkgMatchType() *MatchFlags { return v.PkgMatchType } - -// GetCertifyBad returns __CertifyBadPkgInput.CertifyBad, and is useful for accessing the field via an interface. -func (v *__CertifyBadPkgInput) GetCertifyBad() CertifyBadInputSpec { return v.CertifyBad } +// GetUri returns PathPathHasSBOM.Uri, and is useful for accessing the field via an interface. +func (v *PathPathHasSBOM) GetUri() string { return v.AllHasSBOMTree.Uri } -// __CertifyBadSrcInput is used internally by genqlient -type __CertifyBadSrcInput struct { - Source SourceInputSpec `json:"source"` - CertifyBad CertifyBadInputSpec `json:"certifyBad"` -} +// GetAlgorithm returns PathPathHasSBOM.Algorithm, and is useful for accessing the field via an interface. +func (v *PathPathHasSBOM) GetAlgorithm() string { return v.AllHasSBOMTree.Algorithm } -// GetSource returns __CertifyBadSrcInput.Source, and is useful for accessing the field via an interface. -func (v *__CertifyBadSrcInput) GetSource() SourceInputSpec { return v.Source } +// GetDigest returns PathPathHasSBOM.Digest, and is useful for accessing the field via an interface. +func (v *PathPathHasSBOM) GetDigest() string { return v.AllHasSBOMTree.Digest } -// GetCertifyBad returns __CertifyBadSrcInput.CertifyBad, and is useful for accessing the field via an interface. -func (v *__CertifyBadSrcInput) GetCertifyBad() CertifyBadInputSpec { return v.CertifyBad } +// GetDownloadLocation returns PathPathHasSBOM.DownloadLocation, and is useful for accessing the field via an interface. +func (v *PathPathHasSBOM) GetDownloadLocation() string { return v.AllHasSBOMTree.DownloadLocation } -// __CertifyBadsInput is used internally by genqlient -type __CertifyBadsInput struct { - Filter *CertifyBadSpec `json:"filter"` -} +// GetOrigin returns PathPathHasSBOM.Origin, and is useful for accessing the field via an interface. +func (v *PathPathHasSBOM) GetOrigin() string { return v.AllHasSBOMTree.Origin } -// GetFilter returns __CertifyBadsInput.Filter, and is useful for accessing the field via an interface. -func (v *__CertifyBadsInput) GetFilter() *CertifyBadSpec { return v.Filter } +// GetCollector returns PathPathHasSBOM.Collector, and is useful for accessing the field via an interface. +func (v *PathPathHasSBOM) GetCollector() string { return v.AllHasSBOMTree.Collector } -// __CertifyCVEInput is used internally by genqlient -type __CertifyCVEInput struct { - Pkg PkgInputSpec `json:"pkg"` - Cve CVEInputSpec `json:"cve"` - CertifyVuln VulnerabilityMetaDataInput `json:"certifyVuln"` -} +func (v *PathPathHasSBOM) UnmarshalJSON(b []byte) error { -// GetPkg returns __CertifyCVEInput.Pkg, and is useful for accessing the field via an interface. -func (v *__CertifyCVEInput) GetPkg() PkgInputSpec { return v.Pkg } + if string(b) == "null" { + return nil + } -// GetCve returns __CertifyCVEInput.Cve, and is useful for accessing the field via an interface. -func (v *__CertifyCVEInput) GetCve() CVEInputSpec { return v.Cve } + var firstPass struct { + *PathPathHasSBOM + graphql.NoUnmarshalJSON + } + firstPass.PathPathHasSBOM = v -// GetCertifyVuln returns __CertifyCVEInput.CertifyVuln, and is useful for accessing the field via an interface. -func (v *__CertifyCVEInput) GetCertifyVuln() VulnerabilityMetaDataInput { return v.CertifyVuln } + err := json.Unmarshal(b, &firstPass) + if err != nil { + return err + } -// __CertifyGHSAInput is used internally by genqlient -type __CertifyGHSAInput struct { - Pkg PkgInputSpec `json:"pkg"` - Ghsa GHSAInputSpec `json:"ghsa"` - CertifyVuln VulnerabilityMetaDataInput `json:"certifyVuln"` + err = json.Unmarshal( + b, &v.AllHasSBOMTree) + if err != nil { + return err + } + return nil } -// GetPkg returns __CertifyGHSAInput.Pkg, and is useful for accessing the field via an interface. -func (v *__CertifyGHSAInput) GetPkg() PkgInputSpec { return v.Pkg } - -// GetGhsa returns __CertifyGHSAInput.Ghsa, and is useful for accessing the field via an interface. -func (v *__CertifyGHSAInput) GetGhsa() GHSAInputSpec { return v.Ghsa } +type __premarshalPathPathHasSBOM struct { + Typename *string `json:"__typename"` -// GetCertifyVuln returns __CertifyGHSAInput.CertifyVuln, and is useful for accessing the field via an interface. -func (v *__CertifyGHSAInput) GetCertifyVuln() VulnerabilityMetaDataInput { return v.CertifyVuln } + Id string `json:"id"` -// __CertifyGoodArtifactInput is used internally by genqlient -type __CertifyGoodArtifactInput struct { - Artifact ArtifactInputSpec `json:"artifact"` - CertifyGood CertifyGoodInputSpec `json:"certifyGood"` -} + Subject json.RawMessage `json:"subject"` -// GetArtifact returns __CertifyGoodArtifactInput.Artifact, and is useful for accessing the field via an interface. -func (v *__CertifyGoodArtifactInput) GetArtifact() ArtifactInputSpec { return v.Artifact } + Uri string `json:"uri"` -// GetCertifyGood returns __CertifyGoodArtifactInput.CertifyGood, and is useful for accessing the field via an interface. -func (v *__CertifyGoodArtifactInput) GetCertifyGood() CertifyGoodInputSpec { return v.CertifyGood } + Algorithm string `json:"algorithm"` -// __CertifyGoodPkgInput is used internally by genqlient -type __CertifyGoodPkgInput struct { - Pkg PkgInputSpec `json:"pkg"` - PkgMatchType *MatchFlags `json:"pkgMatchType"` - CertifyGood CertifyGoodInputSpec `json:"certifyGood"` -} + Digest string `json:"digest"` -// GetPkg returns __CertifyGoodPkgInput.Pkg, and is useful for accessing the field via an interface. -func (v *__CertifyGoodPkgInput) GetPkg() PkgInputSpec { return v.Pkg } + DownloadLocation string `json:"downloadLocation"` -// GetPkgMatchType returns __CertifyGoodPkgInput.PkgMatchType, and is useful for accessing the field via an interface. -func (v *__CertifyGoodPkgInput) GetPkgMatchType() *MatchFlags { return v.PkgMatchType } + Origin string `json:"origin"` -// GetCertifyGood returns __CertifyGoodPkgInput.CertifyGood, and is useful for accessing the field via an interface. -func (v *__CertifyGoodPkgInput) GetCertifyGood() CertifyGoodInputSpec { return v.CertifyGood } + Collector string `json:"collector"` +} -// __CertifyGoodSrcInput is used internally by genqlient -type __CertifyGoodSrcInput struct { - Source SourceInputSpec `json:"source"` - CertifyGood CertifyGoodInputSpec `json:"certifyGood"` +func (v *PathPathHasSBOM) MarshalJSON() ([]byte, error) { + premarshaled, err := v.__premarshalJSON() + if err != nil { + return nil, err + } + return json.Marshal(premarshaled) } -// GetSource returns __CertifyGoodSrcInput.Source, and is useful for accessing the field via an interface. -func (v *__CertifyGoodSrcInput) GetSource() SourceInputSpec { return v.Source } +func (v *PathPathHasSBOM) __premarshalJSON() (*__premarshalPathPathHasSBOM, error) { + var retval __premarshalPathPathHasSBOM -// GetCertifyGood returns __CertifyGoodSrcInput.CertifyGood, and is useful for accessing the field via an interface. -func (v *__CertifyGoodSrcInput) GetCertifyGood() CertifyGoodInputSpec { return v.CertifyGood } + retval.Typename = v.Typename + retval.Id = v.AllHasSBOMTree.Id + { -// __CertifyNoKnownVulnInput is used internally by genqlient -type __CertifyNoKnownVulnInput struct { - Pkg PkgInputSpec `json:"pkg"` - CertifyVuln VulnerabilityMetaDataInput `json:"certifyVuln"` + dst := &retval.Subject + src := v.AllHasSBOMTree.Subject + var err error + *dst, err = __marshalAllHasSBOMTreeSubjectPackageOrArtifact( + &src) + if err != nil { + return nil, fmt.Errorf( + "unable to marshal PathPathHasSBOM.AllHasSBOMTree.Subject: %w", err) + } + } + retval.Uri = v.AllHasSBOMTree.Uri + retval.Algorithm = v.AllHasSBOMTree.Algorithm + retval.Digest = v.AllHasSBOMTree.Digest + retval.DownloadLocation = v.AllHasSBOMTree.DownloadLocation + retval.Origin = v.AllHasSBOMTree.Origin + retval.Collector = v.AllHasSBOMTree.Collector + return &retval, nil } -// GetPkg returns __CertifyNoKnownVulnInput.Pkg, and is useful for accessing the field via an interface. -func (v *__CertifyNoKnownVulnInput) GetPkg() PkgInputSpec { return v.Pkg } +// PathPathHasSLSA includes the requested fields of the GraphQL type HasSLSA. +// The GraphQL type's documentation follows. +// +// HasSLSA records that a subject node has a SLSA attestation. +type PathPathHasSLSA struct { + Typename *string `json:"__typename"` + AllSLSATree `json:"-"` +} -// GetCertifyVuln returns __CertifyNoKnownVulnInput.CertifyVuln, and is useful for accessing the field via an interface. -func (v *__CertifyNoKnownVulnInput) GetCertifyVuln() VulnerabilityMetaDataInput { return v.CertifyVuln } +// GetTypename returns PathPathHasSLSA.Typename, and is useful for accessing the field via an interface. +func (v *PathPathHasSLSA) GetTypename() *string { return v.Typename } -// __CertifyOSVInput is used internally by genqlient -type __CertifyOSVInput struct { - Pkg PkgInputSpec `json:"pkg"` - Osv OSVInputSpec `json:"osv"` - CertifyVuln VulnerabilityMetaDataInput `json:"certifyVuln"` -} +// GetId returns PathPathHasSLSA.Id, and is useful for accessing the field via an interface. +func (v *PathPathHasSLSA) GetId() string { return v.AllSLSATree.Id } -// GetPkg returns __CertifyOSVInput.Pkg, and is useful for accessing the field via an interface. -func (v *__CertifyOSVInput) GetPkg() PkgInputSpec { return v.Pkg } +// GetSubject returns PathPathHasSLSA.Subject, and is useful for accessing the field via an interface. +func (v *PathPathHasSLSA) GetSubject() AllSLSATreeSubjectArtifact { return v.AllSLSATree.Subject } -// GetOsv returns __CertifyOSVInput.Osv, and is useful for accessing the field via an interface. -func (v *__CertifyOSVInput) GetOsv() OSVInputSpec { return v.Osv } +// GetSlsa returns PathPathHasSLSA.Slsa, and is useful for accessing the field via an interface. +func (v *PathPathHasSLSA) GetSlsa() AllSLSATreeSlsaSLSA { return v.AllSLSATree.Slsa } -// GetCertifyVuln returns __CertifyOSVInput.CertifyVuln, and is useful for accessing the field via an interface. -func (v *__CertifyOSVInput) GetCertifyVuln() VulnerabilityMetaDataInput { return v.CertifyVuln } +func (v *PathPathHasSLSA) UnmarshalJSON(b []byte) error { -// __CertifyScorecardInput is used internally by genqlient -type __CertifyScorecardInput struct { - Source SourceInputSpec `json:"source"` - Scorecard ScorecardInputSpec `json:"scorecard"` -} + if string(b) == "null" { + return nil + } -// GetSource returns __CertifyScorecardInput.Source, and is useful for accessing the field via an interface. -func (v *__CertifyScorecardInput) GetSource() SourceInputSpec { return v.Source } + var firstPass struct { + *PathPathHasSLSA + graphql.NoUnmarshalJSON + } + firstPass.PathPathHasSLSA = v -// GetScorecard returns __CertifyScorecardInput.Scorecard, and is useful for accessing the field via an interface. -func (v *__CertifyScorecardInput) GetScorecard() ScorecardInputSpec { return v.Scorecard } + err := json.Unmarshal(b, &firstPass) + if err != nil { + return err + } -// __CertifyScorecardsInput is used internally by genqlient -type __CertifyScorecardsInput struct { - Sources []SourceInputSpec `json:"sources"` - Scorecards []ScorecardInputSpec `json:"scorecards"` + err = json.Unmarshal( + b, &v.AllSLSATree) + if err != nil { + return err + } + return nil } -// GetSources returns __CertifyScorecardsInput.Sources, and is useful for accessing the field via an interface. -func (v *__CertifyScorecardsInput) GetSources() []SourceInputSpec { return v.Sources } +type __premarshalPathPathHasSLSA struct { + Typename *string `json:"__typename"` -// GetScorecards returns __CertifyScorecardsInput.Scorecards, and is useful for accessing the field via an interface. -func (v *__CertifyScorecardsInput) GetScorecards() []ScorecardInputSpec { return v.Scorecards } + Id string `json:"id"` -// __FindSoftwareInput is used internally by genqlient -type __FindSoftwareInput struct { - SearchText string `json:"searchText"` -} + Subject AllSLSATreeSubjectArtifact `json:"subject"` -// GetSearchText returns __FindSoftwareInput.SearchText, and is useful for accessing the field via an interface. -func (v *__FindSoftwareInput) GetSearchText() string { return v.SearchText } + Slsa AllSLSATreeSlsaSLSA `json:"slsa"` +} -// __GHSAsInput is used internally by genqlient -type __GHSAsInput struct { - Filter *GHSASpec `json:"filter"` +func (v *PathPathHasSLSA) MarshalJSON() ([]byte, error) { + premarshaled, err := v.__premarshalJSON() + if err != nil { + return nil, err + } + return json.Marshal(premarshaled) } -// GetFilter returns __GHSAsInput.Filter, and is useful for accessing the field via an interface. -func (v *__GHSAsInput) GetFilter() *GHSASpec { return v.Filter } +func (v *PathPathHasSLSA) __premarshalJSON() (*__premarshalPathPathHasSLSA, error) { + var retval __premarshalPathPathHasSLSA -// __HasMetadataArtifactInput is used internally by genqlient -type __HasMetadataArtifactInput struct { - Artifact ArtifactInputSpec `json:"artifact"` - HasMetadata HasMetadataInputSpec `json:"hasMetadata"` + retval.Typename = v.Typename + retval.Id = v.AllSLSATree.Id + retval.Subject = v.AllSLSATree.Subject + retval.Slsa = v.AllSLSATree.Slsa + return &retval, nil } -// GetArtifact returns __HasMetadataArtifactInput.Artifact, and is useful for accessing the field via an interface. -func (v *__HasMetadataArtifactInput) GetArtifact() ArtifactInputSpec { return v.Artifact } +// PathPathHasSourceAt includes the requested fields of the GraphQL type HasSourceAt. +// The GraphQL type's documentation follows. +// +// HasSourceAt records that a package's repository is a given source. +type PathPathHasSourceAt struct { + Typename *string `json:"__typename"` + AllHasSourceAt `json:"-"` +} -// GetHasMetadata returns __HasMetadataArtifactInput.HasMetadata, and is useful for accessing the field via an interface. -func (v *__HasMetadataArtifactInput) GetHasMetadata() HasMetadataInputSpec { return v.HasMetadata } +// GetTypename returns PathPathHasSourceAt.Typename, and is useful for accessing the field via an interface. +func (v *PathPathHasSourceAt) GetTypename() *string { return v.Typename } -// __HasMetadataPkgInput is used internally by genqlient -type __HasMetadataPkgInput struct { - Pkg PkgInputSpec `json:"pkg"` - PkgMatchType *MatchFlags `json:"pkgMatchType"` - HasMetadata HasMetadataInputSpec `json:"hasMetadata"` -} +// GetId returns PathPathHasSourceAt.Id, and is useful for accessing the field via an interface. +func (v *PathPathHasSourceAt) GetId() string { return v.AllHasSourceAt.Id } -// GetPkg returns __HasMetadataPkgInput.Pkg, and is useful for accessing the field via an interface. -func (v *__HasMetadataPkgInput) GetPkg() PkgInputSpec { return v.Pkg } +// GetJustification returns PathPathHasSourceAt.Justification, and is useful for accessing the field via an interface. +func (v *PathPathHasSourceAt) GetJustification() string { return v.AllHasSourceAt.Justification } -// GetPkgMatchType returns __HasMetadataPkgInput.PkgMatchType, and is useful for accessing the field via an interface. -func (v *__HasMetadataPkgInput) GetPkgMatchType() *MatchFlags { return v.PkgMatchType } +// GetKnownSince returns PathPathHasSourceAt.KnownSince, and is useful for accessing the field via an interface. +func (v *PathPathHasSourceAt) GetKnownSince() time.Time { return v.AllHasSourceAt.KnownSince } -// GetHasMetadata returns __HasMetadataPkgInput.HasMetadata, and is useful for accessing the field via an interface. -func (v *__HasMetadataPkgInput) GetHasMetadata() HasMetadataInputSpec { return v.HasMetadata } +// GetPackage returns PathPathHasSourceAt.Package, and is useful for accessing the field via an interface. +func (v *PathPathHasSourceAt) GetPackage() AllHasSourceAtPackage { return v.AllHasSourceAt.Package } -// __HasMetadataSrcInput is used internally by genqlient -type __HasMetadataSrcInput struct { - Source SourceInputSpec `json:"source"` - HasMetadata HasMetadataInputSpec `json:"hasMetadata"` -} +// GetSource returns PathPathHasSourceAt.Source, and is useful for accessing the field via an interface. +func (v *PathPathHasSourceAt) GetSource() AllHasSourceAtSource { return v.AllHasSourceAt.Source } -// GetSource returns __HasMetadataSrcInput.Source, and is useful for accessing the field via an interface. -func (v *__HasMetadataSrcInput) GetSource() SourceInputSpec { return v.Source } +// GetOrigin returns PathPathHasSourceAt.Origin, and is useful for accessing the field via an interface. +func (v *PathPathHasSourceAt) GetOrigin() string { return v.AllHasSourceAt.Origin } -// GetHasMetadata returns __HasMetadataSrcInput.HasMetadata, and is useful for accessing the field via an interface. -func (v *__HasMetadataSrcInput) GetHasMetadata() HasMetadataInputSpec { return v.HasMetadata } +// GetCollector returns PathPathHasSourceAt.Collector, and is useful for accessing the field via an interface. +func (v *PathPathHasSourceAt) GetCollector() string { return v.AllHasSourceAt.Collector } -// __HasSBOMArtifactInput is used internally by genqlient -type __HasSBOMArtifactInput struct { - Artifact ArtifactInputSpec `json:"artifact"` - HasSBOM HasSBOMInputSpec `json:"hasSBOM"` -} +func (v *PathPathHasSourceAt) UnmarshalJSON(b []byte) error { -// GetArtifact returns __HasSBOMArtifactInput.Artifact, and is useful for accessing the field via an interface. -func (v *__HasSBOMArtifactInput) GetArtifact() ArtifactInputSpec { return v.Artifact } + if string(b) == "null" { + return nil + } + + var firstPass struct { + *PathPathHasSourceAt + graphql.NoUnmarshalJSON + } + firstPass.PathPathHasSourceAt = v -// GetHasSBOM returns __HasSBOMArtifactInput.HasSBOM, and is useful for accessing the field via an interface. -func (v *__HasSBOMArtifactInput) GetHasSBOM() HasSBOMInputSpec { return v.HasSBOM } + err := json.Unmarshal(b, &firstPass) + if err != nil { + return err + } -// __HasSBOMPkgInput is used internally by genqlient -type __HasSBOMPkgInput struct { - Pkg PkgInputSpec `json:"pkg"` - HasSBOM HasSBOMInputSpec `json:"hasSBOM"` + err = json.Unmarshal( + b, &v.AllHasSourceAt) + if err != nil { + return err + } + return nil } -// GetPkg returns __HasSBOMPkgInput.Pkg, and is useful for accessing the field via an interface. -func (v *__HasSBOMPkgInput) GetPkg() PkgInputSpec { return v.Pkg } +type __premarshalPathPathHasSourceAt struct { + Typename *string `json:"__typename"` -// GetHasSBOM returns __HasSBOMPkgInput.HasSBOM, and is useful for accessing the field via an interface. -func (v *__HasSBOMPkgInput) GetHasSBOM() HasSBOMInputSpec { return v.HasSBOM } + Id string `json:"id"` -// __HasSourceAtInput is used internally by genqlient -type __HasSourceAtInput struct { - Pkg PkgInputSpec `json:"pkg"` - PkgMatchType MatchFlags `json:"pkgMatchType"` - Source SourceInputSpec `json:"source"` - HasSourceAt HasSourceAtInputSpec `json:"hasSourceAt"` -} + Justification string `json:"justification"` -// GetPkg returns __HasSourceAtInput.Pkg, and is useful for accessing the field via an interface. -func (v *__HasSourceAtInput) GetPkg() PkgInputSpec { return v.Pkg } + KnownSince time.Time `json:"knownSince"` -// GetPkgMatchType returns __HasSourceAtInput.PkgMatchType, and is useful for accessing the field via an interface. -func (v *__HasSourceAtInput) GetPkgMatchType() MatchFlags { return v.PkgMatchType } + Package AllHasSourceAtPackage `json:"package"` -// GetSource returns __HasSourceAtInput.Source, and is useful for accessing the field via an interface. -func (v *__HasSourceAtInput) GetSource() SourceInputSpec { return v.Source } + Source AllHasSourceAtSource `json:"source"` -// GetHasSourceAt returns __HasSourceAtInput.HasSourceAt, and is useful for accessing the field via an interface. -func (v *__HasSourceAtInput) GetHasSourceAt() HasSourceAtInputSpec { return v.HasSourceAt } + Origin string `json:"origin"` -// __HashEqualInput is used internally by genqlient -type __HashEqualInput struct { - Artifact ArtifactInputSpec `json:"artifact"` - OtherArtifact ArtifactInputSpec `json:"otherArtifact"` - HashEqual HashEqualInputSpec `json:"hashEqual"` + Collector string `json:"collector"` } -// GetArtifact returns __HashEqualInput.Artifact, and is useful for accessing the field via an interface. -func (v *__HashEqualInput) GetArtifact() ArtifactInputSpec { return v.Artifact } +func (v *PathPathHasSourceAt) MarshalJSON() ([]byte, error) { + premarshaled, err := v.__premarshalJSON() + if err != nil { + return nil, err + } + return json.Marshal(premarshaled) +} -// GetOtherArtifact returns __HashEqualInput.OtherArtifact, and is useful for accessing the field via an interface. -func (v *__HashEqualInput) GetOtherArtifact() ArtifactInputSpec { return v.OtherArtifact } +func (v *PathPathHasSourceAt) __premarshalJSON() (*__premarshalPathPathHasSourceAt, error) { + var retval __premarshalPathPathHasSourceAt -// GetHashEqual returns __HashEqualInput.HashEqual, and is useful for accessing the field via an interface. -func (v *__HashEqualInput) GetHashEqual() HashEqualInputSpec { return v.HashEqual } + retval.Typename = v.Typename + retval.Id = v.AllHasSourceAt.Id + retval.Justification = v.AllHasSourceAt.Justification + retval.KnownSince = v.AllHasSourceAt.KnownSince + retval.Package = v.AllHasSourceAt.Package + retval.Source = v.AllHasSourceAt.Source + retval.Origin = v.AllHasSourceAt.Origin + retval.Collector = v.AllHasSourceAt.Collector + return &retval, nil +} -// __IngestArtifactInput is used internally by genqlient -type __IngestArtifactInput struct { - Artifact ArtifactInputSpec `json:"artifact"` +// PathPathHashEqual includes the requested fields of the GraphQL type HashEqual. +// The GraphQL type's documentation follows. +// +// HashEqual is an attestation that a set of artifacts are identical. +type PathPathHashEqual struct { + Typename *string `json:"__typename"` + AllHashEqualTree `json:"-"` } -// GetArtifact returns __IngestArtifactInput.Artifact, and is useful for accessing the field via an interface. -func (v *__IngestArtifactInput) GetArtifact() ArtifactInputSpec { return v.Artifact } +// GetTypename returns PathPathHashEqual.Typename, and is useful for accessing the field via an interface. +func (v *PathPathHashEqual) GetTypename() *string { return v.Typename } -// __IngestArtifactsInput is used internally by genqlient -type __IngestArtifactsInput struct { - Artifacts []ArtifactInputSpec `json:"artifacts"` -} +// GetId returns PathPathHashEqual.Id, and is useful for accessing the field via an interface. +func (v *PathPathHashEqual) GetId() string { return v.AllHashEqualTree.Id } -// GetArtifacts returns __IngestArtifactsInput.Artifacts, and is useful for accessing the field via an interface. -func (v *__IngestArtifactsInput) GetArtifacts() []ArtifactInputSpec { return v.Artifacts } +// GetJustification returns PathPathHashEqual.Justification, and is useful for accessing the field via an interface. +func (v *PathPathHashEqual) GetJustification() string { return v.AllHashEqualTree.Justification } -// __IngestBuilderInput is used internally by genqlient -type __IngestBuilderInput struct { - Builder BuilderInputSpec `json:"builder"` +// GetArtifacts returns PathPathHashEqual.Artifacts, and is useful for accessing the field via an interface. +func (v *PathPathHashEqual) GetArtifacts() []AllHashEqualTreeArtifactsArtifact { + return v.AllHashEqualTree.Artifacts } -// GetBuilder returns __IngestBuilderInput.Builder, and is useful for accessing the field via an interface. -func (v *__IngestBuilderInput) GetBuilder() BuilderInputSpec { return v.Builder } +// GetOrigin returns PathPathHashEqual.Origin, and is useful for accessing the field via an interface. +func (v *PathPathHashEqual) GetOrigin() string { return v.AllHashEqualTree.Origin } -// __IngestBuildersInput is used internally by genqlient -type __IngestBuildersInput struct { - Builders []BuilderInputSpec `json:"builders"` -} +// GetCollector returns PathPathHashEqual.Collector, and is useful for accessing the field via an interface. +func (v *PathPathHashEqual) GetCollector() string { return v.AllHashEqualTree.Collector } -// GetBuilders returns __IngestBuildersInput.Builders, and is useful for accessing the field via an interface. -func (v *__IngestBuildersInput) GetBuilders() []BuilderInputSpec { return v.Builders } +func (v *PathPathHashEqual) UnmarshalJSON(b []byte) error { -// __IngestCVEInput is used internally by genqlient -type __IngestCVEInput struct { - Cve CVEInputSpec `json:"cve"` -} + if string(b) == "null" { + return nil + } -// GetCve returns __IngestCVEInput.Cve, and is useful for accessing the field via an interface. -func (v *__IngestCVEInput) GetCve() CVEInputSpec { return v.Cve } + var firstPass struct { + *PathPathHashEqual + graphql.NoUnmarshalJSON + } + firstPass.PathPathHashEqual = v -// __IngestCVEsInput is used internally by genqlient -type __IngestCVEsInput struct { - Cves []CVEInputSpec `json:"cves"` + err := json.Unmarshal(b, &firstPass) + if err != nil { + return err + } + + err = json.Unmarshal( + b, &v.AllHashEqualTree) + if err != nil { + return err + } + return nil } -// GetCves returns __IngestCVEsInput.Cves, and is useful for accessing the field via an interface. -func (v *__IngestCVEsInput) GetCves() []CVEInputSpec { return v.Cves } +type __premarshalPathPathHashEqual struct { + Typename *string `json:"__typename"` -// __IngestGHSAInput is used internally by genqlient -type __IngestGHSAInput struct { - Ghsa GHSAInputSpec `json:"ghsa"` -} + Id string `json:"id"` -// GetGhsa returns __IngestGHSAInput.Ghsa, and is useful for accessing the field via an interface. -func (v *__IngestGHSAInput) GetGhsa() GHSAInputSpec { return v.Ghsa } + Justification string `json:"justification"` -// __IngestGHSAsInput is used internally by genqlient -type __IngestGHSAsInput struct { - Ghsas []GHSAInputSpec `json:"ghsas"` -} + Artifacts []AllHashEqualTreeArtifactsArtifact `json:"artifacts"` -// GetGhsas returns __IngestGHSAsInput.Ghsas, and is useful for accessing the field via an interface. -func (v *__IngestGHSAsInput) GetGhsas() []GHSAInputSpec { return v.Ghsas } + Origin string `json:"origin"` -// __IngestOSVInput is used internally by genqlient -type __IngestOSVInput struct { - Osv OSVInputSpec `json:"osv"` + Collector string `json:"collector"` } -// GetOsv returns __IngestOSVInput.Osv, and is useful for accessing the field via an interface. -func (v *__IngestOSVInput) GetOsv() OSVInputSpec { return v.Osv } - -// __IngestOSVsInput is used internally by genqlient -type __IngestOSVsInput struct { - Osvs []OSVInputSpec `json:"osvs"` +func (v *PathPathHashEqual) MarshalJSON() ([]byte, error) { + premarshaled, err := v.__premarshalJSON() + if err != nil { + return nil, err + } + return json.Marshal(premarshaled) } -// GetOsvs returns __IngestOSVsInput.Osvs, and is useful for accessing the field via an interface. -func (v *__IngestOSVsInput) GetOsvs() []OSVInputSpec { return v.Osvs } +func (v *PathPathHashEqual) __premarshalJSON() (*__premarshalPathPathHashEqual, error) { + var retval __premarshalPathPathHashEqual -// __IngestPackageInput is used internally by genqlient -type __IngestPackageInput struct { - Pkg PkgInputSpec `json:"pkg"` + retval.Typename = v.Typename + retval.Id = v.AllHashEqualTree.Id + retval.Justification = v.AllHashEqualTree.Justification + retval.Artifacts = v.AllHashEqualTree.Artifacts + retval.Origin = v.AllHashEqualTree.Origin + retval.Collector = v.AllHashEqualTree.Collector + return &retval, nil } -// GetPkg returns __IngestPackageInput.Pkg, and is useful for accessing the field via an interface. -func (v *__IngestPackageInput) GetPkg() PkgInputSpec { return v.Pkg } - -// __IngestPackagesInput is used internally by genqlient -type __IngestPackagesInput struct { - Pkgs []PkgInputSpec `json:"pkgs"` +// PathPathIsDependency includes the requested fields of the GraphQL type IsDependency. +// The GraphQL type's documentation follows. +// +// IsDependency is an attestation to record that a package depends on another. +type PathPathIsDependency struct { + Typename *string `json:"__typename"` + AllIsDependencyTree `json:"-"` } -// GetPkgs returns __IngestPackagesInput.Pkgs, and is useful for accessing the field via an interface. -func (v *__IngestPackagesInput) GetPkgs() []PkgInputSpec { return v.Pkgs } +// GetTypename returns PathPathIsDependency.Typename, and is useful for accessing the field via an interface. +func (v *PathPathIsDependency) GetTypename() *string { return v.Typename } -// __IngestSourceInput is used internally by genqlient -type __IngestSourceInput struct { - Source SourceInputSpec `json:"source"` -} +// GetId returns PathPathIsDependency.Id, and is useful for accessing the field via an interface. +func (v *PathPathIsDependency) GetId() string { return v.AllIsDependencyTree.Id } -// GetSource returns __IngestSourceInput.Source, and is useful for accessing the field via an interface. -func (v *__IngestSourceInput) GetSource() SourceInputSpec { return v.Source } +// GetJustification returns PathPathIsDependency.Justification, and is useful for accessing the field via an interface. +func (v *PathPathIsDependency) GetJustification() string { return v.AllIsDependencyTree.Justification } -// __IngestSourcesInput is used internally by genqlient -type __IngestSourcesInput struct { - Sources []SourceInputSpec `json:"sources"` +// GetPackage returns PathPathIsDependency.Package, and is useful for accessing the field via an interface. +func (v *PathPathIsDependency) GetPackage() AllIsDependencyTreePackage { + return v.AllIsDependencyTree.Package } -// GetSources returns __IngestSourcesInput.Sources, and is useful for accessing the field via an interface. -func (v *__IngestSourcesInput) GetSources() []SourceInputSpec { return v.Sources } +// GetDependentPackage returns PathPathIsDependency.DependentPackage, and is useful for accessing the field via an interface. +func (v *PathPathIsDependency) GetDependentPackage() AllIsDependencyTreeDependentPackage { + return v.AllIsDependencyTree.DependentPackage +} -// __IsDependenciesInput is used internally by genqlient -type __IsDependenciesInput struct { - Pkgs []PkgInputSpec `json:"pkgs"` - DepPkgs []PkgInputSpec `json:"depPkgs"` - Dependencies []IsDependencyInputSpec `json:"dependencies"` +// GetDependencyType returns PathPathIsDependency.DependencyType, and is useful for accessing the field via an interface. +func (v *PathPathIsDependency) GetDependencyType() DependencyType { + return v.AllIsDependencyTree.DependencyType } -// GetPkgs returns __IsDependenciesInput.Pkgs, and is useful for accessing the field via an interface. -func (v *__IsDependenciesInput) GetPkgs() []PkgInputSpec { return v.Pkgs } +// GetVersionRange returns PathPathIsDependency.VersionRange, and is useful for accessing the field via an interface. +func (v *PathPathIsDependency) GetVersionRange() string { return v.AllIsDependencyTree.VersionRange } -// GetDepPkgs returns __IsDependenciesInput.DepPkgs, and is useful for accessing the field via an interface. -func (v *__IsDependenciesInput) GetDepPkgs() []PkgInputSpec { return v.DepPkgs } +// GetOrigin returns PathPathIsDependency.Origin, and is useful for accessing the field via an interface. +func (v *PathPathIsDependency) GetOrigin() string { return v.AllIsDependencyTree.Origin } -// GetDependencies returns __IsDependenciesInput.Dependencies, and is useful for accessing the field via an interface. -func (v *__IsDependenciesInput) GetDependencies() []IsDependencyInputSpec { return v.Dependencies } +// GetCollector returns PathPathIsDependency.Collector, and is useful for accessing the field via an interface. +func (v *PathPathIsDependency) GetCollector() string { return v.AllIsDependencyTree.Collector } -// __IsDependencyInput is used internally by genqlient -type __IsDependencyInput struct { - Pkg PkgInputSpec `json:"pkg"` - DepPkg PkgInputSpec `json:"depPkg"` - Dependency IsDependencyInputSpec `json:"dependency"` -} +func (v *PathPathIsDependency) UnmarshalJSON(b []byte) error { -// GetPkg returns __IsDependencyInput.Pkg, and is useful for accessing the field via an interface. -func (v *__IsDependencyInput) GetPkg() PkgInputSpec { return v.Pkg } + if string(b) == "null" { + return nil + } -// GetDepPkg returns __IsDependencyInput.DepPkg, and is useful for accessing the field via an interface. -func (v *__IsDependencyInput) GetDepPkg() PkgInputSpec { return v.DepPkg } + var firstPass struct { + *PathPathIsDependency + graphql.NoUnmarshalJSON + } + firstPass.PathPathIsDependency = v -// GetDependency returns __IsDependencyInput.Dependency, and is useful for accessing the field via an interface. -func (v *__IsDependencyInput) GetDependency() IsDependencyInputSpec { return v.Dependency } + err := json.Unmarshal(b, &firstPass) + if err != nil { + return err + } -// __IsOccurrencePkgInput is used internally by genqlient -type __IsOccurrencePkgInput struct { - Pkg PkgInputSpec `json:"pkg"` - Artifact ArtifactInputSpec `json:"artifact"` - Occurrence IsOccurrenceInputSpec `json:"occurrence"` + err = json.Unmarshal( + b, &v.AllIsDependencyTree) + if err != nil { + return err + } + return nil } -// GetPkg returns __IsOccurrencePkgInput.Pkg, and is useful for accessing the field via an interface. -func (v *__IsOccurrencePkgInput) GetPkg() PkgInputSpec { return v.Pkg } +type __premarshalPathPathIsDependency struct { + Typename *string `json:"__typename"` + + Id string `json:"id"` -// GetArtifact returns __IsOccurrencePkgInput.Artifact, and is useful for accessing the field via an interface. -func (v *__IsOccurrencePkgInput) GetArtifact() ArtifactInputSpec { return v.Artifact } + Justification string `json:"justification"` -// GetOccurrence returns __IsOccurrencePkgInput.Occurrence, and is useful for accessing the field via an interface. -func (v *__IsOccurrencePkgInput) GetOccurrence() IsOccurrenceInputSpec { return v.Occurrence } + Package AllIsDependencyTreePackage `json:"package"` -// __IsOccurrenceSrcInput is used internally by genqlient -type __IsOccurrenceSrcInput struct { - Source SourceInputSpec `json:"source"` - Artifact ArtifactInputSpec `json:"artifact"` - Occurrence IsOccurrenceInputSpec `json:"occurrence"` -} + DependentPackage AllIsDependencyTreeDependentPackage `json:"dependentPackage"` -// GetSource returns __IsOccurrenceSrcInput.Source, and is useful for accessing the field via an interface. -func (v *__IsOccurrenceSrcInput) GetSource() SourceInputSpec { return v.Source } + DependencyType DependencyType `json:"dependencyType"` -// GetArtifact returns __IsOccurrenceSrcInput.Artifact, and is useful for accessing the field via an interface. -func (v *__IsOccurrenceSrcInput) GetArtifact() ArtifactInputSpec { return v.Artifact } + VersionRange string `json:"versionRange"` -// GetOccurrence returns __IsOccurrenceSrcInput.Occurrence, and is useful for accessing the field via an interface. -func (v *__IsOccurrenceSrcInput) GetOccurrence() IsOccurrenceInputSpec { return v.Occurrence } + Origin string `json:"origin"` -// __IsOccurrencesPkgInput is used internally by genqlient -type __IsOccurrencesPkgInput struct { - Pkgs []PkgInputSpec `json:"pkgs"` - Artifacts []ArtifactInputSpec `json:"artifacts"` - Occurrences []IsOccurrenceInputSpec `json:"occurrences"` + Collector string `json:"collector"` } -// GetPkgs returns __IsOccurrencesPkgInput.Pkgs, and is useful for accessing the field via an interface. -func (v *__IsOccurrencesPkgInput) GetPkgs() []PkgInputSpec { return v.Pkgs } +func (v *PathPathIsDependency) MarshalJSON() ([]byte, error) { + premarshaled, err := v.__premarshalJSON() + if err != nil { + return nil, err + } + return json.Marshal(premarshaled) +} -// GetArtifacts returns __IsOccurrencesPkgInput.Artifacts, and is useful for accessing the field via an interface. -func (v *__IsOccurrencesPkgInput) GetArtifacts() []ArtifactInputSpec { return v.Artifacts } +func (v *PathPathIsDependency) __premarshalJSON() (*__premarshalPathPathIsDependency, error) { + var retval __premarshalPathPathIsDependency -// GetOccurrences returns __IsOccurrencesPkgInput.Occurrences, and is useful for accessing the field via an interface. -func (v *__IsOccurrencesPkgInput) GetOccurrences() []IsOccurrenceInputSpec { return v.Occurrences } + retval.Typename = v.Typename + retval.Id = v.AllIsDependencyTree.Id + retval.Justification = v.AllIsDependencyTree.Justification + retval.Package = v.AllIsDependencyTree.Package + retval.DependentPackage = v.AllIsDependencyTree.DependentPackage + retval.DependencyType = v.AllIsDependencyTree.DependencyType + retval.VersionRange = v.AllIsDependencyTree.VersionRange + retval.Origin = v.AllIsDependencyTree.Origin + retval.Collector = v.AllIsDependencyTree.Collector + return &retval, nil +} -// __IsOccurrencesSrcInput is used internally by genqlient -type __IsOccurrencesSrcInput struct { - Sources []SourceInputSpec `json:"sources"` - Artifacts []ArtifactInputSpec `json:"artifacts"` - Occurrences []IsOccurrenceInputSpec `json:"occurrences"` +// PathPathIsOccurrence includes the requested fields of the GraphQL type IsOccurrence. +// The GraphQL type's documentation follows. +// +// IsOccurrence is an attestation to link an artifact to a package or source. +// +// Attestation must occur at the PackageVersion or at the SourceName. +type PathPathIsOccurrence struct { + Typename *string `json:"__typename"` + AllIsOccurrencesTree `json:"-"` } -// GetSources returns __IsOccurrencesSrcInput.Sources, and is useful for accessing the field via an interface. -func (v *__IsOccurrencesSrcInput) GetSources() []SourceInputSpec { return v.Sources } +// GetTypename returns PathPathIsOccurrence.Typename, and is useful for accessing the field via an interface. +func (v *PathPathIsOccurrence) GetTypename() *string { return v.Typename } -// GetArtifacts returns __IsOccurrencesSrcInput.Artifacts, and is useful for accessing the field via an interface. -func (v *__IsOccurrencesSrcInput) GetArtifacts() []ArtifactInputSpec { return v.Artifacts } +// GetId returns PathPathIsOccurrence.Id, and is useful for accessing the field via an interface. +func (v *PathPathIsOccurrence) GetId() string { return v.AllIsOccurrencesTree.Id } -// GetOccurrences returns __IsOccurrencesSrcInput.Occurrences, and is useful for accessing the field via an interface. -func (v *__IsOccurrencesSrcInput) GetOccurrences() []IsOccurrenceInputSpec { return v.Occurrences } +// GetSubject returns PathPathIsOccurrence.Subject, and is useful for accessing the field via an interface. +func (v *PathPathIsOccurrence) GetSubject() AllIsOccurrencesTreeSubjectPackageOrSource { + return v.AllIsOccurrencesTree.Subject +} -// __IsVulnerabilityCVEInput is used internally by genqlient -type __IsVulnerabilityCVEInput struct { - Osv OSVInputSpec `json:"osv"` - Cve CVEInputSpec `json:"cve"` - IsVulnerability IsVulnerabilityInputSpec `json:"isVulnerability"` +// GetArtifact returns PathPathIsOccurrence.Artifact, and is useful for accessing the field via an interface. +func (v *PathPathIsOccurrence) GetArtifact() AllIsOccurrencesTreeArtifact { + return v.AllIsOccurrencesTree.Artifact } -// GetOsv returns __IsVulnerabilityCVEInput.Osv, and is useful for accessing the field via an interface. -func (v *__IsVulnerabilityCVEInput) GetOsv() OSVInputSpec { return v.Osv } +// GetJustification returns PathPathIsOccurrence.Justification, and is useful for accessing the field via an interface. +func (v *PathPathIsOccurrence) GetJustification() string { return v.AllIsOccurrencesTree.Justification } -// GetCve returns __IsVulnerabilityCVEInput.Cve, and is useful for accessing the field via an interface. -func (v *__IsVulnerabilityCVEInput) GetCve() CVEInputSpec { return v.Cve } +// GetOrigin returns PathPathIsOccurrence.Origin, and is useful for accessing the field via an interface. +func (v *PathPathIsOccurrence) GetOrigin() string { return v.AllIsOccurrencesTree.Origin } -// GetIsVulnerability returns __IsVulnerabilityCVEInput.IsVulnerability, and is useful for accessing the field via an interface. -func (v *__IsVulnerabilityCVEInput) GetIsVulnerability() IsVulnerabilityInputSpec { - return v.IsVulnerability -} +// GetCollector returns PathPathIsOccurrence.Collector, and is useful for accessing the field via an interface. +func (v *PathPathIsOccurrence) GetCollector() string { return v.AllIsOccurrencesTree.Collector } -// __IsVulnerabilityGHSAInput is used internally by genqlient -type __IsVulnerabilityGHSAInput struct { - Osv OSVInputSpec `json:"osv"` - Ghsa GHSAInputSpec `json:"ghsa"` - IsVulnerability IsVulnerabilityInputSpec `json:"isVulnerability"` -} +func (v *PathPathIsOccurrence) UnmarshalJSON(b []byte) error { -// GetOsv returns __IsVulnerabilityGHSAInput.Osv, and is useful for accessing the field via an interface. -func (v *__IsVulnerabilityGHSAInput) GetOsv() OSVInputSpec { return v.Osv } + if string(b) == "null" { + return nil + } -// GetGhsa returns __IsVulnerabilityGHSAInput.Ghsa, and is useful for accessing the field via an interface. -func (v *__IsVulnerabilityGHSAInput) GetGhsa() GHSAInputSpec { return v.Ghsa } + var firstPass struct { + *PathPathIsOccurrence + graphql.NoUnmarshalJSON + } + firstPass.PathPathIsOccurrence = v -// GetIsVulnerability returns __IsVulnerabilityGHSAInput.IsVulnerability, and is useful for accessing the field via an interface. -func (v *__IsVulnerabilityGHSAInput) GetIsVulnerability() IsVulnerabilityInputSpec { - return v.IsVulnerability -} + err := json.Unmarshal(b, &firstPass) + if err != nil { + return err + } -// __NeighborsInput is used internally by genqlient -type __NeighborsInput struct { - Node string `json:"node"` - UsingOnly []Edge `json:"usingOnly"` + err = json.Unmarshal( + b, &v.AllIsOccurrencesTree) + if err != nil { + return err + } + return nil } -// GetNode returns __NeighborsInput.Node, and is useful for accessing the field via an interface. -func (v *__NeighborsInput) GetNode() string { return v.Node } +type __premarshalPathPathIsOccurrence struct { + Typename *string `json:"__typename"` -// GetUsingOnly returns __NeighborsInput.UsingOnly, and is useful for accessing the field via an interface. -func (v *__NeighborsInput) GetUsingOnly() []Edge { return v.UsingOnly } + Id string `json:"id"` -// __NodeInput is used internally by genqlient -type __NodeInput struct { - Node string `json:"node"` -} + Subject json.RawMessage `json:"subject"` -// GetNode returns __NodeInput.Node, and is useful for accessing the field via an interface. -func (v *__NodeInput) GetNode() string { return v.Node } + Artifact AllIsOccurrencesTreeArtifact `json:"artifact"` -// __NodesInput is used internally by genqlient -type __NodesInput struct { - Nodes []string `json:"nodes"` -} + Justification string `json:"justification"` -// GetNodes returns __NodesInput.Nodes, and is useful for accessing the field via an interface. -func (v *__NodesInput) GetNodes() []string { return v.Nodes } + Origin string `json:"origin"` -// __OSVsInput is used internally by genqlient -type __OSVsInput struct { - Filter *OSVSpec `json:"filter"` + Collector string `json:"collector"` } -// GetFilter returns __OSVsInput.Filter, and is useful for accessing the field via an interface. -func (v *__OSVsInput) GetFilter() *OSVSpec { return v.Filter } - -// __PackagesInput is used internally by genqlient -type __PackagesInput struct { - Filter *PkgSpec `json:"filter"` +func (v *PathPathIsOccurrence) MarshalJSON() ([]byte, error) { + premarshaled, err := v.__premarshalJSON() + if err != nil { + return nil, err + } + return json.Marshal(premarshaled) } -// GetFilter returns __PackagesInput.Filter, and is useful for accessing the field via an interface. -func (v *__PackagesInput) GetFilter() *PkgSpec { return v.Filter } +func (v *PathPathIsOccurrence) __premarshalJSON() (*__premarshalPathPathIsOccurrence, error) { + var retval __premarshalPathPathIsOccurrence -// __PathInput is used internally by genqlient -type __PathInput struct { - Subject string `json:"subject"` - Target string `json:"target"` - MaxPathLength int `json:"maxPathLength"` - UsingOnly []Edge `json:"usingOnly"` + retval.Typename = v.Typename + retval.Id = v.AllIsOccurrencesTree.Id + { + + dst := &retval.Subject + src := v.AllIsOccurrencesTree.Subject + var err error + *dst, err = __marshalAllIsOccurrencesTreeSubjectPackageOrSource( + &src) + if err != nil { + return nil, fmt.Errorf( + "unable to marshal PathPathIsOccurrence.AllIsOccurrencesTree.Subject: %w", err) + } + } + retval.Artifact = v.AllIsOccurrencesTree.Artifact + retval.Justification = v.AllIsOccurrencesTree.Justification + retval.Origin = v.AllIsOccurrencesTree.Origin + retval.Collector = v.AllIsOccurrencesTree.Collector + return &retval, nil } -// GetSubject returns __PathInput.Subject, and is useful for accessing the field via an interface. -func (v *__PathInput) GetSubject() string { return v.Subject } +// PathPathIsVulnerability includes the requested fields of the GraphQL type IsVulnerability. +// The GraphQL type's documentation follows. +// +// IsVulnerability is an attestation to link CVE/GHSA with data in OSV. +type PathPathIsVulnerability struct { + Typename *string `json:"__typename"` + AllIsVulnerability `json:"-"` +} -// GetTarget returns __PathInput.Target, and is useful for accessing the field via an interface. -func (v *__PathInput) GetTarget() string { return v.Target } +// GetTypename returns PathPathIsVulnerability.Typename, and is useful for accessing the field via an interface. +func (v *PathPathIsVulnerability) GetTypename() *string { return v.Typename } -// GetMaxPathLength returns __PathInput.MaxPathLength, and is useful for accessing the field via an interface. -func (v *__PathInput) GetMaxPathLength() int { return v.MaxPathLength } +// GetId returns PathPathIsVulnerability.Id, and is useful for accessing the field via an interface. +func (v *PathPathIsVulnerability) GetId() string { return v.AllIsVulnerability.Id } -// GetUsingOnly returns __PathInput.UsingOnly, and is useful for accessing the field via an interface. -func (v *__PathInput) GetUsingOnly() []Edge { return v.UsingOnly } +// GetOsv returns PathPathIsVulnerability.Osv, and is useful for accessing the field via an interface. +func (v *PathPathIsVulnerability) GetOsv() AllIsVulnerabilityOsvOSV { return v.AllIsVulnerability.Osv } -// __PkgEqualInput is used internally by genqlient -type __PkgEqualInput struct { - Pkg PkgInputSpec `json:"pkg"` - OtherPackage PkgInputSpec `json:"otherPackage"` - PkgEqual PkgEqualInputSpec `json:"pkgEqual"` +// GetVulnerability returns PathPathIsVulnerability.Vulnerability, and is useful for accessing the field via an interface. +func (v *PathPathIsVulnerability) GetVulnerability() AllIsVulnerabilityVulnerabilityCveOrGhsa { + return v.AllIsVulnerability.Vulnerability } -// GetPkg returns __PkgEqualInput.Pkg, and is useful for accessing the field via an interface. -func (v *__PkgEqualInput) GetPkg() PkgInputSpec { return v.Pkg } +// GetJustification returns PathPathIsVulnerability.Justification, and is useful for accessing the field via an interface. +func (v *PathPathIsVulnerability) GetJustification() string { + return v.AllIsVulnerability.Justification +} -// GetOtherPackage returns __PkgEqualInput.OtherPackage, and is useful for accessing the field via an interface. -func (v *__PkgEqualInput) GetOtherPackage() PkgInputSpec { return v.OtherPackage } +// GetOrigin returns PathPathIsVulnerability.Origin, and is useful for accessing the field via an interface. +func (v *PathPathIsVulnerability) GetOrigin() string { return v.AllIsVulnerability.Origin } -// GetPkgEqual returns __PkgEqualInput.PkgEqual, and is useful for accessing the field via an interface. -func (v *__PkgEqualInput) GetPkgEqual() PkgEqualInputSpec { return v.PkgEqual } +// GetCollector returns PathPathIsVulnerability.Collector, and is useful for accessing the field via an interface. +func (v *PathPathIsVulnerability) GetCollector() string { return v.AllIsVulnerability.Collector } -// __PointOfContactArtifactInput is used internally by genqlient -type __PointOfContactArtifactInput struct { - Artifact ArtifactInputSpec `json:"artifact"` - PointOfContact PointOfContactInputSpec `json:"pointOfContact"` -} +func (v *PathPathIsVulnerability) UnmarshalJSON(b []byte) error { + + if string(b) == "null" { + return nil + } + + var firstPass struct { + *PathPathIsVulnerability + graphql.NoUnmarshalJSON + } + firstPass.PathPathIsVulnerability = v -// GetArtifact returns __PointOfContactArtifactInput.Artifact, and is useful for accessing the field via an interface. -func (v *__PointOfContactArtifactInput) GetArtifact() ArtifactInputSpec { return v.Artifact } + err := json.Unmarshal(b, &firstPass) + if err != nil { + return err + } -// GetPointOfContact returns __PointOfContactArtifactInput.PointOfContact, and is useful for accessing the field via an interface. -func (v *__PointOfContactArtifactInput) GetPointOfContact() PointOfContactInputSpec { - return v.PointOfContact + err = json.Unmarshal( + b, &v.AllIsVulnerability) + if err != nil { + return err + } + return nil } -// __PointOfContactPkgInput is used internally by genqlient -type __PointOfContactPkgInput struct { - Pkg PkgInputSpec `json:"pkg"` - PkgMatchType *MatchFlags `json:"pkgMatchType"` - PointOfContact PointOfContactInputSpec `json:"pointOfContact"` -} +type __premarshalPathPathIsVulnerability struct { + Typename *string `json:"__typename"` -// GetPkg returns __PointOfContactPkgInput.Pkg, and is useful for accessing the field via an interface. -func (v *__PointOfContactPkgInput) GetPkg() PkgInputSpec { return v.Pkg } + Id string `json:"id"` -// GetPkgMatchType returns __PointOfContactPkgInput.PkgMatchType, and is useful for accessing the field via an interface. -func (v *__PointOfContactPkgInput) GetPkgMatchType() *MatchFlags { return v.PkgMatchType } + Osv AllIsVulnerabilityOsvOSV `json:"osv"` -// GetPointOfContact returns __PointOfContactPkgInput.PointOfContact, and is useful for accessing the field via an interface. -func (v *__PointOfContactPkgInput) GetPointOfContact() PointOfContactInputSpec { - return v.PointOfContact -} + Vulnerability json.RawMessage `json:"vulnerability"` -// __PointOfContactSrcInput is used internally by genqlient -type __PointOfContactSrcInput struct { - Source SourceInputSpec `json:"source"` - PointOfContact PointOfContactInputSpec `json:"pointOfContact"` -} + Justification string `json:"justification"` -// GetSource returns __PointOfContactSrcInput.Source, and is useful for accessing the field via an interface. -func (v *__PointOfContactSrcInput) GetSource() SourceInputSpec { return v.Source } + Origin string `json:"origin"` -// GetPointOfContact returns __PointOfContactSrcInput.PointOfContact, and is useful for accessing the field via an interface. -func (v *__PointOfContactSrcInput) GetPointOfContact() PointOfContactInputSpec { - return v.PointOfContact + Collector string `json:"collector"` } -// __SLSAForArtifactInput is used internally by genqlient -type __SLSAForArtifactInput struct { - Artifact ArtifactInputSpec `json:"artifact"` - Materials []ArtifactInputSpec `json:"materials"` - Builder BuilderInputSpec `json:"builder"` - Slsa SLSAInputSpec `json:"slsa"` +func (v *PathPathIsVulnerability) MarshalJSON() ([]byte, error) { + premarshaled, err := v.__premarshalJSON() + if err != nil { + return nil, err + } + return json.Marshal(premarshaled) } -// GetArtifact returns __SLSAForArtifactInput.Artifact, and is useful for accessing the field via an interface. -func (v *__SLSAForArtifactInput) GetArtifact() ArtifactInputSpec { return v.Artifact } - -// GetMaterials returns __SLSAForArtifactInput.Materials, and is useful for accessing the field via an interface. -func (v *__SLSAForArtifactInput) GetMaterials() []ArtifactInputSpec { return v.Materials } +func (v *PathPathIsVulnerability) __premarshalJSON() (*__premarshalPathPathIsVulnerability, error) { + var retval __premarshalPathPathIsVulnerability -// GetBuilder returns __SLSAForArtifactInput.Builder, and is useful for accessing the field via an interface. -func (v *__SLSAForArtifactInput) GetBuilder() BuilderInputSpec { return v.Builder } + retval.Typename = v.Typename + retval.Id = v.AllIsVulnerability.Id + retval.Osv = v.AllIsVulnerability.Osv + { -// GetSlsa returns __SLSAForArtifactInput.Slsa, and is useful for accessing the field via an interface. -func (v *__SLSAForArtifactInput) GetSlsa() SLSAInputSpec { return v.Slsa } + dst := &retval.Vulnerability + src := v.AllIsVulnerability.Vulnerability + var err error + *dst, err = __marshalAllIsVulnerabilityVulnerabilityCveOrGhsa( + &src) + if err != nil { + return nil, fmt.Errorf( + "unable to marshal PathPathIsVulnerability.AllIsVulnerability.Vulnerability: %w", err) + } + } + retval.Justification = v.AllIsVulnerability.Justification + retval.Origin = v.AllIsVulnerability.Origin + retval.Collector = v.AllIsVulnerability.Collector + return &retval, nil +} -// __SLSAForArtifactsInput is used internally by genqlient -type __SLSAForArtifactsInput struct { - Artifacts []ArtifactInputSpec `json:"artifacts"` - MaterialsList [][]ArtifactInputSpec `json:"materialsList"` - Builders []BuilderInputSpec `json:"builders"` - SlsaList []SLSAInputSpec `json:"slsaList"` +// PathPathNoVuln includes the requested fields of the GraphQL type NoVuln. +// The GraphQL type's documentation follows. +// +// NoVuln is a special vulnerability node to attest that no vulnerability has been +// found during a vulnerability scan. +// +// Backends guarantee that this is a singleton node. +type PathPathNoVuln struct { + Typename *string `json:"__typename"` + Id string `json:"id"` } -// GetArtifacts returns __SLSAForArtifactsInput.Artifacts, and is useful for accessing the field via an interface. -func (v *__SLSAForArtifactsInput) GetArtifacts() []ArtifactInputSpec { return v.Artifacts } +// GetTypename returns PathPathNoVuln.Typename, and is useful for accessing the field via an interface. +func (v *PathPathNoVuln) GetTypename() *string { return v.Typename } -// GetMaterialsList returns __SLSAForArtifactsInput.MaterialsList, and is useful for accessing the field via an interface. -func (v *__SLSAForArtifactsInput) GetMaterialsList() [][]ArtifactInputSpec { return v.MaterialsList } +// GetId returns PathPathNoVuln.Id, and is useful for accessing the field via an interface. +func (v *PathPathNoVuln) GetId() string { return v.Id } -// GetBuilders returns __SLSAForArtifactsInput.Builders, and is useful for accessing the field via an interface. -func (v *__SLSAForArtifactsInput) GetBuilders() []BuilderInputSpec { return v.Builders } +// PathPathNode includes the requested fields of the GraphQL interface Node. +// +// PathPathNode is implemented by the following types: +// PathPathArtifact +// PathPathBuilder +// PathPathCVE +// PathPathCertifyBad +// PathPathCertifyGood +// PathPathCertifyScorecard +// PathPathCertifyVEXStatement +// PathPathCertifyVuln +// PathPathGHSA +// PathPathHasMetadata +// PathPathHasSBOM +// PathPathHasSLSA +// PathPathHasSourceAt +// PathPathHashEqual +// PathPathIsDependency +// PathPathIsOccurrence +// PathPathIsVulnerability +// PathPathNoVuln +// PathPathOSV +// PathPathPackage +// PathPathPkgEqual +// PathPathPointOfContact +// PathPathSource +// The GraphQL type's documentation follows. +// +// Node is a union type of all the possible nodes. +// +// It encapsulates the software tree nodes along with the evidence nodes. In a +// path query, all connecting evidence nodes along with their intermediate subject +// nodes need to be returned in order to create a complete graph. +type PathPathNode interface { + implementsGraphQLInterfacePathPathNode() + // GetTypename returns the receiver's concrete GraphQL type-name (see interface doc for possible values). + GetTypename() *string +} -// GetSlsaList returns __SLSAForArtifactsInput.SlsaList, and is useful for accessing the field via an interface. -func (v *__SLSAForArtifactsInput) GetSlsaList() []SLSAInputSpec { return v.SlsaList } +func (v *PathPathArtifact) implementsGraphQLInterfacePathPathNode() {} +func (v *PathPathBuilder) implementsGraphQLInterfacePathPathNode() {} +func (v *PathPathCVE) implementsGraphQLInterfacePathPathNode() {} +func (v *PathPathCertifyBad) implementsGraphQLInterfacePathPathNode() {} +func (v *PathPathCertifyGood) implementsGraphQLInterfacePathPathNode() {} +func (v *PathPathCertifyScorecard) implementsGraphQLInterfacePathPathNode() {} +func (v *PathPathCertifyVEXStatement) implementsGraphQLInterfacePathPathNode() {} +func (v *PathPathCertifyVuln) implementsGraphQLInterfacePathPathNode() {} +func (v *PathPathGHSA) implementsGraphQLInterfacePathPathNode() {} +func (v *PathPathHasMetadata) implementsGraphQLInterfacePathPathNode() {} +func (v *PathPathHasSBOM) implementsGraphQLInterfacePathPathNode() {} +func (v *PathPathHasSLSA) implementsGraphQLInterfacePathPathNode() {} +func (v *PathPathHasSourceAt) implementsGraphQLInterfacePathPathNode() {} +func (v *PathPathHashEqual) implementsGraphQLInterfacePathPathNode() {} +func (v *PathPathIsDependency) implementsGraphQLInterfacePathPathNode() {} +func (v *PathPathIsOccurrence) implementsGraphQLInterfacePathPathNode() {} +func (v *PathPathIsVulnerability) implementsGraphQLInterfacePathPathNode() {} +func (v *PathPathNoVuln) implementsGraphQLInterfacePathPathNode() {} +func (v *PathPathOSV) implementsGraphQLInterfacePathPathNode() {} +func (v *PathPathPackage) implementsGraphQLInterfacePathPathNode() {} +func (v *PathPathPkgEqual) implementsGraphQLInterfacePathPathNode() {} +func (v *PathPathPointOfContact) implementsGraphQLInterfacePathPathNode() {} +func (v *PathPathSource) implementsGraphQLInterfacePathPathNode() {} -// __SourcesInput is used internally by genqlient -type __SourcesInput struct { - Filter *SourceSpec `json:"filter"` -} +func __unmarshalPathPathNode(b []byte, v *PathPathNode) error { + if string(b) == "null" { + return nil + } -// GetFilter returns __SourcesInput.Filter, and is useful for accessing the field via an interface. -func (v *__SourcesInput) GetFilter() *SourceSpec { return v.Filter } + var tn struct { + TypeName string `json:"__typename"` + } + err := json.Unmarshal(b, &tn) + if err != nil { + return err + } -// __VEXPackageAndGhsaInput is used internally by genqlient -type __VEXPackageAndGhsaInput struct { - Pkg PkgInputSpec `json:"pkg"` - Ghsa GHSAInputSpec `json:"ghsa"` - VexStatement VexStatementInputSpec `json:"vexStatement"` + switch tn.TypeName { + case "Artifact": + *v = new(PathPathArtifact) + return json.Unmarshal(b, *v) + case "Builder": + *v = new(PathPathBuilder) + return json.Unmarshal(b, *v) + case "CVE": + *v = new(PathPathCVE) + return json.Unmarshal(b, *v) + case "CertifyBad": + *v = new(PathPathCertifyBad) + return json.Unmarshal(b, *v) + case "CertifyGood": + *v = new(PathPathCertifyGood) + return json.Unmarshal(b, *v) + case "CertifyScorecard": + *v = new(PathPathCertifyScorecard) + return json.Unmarshal(b, *v) + case "CertifyVEXStatement": + *v = new(PathPathCertifyVEXStatement) + return json.Unmarshal(b, *v) + case "CertifyVuln": + *v = new(PathPathCertifyVuln) + return json.Unmarshal(b, *v) + case "GHSA": + *v = new(PathPathGHSA) + return json.Unmarshal(b, *v) + case "HasMetadata": + *v = new(PathPathHasMetadata) + return json.Unmarshal(b, *v) + case "HasSBOM": + *v = new(PathPathHasSBOM) + return json.Unmarshal(b, *v) + case "HasSLSA": + *v = new(PathPathHasSLSA) + return json.Unmarshal(b, *v) + case "HasSourceAt": + *v = new(PathPathHasSourceAt) + return json.Unmarshal(b, *v) + case "HashEqual": + *v = new(PathPathHashEqual) + return json.Unmarshal(b, *v) + case "IsDependency": + *v = new(PathPathIsDependency) + return json.Unmarshal(b, *v) + case "IsOccurrence": + *v = new(PathPathIsOccurrence) + return json.Unmarshal(b, *v) + case "IsVulnerability": + *v = new(PathPathIsVulnerability) + return json.Unmarshal(b, *v) + case "NoVuln": + *v = new(PathPathNoVuln) + return json.Unmarshal(b, *v) + case "OSV": + *v = new(PathPathOSV) + return json.Unmarshal(b, *v) + case "Package": + *v = new(PathPathPackage) + return json.Unmarshal(b, *v) + case "PkgEqual": + *v = new(PathPathPkgEqual) + return json.Unmarshal(b, *v) + case "PointOfContact": + *v = new(PathPathPointOfContact) + return json.Unmarshal(b, *v) + case "Source": + *v = new(PathPathSource) + return json.Unmarshal(b, *v) + case "": + return fmt.Errorf( + "response was missing Node.__typename") + default: + return fmt.Errorf( + `unexpected concrete type for PathPathNode: "%v"`, tn.TypeName) + } } -// GetPkg returns __VEXPackageAndGhsaInput.Pkg, and is useful for accessing the field via an interface. -func (v *__VEXPackageAndGhsaInput) GetPkg() PkgInputSpec { return v.Pkg } - -// GetGhsa returns __VEXPackageAndGhsaInput.Ghsa, and is useful for accessing the field via an interface. -func (v *__VEXPackageAndGhsaInput) GetGhsa() GHSAInputSpec { return v.Ghsa } +func __marshalPathPathNode(v *PathPathNode) ([]byte, error) { -// GetVexStatement returns __VEXPackageAndGhsaInput.VexStatement, and is useful for accessing the field via an interface. -func (v *__VEXPackageAndGhsaInput) GetVexStatement() VexStatementInputSpec { return v.VexStatement } + var typename string + switch v := (*v).(type) { + case *PathPathArtifact: + typename = "Artifact" -// __VexArtifactAndCveInput is used internally by genqlient -type __VexArtifactAndCveInput struct { - Artifact ArtifactInputSpec `json:"artifact"` - Cve CVEInputSpec `json:"cve"` - VexStatement VexStatementInputSpec `json:"vexStatement"` -} + premarshaled, err := v.__premarshalJSON() + if err != nil { + return nil, err + } + result := struct { + TypeName string `json:"__typename"` + *__premarshalPathPathArtifact + }{typename, premarshaled} + return json.Marshal(result) + case *PathPathBuilder: + typename = "Builder" -// GetArtifact returns __VexArtifactAndCveInput.Artifact, and is useful for accessing the field via an interface. -func (v *__VexArtifactAndCveInput) GetArtifact() ArtifactInputSpec { return v.Artifact } + premarshaled, err := v.__premarshalJSON() + if err != nil { + return nil, err + } + result := struct { + TypeName string `json:"__typename"` + *__premarshalPathPathBuilder + }{typename, premarshaled} + return json.Marshal(result) + case *PathPathCVE: + typename = "CVE" -// GetCve returns __VexArtifactAndCveInput.Cve, and is useful for accessing the field via an interface. -func (v *__VexArtifactAndCveInput) GetCve() CVEInputSpec { return v.Cve } + premarshaled, err := v.__premarshalJSON() + if err != nil { + return nil, err + } + result := struct { + TypeName string `json:"__typename"` + *__premarshalPathPathCVE + }{typename, premarshaled} + return json.Marshal(result) + case *PathPathCertifyBad: + typename = "CertifyBad" -// GetVexStatement returns __VexArtifactAndCveInput.VexStatement, and is useful for accessing the field via an interface. -func (v *__VexArtifactAndCveInput) GetVexStatement() VexStatementInputSpec { return v.VexStatement } + premarshaled, err := v.__premarshalJSON() + if err != nil { + return nil, err + } + result := struct { + TypeName string `json:"__typename"` + *__premarshalPathPathCertifyBad + }{typename, premarshaled} + return json.Marshal(result) + case *PathPathCertifyGood: + typename = "CertifyGood" -// __VexArtifactAndGhsaInput is used internally by genqlient -type __VexArtifactAndGhsaInput struct { - Artifact ArtifactInputSpec `json:"artifact"` - Ghsa GHSAInputSpec `json:"ghsa"` - VexStatement VexStatementInputSpec `json:"vexStatement"` -} + premarshaled, err := v.__premarshalJSON() + if err != nil { + return nil, err + } + result := struct { + TypeName string `json:"__typename"` + *__premarshalPathPathCertifyGood + }{typename, premarshaled} + return json.Marshal(result) + case *PathPathCertifyScorecard: + typename = "CertifyScorecard" -// GetArtifact returns __VexArtifactAndGhsaInput.Artifact, and is useful for accessing the field via an interface. -func (v *__VexArtifactAndGhsaInput) GetArtifact() ArtifactInputSpec { return v.Artifact } + premarshaled, err := v.__premarshalJSON() + if err != nil { + return nil, err + } + result := struct { + TypeName string `json:"__typename"` + *__premarshalPathPathCertifyScorecard + }{typename, premarshaled} + return json.Marshal(result) + case *PathPathCertifyVEXStatement: + typename = "CertifyVEXStatement" -// GetGhsa returns __VexArtifactAndGhsaInput.Ghsa, and is useful for accessing the field via an interface. -func (v *__VexArtifactAndGhsaInput) GetGhsa() GHSAInputSpec { return v.Ghsa } + premarshaled, err := v.__premarshalJSON() + if err != nil { + return nil, err + } + result := struct { + TypeName string `json:"__typename"` + *__premarshalPathPathCertifyVEXStatement + }{typename, premarshaled} + return json.Marshal(result) + case *PathPathCertifyVuln: + typename = "CertifyVuln" -// GetVexStatement returns __VexArtifactAndGhsaInput.VexStatement, and is useful for accessing the field via an interface. -func (v *__VexArtifactAndGhsaInput) GetVexStatement() VexStatementInputSpec { return v.VexStatement } + premarshaled, err := v.__premarshalJSON() + if err != nil { + return nil, err + } + result := struct { + TypeName string `json:"__typename"` + *__premarshalPathPathCertifyVuln + }{typename, premarshaled} + return json.Marshal(result) + case *PathPathGHSA: + typename = "GHSA" -// __VexArtifactAndOsvInput is used internally by genqlient -type __VexArtifactAndOsvInput struct { - Artifact ArtifactInputSpec `json:"artifact"` - Osv OSVInputSpec `json:"osv"` - VexStatement VexStatementInputSpec `json:"vexStatement"` -} + premarshaled, err := v.__premarshalJSON() + if err != nil { + return nil, err + } + result := struct { + TypeName string `json:"__typename"` + *__premarshalPathPathGHSA + }{typename, premarshaled} + return json.Marshal(result) + case *PathPathHasMetadata: + typename = "HasMetadata" -// GetArtifact returns __VexArtifactAndOsvInput.Artifact, and is useful for accessing the field via an interface. -func (v *__VexArtifactAndOsvInput) GetArtifact() ArtifactInputSpec { return v.Artifact } + result := struct { + TypeName string `json:"__typename"` + *PathPathHasMetadata + }{typename, v} + return json.Marshal(result) + case *PathPathHasSBOM: + typename = "HasSBOM" -// GetOsv returns __VexArtifactAndOsvInput.Osv, and is useful for accessing the field via an interface. -func (v *__VexArtifactAndOsvInput) GetOsv() OSVInputSpec { return v.Osv } + premarshaled, err := v.__premarshalJSON() + if err != nil { + return nil, err + } + result := struct { + TypeName string `json:"__typename"` + *__premarshalPathPathHasSBOM + }{typename, premarshaled} + return json.Marshal(result) + case *PathPathHasSLSA: + typename = "HasSLSA" -// GetVexStatement returns __VexArtifactAndOsvInput.VexStatement, and is useful for accessing the field via an interface. -func (v *__VexArtifactAndOsvInput) GetVexStatement() VexStatementInputSpec { return v.VexStatement } + premarshaled, err := v.__premarshalJSON() + if err != nil { + return nil, err + } + result := struct { + TypeName string `json:"__typename"` + *__premarshalPathPathHasSLSA + }{typename, premarshaled} + return json.Marshal(result) + case *PathPathHasSourceAt: + typename = "HasSourceAt" -// __VexPackageAndCveInput is used internally by genqlient -type __VexPackageAndCveInput struct { - Pkg PkgInputSpec `json:"pkg"` - Cve CVEInputSpec `json:"cve"` - VexStatement VexStatementInputSpec `json:"vexStatement"` -} + premarshaled, err := v.__premarshalJSON() + if err != nil { + return nil, err + } + result := struct { + TypeName string `json:"__typename"` + *__premarshalPathPathHasSourceAt + }{typename, premarshaled} + return json.Marshal(result) + case *PathPathHashEqual: + typename = "HashEqual" -// GetPkg returns __VexPackageAndCveInput.Pkg, and is useful for accessing the field via an interface. -func (v *__VexPackageAndCveInput) GetPkg() PkgInputSpec { return v.Pkg } + premarshaled, err := v.__premarshalJSON() + if err != nil { + return nil, err + } + result := struct { + TypeName string `json:"__typename"` + *__premarshalPathPathHashEqual + }{typename, premarshaled} + return json.Marshal(result) + case *PathPathIsDependency: + typename = "IsDependency" -// GetCve returns __VexPackageAndCveInput.Cve, and is useful for accessing the field via an interface. -func (v *__VexPackageAndCveInput) GetCve() CVEInputSpec { return v.Cve } + premarshaled, err := v.__premarshalJSON() + if err != nil { + return nil, err + } + result := struct { + TypeName string `json:"__typename"` + *__premarshalPathPathIsDependency + }{typename, premarshaled} + return json.Marshal(result) + case *PathPathIsOccurrence: + typename = "IsOccurrence" -// GetVexStatement returns __VexPackageAndCveInput.VexStatement, and is useful for accessing the field via an interface. -func (v *__VexPackageAndCveInput) GetVexStatement() VexStatementInputSpec { return v.VexStatement } + premarshaled, err := v.__premarshalJSON() + if err != nil { + return nil, err + } + result := struct { + TypeName string `json:"__typename"` + *__premarshalPathPathIsOccurrence + }{typename, premarshaled} + return json.Marshal(result) + case *PathPathIsVulnerability: + typename = "IsVulnerability" -// __VexPackageAndOsvInput is used internally by genqlient -type __VexPackageAndOsvInput struct { - Pkg PkgInputSpec `json:"pkg"` - Osv OSVInputSpec `json:"osv"` - VexStatement VexStatementInputSpec `json:"vexStatement"` -} + premarshaled, err := v.__premarshalJSON() + if err != nil { + return nil, err + } + result := struct { + TypeName string `json:"__typename"` + *__premarshalPathPathIsVulnerability + }{typename, premarshaled} + return json.Marshal(result) + case *PathPathNoVuln: + typename = "NoVuln" -// GetPkg returns __VexPackageAndOsvInput.Pkg, and is useful for accessing the field via an interface. -func (v *__VexPackageAndOsvInput) GetPkg() PkgInputSpec { return v.Pkg } + result := struct { + TypeName string `json:"__typename"` + *PathPathNoVuln + }{typename, v} + return json.Marshal(result) + case *PathPathOSV: + typename = "OSV" -// GetOsv returns __VexPackageAndOsvInput.Osv, and is useful for accessing the field via an interface. -func (v *__VexPackageAndOsvInput) GetOsv() OSVInputSpec { return v.Osv } + premarshaled, err := v.__premarshalJSON() + if err != nil { + return nil, err + } + result := struct { + TypeName string `json:"__typename"` + *__premarshalPathPathOSV + }{typename, premarshaled} + return json.Marshal(result) + case *PathPathPackage: + typename = "Package" -// GetVexStatement returns __VexPackageAndOsvInput.VexStatement, and is useful for accessing the field via an interface. -func (v *__VexPackageAndOsvInput) GetVexStatement() VexStatementInputSpec { return v.VexStatement } + premarshaled, err := v.__premarshalJSON() + if err != nil { + return nil, err + } + result := struct { + TypeName string `json:"__typename"` + *__premarshalPathPathPackage + }{typename, premarshaled} + return json.Marshal(result) + case *PathPathPkgEqual: + typename = "PkgEqual" -// allBuilderTree includes the GraphQL fields of Builder requested by the fragment allBuilderTree. -// The GraphQL type's documentation follows. -// -// Builder represents the builder (e.g., FRSCA or GitHub Actions). -// -// Currently builders are identified by the uri field. -type allBuilderTree struct { - Id string `json:"id"` - Uri string `json:"uri"` -} + premarshaled, err := v.__premarshalJSON() + if err != nil { + return nil, err + } + result := struct { + TypeName string `json:"__typename"` + *__premarshalPathPathPkgEqual + }{typename, premarshaled} + return json.Marshal(result) + case *PathPathPointOfContact: + typename = "PointOfContact" -// GetId returns allBuilderTree.Id, and is useful for accessing the field via an interface. -func (v *allBuilderTree) GetId() string { return v.Id } + result := struct { + TypeName string `json:"__typename"` + *PathPathPointOfContact + }{typename, v} + return json.Marshal(result) + case *PathPathSource: + typename = "Source" -// GetUri returns allBuilderTree.Uri, and is useful for accessing the field via an interface. -func (v *allBuilderTree) GetUri() string { return v.Uri } + premarshaled, err := v.__premarshalJSON() + if err != nil { + return nil, err + } + result := struct { + TypeName string `json:"__typename"` + *__premarshalPathPathSource + }{typename, premarshaled} + return json.Marshal(result) + case nil: + return []byte("null"), nil + default: + return nil, fmt.Errorf( + `unexpected concrete type for PathPathNode: "%T"`, v) + } +} -// allCertifyGood includes the GraphQL fields of CertifyGood requested by the fragment allCertifyGood. +// PathPathOSV includes the requested fields of the GraphQL type OSV. // The GraphQL type's documentation follows. // -// CertifyGood is an attestation that a package, source, or artifact is considered -// good. +// OSV represents an Open Source Vulnerability. // -// All evidence trees record a justification for the property they represent as -// well as the document that contains the attestation (origin) and the collector -// that collected the document (collector). +// The osvId field is mandatory and canonicalized to be lowercase. // -// The certification applies to a subject which is a package, source, or artifact. -// If the attestation targets a package, it must target a PackageName or a -// PackageVersion. If the attestation targets a source, it must target a -// SourceName. -type allCertifyGood struct { - Id string `json:"id"` - Justification string `json:"justification"` - Subject allCertifyGoodSubjectPackageSourceOrArtifact `json:"-"` - Origin string `json:"origin"` - Collector string `json:"collector"` +// This maps to a vulnerability ID specific to the environment (e.g., GHSA ID or +// CVE ID). +// +// This node can be referred to by other parts of GUAC. +type PathPathOSV struct { + Typename *string `json:"__typename"` + AllOSVTree `json:"-"` } -// GetId returns allCertifyGood.Id, and is useful for accessing the field via an interface. -func (v *allCertifyGood) GetId() string { return v.Id } - -// GetJustification returns allCertifyGood.Justification, and is useful for accessing the field via an interface. -func (v *allCertifyGood) GetJustification() string { return v.Justification } - -// GetSubject returns allCertifyGood.Subject, and is useful for accessing the field via an interface. -func (v *allCertifyGood) GetSubject() allCertifyGoodSubjectPackageSourceOrArtifact { return v.Subject } +// GetTypename returns PathPathOSV.Typename, and is useful for accessing the field via an interface. +func (v *PathPathOSV) GetTypename() *string { return v.Typename } -// GetOrigin returns allCertifyGood.Origin, and is useful for accessing the field via an interface. -func (v *allCertifyGood) GetOrigin() string { return v.Origin } +// GetId returns PathPathOSV.Id, and is useful for accessing the field via an interface. +func (v *PathPathOSV) GetId() string { return v.AllOSVTree.Id } -// GetCollector returns allCertifyGood.Collector, and is useful for accessing the field via an interface. -func (v *allCertifyGood) GetCollector() string { return v.Collector } +// GetOsvId returns PathPathOSV.OsvId, and is useful for accessing the field via an interface. +func (v *PathPathOSV) GetOsvId() string { return v.AllOSVTree.OsvId } -func (v *allCertifyGood) UnmarshalJSON(b []byte) error { +func (v *PathPathOSV) UnmarshalJSON(b []byte) error { if string(b) == "null" { return nil } var firstPass struct { - *allCertifyGood - Subject json.RawMessage `json:"subject"` + *PathPathOSV graphql.NoUnmarshalJSON } - firstPass.allCertifyGood = v + firstPass.PathPathOSV = v err := json.Unmarshal(b, &firstPass) if err != nil { return err } - { - dst := &v.Subject - src := firstPass.Subject - if len(src) != 0 && string(src) != "null" { - err = __unmarshalallCertifyGoodSubjectPackageSourceOrArtifact( - src, dst) - if err != nil { - return fmt.Errorf( - "unable to unmarshal allCertifyGood.Subject: %w", err) - } - } + err = json.Unmarshal( + b, &v.AllOSVTree) + if err != nil { + return err } return nil } -type __premarshalallCertifyGood struct { - Id string `json:"id"` - - Justification string `json:"justification"` - - Subject json.RawMessage `json:"subject"` +type __premarshalPathPathOSV struct { + Typename *string `json:"__typename"` - Origin string `json:"origin"` + Id string `json:"id"` - Collector string `json:"collector"` + OsvId string `json:"osvId"` } -func (v *allCertifyGood) MarshalJSON() ([]byte, error) { +func (v *PathPathOSV) MarshalJSON() ([]byte, error) { premarshaled, err := v.__premarshalJSON() if err != nil { return nil, err @@ -20830,66 +21199,62 @@ func (v *allCertifyGood) MarshalJSON() ([]byte, error) { return json.Marshal(premarshaled) } -func (v *allCertifyGood) __premarshalJSON() (*__premarshalallCertifyGood, error) { - var retval __premarshalallCertifyGood - - retval.Id = v.Id - retval.Justification = v.Justification - { +func (v *PathPathOSV) __premarshalJSON() (*__premarshalPathPathOSV, error) { + var retval __premarshalPathPathOSV - dst := &retval.Subject - src := v.Subject - var err error - *dst, err = __marshalallCertifyGoodSubjectPackageSourceOrArtifact( - &src) - if err != nil { - return nil, fmt.Errorf( - "unable to marshal allCertifyGood.Subject: %w", err) - } - } - retval.Origin = v.Origin - retval.Collector = v.Collector + retval.Typename = v.Typename + retval.Id = v.AllOSVTree.Id + retval.OsvId = v.AllOSVTree.OsvId return &retval, nil } -// allCertifyGoodSubjectArtifact includes the requested fields of the GraphQL type Artifact. +// PathPathPackage includes the requested fields of the GraphQL type Package. // The GraphQL type's documentation follows. // -// Artifact represents an artifact identified by a checksum hash. +// Package represents the root of the package trie/tree. // -// The checksum is split into the digest value and the algorithm used to generate -// it. Both fields are mandatory and canonicalized to be lowercase. +// We map package information to a trie, closely matching the pURL specification +// (https://github.com/package-url/purl-spec/blob/0dd92f26f8bb11956ffdf5e8acfcee71e8560407/README.rst), +// but deviating from it where GUAC heuristics allow for better representation of +// package information. Each path in the trie fully represents a package; we split +// the trie based on the pURL components. // -// If having a checksum Go object, algorithm can be -// strings.ToLower(string(checksum.Algorithm)) and digest can be checksum.Value. -type allCertifyGoodSubjectArtifact struct { - Typename *string `json:"__typename"` - AllArtifactTree `json:"-"` +// This node matches a pkg: partial pURL. The type field matches the +// pURL types but we might also use "guac" for the cases where the pURL +// representation is not complete or when we have custom rules. +// +// Since this node is at the root of the package trie, it is named Package, not +// PackageType. +type PathPathPackage struct { + Typename *string `json:"__typename"` + AllPkgTree `json:"-"` } -// GetTypename returns allCertifyGoodSubjectArtifact.Typename, and is useful for accessing the field via an interface. -func (v *allCertifyGoodSubjectArtifact) GetTypename() *string { return v.Typename } +// GetTypename returns PathPathPackage.Typename, and is useful for accessing the field via an interface. +func (v *PathPathPackage) GetTypename() *string { return v.Typename } -// GetId returns allCertifyGoodSubjectArtifact.Id, and is useful for accessing the field via an interface. -func (v *allCertifyGoodSubjectArtifact) GetId() string { return v.AllArtifactTree.Id } +// GetId returns PathPathPackage.Id, and is useful for accessing the field via an interface. +func (v *PathPathPackage) GetId() string { return v.AllPkgTree.Id } -// GetAlgorithm returns allCertifyGoodSubjectArtifact.Algorithm, and is useful for accessing the field via an interface. -func (v *allCertifyGoodSubjectArtifact) GetAlgorithm() string { return v.AllArtifactTree.Algorithm } +// GetType returns PathPathPackage.Type, and is useful for accessing the field via an interface. +func (v *PathPathPackage) GetType() string { return v.AllPkgTree.Type } -// GetDigest returns allCertifyGoodSubjectArtifact.Digest, and is useful for accessing the field via an interface. -func (v *allCertifyGoodSubjectArtifact) GetDigest() string { return v.AllArtifactTree.Digest } +// GetNamespaces returns PathPathPackage.Namespaces, and is useful for accessing the field via an interface. +func (v *PathPathPackage) GetNamespaces() []AllPkgTreeNamespacesPackageNamespace { + return v.AllPkgTree.Namespaces +} -func (v *allCertifyGoodSubjectArtifact) UnmarshalJSON(b []byte) error { +func (v *PathPathPackage) UnmarshalJSON(b []byte) error { if string(b) == "null" { return nil } var firstPass struct { - *allCertifyGoodSubjectArtifact + *PathPathPackage graphql.NoUnmarshalJSON } - firstPass.allCertifyGoodSubjectArtifact = v + firstPass.PathPathPackage = v err := json.Unmarshal(b, &firstPass) if err != nil { @@ -20897,24 +21262,24 @@ func (v *allCertifyGoodSubjectArtifact) UnmarshalJSON(b []byte) error { } err = json.Unmarshal( - b, &v.AllArtifactTree) + b, &v.AllPkgTree) if err != nil { return err } return nil } -type __premarshalallCertifyGoodSubjectArtifact struct { +type __premarshalPathPathPackage struct { Typename *string `json:"__typename"` Id string `json:"id"` - Algorithm string `json:"algorithm"` + Type string `json:"type"` - Digest string `json:"digest"` + Namespaces []AllPkgTreeNamespacesPackageNamespace `json:"namespaces"` } -func (v *allCertifyGoodSubjectArtifact) MarshalJSON() ([]byte, error) { +func (v *PathPathPackage) MarshalJSON() ([]byte, error) { premarshaled, err := v.__premarshalJSON() if err != nil { return nil, err @@ -20922,63 +21287,54 @@ func (v *allCertifyGoodSubjectArtifact) MarshalJSON() ([]byte, error) { return json.Marshal(premarshaled) } -func (v *allCertifyGoodSubjectArtifact) __premarshalJSON() (*__premarshalallCertifyGoodSubjectArtifact, error) { - var retval __premarshalallCertifyGoodSubjectArtifact +func (v *PathPathPackage) __premarshalJSON() (*__premarshalPathPathPackage, error) { + var retval __premarshalPathPathPackage retval.Typename = v.Typename - retval.Id = v.AllArtifactTree.Id - retval.Algorithm = v.AllArtifactTree.Algorithm - retval.Digest = v.AllArtifactTree.Digest + retval.Id = v.AllPkgTree.Id + retval.Type = v.AllPkgTree.Type + retval.Namespaces = v.AllPkgTree.Namespaces return &retval, nil } -// allCertifyGoodSubjectPackage includes the requested fields of the GraphQL type Package. +// PathPathPkgEqual includes the requested fields of the GraphQL type PkgEqual. // The GraphQL type's documentation follows. // -// Package represents the root of the package trie/tree. -// -// We map package information to a trie, closely matching the pURL specification -// (https://github.com/package-url/purl-spec/blob/0dd92f26f8bb11956ffdf5e8acfcee71e8560407/README.rst), -// but deviating from it where GUAC heuristics allow for better representation of -// package information. Each path in the trie fully represents a package; we split -// the trie based on the pURL components. -// -// This node matches a pkg: partial pURL. The type field matches the -// pURL types but we might also use "guac" for the cases where the pURL -// representation is not complete or when we have custom rules. -// -// Since this node is at the root of the package trie, it is named Package, not -// PackageType. -type allCertifyGoodSubjectPackage struct { - Typename *string `json:"__typename"` - AllPkgTree `json:"-"` +// PkgEqual is an attestation that a set of packages are similar. +type PathPathPkgEqual struct { + Typename *string `json:"__typename"` + AllPkgEqual `json:"-"` } -// GetTypename returns allCertifyGoodSubjectPackage.Typename, and is useful for accessing the field via an interface. -func (v *allCertifyGoodSubjectPackage) GetTypename() *string { return v.Typename } +// GetTypename returns PathPathPkgEqual.Typename, and is useful for accessing the field via an interface. +func (v *PathPathPkgEqual) GetTypename() *string { return v.Typename } + +// GetId returns PathPathPkgEqual.Id, and is useful for accessing the field via an interface. +func (v *PathPathPkgEqual) GetId() string { return v.AllPkgEqual.Id } -// GetId returns allCertifyGoodSubjectPackage.Id, and is useful for accessing the field via an interface. -func (v *allCertifyGoodSubjectPackage) GetId() string { return v.AllPkgTree.Id } +// GetJustification returns PathPathPkgEqual.Justification, and is useful for accessing the field via an interface. +func (v *PathPathPkgEqual) GetJustification() string { return v.AllPkgEqual.Justification } -// GetType returns allCertifyGoodSubjectPackage.Type, and is useful for accessing the field via an interface. -func (v *allCertifyGoodSubjectPackage) GetType() string { return v.AllPkgTree.Type } +// GetPackages returns PathPathPkgEqual.Packages, and is useful for accessing the field via an interface. +func (v *PathPathPkgEqual) GetPackages() []AllPkgEqualPackagesPackage { return v.AllPkgEqual.Packages } -// GetNamespaces returns allCertifyGoodSubjectPackage.Namespaces, and is useful for accessing the field via an interface. -func (v *allCertifyGoodSubjectPackage) GetNamespaces() []AllPkgTreeNamespacesPackageNamespace { - return v.AllPkgTree.Namespaces -} +// GetOrigin returns PathPathPkgEqual.Origin, and is useful for accessing the field via an interface. +func (v *PathPathPkgEqual) GetOrigin() string { return v.AllPkgEqual.Origin } + +// GetCollector returns PathPathPkgEqual.Collector, and is useful for accessing the field via an interface. +func (v *PathPathPkgEqual) GetCollector() string { return v.AllPkgEqual.Collector } -func (v *allCertifyGoodSubjectPackage) UnmarshalJSON(b []byte) error { +func (v *PathPathPkgEqual) UnmarshalJSON(b []byte) error { if string(b) == "null" { return nil } var firstPass struct { - *allCertifyGoodSubjectPackage + *PathPathPkgEqual graphql.NoUnmarshalJSON } - firstPass.allCertifyGoodSubjectPackage = v + firstPass.PathPathPkgEqual = v err := json.Unmarshal(b, &firstPass) if err != nil { @@ -20986,24 +21342,28 @@ func (v *allCertifyGoodSubjectPackage) UnmarshalJSON(b []byte) error { } err = json.Unmarshal( - b, &v.AllPkgTree) + b, &v.AllPkgEqual) if err != nil { return err } return nil } -type __premarshalallCertifyGoodSubjectPackage struct { +type __premarshalPathPathPkgEqual struct { Typename *string `json:"__typename"` Id string `json:"id"` - Type string `json:"type"` + Justification string `json:"justification"` - Namespaces []AllPkgTreeNamespacesPackageNamespace `json:"namespaces"` + Packages []AllPkgEqualPackagesPackage `json:"packages"` + + Origin string `json:"origin"` + + Collector string `json:"collector"` } -func (v *allCertifyGoodSubjectPackage) MarshalJSON() ([]byte, error) { +func (v *PathPathPkgEqual) MarshalJSON() ([]byte, error) { premarshaled, err := v.__premarshalJSON() if err != nil { return nil, err @@ -21011,119 +21371,50 @@ func (v *allCertifyGoodSubjectPackage) MarshalJSON() ([]byte, error) { return json.Marshal(premarshaled) } -func (v *allCertifyGoodSubjectPackage) __premarshalJSON() (*__premarshalallCertifyGoodSubjectPackage, error) { - var retval __premarshalallCertifyGoodSubjectPackage +func (v *PathPathPkgEqual) __premarshalJSON() (*__premarshalPathPathPkgEqual, error) { + var retval __premarshalPathPathPkgEqual retval.Typename = v.Typename - retval.Id = v.AllPkgTree.Id - retval.Type = v.AllPkgTree.Type - retval.Namespaces = v.AllPkgTree.Namespaces + retval.Id = v.AllPkgEqual.Id + retval.Justification = v.AllPkgEqual.Justification + retval.Packages = v.AllPkgEqual.Packages + retval.Origin = v.AllPkgEqual.Origin + retval.Collector = v.AllPkgEqual.Collector return &retval, nil } -// allCertifyGoodSubjectPackageSourceOrArtifact includes the requested fields of the GraphQL interface PackageSourceOrArtifact. -// -// allCertifyGoodSubjectPackageSourceOrArtifact is implemented by the following types: -// allCertifyGoodSubjectArtifact -// allCertifyGoodSubjectPackage -// allCertifyGoodSubjectSource +// PathPathPointOfContact includes the requested fields of the GraphQL type PointOfContact. // The GraphQL type's documentation follows. // -// PackageSourceOrArtifact is a union of Package, Source, and Artifact. -type allCertifyGoodSubjectPackageSourceOrArtifact interface { - implementsGraphQLInterfaceallCertifyGoodSubjectPackageSourceOrArtifact() - // GetTypename returns the receiver's concrete GraphQL type-name (see interface doc for possible values). - GetTypename() *string -} - -func (v *allCertifyGoodSubjectArtifact) implementsGraphQLInterfaceallCertifyGoodSubjectPackageSourceOrArtifact() { -} -func (v *allCertifyGoodSubjectPackage) implementsGraphQLInterfaceallCertifyGoodSubjectPackageSourceOrArtifact() { -} -func (v *allCertifyGoodSubjectSource) implementsGraphQLInterfaceallCertifyGoodSubjectPackageSourceOrArtifact() { -} - -func __unmarshalallCertifyGoodSubjectPackageSourceOrArtifact(b []byte, v *allCertifyGoodSubjectPackageSourceOrArtifact) error { - if string(b) == "null" { - return nil - } - - var tn struct { - TypeName string `json:"__typename"` - } - err := json.Unmarshal(b, &tn) - if err != nil { - return err - } - - switch tn.TypeName { - case "Artifact": - *v = new(allCertifyGoodSubjectArtifact) - return json.Unmarshal(b, *v) - case "Package": - *v = new(allCertifyGoodSubjectPackage) - return json.Unmarshal(b, *v) - case "Source": - *v = new(allCertifyGoodSubjectSource) - return json.Unmarshal(b, *v) - case "": - return fmt.Errorf( - "response was missing PackageSourceOrArtifact.__typename") - default: - return fmt.Errorf( - `unexpected concrete type for allCertifyGoodSubjectPackageSourceOrArtifact: "%v"`, tn.TypeName) - } +// PointOfContact is an attestation of how to get in touch with the person(s) responsible +// for a package, source, or artifact. +// +// All evidence trees record a justification for the property they represent as +// well as the document that contains the attestation (origin) and the collector +// that collected the document (collector). +// +// The attestation applies to a subject which is a package, source, or artifact. +// If the attestation targets a package, it must target a PackageName or a +// PackageVersion. If the attestation targets a source, it must target a +// SourceName. +// +// email is the email address (singular) of the point of contact. +// +// info is additional contact information other than email address. This is free +// form. +// +// NOTE: the identifiers for point of contact should be part of software trees. +// This will benefit from identifier look up and traversal as well as organization +// hierarchy. However, until the use case arises, PointOfContact will be a flat +// reference to the contact details. +type PathPathPointOfContact struct { + Typename *string `json:"__typename"` } -func __marshalallCertifyGoodSubjectPackageSourceOrArtifact(v *allCertifyGoodSubjectPackageSourceOrArtifact) ([]byte, error) { - - var typename string - switch v := (*v).(type) { - case *allCertifyGoodSubjectArtifact: - typename = "Artifact" - - premarshaled, err := v.__premarshalJSON() - if err != nil { - return nil, err - } - result := struct { - TypeName string `json:"__typename"` - *__premarshalallCertifyGoodSubjectArtifact - }{typename, premarshaled} - return json.Marshal(result) - case *allCertifyGoodSubjectPackage: - typename = "Package" - - premarshaled, err := v.__premarshalJSON() - if err != nil { - return nil, err - } - result := struct { - TypeName string `json:"__typename"` - *__premarshalallCertifyGoodSubjectPackage - }{typename, premarshaled} - return json.Marshal(result) - case *allCertifyGoodSubjectSource: - typename = "Source" - - premarshaled, err := v.__premarshalJSON() - if err != nil { - return nil, err - } - result := struct { - TypeName string `json:"__typename"` - *__premarshalallCertifyGoodSubjectSource - }{typename, premarshaled} - return json.Marshal(result) - case nil: - return []byte("null"), nil - default: - return nil, fmt.Errorf( - `unexpected concrete type for allCertifyGoodSubjectPackageSourceOrArtifact: "%T"`, v) - } -} +// GetTypename returns PathPathPointOfContact.Typename, and is useful for accessing the field via an interface. +func (v *PathPathPointOfContact) GetTypename() *string { return v.Typename } -// allCertifyGoodSubjectSource includes the requested fields of the GraphQL type Source. +// PathPathSource includes the requested fields of the GraphQL type Source. // The GraphQL type's documentation follows. // // Source represents the root of the source trie/tree. @@ -21137,36 +21428,36 @@ func __marshalallCertifyGoodSubjectPackageSourceOrArtifact(v *allCertifyGoodSubj // // Since this node is at the root of the source trie, it is named Source, not // SourceType. -type allCertifyGoodSubjectSource struct { +type PathPathSource struct { Typename *string `json:"__typename"` AllSourceTree `json:"-"` } -// GetTypename returns allCertifyGoodSubjectSource.Typename, and is useful for accessing the field via an interface. -func (v *allCertifyGoodSubjectSource) GetTypename() *string { return v.Typename } +// GetTypename returns PathPathSource.Typename, and is useful for accessing the field via an interface. +func (v *PathPathSource) GetTypename() *string { return v.Typename } -// GetId returns allCertifyGoodSubjectSource.Id, and is useful for accessing the field via an interface. -func (v *allCertifyGoodSubjectSource) GetId() string { return v.AllSourceTree.Id } +// GetId returns PathPathSource.Id, and is useful for accessing the field via an interface. +func (v *PathPathSource) GetId() string { return v.AllSourceTree.Id } -// GetType returns allCertifyGoodSubjectSource.Type, and is useful for accessing the field via an interface. -func (v *allCertifyGoodSubjectSource) GetType() string { return v.AllSourceTree.Type } +// GetType returns PathPathSource.Type, and is useful for accessing the field via an interface. +func (v *PathPathSource) GetType() string { return v.AllSourceTree.Type } -// GetNamespaces returns allCertifyGoodSubjectSource.Namespaces, and is useful for accessing the field via an interface. -func (v *allCertifyGoodSubjectSource) GetNamespaces() []AllSourceTreeNamespacesSourceNamespace { +// GetNamespaces returns PathPathSource.Namespaces, and is useful for accessing the field via an interface. +func (v *PathPathSource) GetNamespaces() []AllSourceTreeNamespacesSourceNamespace { return v.AllSourceTree.Namespaces } -func (v *allCertifyGoodSubjectSource) UnmarshalJSON(b []byte) error { +func (v *PathPathSource) UnmarshalJSON(b []byte) error { if string(b) == "null" { return nil } var firstPass struct { - *allCertifyGoodSubjectSource + *PathPathSource graphql.NoUnmarshalJSON } - firstPass.allCertifyGoodSubjectSource = v + firstPass.PathPathSource = v err := json.Unmarshal(b, &firstPass) if err != nil { @@ -21181,7 +21472,7 @@ func (v *allCertifyGoodSubjectSource) UnmarshalJSON(b []byte) error { return nil } -type __premarshalallCertifyGoodSubjectSource struct { +type __premarshalPathPathSource struct { Typename *string `json:"__typename"` Id string `json:"id"` @@ -21191,7 +21482,7 @@ type __premarshalallCertifyGoodSubjectSource struct { Namespaces []AllSourceTreeNamespacesSourceNamespace `json:"namespaces"` } -func (v *allCertifyGoodSubjectSource) MarshalJSON() ([]byte, error) { +func (v *PathPathSource) MarshalJSON() ([]byte, error) { premarshaled, err := v.__premarshalJSON() if err != nil { return nil, err @@ -21199,8 +21490,8 @@ func (v *allCertifyGoodSubjectSource) MarshalJSON() ([]byte, error) { return json.Marshal(premarshaled) } -func (v *allCertifyGoodSubjectSource) __premarshalJSON() (*__premarshalallCertifyGoodSubjectSource, error) { - var retval __premarshalallCertifyGoodSubjectSource +func (v *PathPathSource) __premarshalJSON() (*__premarshalPathPathSource, error) { + var retval __premarshalPathPathSource retval.Typename = v.Typename retval.Id = v.AllSourceTree.Id @@ -21209,80 +21500,33 @@ func (v *allCertifyGoodSubjectSource) __premarshalJSON() (*__premarshalallCertif return &retval, nil } -// allCertifyVEXStatement includes the GraphQL fields of CertifyVEXStatement requested by the fragment allCertifyVEXStatement. -// The GraphQL type's documentation follows. -// -// CertifyVEXStatement is an attestation to attach VEX statements to a package or -// artifact to clarify the impact of a specific vulnerability (CVE, GHSA or OSV). -type allCertifyVEXStatement struct { - Id string `json:"id"` - // Subject of attestation - Subject allCertifyVEXStatementSubjectPackageOrArtifact `json:"-"` - // Attested vulnerability - Vulnerability allCertifyVEXStatementVulnerability `json:"-"` - // Status of the vulnerabilities with respect to the subject - Status VexStatus `json:"status"` - // Justification from VEX statement - VexJustification VexJustification `json:"vexJustification"` - // VEX statement: impact_statement or action_statement depending on status - Statement string `json:"statement"` - // statusNotes may convey information about how status was determined - StatusNotes string `json:"statusNotes"` - // Timestamp (exact time in RFC 3339 format) for the VEX statement - KnownSince time.Time `json:"knownSince"` - // Document from which this attestation is generated from - Origin string `json:"origin"` - // GUAC collector for the document - Collector string `json:"collector"` -} - -// GetId returns allCertifyVEXStatement.Id, and is useful for accessing the field via an interface. -func (v *allCertifyVEXStatement) GetId() string { return v.Id } - -// GetSubject returns allCertifyVEXStatement.Subject, and is useful for accessing the field via an interface. -func (v *allCertifyVEXStatement) GetSubject() allCertifyVEXStatementSubjectPackageOrArtifact { - return v.Subject -} - -// GetVulnerability returns allCertifyVEXStatement.Vulnerability, and is useful for accessing the field via an interface. -func (v *allCertifyVEXStatement) GetVulnerability() allCertifyVEXStatementVulnerability { - return v.Vulnerability +// PathResponse is returned by Path on success. +type PathResponse struct { + // path query returns a path between subject and target, of a maximum length. + // + // Since we want to uniquely identify endpoints, nodes must be specified by + // valid IDs only (instead of using filters/input spec structs). + // + // Specifying any Edge value in `usingOnly` will make the path only contain the + // corresponding GUAC evidence trees (GUAC verbs). + Path []PathPathNode `json:"-"` } -// GetStatus returns allCertifyVEXStatement.Status, and is useful for accessing the field via an interface. -func (v *allCertifyVEXStatement) GetStatus() VexStatus { return v.Status } - -// GetVexJustification returns allCertifyVEXStatement.VexJustification, and is useful for accessing the field via an interface. -func (v *allCertifyVEXStatement) GetVexJustification() VexJustification { return v.VexJustification } - -// GetStatement returns allCertifyVEXStatement.Statement, and is useful for accessing the field via an interface. -func (v *allCertifyVEXStatement) GetStatement() string { return v.Statement } - -// GetStatusNotes returns allCertifyVEXStatement.StatusNotes, and is useful for accessing the field via an interface. -func (v *allCertifyVEXStatement) GetStatusNotes() string { return v.StatusNotes } - -// GetKnownSince returns allCertifyVEXStatement.KnownSince, and is useful for accessing the field via an interface. -func (v *allCertifyVEXStatement) GetKnownSince() time.Time { return v.KnownSince } - -// GetOrigin returns allCertifyVEXStatement.Origin, and is useful for accessing the field via an interface. -func (v *allCertifyVEXStatement) GetOrigin() string { return v.Origin } - -// GetCollector returns allCertifyVEXStatement.Collector, and is useful for accessing the field via an interface. -func (v *allCertifyVEXStatement) GetCollector() string { return v.Collector } +// GetPath returns PathResponse.Path, and is useful for accessing the field via an interface. +func (v *PathResponse) GetPath() []PathPathNode { return v.Path } -func (v *allCertifyVEXStatement) UnmarshalJSON(b []byte) error { +func (v *PathResponse) UnmarshalJSON(b []byte) error { if string(b) == "null" { return nil } var firstPass struct { - *allCertifyVEXStatement - Subject json.RawMessage `json:"subject"` - Vulnerability json.RawMessage `json:"vulnerability"` + *PathResponse + Path []json.RawMessage `json:"path"` graphql.NoUnmarshalJSON } - firstPass.allCertifyVEXStatement = v + firstPass.PathResponse = v err := json.Unmarshal(b, &firstPass) if err != nil { @@ -21290,56 +21534,31 @@ func (v *allCertifyVEXStatement) UnmarshalJSON(b []byte) error { } { - dst := &v.Subject - src := firstPass.Subject - if len(src) != 0 && string(src) != "null" { - err = __unmarshalallCertifyVEXStatementSubjectPackageOrArtifact( - src, dst) - if err != nil { - return fmt.Errorf( - "unable to unmarshal allCertifyVEXStatement.Subject: %w", err) - } - } - } - - { - dst := &v.Vulnerability - src := firstPass.Vulnerability - if len(src) != 0 && string(src) != "null" { - err = __unmarshalallCertifyVEXStatementVulnerability( - src, dst) - if err != nil { - return fmt.Errorf( - "unable to unmarshal allCertifyVEXStatement.Vulnerability: %w", err) + dst := &v.Path + src := firstPass.Path + *dst = make( + []PathPathNode, + len(src)) + for i, src := range src { + dst := &(*dst)[i] + if len(src) != 0 && string(src) != "null" { + err = __unmarshalPathPathNode( + src, dst) + if err != nil { + return fmt.Errorf( + "unable to unmarshal PathResponse.Path: %w", err) + } } } } return nil } -type __premarshalallCertifyVEXStatement struct { - Id string `json:"id"` - - Subject json.RawMessage `json:"subject"` - - Vulnerability json.RawMessage `json:"vulnerability"` - - Status VexStatus `json:"status"` - - VexJustification VexJustification `json:"vexJustification"` - - Statement string `json:"statement"` - - StatusNotes string `json:"statusNotes"` - - KnownSince time.Time `json:"knownSince"` - - Origin string `json:"origin"` - - Collector string `json:"collector"` +type __premarshalPathResponse struct { + Path []json.RawMessage `json:"path"` } -func (v *allCertifyVEXStatement) MarshalJSON() ([]byte, error) { +func (v *PathResponse) MarshalJSON() ([]byte, error) { premarshaled, err := v.__premarshalJSON() if err != nil { return nil, err @@ -21347,84 +21566,66 @@ func (v *allCertifyVEXStatement) MarshalJSON() ([]byte, error) { return json.Marshal(premarshaled) } -func (v *allCertifyVEXStatement) __premarshalJSON() (*__premarshalallCertifyVEXStatement, error) { - var retval __premarshalallCertifyVEXStatement - - retval.Id = v.Id - { +func (v *PathResponse) __premarshalJSON() (*__premarshalPathResponse, error) { + var retval __premarshalPathResponse - dst := &retval.Subject - src := v.Subject - var err error - *dst, err = __marshalallCertifyVEXStatementSubjectPackageOrArtifact( - &src) - if err != nil { - return nil, fmt.Errorf( - "unable to marshal allCertifyVEXStatement.Subject: %w", err) - } - } { - dst := &retval.Vulnerability - src := v.Vulnerability - var err error - *dst, err = __marshalallCertifyVEXStatementVulnerability( - &src) - if err != nil { - return nil, fmt.Errorf( - "unable to marshal allCertifyVEXStatement.Vulnerability: %w", err) + dst := &retval.Path + src := v.Path + *dst = make( + []json.RawMessage, + len(src)) + for i, src := range src { + dst := &(*dst)[i] + var err error + *dst, err = __marshalPathPathNode( + &src) + if err != nil { + return nil, fmt.Errorf( + "unable to marshal PathResponse.Path: %w", err) + } } } - retval.Status = v.Status - retval.VexJustification = v.VexJustification - retval.Statement = v.Statement - retval.StatusNotes = v.StatusNotes - retval.KnownSince = v.KnownSince - retval.Origin = v.Origin - retval.Collector = v.Collector return &retval, nil } -// allCertifyVEXStatementSubjectArtifact includes the requested fields of the GraphQL type Artifact. +// PkgEqualIngestPkgEqual includes the requested fields of the GraphQL type PkgEqual. // The GraphQL type's documentation follows. // -// Artifact represents an artifact identified by a checksum hash. -// -// The checksum is split into the digest value and the algorithm used to generate -// it. Both fields are mandatory and canonicalized to be lowercase. -// -// If having a checksum Go object, algorithm can be -// strings.ToLower(string(checksum.Algorithm)) and digest can be checksum.Value. -type allCertifyVEXStatementSubjectArtifact struct { - Typename *string `json:"__typename"` - AllArtifactTree `json:"-"` +// PkgEqual is an attestation that a set of packages are similar. +type PkgEqualIngestPkgEqual struct { + AllPkgEqual `json:"-"` } -// GetTypename returns allCertifyVEXStatementSubjectArtifact.Typename, and is useful for accessing the field via an interface. -func (v *allCertifyVEXStatementSubjectArtifact) GetTypename() *string { return v.Typename } +// GetId returns PkgEqualIngestPkgEqual.Id, and is useful for accessing the field via an interface. +func (v *PkgEqualIngestPkgEqual) GetId() string { return v.AllPkgEqual.Id } -// GetId returns allCertifyVEXStatementSubjectArtifact.Id, and is useful for accessing the field via an interface. -func (v *allCertifyVEXStatementSubjectArtifact) GetId() string { return v.AllArtifactTree.Id } +// GetJustification returns PkgEqualIngestPkgEqual.Justification, and is useful for accessing the field via an interface. +func (v *PkgEqualIngestPkgEqual) GetJustification() string { return v.AllPkgEqual.Justification } -// GetAlgorithm returns allCertifyVEXStatementSubjectArtifact.Algorithm, and is useful for accessing the field via an interface. -func (v *allCertifyVEXStatementSubjectArtifact) GetAlgorithm() string { - return v.AllArtifactTree.Algorithm +// GetPackages returns PkgEqualIngestPkgEqual.Packages, and is useful for accessing the field via an interface. +func (v *PkgEqualIngestPkgEqual) GetPackages() []AllPkgEqualPackagesPackage { + return v.AllPkgEqual.Packages } -// GetDigest returns allCertifyVEXStatementSubjectArtifact.Digest, and is useful for accessing the field via an interface. -func (v *allCertifyVEXStatementSubjectArtifact) GetDigest() string { return v.AllArtifactTree.Digest } +// GetOrigin returns PkgEqualIngestPkgEqual.Origin, and is useful for accessing the field via an interface. +func (v *PkgEqualIngestPkgEqual) GetOrigin() string { return v.AllPkgEqual.Origin } + +// GetCollector returns PkgEqualIngestPkgEqual.Collector, and is useful for accessing the field via an interface. +func (v *PkgEqualIngestPkgEqual) GetCollector() string { return v.AllPkgEqual.Collector } -func (v *allCertifyVEXStatementSubjectArtifact) UnmarshalJSON(b []byte) error { +func (v *PkgEqualIngestPkgEqual) UnmarshalJSON(b []byte) error { if string(b) == "null" { return nil } var firstPass struct { - *allCertifyVEXStatementSubjectArtifact + *PkgEqualIngestPkgEqual graphql.NoUnmarshalJSON } - firstPass.allCertifyVEXStatementSubjectArtifact = v + firstPass.PkgEqualIngestPkgEqual = v err := json.Unmarshal(b, &firstPass) if err != nil { @@ -21432,24 +21633,26 @@ func (v *allCertifyVEXStatementSubjectArtifact) UnmarshalJSON(b []byte) error { } err = json.Unmarshal( - b, &v.AllArtifactTree) + b, &v.AllPkgEqual) if err != nil { return err } return nil } -type __premarshalallCertifyVEXStatementSubjectArtifact struct { - Typename *string `json:"__typename"` - +type __premarshalPkgEqualIngestPkgEqual struct { Id string `json:"id"` - Algorithm string `json:"algorithm"` + Justification string `json:"justification"` - Digest string `json:"digest"` + Packages []AllPkgEqualPackagesPackage `json:"packages"` + + Origin string `json:"origin"` + + Collector string `json:"collector"` } -func (v *allCertifyVEXStatementSubjectArtifact) MarshalJSON() ([]byte, error) { +func (v *PkgEqualIngestPkgEqual) MarshalJSON() ([]byte, error) { premarshaled, err := v.__premarshalJSON() if err != nil { return nil, err @@ -21457,17 +21660,34 @@ func (v *allCertifyVEXStatementSubjectArtifact) MarshalJSON() ([]byte, error) { return json.Marshal(premarshaled) } -func (v *allCertifyVEXStatementSubjectArtifact) __premarshalJSON() (*__premarshalallCertifyVEXStatementSubjectArtifact, error) { - var retval __premarshalallCertifyVEXStatementSubjectArtifact +func (v *PkgEqualIngestPkgEqual) __premarshalJSON() (*__premarshalPkgEqualIngestPkgEqual, error) { + var retval __premarshalPkgEqualIngestPkgEqual - retval.Typename = v.Typename - retval.Id = v.AllArtifactTree.Id - retval.Algorithm = v.AllArtifactTree.Algorithm - retval.Digest = v.AllArtifactTree.Digest + retval.Id = v.AllPkgEqual.Id + retval.Justification = v.AllPkgEqual.Justification + retval.Packages = v.AllPkgEqual.Packages + retval.Origin = v.AllPkgEqual.Origin + retval.Collector = v.AllPkgEqual.Collector return &retval, nil } -// allCertifyVEXStatementSubjectPackage includes the requested fields of the GraphQL type Package. +// PkgEqualInputSpec represents the input to certify that packages are similar. +type PkgEqualInputSpec struct { + Justification string `json:"justification"` + Origin string `json:"origin"` + Collector string `json:"collector"` +} + +// GetJustification returns PkgEqualInputSpec.Justification, and is useful for accessing the field via an interface. +func (v *PkgEqualInputSpec) GetJustification() string { return v.Justification } + +// GetOrigin returns PkgEqualInputSpec.Origin, and is useful for accessing the field via an interface. +func (v *PkgEqualInputSpec) GetOrigin() string { return v.Origin } + +// GetCollector returns PkgEqualInputSpec.Collector, and is useful for accessing the field via an interface. +func (v *PkgEqualInputSpec) GetCollector() string { return v.Collector } + +// PkgEqualOtherPackage includes the requested fields of the GraphQL type Package. // The GraphQL type's documentation follows. // // Package represents the root of the package trie/tree. @@ -21484,36 +21704,32 @@ func (v *allCertifyVEXStatementSubjectArtifact) __premarshalJSON() (*__premarsha // // Since this node is at the root of the package trie, it is named Package, not // PackageType. -type allCertifyVEXStatementSubjectPackage struct { - Typename *string `json:"__typename"` +type PkgEqualOtherPackage struct { AllPkgTree `json:"-"` } -// GetTypename returns allCertifyVEXStatementSubjectPackage.Typename, and is useful for accessing the field via an interface. -func (v *allCertifyVEXStatementSubjectPackage) GetTypename() *string { return v.Typename } - -// GetId returns allCertifyVEXStatementSubjectPackage.Id, and is useful for accessing the field via an interface. -func (v *allCertifyVEXStatementSubjectPackage) GetId() string { return v.AllPkgTree.Id } +// GetId returns PkgEqualOtherPackage.Id, and is useful for accessing the field via an interface. +func (v *PkgEqualOtherPackage) GetId() string { return v.AllPkgTree.Id } -// GetType returns allCertifyVEXStatementSubjectPackage.Type, and is useful for accessing the field via an interface. -func (v *allCertifyVEXStatementSubjectPackage) GetType() string { return v.AllPkgTree.Type } +// GetType returns PkgEqualOtherPackage.Type, and is useful for accessing the field via an interface. +func (v *PkgEqualOtherPackage) GetType() string { return v.AllPkgTree.Type } -// GetNamespaces returns allCertifyVEXStatementSubjectPackage.Namespaces, and is useful for accessing the field via an interface. -func (v *allCertifyVEXStatementSubjectPackage) GetNamespaces() []AllPkgTreeNamespacesPackageNamespace { +// GetNamespaces returns PkgEqualOtherPackage.Namespaces, and is useful for accessing the field via an interface. +func (v *PkgEqualOtherPackage) GetNamespaces() []AllPkgTreeNamespacesPackageNamespace { return v.AllPkgTree.Namespaces } -func (v *allCertifyVEXStatementSubjectPackage) UnmarshalJSON(b []byte) error { +func (v *PkgEqualOtherPackage) UnmarshalJSON(b []byte) error { if string(b) == "null" { return nil } var firstPass struct { - *allCertifyVEXStatementSubjectPackage + *PkgEqualOtherPackage graphql.NoUnmarshalJSON } - firstPass.allCertifyVEXStatementSubjectPackage = v + firstPass.PkgEqualOtherPackage = v err := json.Unmarshal(b, &firstPass) if err != nil { @@ -21528,9 +21744,7 @@ func (v *allCertifyVEXStatementSubjectPackage) UnmarshalJSON(b []byte) error { return nil } -type __premarshalallCertifyVEXStatementSubjectPackage struct { - Typename *string `json:"__typename"` - +type __premarshalPkgEqualOtherPackage struct { Id string `json:"id"` Type string `json:"type"` @@ -21538,7 +21752,7 @@ type __premarshalallCertifyVEXStatementSubjectPackage struct { Namespaces []AllPkgTreeNamespacesPackageNamespace `json:"namespaces"` } -func (v *allCertifyVEXStatementSubjectPackage) MarshalJSON() ([]byte, error) { +func (v *PkgEqualOtherPackage) MarshalJSON() ([]byte, error) { premarshaled, err := v.__premarshalJSON() if err != nil { return nil, err @@ -21546,257 +21760,58 @@ func (v *allCertifyVEXStatementSubjectPackage) MarshalJSON() ([]byte, error) { return json.Marshal(premarshaled) } -func (v *allCertifyVEXStatementSubjectPackage) __premarshalJSON() (*__premarshalallCertifyVEXStatementSubjectPackage, error) { - var retval __premarshalallCertifyVEXStatementSubjectPackage +func (v *PkgEqualOtherPackage) __premarshalJSON() (*__premarshalPkgEqualOtherPackage, error) { + var retval __premarshalPkgEqualOtherPackage - retval.Typename = v.Typename retval.Id = v.AllPkgTree.Id retval.Type = v.AllPkgTree.Type retval.Namespaces = v.AllPkgTree.Namespaces return &retval, nil } -// allCertifyVEXStatementSubjectPackageOrArtifact includes the requested fields of the GraphQL interface PackageOrArtifact. -// -// allCertifyVEXStatementSubjectPackageOrArtifact is implemented by the following types: -// allCertifyVEXStatementSubjectArtifact -// allCertifyVEXStatementSubjectPackage -// The GraphQL type's documentation follows. -// -// PackageOrArtifact is a union of Package and Artifact. -type allCertifyVEXStatementSubjectPackageOrArtifact interface { - implementsGraphQLInterfaceallCertifyVEXStatementSubjectPackageOrArtifact() - // GetTypename returns the receiver's concrete GraphQL type-name (see interface doc for possible values). - GetTypename() *string -} - -func (v *allCertifyVEXStatementSubjectArtifact) implementsGraphQLInterfaceallCertifyVEXStatementSubjectPackageOrArtifact() { -} -func (v *allCertifyVEXStatementSubjectPackage) implementsGraphQLInterfaceallCertifyVEXStatementSubjectPackageOrArtifact() { -} - -func __unmarshalallCertifyVEXStatementSubjectPackageOrArtifact(b []byte, v *allCertifyVEXStatementSubjectPackageOrArtifact) error { - if string(b) == "null" { - return nil - } - - var tn struct { - TypeName string `json:"__typename"` - } - err := json.Unmarshal(b, &tn) - if err != nil { - return err - } - - switch tn.TypeName { - case "Artifact": - *v = new(allCertifyVEXStatementSubjectArtifact) - return json.Unmarshal(b, *v) - case "Package": - *v = new(allCertifyVEXStatementSubjectPackage) - return json.Unmarshal(b, *v) - case "": - return fmt.Errorf( - "response was missing PackageOrArtifact.__typename") - default: - return fmt.Errorf( - `unexpected concrete type for allCertifyVEXStatementSubjectPackageOrArtifact: "%v"`, tn.TypeName) - } -} - -func __marshalallCertifyVEXStatementSubjectPackageOrArtifact(v *allCertifyVEXStatementSubjectPackageOrArtifact) ([]byte, error) { - - var typename string - switch v := (*v).(type) { - case *allCertifyVEXStatementSubjectArtifact: - typename = "Artifact" - - premarshaled, err := v.__premarshalJSON() - if err != nil { - return nil, err - } - result := struct { - TypeName string `json:"__typename"` - *__premarshalallCertifyVEXStatementSubjectArtifact - }{typename, premarshaled} - return json.Marshal(result) - case *allCertifyVEXStatementSubjectPackage: - typename = "Package" - - premarshaled, err := v.__premarshalJSON() - if err != nil { - return nil, err - } - result := struct { - TypeName string `json:"__typename"` - *__premarshalallCertifyVEXStatementSubjectPackage - }{typename, premarshaled} - return json.Marshal(result) - case nil: - return []byte("null"), nil - default: - return nil, fmt.Errorf( - `unexpected concrete type for allCertifyVEXStatementSubjectPackageOrArtifact: "%T"`, v) - } -} - -// allCertifyVEXStatementVulnerability includes the requested fields of the GraphQL interface Vulnerability. -// -// allCertifyVEXStatementVulnerability is implemented by the following types: -// allCertifyVEXStatementVulnerabilityCVE -// allCertifyVEXStatementVulnerabilityGHSA -// allCertifyVEXStatementVulnerabilityNoVuln -// allCertifyVEXStatementVulnerabilityOSV -// The GraphQL type's documentation follows. -// -// Vulnerability is a union of OSV, CVE, GHSA or the NoVuln node. -type allCertifyVEXStatementVulnerability interface { - implementsGraphQLInterfaceallCertifyVEXStatementVulnerability() - // GetTypename returns the receiver's concrete GraphQL type-name (see interface doc for possible values). - GetTypename() *string -} - -func (v *allCertifyVEXStatementVulnerabilityCVE) implementsGraphQLInterfaceallCertifyVEXStatementVulnerability() { -} -func (v *allCertifyVEXStatementVulnerabilityGHSA) implementsGraphQLInterfaceallCertifyVEXStatementVulnerability() { -} -func (v *allCertifyVEXStatementVulnerabilityNoVuln) implementsGraphQLInterfaceallCertifyVEXStatementVulnerability() { -} -func (v *allCertifyVEXStatementVulnerabilityOSV) implementsGraphQLInterfaceallCertifyVEXStatementVulnerability() { -} - -func __unmarshalallCertifyVEXStatementVulnerability(b []byte, v *allCertifyVEXStatementVulnerability) error { - if string(b) == "null" { - return nil - } - - var tn struct { - TypeName string `json:"__typename"` - } - err := json.Unmarshal(b, &tn) - if err != nil { - return err - } - - switch tn.TypeName { - case "CVE": - *v = new(allCertifyVEXStatementVulnerabilityCVE) - return json.Unmarshal(b, *v) - case "GHSA": - *v = new(allCertifyVEXStatementVulnerabilityGHSA) - return json.Unmarshal(b, *v) - case "NoVuln": - *v = new(allCertifyVEXStatementVulnerabilityNoVuln) - return json.Unmarshal(b, *v) - case "OSV": - *v = new(allCertifyVEXStatementVulnerabilityOSV) - return json.Unmarshal(b, *v) - case "": - return fmt.Errorf( - "response was missing Vulnerability.__typename") - default: - return fmt.Errorf( - `unexpected concrete type for allCertifyVEXStatementVulnerability: "%v"`, tn.TypeName) - } -} - -func __marshalallCertifyVEXStatementVulnerability(v *allCertifyVEXStatementVulnerability) ([]byte, error) { - - var typename string - switch v := (*v).(type) { - case *allCertifyVEXStatementVulnerabilityCVE: - typename = "CVE" - - premarshaled, err := v.__premarshalJSON() - if err != nil { - return nil, err - } - result := struct { - TypeName string `json:"__typename"` - *__premarshalallCertifyVEXStatementVulnerabilityCVE - }{typename, premarshaled} - return json.Marshal(result) - case *allCertifyVEXStatementVulnerabilityGHSA: - typename = "GHSA" - - premarshaled, err := v.__premarshalJSON() - if err != nil { - return nil, err - } - result := struct { - TypeName string `json:"__typename"` - *__premarshalallCertifyVEXStatementVulnerabilityGHSA - }{typename, premarshaled} - return json.Marshal(result) - case *allCertifyVEXStatementVulnerabilityNoVuln: - typename = "NoVuln" - - result := struct { - TypeName string `json:"__typename"` - *allCertifyVEXStatementVulnerabilityNoVuln - }{typename, v} - return json.Marshal(result) - case *allCertifyVEXStatementVulnerabilityOSV: - typename = "OSV" - - premarshaled, err := v.__premarshalJSON() - if err != nil { - return nil, err - } - result := struct { - TypeName string `json:"__typename"` - *__premarshalallCertifyVEXStatementVulnerabilityOSV - }{typename, premarshaled} - return json.Marshal(result) - case nil: - return []byte("null"), nil - default: - return nil, fmt.Errorf( - `unexpected concrete type for allCertifyVEXStatementVulnerability: "%T"`, v) - } -} - -// allCertifyVEXStatementVulnerabilityCVE includes the requested fields of the GraphQL type CVE. +// PkgEqualPkgPackage includes the requested fields of the GraphQL type Package. // The GraphQL type's documentation follows. // -// CVE represents a vulnerability in the Common Vulnerabilities and Exposures -// schema. +// Package represents the root of the package trie/tree. // -// The vulnerability identifier contains a year field, so we are extracting that -// to allow matching for vulnerabilities found in a given year. +// We map package information to a trie, closely matching the pURL specification +// (https://github.com/package-url/purl-spec/blob/0dd92f26f8bb11956ffdf5e8acfcee71e8560407/README.rst), +// but deviating from it where GUAC heuristics allow for better representation of +// package information. Each path in the trie fully represents a package; we split +// the trie based on the pURL components. // -// The vulnerability identifier field is mandatory and canonicalized to be -// lowercase. +// This node matches a pkg: partial pURL. The type field matches the +// pURL types but we might also use "guac" for the cases where the pURL +// representation is not complete or when we have custom rules. // -// This node can be referred to by other parts of GUAC. -type allCertifyVEXStatementVulnerabilityCVE struct { - Typename *string `json:"__typename"` - AllCveTree `json:"-"` +// Since this node is at the root of the package trie, it is named Package, not +// PackageType. +type PkgEqualPkgPackage struct { + AllPkgTree `json:"-"` } -// GetTypename returns allCertifyVEXStatementVulnerabilityCVE.Typename, and is useful for accessing the field via an interface. -func (v *allCertifyVEXStatementVulnerabilityCVE) GetTypename() *string { return v.Typename } - -// GetId returns allCertifyVEXStatementVulnerabilityCVE.Id, and is useful for accessing the field via an interface. -func (v *allCertifyVEXStatementVulnerabilityCVE) GetId() string { return v.AllCveTree.Id } +// GetId returns PkgEqualPkgPackage.Id, and is useful for accessing the field via an interface. +func (v *PkgEqualPkgPackage) GetId() string { return v.AllPkgTree.Id } -// GetYear returns allCertifyVEXStatementVulnerabilityCVE.Year, and is useful for accessing the field via an interface. -func (v *allCertifyVEXStatementVulnerabilityCVE) GetYear() int { return v.AllCveTree.Year } +// GetType returns PkgEqualPkgPackage.Type, and is useful for accessing the field via an interface. +func (v *PkgEqualPkgPackage) GetType() string { return v.AllPkgTree.Type } -// GetCveId returns allCertifyVEXStatementVulnerabilityCVE.CveId, and is useful for accessing the field via an interface. -func (v *allCertifyVEXStatementVulnerabilityCVE) GetCveId() string { return v.AllCveTree.CveId } +// GetNamespaces returns PkgEqualPkgPackage.Namespaces, and is useful for accessing the field via an interface. +func (v *PkgEqualPkgPackage) GetNamespaces() []AllPkgTreeNamespacesPackageNamespace { + return v.AllPkgTree.Namespaces +} -func (v *allCertifyVEXStatementVulnerabilityCVE) UnmarshalJSON(b []byte) error { +func (v *PkgEqualPkgPackage) UnmarshalJSON(b []byte) error { if string(b) == "null" { return nil } var firstPass struct { - *allCertifyVEXStatementVulnerabilityCVE + *PkgEqualPkgPackage graphql.NoUnmarshalJSON } - firstPass.allCertifyVEXStatementVulnerabilityCVE = v + firstPass.PkgEqualPkgPackage = v err := json.Unmarshal(b, &firstPass) if err != nil { @@ -21804,24 +21819,22 @@ func (v *allCertifyVEXStatementVulnerabilityCVE) UnmarshalJSON(b []byte) error { } err = json.Unmarshal( - b, &v.AllCveTree) + b, &v.AllPkgTree) if err != nil { return err } return nil } -type __premarshalallCertifyVEXStatementVulnerabilityCVE struct { - Typename *string `json:"__typename"` - +type __premarshalPkgEqualPkgPackage struct { Id string `json:"id"` - Year int `json:"year"` + Type string `json:"type"` - CveId string `json:"cveId"` + Namespaces []AllPkgTreeNamespacesPackageNamespace `json:"namespaces"` } -func (v *allCertifyVEXStatementVulnerabilityCVE) MarshalJSON() ([]byte, error) { +func (v *PkgEqualPkgPackage) MarshalJSON() ([]byte, error) { premarshaled, err := v.__premarshalJSON() if err != nil { return nil, err @@ -21829,138 +21842,373 @@ func (v *allCertifyVEXStatementVulnerabilityCVE) MarshalJSON() ([]byte, error) { return json.Marshal(premarshaled) } -func (v *allCertifyVEXStatementVulnerabilityCVE) __premarshalJSON() (*__premarshalallCertifyVEXStatementVulnerabilityCVE, error) { - var retval __premarshalallCertifyVEXStatementVulnerabilityCVE +func (v *PkgEqualPkgPackage) __premarshalJSON() (*__premarshalPkgEqualPkgPackage, error) { + var retval __premarshalPkgEqualPkgPackage - retval.Typename = v.Typename - retval.Id = v.AllCveTree.Id - retval.Year = v.AllCveTree.Year - retval.CveId = v.AllCveTree.CveId + retval.Id = v.AllPkgTree.Id + retval.Type = v.AllPkgTree.Type + retval.Namespaces = v.AllPkgTree.Namespaces return &retval, nil } -// allCertifyVEXStatementVulnerabilityGHSA includes the requested fields of the GraphQL type GHSA. +// PkgEqualResponse is returned by PkgEqual on success. +type PkgEqualResponse struct { + // Ingests a new package and returns the corresponding package trie path. + Pkg PkgEqualPkgPackage `json:"pkg"` + // Ingests a new package and returns the corresponding package trie path. + OtherPackage PkgEqualOtherPackage `json:"otherPackage"` + // Adds a certification that two packages are similar. + IngestPkgEqual PkgEqualIngestPkgEqual `json:"ingestPkgEqual"` +} + +// GetPkg returns PkgEqualResponse.Pkg, and is useful for accessing the field via an interface. +func (v *PkgEqualResponse) GetPkg() PkgEqualPkgPackage { return v.Pkg } + +// GetOtherPackage returns PkgEqualResponse.OtherPackage, and is useful for accessing the field via an interface. +func (v *PkgEqualResponse) GetOtherPackage() PkgEqualOtherPackage { return v.OtherPackage } + +// GetIngestPkgEqual returns PkgEqualResponse.IngestPkgEqual, and is useful for accessing the field via an interface. +func (v *PkgEqualResponse) GetIngestPkgEqual() PkgEqualIngestPkgEqual { return v.IngestPkgEqual } + +// PkgInputSpec specifies a package for mutations. +// +// This is different than PkgSpec because we want to encode mandatory fields: +// type and name. All optional fields are given empty default values. +type PkgInputSpec struct { + Type string `json:"type"` + Namespace *string `json:"namespace"` + Name string `json:"name"` + Version *string `json:"version"` + Qualifiers []PackageQualifierInputSpec `json:"qualifiers"` + Subpath *string `json:"subpath"` +} + +// GetType returns PkgInputSpec.Type, and is useful for accessing the field via an interface. +func (v *PkgInputSpec) GetType() string { return v.Type } + +// GetNamespace returns PkgInputSpec.Namespace, and is useful for accessing the field via an interface. +func (v *PkgInputSpec) GetNamespace() *string { return v.Namespace } + +// GetName returns PkgInputSpec.Name, and is useful for accessing the field via an interface. +func (v *PkgInputSpec) GetName() string { return v.Name } + +// GetVersion returns PkgInputSpec.Version, and is useful for accessing the field via an interface. +func (v *PkgInputSpec) GetVersion() *string { return v.Version } + +// GetQualifiers returns PkgInputSpec.Qualifiers, and is useful for accessing the field via an interface. +func (v *PkgInputSpec) GetQualifiers() []PackageQualifierInputSpec { return v.Qualifiers } + +// GetSubpath returns PkgInputSpec.Subpath, and is useful for accessing the field via an interface. +func (v *PkgInputSpec) GetSubpath() *string { return v.Subpath } + +// PkgMatchType is an enum to determine if the attestation should be done at the +// specific version or package name. +type PkgMatchType string + +const ( + PkgMatchTypeAllVersions PkgMatchType = "ALL_VERSIONS" + PkgMatchTypeSpecificVersion PkgMatchType = "SPECIFIC_VERSION" +) + +// PkgSpec allows filtering the list of sources to return in a query. +// +// Each field matches a qualifier from pURL. Use null to match on all values at +// that level. For example, to get all packages in GUAC backend, use a PkgSpec +// where every field is null. +// +// Empty string at a field means matching with the empty string. If passing in +// qualifiers, all of the values in the list must match. Since we want to return +// nodes with any number of qualifiers if no qualifiers are passed in the input, +// we must also return the same set of nodes it the qualifiers list is empty. To +// match on nodes that don't contain any qualifier, set matchOnlyEmptyQualifiers +// to true. If this field is true, then the qualifiers argument is ignored. +type PkgSpec struct { + Id *string `json:"id"` + Type *string `json:"type"` + Namespace *string `json:"namespace"` + Name *string `json:"name"` + Version *string `json:"version"` + Qualifiers []PackageQualifierSpec `json:"qualifiers"` + MatchOnlyEmptyQualifiers *bool `json:"matchOnlyEmptyQualifiers"` + Subpath *string `json:"subpath"` +} + +// GetId returns PkgSpec.Id, and is useful for accessing the field via an interface. +func (v *PkgSpec) GetId() *string { return v.Id } + +// GetType returns PkgSpec.Type, and is useful for accessing the field via an interface. +func (v *PkgSpec) GetType() *string { return v.Type } + +// GetNamespace returns PkgSpec.Namespace, and is useful for accessing the field via an interface. +func (v *PkgSpec) GetNamespace() *string { return v.Namespace } + +// GetName returns PkgSpec.Name, and is useful for accessing the field via an interface. +func (v *PkgSpec) GetName() *string { return v.Name } + +// GetVersion returns PkgSpec.Version, and is useful for accessing the field via an interface. +func (v *PkgSpec) GetVersion() *string { return v.Version } + +// GetQualifiers returns PkgSpec.Qualifiers, and is useful for accessing the field via an interface. +func (v *PkgSpec) GetQualifiers() []PackageQualifierSpec { return v.Qualifiers } + +// GetMatchOnlyEmptyQualifiers returns PkgSpec.MatchOnlyEmptyQualifiers, and is useful for accessing the field via an interface. +func (v *PkgSpec) GetMatchOnlyEmptyQualifiers() *bool { return v.MatchOnlyEmptyQualifiers } + +// GetSubpath returns PkgSpec.Subpath, and is useful for accessing the field via an interface. +func (v *PkgSpec) GetSubpath() *string { return v.Subpath } + +// PointOfContactArtifactIngestPointOfContact includes the requested fields of the GraphQL type PointOfContact. // The GraphQL type's documentation follows. // -// GHSA represents GitHub security advisories. +// PointOfContact is an attestation of how to get in touch with the person(s) responsible +// for a package, source, or artifact. // -// The advisory id field is mandatory and canonicalized to be lowercase. +// All evidence trees record a justification for the property they represent as +// well as the document that contains the attestation (origin) and the collector +// that collected the document (collector). // -// This node can be referred to by other parts of GUAC. -type allCertifyVEXStatementVulnerabilityGHSA struct { - Typename *string `json:"__typename"` - AllGHSATree `json:"-"` +// The attestation applies to a subject which is a package, source, or artifact. +// If the attestation targets a package, it must target a PackageName or a +// PackageVersion. If the attestation targets a source, it must target a +// SourceName. +// +// email is the email address (singular) of the point of contact. +// +// info is additional contact information other than email address. This is free +// form. +// +// NOTE: the identifiers for point of contact should be part of software trees. +// This will benefit from identifier look up and traversal as well as organization +// hierarchy. However, until the use case arises, PointOfContact will be a flat +// reference to the contact details. +type PointOfContactArtifactIngestPointOfContact struct { + AllPointOfContact `json:"-"` +} + +// GetId returns PointOfContactArtifactIngestPointOfContact.Id, and is useful for accessing the field via an interface. +func (v *PointOfContactArtifactIngestPointOfContact) GetId() string { return v.AllPointOfContact.Id } + +// GetSubject returns PointOfContactArtifactIngestPointOfContact.Subject, and is useful for accessing the field via an interface. +func (v *PointOfContactArtifactIngestPointOfContact) GetSubject() AllPointOfContactSubjectPackageSourceOrArtifact { + return v.AllPointOfContact.Subject } -// GetTypename returns allCertifyVEXStatementVulnerabilityGHSA.Typename, and is useful for accessing the field via an interface. -func (v *allCertifyVEXStatementVulnerabilityGHSA) GetTypename() *string { return v.Typename } +// GetEmail returns PointOfContactArtifactIngestPointOfContact.Email, and is useful for accessing the field via an interface. +func (v *PointOfContactArtifactIngestPointOfContact) GetEmail() string { + return v.AllPointOfContact.Email +} + +// GetInfo returns PointOfContactArtifactIngestPointOfContact.Info, and is useful for accessing the field via an interface. +func (v *PointOfContactArtifactIngestPointOfContact) GetInfo() string { + return v.AllPointOfContact.Info +} + +// GetSince returns PointOfContactArtifactIngestPointOfContact.Since, and is useful for accessing the field via an interface. +func (v *PointOfContactArtifactIngestPointOfContact) GetSince() time.Time { + return v.AllPointOfContact.Since +} + +// GetJustification returns PointOfContactArtifactIngestPointOfContact.Justification, and is useful for accessing the field via an interface. +func (v *PointOfContactArtifactIngestPointOfContact) GetJustification() string { + return v.AllPointOfContact.Justification +} -// GetId returns allCertifyVEXStatementVulnerabilityGHSA.Id, and is useful for accessing the field via an interface. -func (v *allCertifyVEXStatementVulnerabilityGHSA) GetId() string { return v.AllGHSATree.Id } +// GetOrigin returns PointOfContactArtifactIngestPointOfContact.Origin, and is useful for accessing the field via an interface. +func (v *PointOfContactArtifactIngestPointOfContact) GetOrigin() string { + return v.AllPointOfContact.Origin +} -// GetGhsaId returns allCertifyVEXStatementVulnerabilityGHSA.GhsaId, and is useful for accessing the field via an interface. -func (v *allCertifyVEXStatementVulnerabilityGHSA) GetGhsaId() string { return v.AllGHSATree.GhsaId } +// GetCollector returns PointOfContactArtifactIngestPointOfContact.Collector, and is useful for accessing the field via an interface. +func (v *PointOfContactArtifactIngestPointOfContact) GetCollector() string { + return v.AllPointOfContact.Collector +} -func (v *allCertifyVEXStatementVulnerabilityGHSA) UnmarshalJSON(b []byte) error { +func (v *PointOfContactArtifactIngestPointOfContact) UnmarshalJSON(b []byte) error { if string(b) == "null" { return nil } var firstPass struct { - *allCertifyVEXStatementVulnerabilityGHSA + *PointOfContactArtifactIngestPointOfContact graphql.NoUnmarshalJSON } - firstPass.allCertifyVEXStatementVulnerabilityGHSA = v + firstPass.PointOfContactArtifactIngestPointOfContact = v err := json.Unmarshal(b, &firstPass) if err != nil { return err } - err = json.Unmarshal( - b, &v.AllGHSATree) - if err != nil { - return err - } - return nil + err = json.Unmarshal( + b, &v.AllPointOfContact) + if err != nil { + return err + } + return nil +} + +type __premarshalPointOfContactArtifactIngestPointOfContact struct { + Id string `json:"id"` + + Subject json.RawMessage `json:"subject"` + + Email string `json:"email"` + + Info string `json:"info"` + + Since time.Time `json:"since"` + + Justification string `json:"justification"` + + Origin string `json:"origin"` + + Collector string `json:"collector"` +} + +func (v *PointOfContactArtifactIngestPointOfContact) MarshalJSON() ([]byte, error) { + premarshaled, err := v.__premarshalJSON() + if err != nil { + return nil, err + } + return json.Marshal(premarshaled) +} + +func (v *PointOfContactArtifactIngestPointOfContact) __premarshalJSON() (*__premarshalPointOfContactArtifactIngestPointOfContact, error) { + var retval __premarshalPointOfContactArtifactIngestPointOfContact + + retval.Id = v.AllPointOfContact.Id + { + + dst := &retval.Subject + src := v.AllPointOfContact.Subject + var err error + *dst, err = __marshalAllPointOfContactSubjectPackageSourceOrArtifact( + &src) + if err != nil { + return nil, fmt.Errorf( + "unable to marshal PointOfContactArtifactIngestPointOfContact.AllPointOfContact.Subject: %w", err) + } + } + retval.Email = v.AllPointOfContact.Email + retval.Info = v.AllPointOfContact.Info + retval.Since = v.AllPointOfContact.Since + retval.Justification = v.AllPointOfContact.Justification + retval.Origin = v.AllPointOfContact.Origin + retval.Collector = v.AllPointOfContact.Collector + return &retval, nil +} + +// PointOfContactArtifactResponse is returned by PointOfContactArtifact on success. +type PointOfContactArtifactResponse struct { + // Adds a PointOfContact attestation to a package, source or artifact. + IngestPointOfContact PointOfContactArtifactIngestPointOfContact `json:"ingestPointOfContact"` +} + +// GetIngestPointOfContact returns PointOfContactArtifactResponse.IngestPointOfContact, and is useful for accessing the field via an interface. +func (v *PointOfContactArtifactResponse) GetIngestPointOfContact() PointOfContactArtifactIngestPointOfContact { + return v.IngestPointOfContact +} + +// PointOfContactInputSpec represents the mutation input to ingest a PointOfContact evidence. +type PointOfContactInputSpec struct { + Email string `json:"email"` + Info string `json:"info"` + Since time.Time `json:"since"` + Justification string `json:"justification"` + Origin string `json:"origin"` + Collector string `json:"collector"` } -type __premarshalallCertifyVEXStatementVulnerabilityGHSA struct { - Typename *string `json:"__typename"` +// GetEmail returns PointOfContactInputSpec.Email, and is useful for accessing the field via an interface. +func (v *PointOfContactInputSpec) GetEmail() string { return v.Email } - Id string `json:"id"` +// GetInfo returns PointOfContactInputSpec.Info, and is useful for accessing the field via an interface. +func (v *PointOfContactInputSpec) GetInfo() string { return v.Info } - GhsaId string `json:"ghsaId"` -} +// GetSince returns PointOfContactInputSpec.Since, and is useful for accessing the field via an interface. +func (v *PointOfContactInputSpec) GetSince() time.Time { return v.Since } -func (v *allCertifyVEXStatementVulnerabilityGHSA) MarshalJSON() ([]byte, error) { - premarshaled, err := v.__premarshalJSON() - if err != nil { - return nil, err - } - return json.Marshal(premarshaled) -} +// GetJustification returns PointOfContactInputSpec.Justification, and is useful for accessing the field via an interface. +func (v *PointOfContactInputSpec) GetJustification() string { return v.Justification } -func (v *allCertifyVEXStatementVulnerabilityGHSA) __premarshalJSON() (*__premarshalallCertifyVEXStatementVulnerabilityGHSA, error) { - var retval __premarshalallCertifyVEXStatementVulnerabilityGHSA +// GetOrigin returns PointOfContactInputSpec.Origin, and is useful for accessing the field via an interface. +func (v *PointOfContactInputSpec) GetOrigin() string { return v.Origin } - retval.Typename = v.Typename - retval.Id = v.AllGHSATree.Id - retval.GhsaId = v.AllGHSATree.GhsaId - return &retval, nil -} +// GetCollector returns PointOfContactInputSpec.Collector, and is useful for accessing the field via an interface. +func (v *PointOfContactInputSpec) GetCollector() string { return v.Collector } -// allCertifyVEXStatementVulnerabilityNoVuln includes the requested fields of the GraphQL type NoVuln. +// PointOfContactPkgIngestPointOfContact includes the requested fields of the GraphQL type PointOfContact. // The GraphQL type's documentation follows. // -// NoVuln is a special vulnerability node to attest that no vulnerability has been -// found during a vulnerability scan. +// PointOfContact is an attestation of how to get in touch with the person(s) responsible +// for a package, source, or artifact. // -// Backends guarantee that this is a singleton node. -type allCertifyVEXStatementVulnerabilityNoVuln struct { - Typename *string `json:"__typename"` -} - -// GetTypename returns allCertifyVEXStatementVulnerabilityNoVuln.Typename, and is useful for accessing the field via an interface. -func (v *allCertifyVEXStatementVulnerabilityNoVuln) GetTypename() *string { return v.Typename } - -// allCertifyVEXStatementVulnerabilityOSV includes the requested fields of the GraphQL type OSV. -// The GraphQL type's documentation follows. +// All evidence trees record a justification for the property they represent as +// well as the document that contains the attestation (origin) and the collector +// that collected the document (collector). // -// OSV represents an Open Source Vulnerability. +// The attestation applies to a subject which is a package, source, or artifact. +// If the attestation targets a package, it must target a PackageName or a +// PackageVersion. If the attestation targets a source, it must target a +// SourceName. // -// The osvId field is mandatory and canonicalized to be lowercase. +// email is the email address (singular) of the point of contact. // -// This maps to a vulnerability ID specific to the environment (e.g., GHSA ID or -// CVE ID). +// info is additional contact information other than email address. This is free +// form. // -// This node can be referred to by other parts of GUAC. -type allCertifyVEXStatementVulnerabilityOSV struct { - Typename *string `json:"__typename"` - AllOSVTree `json:"-"` +// NOTE: the identifiers for point of contact should be part of software trees. +// This will benefit from identifier look up and traversal as well as organization +// hierarchy. However, until the use case arises, PointOfContact will be a flat +// reference to the contact details. +type PointOfContactPkgIngestPointOfContact struct { + AllPointOfContact `json:"-"` +} + +// GetId returns PointOfContactPkgIngestPointOfContact.Id, and is useful for accessing the field via an interface. +func (v *PointOfContactPkgIngestPointOfContact) GetId() string { return v.AllPointOfContact.Id } + +// GetSubject returns PointOfContactPkgIngestPointOfContact.Subject, and is useful for accessing the field via an interface. +func (v *PointOfContactPkgIngestPointOfContact) GetSubject() AllPointOfContactSubjectPackageSourceOrArtifact { + return v.AllPointOfContact.Subject +} + +// GetEmail returns PointOfContactPkgIngestPointOfContact.Email, and is useful for accessing the field via an interface. +func (v *PointOfContactPkgIngestPointOfContact) GetEmail() string { return v.AllPointOfContact.Email } + +// GetInfo returns PointOfContactPkgIngestPointOfContact.Info, and is useful for accessing the field via an interface. +func (v *PointOfContactPkgIngestPointOfContact) GetInfo() string { return v.AllPointOfContact.Info } + +// GetSince returns PointOfContactPkgIngestPointOfContact.Since, and is useful for accessing the field via an interface. +func (v *PointOfContactPkgIngestPointOfContact) GetSince() time.Time { + return v.AllPointOfContact.Since } -// GetTypename returns allCertifyVEXStatementVulnerabilityOSV.Typename, and is useful for accessing the field via an interface. -func (v *allCertifyVEXStatementVulnerabilityOSV) GetTypename() *string { return v.Typename } +// GetJustification returns PointOfContactPkgIngestPointOfContact.Justification, and is useful for accessing the field via an interface. +func (v *PointOfContactPkgIngestPointOfContact) GetJustification() string { + return v.AllPointOfContact.Justification +} -// GetId returns allCertifyVEXStatementVulnerabilityOSV.Id, and is useful for accessing the field via an interface. -func (v *allCertifyVEXStatementVulnerabilityOSV) GetId() string { return v.AllOSVTree.Id } +// GetOrigin returns PointOfContactPkgIngestPointOfContact.Origin, and is useful for accessing the field via an interface. +func (v *PointOfContactPkgIngestPointOfContact) GetOrigin() string { return v.AllPointOfContact.Origin } -// GetOsvId returns allCertifyVEXStatementVulnerabilityOSV.OsvId, and is useful for accessing the field via an interface. -func (v *allCertifyVEXStatementVulnerabilityOSV) GetOsvId() string { return v.AllOSVTree.OsvId } +// GetCollector returns PointOfContactPkgIngestPointOfContact.Collector, and is useful for accessing the field via an interface. +func (v *PointOfContactPkgIngestPointOfContact) GetCollector() string { + return v.AllPointOfContact.Collector +} -func (v *allCertifyVEXStatementVulnerabilityOSV) UnmarshalJSON(b []byte) error { +func (v *PointOfContactPkgIngestPointOfContact) UnmarshalJSON(b []byte) error { if string(b) == "null" { return nil } var firstPass struct { - *allCertifyVEXStatementVulnerabilityOSV + *PointOfContactPkgIngestPointOfContact graphql.NoUnmarshalJSON } - firstPass.allCertifyVEXStatementVulnerabilityOSV = v + firstPass.PointOfContactPkgIngestPointOfContact = v err := json.Unmarshal(b, &firstPass) if err != nil { @@ -21968,22 +22216,32 @@ func (v *allCertifyVEXStatementVulnerabilityOSV) UnmarshalJSON(b []byte) error { } err = json.Unmarshal( - b, &v.AllOSVTree) + b, &v.AllPointOfContact) if err != nil { return err } return nil } -type __premarshalallCertifyVEXStatementVulnerabilityOSV struct { - Typename *string `json:"__typename"` - +type __premarshalPointOfContactPkgIngestPointOfContact struct { Id string `json:"id"` - OsvId string `json:"osvId"` + Subject json.RawMessage `json:"subject"` + + Email string `json:"email"` + + Info string `json:"info"` + + Since time.Time `json:"since"` + + Justification string `json:"justification"` + + Origin string `json:"origin"` + + Collector string `json:"collector"` } -func (v *allCertifyVEXStatementVulnerabilityOSV) MarshalJSON() ([]byte, error) { +func (v *PointOfContactPkgIngestPointOfContact) MarshalJSON() ([]byte, error) { premarshaled, err := v.__premarshalJSON() if err != nil { return nil, err @@ -21991,110 +22249,137 @@ func (v *allCertifyVEXStatementVulnerabilityOSV) MarshalJSON() ([]byte, error) { return json.Marshal(premarshaled) } -func (v *allCertifyVEXStatementVulnerabilityOSV) __premarshalJSON() (*__premarshalallCertifyVEXStatementVulnerabilityOSV, error) { - var retval __premarshalallCertifyVEXStatementVulnerabilityOSV +func (v *PointOfContactPkgIngestPointOfContact) __premarshalJSON() (*__premarshalPointOfContactPkgIngestPointOfContact, error) { + var retval __premarshalPointOfContactPkgIngestPointOfContact + + retval.Id = v.AllPointOfContact.Id + { - retval.Typename = v.Typename - retval.Id = v.AllOSVTree.Id - retval.OsvId = v.AllOSVTree.OsvId + dst := &retval.Subject + src := v.AllPointOfContact.Subject + var err error + *dst, err = __marshalAllPointOfContactSubjectPackageSourceOrArtifact( + &src) + if err != nil { + return nil, fmt.Errorf( + "unable to marshal PointOfContactPkgIngestPointOfContact.AllPointOfContact.Subject: %w", err) + } + } + retval.Email = v.AllPointOfContact.Email + retval.Info = v.AllPointOfContact.Info + retval.Since = v.AllPointOfContact.Since + retval.Justification = v.AllPointOfContact.Justification + retval.Origin = v.AllPointOfContact.Origin + retval.Collector = v.AllPointOfContact.Collector return &retval, nil } -// allHasMetadata includes the GraphQL fields of HasMetadata requested by the fragment allHasMetadata. +// PointOfContactPkgResponse is returned by PointOfContactPkg on success. +type PointOfContactPkgResponse struct { + // Adds a PointOfContact attestation to a package, source or artifact. + IngestPointOfContact PointOfContactPkgIngestPointOfContact `json:"ingestPointOfContact"` +} + +// GetIngestPointOfContact returns PointOfContactPkgResponse.IngestPointOfContact, and is useful for accessing the field via an interface. +func (v *PointOfContactPkgResponse) GetIngestPointOfContact() PointOfContactPkgIngestPointOfContact { + return v.IngestPointOfContact +} + +// PointOfContactSrcIngestPointOfContact includes the requested fields of the GraphQL type PointOfContact. // The GraphQL type's documentation follows. // -// HasMetadata is an attestation that a package, source, or artifact has a certain -// attested property (key) with value (value). For example, a source may have -// metadata "SourceRepo2FAEnabled=true". -// -// The intent of this evidence tree predicate is to allow extensibility of metadata -// expressible within the GUAC ontology. Metadata that is commonly used will then -// be promoted to a predicate on its own. +// PointOfContact is an attestation of how to get in touch with the person(s) responsible +// for a package, source, or artifact. // -// Justification indicates how the metadata was determined. +// All evidence trees record a justification for the property they represent as +// well as the document that contains the attestation (origin) and the collector +// that collected the document (collector). // -// The metadata applies to a subject which is a package, source, or artifact. +// The attestation applies to a subject which is a package, source, or artifact. // If the attestation targets a package, it must target a PackageName or a // PackageVersion. If the attestation targets a source, it must target a // SourceName. -type allHasMetadata struct { - Id string `json:"id"` - Subject allHasMetadataSubjectPackageSourceOrArtifact `json:"-"` - Key string `json:"key"` - Value string `json:"value"` - Timestamp time.Time `json:"timestamp"` - Justification string `json:"justification"` - Origin string `json:"origin"` - Collector string `json:"collector"` +// +// email is the email address (singular) of the point of contact. +// +// info is additional contact information other than email address. This is free +// form. +// +// NOTE: the identifiers for point of contact should be part of software trees. +// This will benefit from identifier look up and traversal as well as organization +// hierarchy. However, until the use case arises, PointOfContact will be a flat +// reference to the contact details. +type PointOfContactSrcIngestPointOfContact struct { + AllPointOfContact `json:"-"` } -// GetId returns allHasMetadata.Id, and is useful for accessing the field via an interface. -func (v *allHasMetadata) GetId() string { return v.Id } +// GetId returns PointOfContactSrcIngestPointOfContact.Id, and is useful for accessing the field via an interface. +func (v *PointOfContactSrcIngestPointOfContact) GetId() string { return v.AllPointOfContact.Id } -// GetSubject returns allHasMetadata.Subject, and is useful for accessing the field via an interface. -func (v *allHasMetadata) GetSubject() allHasMetadataSubjectPackageSourceOrArtifact { return v.Subject } +// GetSubject returns PointOfContactSrcIngestPointOfContact.Subject, and is useful for accessing the field via an interface. +func (v *PointOfContactSrcIngestPointOfContact) GetSubject() AllPointOfContactSubjectPackageSourceOrArtifact { + return v.AllPointOfContact.Subject +} -// GetKey returns allHasMetadata.Key, and is useful for accessing the field via an interface. -func (v *allHasMetadata) GetKey() string { return v.Key } +// GetEmail returns PointOfContactSrcIngestPointOfContact.Email, and is useful for accessing the field via an interface. +func (v *PointOfContactSrcIngestPointOfContact) GetEmail() string { return v.AllPointOfContact.Email } -// GetValue returns allHasMetadata.Value, and is useful for accessing the field via an interface. -func (v *allHasMetadata) GetValue() string { return v.Value } +// GetInfo returns PointOfContactSrcIngestPointOfContact.Info, and is useful for accessing the field via an interface. +func (v *PointOfContactSrcIngestPointOfContact) GetInfo() string { return v.AllPointOfContact.Info } -// GetTimestamp returns allHasMetadata.Timestamp, and is useful for accessing the field via an interface. -func (v *allHasMetadata) GetTimestamp() time.Time { return v.Timestamp } +// GetSince returns PointOfContactSrcIngestPointOfContact.Since, and is useful for accessing the field via an interface. +func (v *PointOfContactSrcIngestPointOfContact) GetSince() time.Time { + return v.AllPointOfContact.Since +} -// GetJustification returns allHasMetadata.Justification, and is useful for accessing the field via an interface. -func (v *allHasMetadata) GetJustification() string { return v.Justification } +// GetJustification returns PointOfContactSrcIngestPointOfContact.Justification, and is useful for accessing the field via an interface. +func (v *PointOfContactSrcIngestPointOfContact) GetJustification() string { + return v.AllPointOfContact.Justification +} -// GetOrigin returns allHasMetadata.Origin, and is useful for accessing the field via an interface. -func (v *allHasMetadata) GetOrigin() string { return v.Origin } +// GetOrigin returns PointOfContactSrcIngestPointOfContact.Origin, and is useful for accessing the field via an interface. +func (v *PointOfContactSrcIngestPointOfContact) GetOrigin() string { return v.AllPointOfContact.Origin } -// GetCollector returns allHasMetadata.Collector, and is useful for accessing the field via an interface. -func (v *allHasMetadata) GetCollector() string { return v.Collector } +// GetCollector returns PointOfContactSrcIngestPointOfContact.Collector, and is useful for accessing the field via an interface. +func (v *PointOfContactSrcIngestPointOfContact) GetCollector() string { + return v.AllPointOfContact.Collector +} -func (v *allHasMetadata) UnmarshalJSON(b []byte) error { +func (v *PointOfContactSrcIngestPointOfContact) UnmarshalJSON(b []byte) error { if string(b) == "null" { return nil } var firstPass struct { - *allHasMetadata - Subject json.RawMessage `json:"subject"` + *PointOfContactSrcIngestPointOfContact graphql.NoUnmarshalJSON } - firstPass.allHasMetadata = v + firstPass.PointOfContactSrcIngestPointOfContact = v err := json.Unmarshal(b, &firstPass) if err != nil { return err } - { - dst := &v.Subject - src := firstPass.Subject - if len(src) != 0 && string(src) != "null" { - err = __unmarshalallHasMetadataSubjectPackageSourceOrArtifact( - src, dst) - if err != nil { - return fmt.Errorf( - "unable to unmarshal allHasMetadata.Subject: %w", err) - } - } + err = json.Unmarshal( + b, &v.AllPointOfContact) + if err != nil { + return err } return nil } -type __premarshalallHasMetadata struct { +type __premarshalPointOfContactSrcIngestPointOfContact struct { Id string `json:"id"` Subject json.RawMessage `json:"subject"` - Key string `json:"key"` + Email string `json:"email"` - Value string `json:"value"` + Info string `json:"info"` - Timestamp time.Time `json:"timestamp"` + Since time.Time `json:"since"` Justification string `json:"justification"` @@ -22103,7 +22388,7 @@ type __premarshalallHasMetadata struct { Collector string `json:"collector"` } -func (v *allHasMetadata) MarshalJSON() ([]byte, error) { +func (v *PointOfContactSrcIngestPointOfContact) MarshalJSON() ([]byte, error) { premarshaled, err := v.__premarshalJSON() if err != nil { return nil, err @@ -22111,69 +22396,72 @@ func (v *allHasMetadata) MarshalJSON() ([]byte, error) { return json.Marshal(premarshaled) } -func (v *allHasMetadata) __premarshalJSON() (*__premarshalallHasMetadata, error) { - var retval __premarshalallHasMetadata +func (v *PointOfContactSrcIngestPointOfContact) __premarshalJSON() (*__premarshalPointOfContactSrcIngestPointOfContact, error) { + var retval __premarshalPointOfContactSrcIngestPointOfContact - retval.Id = v.Id + retval.Id = v.AllPointOfContact.Id { dst := &retval.Subject - src := v.Subject + src := v.AllPointOfContact.Subject var err error - *dst, err = __marshalallHasMetadataSubjectPackageSourceOrArtifact( + *dst, err = __marshalAllPointOfContactSubjectPackageSourceOrArtifact( &src) if err != nil { return nil, fmt.Errorf( - "unable to marshal allHasMetadata.Subject: %w", err) + "unable to marshal PointOfContactSrcIngestPointOfContact.AllPointOfContact.Subject: %w", err) } } - retval.Key = v.Key - retval.Value = v.Value - retval.Timestamp = v.Timestamp - retval.Justification = v.Justification - retval.Origin = v.Origin - retval.Collector = v.Collector + retval.Email = v.AllPointOfContact.Email + retval.Info = v.AllPointOfContact.Info + retval.Since = v.AllPointOfContact.Since + retval.Justification = v.AllPointOfContact.Justification + retval.Origin = v.AllPointOfContact.Origin + retval.Collector = v.AllPointOfContact.Collector return &retval, nil } -// allHasMetadataSubjectArtifact includes the requested fields of the GraphQL type Artifact. +// PointOfContactSrcResponse is returned by PointOfContactSrc on success. +type PointOfContactSrcResponse struct { + // Adds a PointOfContact attestation to a package, source or artifact. + IngestPointOfContact PointOfContactSrcIngestPointOfContact `json:"ingestPointOfContact"` +} + +// GetIngestPointOfContact returns PointOfContactSrcResponse.IngestPointOfContact, and is useful for accessing the field via an interface. +func (v *PointOfContactSrcResponse) GetIngestPointOfContact() PointOfContactSrcIngestPointOfContact { + return v.IngestPointOfContact +} + +// SLSAForArtifactIngestSLSAHasSLSA includes the requested fields of the GraphQL type HasSLSA. // The GraphQL type's documentation follows. // -// Artifact represents an artifact identified by a checksum hash. -// -// The checksum is split into the digest value and the algorithm used to generate -// it. Both fields are mandatory and canonicalized to be lowercase. -// -// If having a checksum Go object, algorithm can be -// strings.ToLower(string(checksum.Algorithm)) and digest can be checksum.Value. -type allHasMetadataSubjectArtifact struct { - Typename *string `json:"__typename"` - AllArtifactTree `json:"-"` +// HasSLSA records that a subject node has a SLSA attestation. +type SLSAForArtifactIngestSLSAHasSLSA struct { + AllSLSATree `json:"-"` } -// GetTypename returns allHasMetadataSubjectArtifact.Typename, and is useful for accessing the field via an interface. -func (v *allHasMetadataSubjectArtifact) GetTypename() *string { return v.Typename } - -// GetId returns allHasMetadataSubjectArtifact.Id, and is useful for accessing the field via an interface. -func (v *allHasMetadataSubjectArtifact) GetId() string { return v.AllArtifactTree.Id } +// GetId returns SLSAForArtifactIngestSLSAHasSLSA.Id, and is useful for accessing the field via an interface. +func (v *SLSAForArtifactIngestSLSAHasSLSA) GetId() string { return v.AllSLSATree.Id } -// GetAlgorithm returns allHasMetadataSubjectArtifact.Algorithm, and is useful for accessing the field via an interface. -func (v *allHasMetadataSubjectArtifact) GetAlgorithm() string { return v.AllArtifactTree.Algorithm } +// GetSubject returns SLSAForArtifactIngestSLSAHasSLSA.Subject, and is useful for accessing the field via an interface. +func (v *SLSAForArtifactIngestSLSAHasSLSA) GetSubject() AllSLSATreeSubjectArtifact { + return v.AllSLSATree.Subject +} -// GetDigest returns allHasMetadataSubjectArtifact.Digest, and is useful for accessing the field via an interface. -func (v *allHasMetadataSubjectArtifact) GetDigest() string { return v.AllArtifactTree.Digest } +// GetSlsa returns SLSAForArtifactIngestSLSAHasSLSA.Slsa, and is useful for accessing the field via an interface. +func (v *SLSAForArtifactIngestSLSAHasSLSA) GetSlsa() AllSLSATreeSlsaSLSA { return v.AllSLSATree.Slsa } -func (v *allHasMetadataSubjectArtifact) UnmarshalJSON(b []byte) error { +func (v *SLSAForArtifactIngestSLSAHasSLSA) UnmarshalJSON(b []byte) error { if string(b) == "null" { return nil } var firstPass struct { - *allHasMetadataSubjectArtifact + *SLSAForArtifactIngestSLSAHasSLSA graphql.NoUnmarshalJSON } - firstPass.allHasMetadataSubjectArtifact = v + firstPass.SLSAForArtifactIngestSLSAHasSLSA = v err := json.Unmarshal(b, &firstPass) if err != nil { @@ -22181,24 +22469,22 @@ func (v *allHasMetadataSubjectArtifact) UnmarshalJSON(b []byte) error { } err = json.Unmarshal( - b, &v.AllArtifactTree) + b, &v.AllSLSATree) if err != nil { return err } return nil } -type __premarshalallHasMetadataSubjectArtifact struct { - Typename *string `json:"__typename"` - +type __premarshalSLSAForArtifactIngestSLSAHasSLSA struct { Id string `json:"id"` - Algorithm string `json:"algorithm"` + Subject AllSLSATreeSubjectArtifact `json:"subject"` - Digest string `json:"digest"` + Slsa AllSLSATreeSlsaSLSA `json:"slsa"` } -func (v *allHasMetadataSubjectArtifact) MarshalJSON() ([]byte, error) { +func (v *SLSAForArtifactIngestSLSAHasSLSA) MarshalJSON() ([]byte, error) { premarshaled, err := v.__premarshalJSON() if err != nil { return nil, err @@ -22206,63 +22492,56 @@ func (v *allHasMetadataSubjectArtifact) MarshalJSON() ([]byte, error) { return json.Marshal(premarshaled) } -func (v *allHasMetadataSubjectArtifact) __premarshalJSON() (*__premarshalallHasMetadataSubjectArtifact, error) { - var retval __premarshalallHasMetadataSubjectArtifact +func (v *SLSAForArtifactIngestSLSAHasSLSA) __premarshalJSON() (*__premarshalSLSAForArtifactIngestSLSAHasSLSA, error) { + var retval __premarshalSLSAForArtifactIngestSLSAHasSLSA - retval.Typename = v.Typename - retval.Id = v.AllArtifactTree.Id - retval.Algorithm = v.AllArtifactTree.Algorithm - retval.Digest = v.AllArtifactTree.Digest + retval.Id = v.AllSLSATree.Id + retval.Subject = v.AllSLSATree.Subject + retval.Slsa = v.AllSLSATree.Slsa return &retval, nil } -// allHasMetadataSubjectPackage includes the requested fields of the GraphQL type Package. -// The GraphQL type's documentation follows. -// -// Package represents the root of the package trie/tree. -// -// We map package information to a trie, closely matching the pURL specification -// (https://github.com/package-url/purl-spec/blob/0dd92f26f8bb11956ffdf5e8acfcee71e8560407/README.rst), -// but deviating from it where GUAC heuristics allow for better representation of -// package information. Each path in the trie fully represents a package; we split -// the trie based on the pURL components. -// -// This node matches a pkg: partial pURL. The type field matches the -// pURL types but we might also use "guac" for the cases where the pURL -// representation is not complete or when we have custom rules. -// -// Since this node is at the root of the package trie, it is named Package, not -// PackageType. -type allHasMetadataSubjectPackage struct { - Typename *string `json:"__typename"` - AllPkgTree `json:"-"` +// SLSAForArtifactResponse is returned by SLSAForArtifact on success. +type SLSAForArtifactResponse struct { + // Ingests a SLSA attestation + IngestSLSA SLSAForArtifactIngestSLSAHasSLSA `json:"ingestSLSA"` } -// GetTypename returns allHasMetadataSubjectPackage.Typename, and is useful for accessing the field via an interface. -func (v *allHasMetadataSubjectPackage) GetTypename() *string { return v.Typename } +// GetIngestSLSA returns SLSAForArtifactResponse.IngestSLSA, and is useful for accessing the field via an interface. +func (v *SLSAForArtifactResponse) GetIngestSLSA() SLSAForArtifactIngestSLSAHasSLSA { + return v.IngestSLSA +} -// GetId returns allHasMetadataSubjectPackage.Id, and is useful for accessing the field via an interface. -func (v *allHasMetadataSubjectPackage) GetId() string { return v.AllPkgTree.Id } +// SLSAForArtifactsIngestSLSAsHasSLSA includes the requested fields of the GraphQL type HasSLSA. +// The GraphQL type's documentation follows. +// +// HasSLSA records that a subject node has a SLSA attestation. +type SLSAForArtifactsIngestSLSAsHasSLSA struct { + AllSLSATree `json:"-"` +} -// GetType returns allHasMetadataSubjectPackage.Type, and is useful for accessing the field via an interface. -func (v *allHasMetadataSubjectPackage) GetType() string { return v.AllPkgTree.Type } +// GetId returns SLSAForArtifactsIngestSLSAsHasSLSA.Id, and is useful for accessing the field via an interface. +func (v *SLSAForArtifactsIngestSLSAsHasSLSA) GetId() string { return v.AllSLSATree.Id } -// GetNamespaces returns allHasMetadataSubjectPackage.Namespaces, and is useful for accessing the field via an interface. -func (v *allHasMetadataSubjectPackage) GetNamespaces() []AllPkgTreeNamespacesPackageNamespace { - return v.AllPkgTree.Namespaces +// GetSubject returns SLSAForArtifactsIngestSLSAsHasSLSA.Subject, and is useful for accessing the field via an interface. +func (v *SLSAForArtifactsIngestSLSAsHasSLSA) GetSubject() AllSLSATreeSubjectArtifact { + return v.AllSLSATree.Subject } -func (v *allHasMetadataSubjectPackage) UnmarshalJSON(b []byte) error { +// GetSlsa returns SLSAForArtifactsIngestSLSAsHasSLSA.Slsa, and is useful for accessing the field via an interface. +func (v *SLSAForArtifactsIngestSLSAsHasSLSA) GetSlsa() AllSLSATreeSlsaSLSA { return v.AllSLSATree.Slsa } + +func (v *SLSAForArtifactsIngestSLSAsHasSLSA) UnmarshalJSON(b []byte) error { if string(b) == "null" { return nil } var firstPass struct { - *allHasMetadataSubjectPackage + *SLSAForArtifactsIngestSLSAsHasSLSA graphql.NoUnmarshalJSON } - firstPass.allHasMetadataSubjectPackage = v + firstPass.SLSAForArtifactsIngestSLSAsHasSLSA = v err := json.Unmarshal(b, &firstPass) if err != nil { @@ -22270,24 +22549,22 @@ func (v *allHasMetadataSubjectPackage) UnmarshalJSON(b []byte) error { } err = json.Unmarshal( - b, &v.AllPkgTree) + b, &v.AllSLSATree) if err != nil { return err } return nil } -type __premarshalallHasMetadataSubjectPackage struct { - Typename *string `json:"__typename"` - +type __premarshalSLSAForArtifactsIngestSLSAsHasSLSA struct { Id string `json:"id"` - Type string `json:"type"` + Subject AllSLSATreeSubjectArtifact `json:"subject"` - Namespaces []AllPkgTreeNamespacesPackageNamespace `json:"namespaces"` + Slsa AllSLSATreeSlsaSLSA `json:"slsa"` } -func (v *allHasMetadataSubjectPackage) MarshalJSON() ([]byte, error) { +func (v *SLSAForArtifactsIngestSLSAsHasSLSA) MarshalJSON() ([]byte, error) { premarshaled, err := v.__premarshalJSON() if err != nil { return nil, err @@ -22295,119 +22572,190 @@ func (v *allHasMetadataSubjectPackage) MarshalJSON() ([]byte, error) { return json.Marshal(premarshaled) } -func (v *allHasMetadataSubjectPackage) __premarshalJSON() (*__premarshalallHasMetadataSubjectPackage, error) { - var retval __premarshalallHasMetadataSubjectPackage +func (v *SLSAForArtifactsIngestSLSAsHasSLSA) __premarshalJSON() (*__premarshalSLSAForArtifactsIngestSLSAsHasSLSA, error) { + var retval __premarshalSLSAForArtifactsIngestSLSAsHasSLSA - retval.Typename = v.Typename - retval.Id = v.AllPkgTree.Id - retval.Type = v.AllPkgTree.Type - retval.Namespaces = v.AllPkgTree.Namespaces + retval.Id = v.AllSLSATree.Id + retval.Subject = v.AllSLSATree.Subject + retval.Slsa = v.AllSLSATree.Slsa return &retval, nil } -// allHasMetadataSubjectPackageSourceOrArtifact includes the requested fields of the GraphQL interface PackageSourceOrArtifact. -// -// allHasMetadataSubjectPackageSourceOrArtifact is implemented by the following types: -// allHasMetadataSubjectArtifact -// allHasMetadataSubjectPackage -// allHasMetadataSubjectSource -// The GraphQL type's documentation follows. -// -// PackageSourceOrArtifact is a union of Package, Source, and Artifact. -type allHasMetadataSubjectPackageSourceOrArtifact interface { - implementsGraphQLInterfaceallHasMetadataSubjectPackageSourceOrArtifact() - // GetTypename returns the receiver's concrete GraphQL type-name (see interface doc for possible values). - GetTypename() *string +// SLSAForArtifactsResponse is returned by SLSAForArtifacts on success. +type SLSAForArtifactsResponse struct { + // Bulk Ingest SLSA attestations + IngestSLSAs []SLSAForArtifactsIngestSLSAsHasSLSA `json:"ingestSLSAs"` } -func (v *allHasMetadataSubjectArtifact) implementsGraphQLInterfaceallHasMetadataSubjectPackageSourceOrArtifact() { +// GetIngestSLSAs returns SLSAForArtifactsResponse.IngestSLSAs, and is useful for accessing the field via an interface. +func (v *SLSAForArtifactsResponse) GetIngestSLSAs() []SLSAForArtifactsIngestSLSAsHasSLSA { + return v.IngestSLSAs } -func (v *allHasMetadataSubjectPackage) implementsGraphQLInterfaceallHasMetadataSubjectPackageSourceOrArtifact() { + +// SLSAInputSpec is the same as SLSA but for mutation input. +type SLSAInputSpec struct { + BuildType string `json:"buildType"` + SlsaPredicate []SLSAPredicateInputSpec `json:"slsaPredicate"` + SlsaVersion string `json:"slsaVersion"` + StartedOn *time.Time `json:"startedOn"` + FinishedOn *time.Time `json:"finishedOn"` + Origin string `json:"origin"` + Collector string `json:"collector"` } -func (v *allHasMetadataSubjectSource) implementsGraphQLInterfaceallHasMetadataSubjectPackageSourceOrArtifact() { + +// GetBuildType returns SLSAInputSpec.BuildType, and is useful for accessing the field via an interface. +func (v *SLSAInputSpec) GetBuildType() string { return v.BuildType } + +// GetSlsaPredicate returns SLSAInputSpec.SlsaPredicate, and is useful for accessing the field via an interface. +func (v *SLSAInputSpec) GetSlsaPredicate() []SLSAPredicateInputSpec { return v.SlsaPredicate } + +// GetSlsaVersion returns SLSAInputSpec.SlsaVersion, and is useful for accessing the field via an interface. +func (v *SLSAInputSpec) GetSlsaVersion() string { return v.SlsaVersion } + +// GetStartedOn returns SLSAInputSpec.StartedOn, and is useful for accessing the field via an interface. +func (v *SLSAInputSpec) GetStartedOn() *time.Time { return v.StartedOn } + +// GetFinishedOn returns SLSAInputSpec.FinishedOn, and is useful for accessing the field via an interface. +func (v *SLSAInputSpec) GetFinishedOn() *time.Time { return v.FinishedOn } + +// GetOrigin returns SLSAInputSpec.Origin, and is useful for accessing the field via an interface. +func (v *SLSAInputSpec) GetOrigin() string { return v.Origin } + +// GetCollector returns SLSAInputSpec.Collector, and is useful for accessing the field via an interface. +func (v *SLSAInputSpec) GetCollector() string { return v.Collector } + +// SLSAPredicateInputSpec allows ingesting SLSAPredicateSpec. +type SLSAPredicateInputSpec struct { + Key string `json:"key"` + Value string `json:"value"` } -func __unmarshalallHasMetadataSubjectPackageSourceOrArtifact(b []byte, v *allHasMetadataSubjectPackageSourceOrArtifact) error { - if string(b) == "null" { - return nil - } +// GetKey returns SLSAPredicateInputSpec.Key, and is useful for accessing the field via an interface. +func (v *SLSAPredicateInputSpec) GetKey() string { return v.Key } - var tn struct { - TypeName string `json:"__typename"` - } - err := json.Unmarshal(b, &tn) - if err != nil { - return err - } +// GetValue returns SLSAPredicateInputSpec.Value, and is useful for accessing the field via an interface. +func (v *SLSAPredicateInputSpec) GetValue() string { return v.Value } - switch tn.TypeName { - case "Artifact": - *v = new(allHasMetadataSubjectArtifact) - return json.Unmarshal(b, *v) - case "Package": - *v = new(allHasMetadataSubjectPackage) - return json.Unmarshal(b, *v) - case "Source": - *v = new(allHasMetadataSubjectSource) - return json.Unmarshal(b, *v) - case "": - return fmt.Errorf( - "response was missing PackageSourceOrArtifact.__typename") - default: - return fmt.Errorf( - `unexpected concrete type for allHasMetadataSubjectPackageSourceOrArtifact: "%v"`, tn.TypeName) - } +// ScorecardCheckInputSpec represents the mutation input for a Scorecard check. +type ScorecardCheckInputSpec struct { + Check string `json:"check"` + Score int `json:"score"` } -func __marshalallHasMetadataSubjectPackageSourceOrArtifact(v *allHasMetadataSubjectPackageSourceOrArtifact) ([]byte, error) { +// GetCheck returns ScorecardCheckInputSpec.Check, and is useful for accessing the field via an interface. +func (v *ScorecardCheckInputSpec) GetCheck() string { return v.Check } - var typename string - switch v := (*v).(type) { - case *allHasMetadataSubjectArtifact: - typename = "Artifact" +// GetScore returns ScorecardCheckInputSpec.Score, and is useful for accessing the field via an interface. +func (v *ScorecardCheckInputSpec) GetScore() int { return v.Score } - premarshaled, err := v.__premarshalJSON() - if err != nil { - return nil, err - } - result := struct { - TypeName string `json:"__typename"` - *__premarshalallHasMetadataSubjectArtifact - }{typename, premarshaled} - return json.Marshal(result) - case *allHasMetadataSubjectPackage: - typename = "Package" +// ScorecardInputSpec represents the mutation input to ingest a Scorecard. +type ScorecardInputSpec struct { + Checks []ScorecardCheckInputSpec `json:"checks"` + AggregateScore float64 `json:"aggregateScore"` + TimeScanned time.Time `json:"timeScanned"` + ScorecardVersion string `json:"scorecardVersion"` + ScorecardCommit string `json:"scorecardCommit"` + Origin string `json:"origin"` + Collector string `json:"collector"` +} + +// GetChecks returns ScorecardInputSpec.Checks, and is useful for accessing the field via an interface. +func (v *ScorecardInputSpec) GetChecks() []ScorecardCheckInputSpec { return v.Checks } + +// GetAggregateScore returns ScorecardInputSpec.AggregateScore, and is useful for accessing the field via an interface. +func (v *ScorecardInputSpec) GetAggregateScore() float64 { return v.AggregateScore } + +// GetTimeScanned returns ScorecardInputSpec.TimeScanned, and is useful for accessing the field via an interface. +func (v *ScorecardInputSpec) GetTimeScanned() time.Time { return v.TimeScanned } + +// GetScorecardVersion returns ScorecardInputSpec.ScorecardVersion, and is useful for accessing the field via an interface. +func (v *ScorecardInputSpec) GetScorecardVersion() string { return v.ScorecardVersion } + +// GetScorecardCommit returns ScorecardInputSpec.ScorecardCommit, and is useful for accessing the field via an interface. +func (v *ScorecardInputSpec) GetScorecardCommit() string { return v.ScorecardCommit } + +// GetOrigin returns ScorecardInputSpec.Origin, and is useful for accessing the field via an interface. +func (v *ScorecardInputSpec) GetOrigin() string { return v.Origin } + +// GetCollector returns ScorecardInputSpec.Collector, and is useful for accessing the field via an interface. +func (v *ScorecardInputSpec) GetCollector() string { return v.Collector } + +// SourceInputSpec specifies a source for mutations. +// +// This is different than SourceSpec because we want to encode that all fields +// except tag and commit are mandatory fields. All optional fields are given empty +// default values. +// +// It is an error to set both tag and commit fields to values different than the +// default. +type SourceInputSpec struct { + Type string `json:"type"` + Namespace string `json:"namespace"` + Name string `json:"name"` + Tag *string `json:"tag"` + Commit *string `json:"commit"` +} + +// GetType returns SourceInputSpec.Type, and is useful for accessing the field via an interface. +func (v *SourceInputSpec) GetType() string { return v.Type } + +// GetNamespace returns SourceInputSpec.Namespace, and is useful for accessing the field via an interface. +func (v *SourceInputSpec) GetNamespace() string { return v.Namespace } + +// GetName returns SourceInputSpec.Name, and is useful for accessing the field via an interface. +func (v *SourceInputSpec) GetName() string { return v.Name } + +// GetTag returns SourceInputSpec.Tag, and is useful for accessing the field via an interface. +func (v *SourceInputSpec) GetTag() *string { return v.Tag } + +// GetCommit returns SourceInputSpec.Commit, and is useful for accessing the field via an interface. +func (v *SourceInputSpec) GetCommit() *string { return v.Commit } + +// SourceSpec allows filtering the list of sources to return in a query. +// +// Empty string at a field means matching with the empty string. Missing field +// means retrieving all possible matches. +// +// It is an error to specify both tag and commit fields, except it both are set as +// empty string (in which case the returned sources are only those for which there +// is no tag/commit information). +type SourceSpec struct { + Id *string `json:"id"` + Type *string `json:"type"` + Namespace *string `json:"namespace"` + Name *string `json:"name"` + Tag *string `json:"tag"` + Commit *string `json:"commit"` +} + +// GetId returns SourceSpec.Id, and is useful for accessing the field via an interface. +func (v *SourceSpec) GetId() *string { return v.Id } + +// GetType returns SourceSpec.Type, and is useful for accessing the field via an interface. +func (v *SourceSpec) GetType() *string { return v.Type } + +// GetNamespace returns SourceSpec.Namespace, and is useful for accessing the field via an interface. +func (v *SourceSpec) GetNamespace() *string { return v.Namespace } + +// GetName returns SourceSpec.Name, and is useful for accessing the field via an interface. +func (v *SourceSpec) GetName() *string { return v.Name } + +// GetTag returns SourceSpec.Tag, and is useful for accessing the field via an interface. +func (v *SourceSpec) GetTag() *string { return v.Tag } - premarshaled, err := v.__premarshalJSON() - if err != nil { - return nil, err - } - result := struct { - TypeName string `json:"__typename"` - *__premarshalallHasMetadataSubjectPackage - }{typename, premarshaled} - return json.Marshal(result) - case *allHasMetadataSubjectSource: - typename = "Source" +// GetCommit returns SourceSpec.Commit, and is useful for accessing the field via an interface. +func (v *SourceSpec) GetCommit() *string { return v.Commit } - premarshaled, err := v.__premarshalJSON() - if err != nil { - return nil, err - } - result := struct { - TypeName string `json:"__typename"` - *__premarshalallHasMetadataSubjectSource - }{typename, premarshaled} - return json.Marshal(result) - case nil: - return []byte("null"), nil - default: - return nil, fmt.Errorf( - `unexpected concrete type for allHasMetadataSubjectPackageSourceOrArtifact: "%T"`, v) - } +// SourcesResponse is returned by Sources on success. +type SourcesResponse struct { + // Returns all sources matching a filter. + Sources []SourcesSourcesSource `json:"sources"` } -// allHasMetadataSubjectSource includes the requested fields of the GraphQL type Source. +// GetSources returns SourcesResponse.Sources, and is useful for accessing the field via an interface. +func (v *SourcesResponse) GetSources() []SourcesSourcesSource { return v.Sources } + +// SourcesSourcesSource includes the requested fields of the GraphQL type Source. // The GraphQL type's documentation follows. // // Source represents the root of the source trie/tree. @@ -22421,36 +22769,32 @@ func __marshalallHasMetadataSubjectPackageSourceOrArtifact(v *allHasMetadataSubj // // Since this node is at the root of the source trie, it is named Source, not // SourceType. -type allHasMetadataSubjectSource struct { - Typename *string `json:"__typename"` +type SourcesSourcesSource struct { AllSourceTree `json:"-"` } -// GetTypename returns allHasMetadataSubjectSource.Typename, and is useful for accessing the field via an interface. -func (v *allHasMetadataSubjectSource) GetTypename() *string { return v.Typename } - -// GetId returns allHasMetadataSubjectSource.Id, and is useful for accessing the field via an interface. -func (v *allHasMetadataSubjectSource) GetId() string { return v.AllSourceTree.Id } +// GetId returns SourcesSourcesSource.Id, and is useful for accessing the field via an interface. +func (v *SourcesSourcesSource) GetId() string { return v.AllSourceTree.Id } -// GetType returns allHasMetadataSubjectSource.Type, and is useful for accessing the field via an interface. -func (v *allHasMetadataSubjectSource) GetType() string { return v.AllSourceTree.Type } +// GetType returns SourcesSourcesSource.Type, and is useful for accessing the field via an interface. +func (v *SourcesSourcesSource) GetType() string { return v.AllSourceTree.Type } -// GetNamespaces returns allHasMetadataSubjectSource.Namespaces, and is useful for accessing the field via an interface. -func (v *allHasMetadataSubjectSource) GetNamespaces() []AllSourceTreeNamespacesSourceNamespace { +// GetNamespaces returns SourcesSourcesSource.Namespaces, and is useful for accessing the field via an interface. +func (v *SourcesSourcesSource) GetNamespaces() []AllSourceTreeNamespacesSourceNamespace { return v.AllSourceTree.Namespaces } -func (v *allHasMetadataSubjectSource) UnmarshalJSON(b []byte) error { +func (v *SourcesSourcesSource) UnmarshalJSON(b []byte) error { if string(b) == "null" { return nil } var firstPass struct { - *allHasMetadataSubjectSource + *SourcesSourcesSource graphql.NoUnmarshalJSON } - firstPass.allHasMetadataSubjectSource = v + firstPass.SourcesSourcesSource = v err := json.Unmarshal(b, &firstPass) if err != nil { @@ -22465,9 +22809,7 @@ func (v *allHasMetadataSubjectSource) UnmarshalJSON(b []byte) error { return nil } -type __premarshalallHasMetadataSubjectSource struct { - Typename *string `json:"__typename"` - +type __premarshalSourcesSourcesSource struct { Id string `json:"id"` Type string `json:"type"` @@ -22475,7 +22817,7 @@ type __premarshalallHasMetadataSubjectSource struct { Namespaces []AllSourceTreeNamespacesSourceNamespace `json:"namespaces"` } -func (v *allHasMetadataSubjectSource) MarshalJSON() ([]byte, error) { +func (v *SourcesSourcesSource) MarshalJSON() ([]byte, error) { premarshaled, err := v.__premarshalJSON() if err != nil { return nil, err @@ -22483,181 +22825,85 @@ func (v *allHasMetadataSubjectSource) MarshalJSON() ([]byte, error) { return json.Marshal(premarshaled) } -func (v *allHasMetadataSubjectSource) __premarshalJSON() (*__premarshalallHasMetadataSubjectSource, error) { - var retval __premarshalallHasMetadataSubjectSource +func (v *SourcesSourcesSource) __premarshalJSON() (*__premarshalSourcesSourcesSource, error) { + var retval __premarshalSourcesSourcesSource - retval.Typename = v.Typename retval.Id = v.AllSourceTree.Id retval.Type = v.AllSourceTree.Type retval.Namespaces = v.AllSourceTree.Namespaces return &retval, nil } -// allHasSBOMTree includes the GraphQL fields of HasSBOM requested by the fragment allHasSBOMTree. -type allHasSBOMTree struct { - Id string `json:"id"` - // SBOM subject - Subject allHasSBOMTreeSubjectPackageOrArtifact `json:"-"` - // Identifier for the SBOM document - Uri string `json:"uri"` - // Algorithm by which SBOMs digest was computed - Algorithm string `json:"algorithm"` - // Digest of SBOM - Digest string `json:"digest"` - // Location from which the SBOM can be downloaded - DownloadLocation string `json:"downloadLocation"` - // Document from which this attestation is generated from - Origin string `json:"origin"` - // GUAC collector for the document - Collector string `json:"collector"` +// VEXPackageAndGhsaIngestVEXStatementCertifyVEXStatement includes the requested fields of the GraphQL type CertifyVEXStatement. +// The GraphQL type's documentation follows. +// +// CertifyVEXStatement is an attestation to attach VEX statements to a package or +// artifact to clarify the impact of a specific vulnerability (CVE, GHSA or OSV). +type VEXPackageAndGhsaIngestVEXStatementCertifyVEXStatement struct { + AllCertifyVEXStatement `json:"-"` } -// GetId returns allHasSBOMTree.Id, and is useful for accessing the field via an interface. -func (v *allHasSBOMTree) GetId() string { return v.Id } - -// GetSubject returns allHasSBOMTree.Subject, and is useful for accessing the field via an interface. -func (v *allHasSBOMTree) GetSubject() allHasSBOMTreeSubjectPackageOrArtifact { return v.Subject } - -// GetUri returns allHasSBOMTree.Uri, and is useful for accessing the field via an interface. -func (v *allHasSBOMTree) GetUri() string { return v.Uri } - -// GetAlgorithm returns allHasSBOMTree.Algorithm, and is useful for accessing the field via an interface. -func (v *allHasSBOMTree) GetAlgorithm() string { return v.Algorithm } - -// GetDigest returns allHasSBOMTree.Digest, and is useful for accessing the field via an interface. -func (v *allHasSBOMTree) GetDigest() string { return v.Digest } - -// GetDownloadLocation returns allHasSBOMTree.DownloadLocation, and is useful for accessing the field via an interface. -func (v *allHasSBOMTree) GetDownloadLocation() string { return v.DownloadLocation } - -// GetOrigin returns allHasSBOMTree.Origin, and is useful for accessing the field via an interface. -func (v *allHasSBOMTree) GetOrigin() string { return v.Origin } - -// GetCollector returns allHasSBOMTree.Collector, and is useful for accessing the field via an interface. -func (v *allHasSBOMTree) GetCollector() string { return v.Collector } - -func (v *allHasSBOMTree) UnmarshalJSON(b []byte) error { - - if string(b) == "null" { - return nil - } - - var firstPass struct { - *allHasSBOMTree - Subject json.RawMessage `json:"subject"` - graphql.NoUnmarshalJSON - } - firstPass.allHasSBOMTree = v - - err := json.Unmarshal(b, &firstPass) - if err != nil { - return err - } - - { - dst := &v.Subject - src := firstPass.Subject - if len(src) != 0 && string(src) != "null" { - err = __unmarshalallHasSBOMTreeSubjectPackageOrArtifact( - src, dst) - if err != nil { - return fmt.Errorf( - "unable to unmarshal allHasSBOMTree.Subject: %w", err) - } - } - } - return nil +// GetId returns VEXPackageAndGhsaIngestVEXStatementCertifyVEXStatement.Id, and is useful for accessing the field via an interface. +func (v *VEXPackageAndGhsaIngestVEXStatementCertifyVEXStatement) GetId() string { + return v.AllCertifyVEXStatement.Id } -type __premarshalallHasSBOMTree struct { - Id string `json:"id"` - - Subject json.RawMessage `json:"subject"` - - Uri string `json:"uri"` - - Algorithm string `json:"algorithm"` - - Digest string `json:"digest"` - - DownloadLocation string `json:"downloadLocation"` - - Origin string `json:"origin"` - - Collector string `json:"collector"` +// GetSubject returns VEXPackageAndGhsaIngestVEXStatementCertifyVEXStatement.Subject, and is useful for accessing the field via an interface. +func (v *VEXPackageAndGhsaIngestVEXStatementCertifyVEXStatement) GetSubject() AllCertifyVEXStatementSubjectPackageOrArtifact { + return v.AllCertifyVEXStatement.Subject } -func (v *allHasSBOMTree) MarshalJSON() ([]byte, error) { - premarshaled, err := v.__premarshalJSON() - if err != nil { - return nil, err - } - return json.Marshal(premarshaled) +// GetVulnerability returns VEXPackageAndGhsaIngestVEXStatementCertifyVEXStatement.Vulnerability, and is useful for accessing the field via an interface. +func (v *VEXPackageAndGhsaIngestVEXStatementCertifyVEXStatement) GetVulnerability() AllCertifyVEXStatementVulnerability { + return v.AllCertifyVEXStatement.Vulnerability } -func (v *allHasSBOMTree) __premarshalJSON() (*__premarshalallHasSBOMTree, error) { - var retval __premarshalallHasSBOMTree - - retval.Id = v.Id - { +// GetStatus returns VEXPackageAndGhsaIngestVEXStatementCertifyVEXStatement.Status, and is useful for accessing the field via an interface. +func (v *VEXPackageAndGhsaIngestVEXStatementCertifyVEXStatement) GetStatus() VexStatus { + return v.AllCertifyVEXStatement.Status +} - dst := &retval.Subject - src := v.Subject - var err error - *dst, err = __marshalallHasSBOMTreeSubjectPackageOrArtifact( - &src) - if err != nil { - return nil, fmt.Errorf( - "unable to marshal allHasSBOMTree.Subject: %w", err) - } - } - retval.Uri = v.Uri - retval.Algorithm = v.Algorithm - retval.Digest = v.Digest - retval.DownloadLocation = v.DownloadLocation - retval.Origin = v.Origin - retval.Collector = v.Collector - return &retval, nil +// GetVexJustification returns VEXPackageAndGhsaIngestVEXStatementCertifyVEXStatement.VexJustification, and is useful for accessing the field via an interface. +func (v *VEXPackageAndGhsaIngestVEXStatementCertifyVEXStatement) GetVexJustification() VexJustification { + return v.AllCertifyVEXStatement.VexJustification } -// allHasSBOMTreeSubjectArtifact includes the requested fields of the GraphQL type Artifact. -// The GraphQL type's documentation follows. -// -// Artifact represents an artifact identified by a checksum hash. -// -// The checksum is split into the digest value and the algorithm used to generate -// it. Both fields are mandatory and canonicalized to be lowercase. -// -// If having a checksum Go object, algorithm can be -// strings.ToLower(string(checksum.Algorithm)) and digest can be checksum.Value. -type allHasSBOMTreeSubjectArtifact struct { - Typename *string `json:"__typename"` - AllArtifactTree `json:"-"` +// GetStatement returns VEXPackageAndGhsaIngestVEXStatementCertifyVEXStatement.Statement, and is useful for accessing the field via an interface. +func (v *VEXPackageAndGhsaIngestVEXStatementCertifyVEXStatement) GetStatement() string { + return v.AllCertifyVEXStatement.Statement } -// GetTypename returns allHasSBOMTreeSubjectArtifact.Typename, and is useful for accessing the field via an interface. -func (v *allHasSBOMTreeSubjectArtifact) GetTypename() *string { return v.Typename } +// GetStatusNotes returns VEXPackageAndGhsaIngestVEXStatementCertifyVEXStatement.StatusNotes, and is useful for accessing the field via an interface. +func (v *VEXPackageAndGhsaIngestVEXStatementCertifyVEXStatement) GetStatusNotes() string { + return v.AllCertifyVEXStatement.StatusNotes +} -// GetId returns allHasSBOMTreeSubjectArtifact.Id, and is useful for accessing the field via an interface. -func (v *allHasSBOMTreeSubjectArtifact) GetId() string { return v.AllArtifactTree.Id } +// GetKnownSince returns VEXPackageAndGhsaIngestVEXStatementCertifyVEXStatement.KnownSince, and is useful for accessing the field via an interface. +func (v *VEXPackageAndGhsaIngestVEXStatementCertifyVEXStatement) GetKnownSince() time.Time { + return v.AllCertifyVEXStatement.KnownSince +} -// GetAlgorithm returns allHasSBOMTreeSubjectArtifact.Algorithm, and is useful for accessing the field via an interface. -func (v *allHasSBOMTreeSubjectArtifact) GetAlgorithm() string { return v.AllArtifactTree.Algorithm } +// GetOrigin returns VEXPackageAndGhsaIngestVEXStatementCertifyVEXStatement.Origin, and is useful for accessing the field via an interface. +func (v *VEXPackageAndGhsaIngestVEXStatementCertifyVEXStatement) GetOrigin() string { + return v.AllCertifyVEXStatement.Origin +} -// GetDigest returns allHasSBOMTreeSubjectArtifact.Digest, and is useful for accessing the field via an interface. -func (v *allHasSBOMTreeSubjectArtifact) GetDigest() string { return v.AllArtifactTree.Digest } +// GetCollector returns VEXPackageAndGhsaIngestVEXStatementCertifyVEXStatement.Collector, and is useful for accessing the field via an interface. +func (v *VEXPackageAndGhsaIngestVEXStatementCertifyVEXStatement) GetCollector() string { + return v.AllCertifyVEXStatement.Collector +} -func (v *allHasSBOMTreeSubjectArtifact) UnmarshalJSON(b []byte) error { +func (v *VEXPackageAndGhsaIngestVEXStatementCertifyVEXStatement) UnmarshalJSON(b []byte) error { if string(b) == "null" { return nil } var firstPass struct { - *allHasSBOMTreeSubjectArtifact + *VEXPackageAndGhsaIngestVEXStatementCertifyVEXStatement graphql.NoUnmarshalJSON } - firstPass.allHasSBOMTreeSubjectArtifact = v + firstPass.VEXPackageAndGhsaIngestVEXStatementCertifyVEXStatement = v err := json.Unmarshal(b, &firstPass) if err != nil { @@ -22665,113 +22911,36 @@ func (v *allHasSBOMTreeSubjectArtifact) UnmarshalJSON(b []byte) error { } err = json.Unmarshal( - b, &v.AllArtifactTree) + b, &v.AllCertifyVEXStatement) if err != nil { return err } return nil } -type __premarshalallHasSBOMTreeSubjectArtifact struct { - Typename *string `json:"__typename"` - +type __premarshalVEXPackageAndGhsaIngestVEXStatementCertifyVEXStatement struct { Id string `json:"id"` - Algorithm string `json:"algorithm"` - - Digest string `json:"digest"` -} - -func (v *allHasSBOMTreeSubjectArtifact) MarshalJSON() ([]byte, error) { - premarshaled, err := v.__premarshalJSON() - if err != nil { - return nil, err - } - return json.Marshal(premarshaled) -} - -func (v *allHasSBOMTreeSubjectArtifact) __premarshalJSON() (*__premarshalallHasSBOMTreeSubjectArtifact, error) { - var retval __premarshalallHasSBOMTreeSubjectArtifact - - retval.Typename = v.Typename - retval.Id = v.AllArtifactTree.Id - retval.Algorithm = v.AllArtifactTree.Algorithm - retval.Digest = v.AllArtifactTree.Digest - return &retval, nil -} - -// allHasSBOMTreeSubjectPackage includes the requested fields of the GraphQL type Package. -// The GraphQL type's documentation follows. -// -// Package represents the root of the package trie/tree. -// -// We map package information to a trie, closely matching the pURL specification -// (https://github.com/package-url/purl-spec/blob/0dd92f26f8bb11956ffdf5e8acfcee71e8560407/README.rst), -// but deviating from it where GUAC heuristics allow for better representation of -// package information. Each path in the trie fully represents a package; we split -// the trie based on the pURL components. -// -// This node matches a pkg: partial pURL. The type field matches the -// pURL types but we might also use "guac" for the cases where the pURL -// representation is not complete or when we have custom rules. -// -// Since this node is at the root of the package trie, it is named Package, not -// PackageType. -type allHasSBOMTreeSubjectPackage struct { - Typename *string `json:"__typename"` - AllPkgTree `json:"-"` -} - -// GetTypename returns allHasSBOMTreeSubjectPackage.Typename, and is useful for accessing the field via an interface. -func (v *allHasSBOMTreeSubjectPackage) GetTypename() *string { return v.Typename } - -// GetId returns allHasSBOMTreeSubjectPackage.Id, and is useful for accessing the field via an interface. -func (v *allHasSBOMTreeSubjectPackage) GetId() string { return v.AllPkgTree.Id } - -// GetType returns allHasSBOMTreeSubjectPackage.Type, and is useful for accessing the field via an interface. -func (v *allHasSBOMTreeSubjectPackage) GetType() string { return v.AllPkgTree.Type } - -// GetNamespaces returns allHasSBOMTreeSubjectPackage.Namespaces, and is useful for accessing the field via an interface. -func (v *allHasSBOMTreeSubjectPackage) GetNamespaces() []AllPkgTreeNamespacesPackageNamespace { - return v.AllPkgTree.Namespaces -} - -func (v *allHasSBOMTreeSubjectPackage) UnmarshalJSON(b []byte) error { + Subject json.RawMessage `json:"subject"` - if string(b) == "null" { - return nil - } + Vulnerability json.RawMessage `json:"vulnerability"` - var firstPass struct { - *allHasSBOMTreeSubjectPackage - graphql.NoUnmarshalJSON - } - firstPass.allHasSBOMTreeSubjectPackage = v + Status VexStatus `json:"status"` - err := json.Unmarshal(b, &firstPass) - if err != nil { - return err - } + VexJustification VexJustification `json:"vexJustification"` - err = json.Unmarshal( - b, &v.AllPkgTree) - if err != nil { - return err - } - return nil -} + Statement string `json:"statement"` -type __premarshalallHasSBOMTreeSubjectPackage struct { - Typename *string `json:"__typename"` + StatusNotes string `json:"statusNotes"` - Id string `json:"id"` + KnownSince time.Time `json:"knownSince"` - Type string `json:"type"` + Origin string `json:"origin"` - Namespaces []AllPkgTreeNamespacesPackageNamespace `json:"namespaces"` + Collector string `json:"collector"` } -func (v *allHasSBOMTreeSubjectPackage) MarshalJSON() ([]byte, error) { +func (v *VEXPackageAndGhsaIngestVEXStatementCertifyVEXStatement) MarshalJSON() ([]byte, error) { premarshaled, err := v.__premarshalJSON() if err != nil { return nil, err @@ -22779,184 +22948,125 @@ func (v *allHasSBOMTreeSubjectPackage) MarshalJSON() ([]byte, error) { return json.Marshal(premarshaled) } -func (v *allHasSBOMTreeSubjectPackage) __premarshalJSON() (*__premarshalallHasSBOMTreeSubjectPackage, error) { - var retval __premarshalallHasSBOMTreeSubjectPackage - - retval.Typename = v.Typename - retval.Id = v.AllPkgTree.Id - retval.Type = v.AllPkgTree.Type - retval.Namespaces = v.AllPkgTree.Namespaces - return &retval, nil -} - -// allHasSBOMTreeSubjectPackageOrArtifact includes the requested fields of the GraphQL interface PackageOrArtifact. -// -// allHasSBOMTreeSubjectPackageOrArtifact is implemented by the following types: -// allHasSBOMTreeSubjectArtifact -// allHasSBOMTreeSubjectPackage -// The GraphQL type's documentation follows. -// -// PackageOrArtifact is a union of Package and Artifact. -type allHasSBOMTreeSubjectPackageOrArtifact interface { - implementsGraphQLInterfaceallHasSBOMTreeSubjectPackageOrArtifact() - // GetTypename returns the receiver's concrete GraphQL type-name (see interface doc for possible values). - GetTypename() *string -} - -func (v *allHasSBOMTreeSubjectArtifact) implementsGraphQLInterfaceallHasSBOMTreeSubjectPackageOrArtifact() { -} -func (v *allHasSBOMTreeSubjectPackage) implementsGraphQLInterfaceallHasSBOMTreeSubjectPackageOrArtifact() { -} - -func __unmarshalallHasSBOMTreeSubjectPackageOrArtifact(b []byte, v *allHasSBOMTreeSubjectPackageOrArtifact) error { - if string(b) == "null" { - return nil - } - - var tn struct { - TypeName string `json:"__typename"` - } - err := json.Unmarshal(b, &tn) - if err != nil { - return err - } - - switch tn.TypeName { - case "Artifact": - *v = new(allHasSBOMTreeSubjectArtifact) - return json.Unmarshal(b, *v) - case "Package": - *v = new(allHasSBOMTreeSubjectPackage) - return json.Unmarshal(b, *v) - case "": - return fmt.Errorf( - "response was missing PackageOrArtifact.__typename") - default: - return fmt.Errorf( - `unexpected concrete type for allHasSBOMTreeSubjectPackageOrArtifact: "%v"`, tn.TypeName) - } -} - -func __marshalallHasSBOMTreeSubjectPackageOrArtifact(v *allHasSBOMTreeSubjectPackageOrArtifact) ([]byte, error) { +func (v *VEXPackageAndGhsaIngestVEXStatementCertifyVEXStatement) __premarshalJSON() (*__premarshalVEXPackageAndGhsaIngestVEXStatementCertifyVEXStatement, error) { + var retval __premarshalVEXPackageAndGhsaIngestVEXStatementCertifyVEXStatement - var typename string - switch v := (*v).(type) { - case *allHasSBOMTreeSubjectArtifact: - typename = "Artifact" + retval.Id = v.AllCertifyVEXStatement.Id + { - premarshaled, err := v.__premarshalJSON() + dst := &retval.Subject + src := v.AllCertifyVEXStatement.Subject + var err error + *dst, err = __marshalAllCertifyVEXStatementSubjectPackageOrArtifact( + &src) if err != nil { - return nil, err + return nil, fmt.Errorf( + "unable to marshal VEXPackageAndGhsaIngestVEXStatementCertifyVEXStatement.AllCertifyVEXStatement.Subject: %w", err) } - result := struct { - TypeName string `json:"__typename"` - *__premarshalallHasSBOMTreeSubjectArtifact - }{typename, premarshaled} - return json.Marshal(result) - case *allHasSBOMTreeSubjectPackage: - typename = "Package" + } + { - premarshaled, err := v.__premarshalJSON() + dst := &retval.Vulnerability + src := v.AllCertifyVEXStatement.Vulnerability + var err error + *dst, err = __marshalAllCertifyVEXStatementVulnerability( + &src) if err != nil { - return nil, err + return nil, fmt.Errorf( + "unable to marshal VEXPackageAndGhsaIngestVEXStatementCertifyVEXStatement.AllCertifyVEXStatement.Vulnerability: %w", err) } - result := struct { - TypeName string `json:"__typename"` - *__premarshalallHasSBOMTreeSubjectPackage - }{typename, premarshaled} - return json.Marshal(result) - case nil: - return []byte("null"), nil - default: - return nil, fmt.Errorf( - `unexpected concrete type for allHasSBOMTreeSubjectPackageOrArtifact: "%T"`, v) } + retval.Status = v.AllCertifyVEXStatement.Status + retval.VexJustification = v.AllCertifyVEXStatement.VexJustification + retval.Statement = v.AllCertifyVEXStatement.Statement + retval.StatusNotes = v.AllCertifyVEXStatement.StatusNotes + retval.KnownSince = v.AllCertifyVEXStatement.KnownSince + retval.Origin = v.AllCertifyVEXStatement.Origin + retval.Collector = v.AllCertifyVEXStatement.Collector + return &retval, nil +} + +// VEXPackageAndGhsaResponse is returned by VEXPackageAndGhsa on success. +type VEXPackageAndGhsaResponse struct { + // Adds a VEX certification for a package. + IngestVEXStatement VEXPackageAndGhsaIngestVEXStatementCertifyVEXStatement `json:"ingestVEXStatement"` +} + +// GetIngestVEXStatement returns VEXPackageAndGhsaResponse.IngestVEXStatement, and is useful for accessing the field via an interface. +func (v *VEXPackageAndGhsaResponse) GetIngestVEXStatement() VEXPackageAndGhsaIngestVEXStatementCertifyVEXStatement { + return v.IngestVEXStatement } -// allHasSourceAt includes the GraphQL fields of HasSourceAt requested by the fragment allHasSourceAt. +// VexArtifactAndCveIngestVEXStatementCertifyVEXStatement includes the requested fields of the GraphQL type CertifyVEXStatement. // The GraphQL type's documentation follows. // -// HasSourceAt records that a package's repository is a given source. -type allHasSourceAt struct { - Id string `json:"id"` - // Justification for the attested relationship - Justification string `json:"justification"` - // Timestamp since this link between package and source was certified - KnownSince time.Time `json:"knownSince"` - // The subject of the attestation: can be a PackageName or a PackageVersion - Package allHasSourceAtPackage `json:"package"` - // Source repository from which the package is built - Source allHasSourceAtSource `json:"source"` - // Document from which this attestation is generated from - Origin string `json:"origin"` - // GUAC collector for the document - Collector string `json:"collector"` +// CertifyVEXStatement is an attestation to attach VEX statements to a package or +// artifact to clarify the impact of a specific vulnerability (CVE, GHSA or OSV). +type VexArtifactAndCveIngestVEXStatementCertifyVEXStatement struct { + AllCertifyVEXStatement `json:"-"` } -// GetId returns allHasSourceAt.Id, and is useful for accessing the field via an interface. -func (v *allHasSourceAt) GetId() string { return v.Id } - -// GetJustification returns allHasSourceAt.Justification, and is useful for accessing the field via an interface. -func (v *allHasSourceAt) GetJustification() string { return v.Justification } +// GetId returns VexArtifactAndCveIngestVEXStatementCertifyVEXStatement.Id, and is useful for accessing the field via an interface. +func (v *VexArtifactAndCveIngestVEXStatementCertifyVEXStatement) GetId() string { + return v.AllCertifyVEXStatement.Id +} -// GetKnownSince returns allHasSourceAt.KnownSince, and is useful for accessing the field via an interface. -func (v *allHasSourceAt) GetKnownSince() time.Time { return v.KnownSince } +// GetSubject returns VexArtifactAndCveIngestVEXStatementCertifyVEXStatement.Subject, and is useful for accessing the field via an interface. +func (v *VexArtifactAndCveIngestVEXStatementCertifyVEXStatement) GetSubject() AllCertifyVEXStatementSubjectPackageOrArtifact { + return v.AllCertifyVEXStatement.Subject +} -// GetPackage returns allHasSourceAt.Package, and is useful for accessing the field via an interface. -func (v *allHasSourceAt) GetPackage() allHasSourceAtPackage { return v.Package } +// GetVulnerability returns VexArtifactAndCveIngestVEXStatementCertifyVEXStatement.Vulnerability, and is useful for accessing the field via an interface. +func (v *VexArtifactAndCveIngestVEXStatementCertifyVEXStatement) GetVulnerability() AllCertifyVEXStatementVulnerability { + return v.AllCertifyVEXStatement.Vulnerability +} -// GetSource returns allHasSourceAt.Source, and is useful for accessing the field via an interface. -func (v *allHasSourceAt) GetSource() allHasSourceAtSource { return v.Source } +// GetStatus returns VexArtifactAndCveIngestVEXStatementCertifyVEXStatement.Status, and is useful for accessing the field via an interface. +func (v *VexArtifactAndCveIngestVEXStatementCertifyVEXStatement) GetStatus() VexStatus { + return v.AllCertifyVEXStatement.Status +} -// GetOrigin returns allHasSourceAt.Origin, and is useful for accessing the field via an interface. -func (v *allHasSourceAt) GetOrigin() string { return v.Origin } +// GetVexJustification returns VexArtifactAndCveIngestVEXStatementCertifyVEXStatement.VexJustification, and is useful for accessing the field via an interface. +func (v *VexArtifactAndCveIngestVEXStatementCertifyVEXStatement) GetVexJustification() VexJustification { + return v.AllCertifyVEXStatement.VexJustification +} -// GetCollector returns allHasSourceAt.Collector, and is useful for accessing the field via an interface. -func (v *allHasSourceAt) GetCollector() string { return v.Collector } +// GetStatement returns VexArtifactAndCveIngestVEXStatementCertifyVEXStatement.Statement, and is useful for accessing the field via an interface. +func (v *VexArtifactAndCveIngestVEXStatementCertifyVEXStatement) GetStatement() string { + return v.AllCertifyVEXStatement.Statement +} -// allHasSourceAtPackage includes the requested fields of the GraphQL type Package. -// The GraphQL type's documentation follows. -// -// Package represents the root of the package trie/tree. -// -// We map package information to a trie, closely matching the pURL specification -// (https://github.com/package-url/purl-spec/blob/0dd92f26f8bb11956ffdf5e8acfcee71e8560407/README.rst), -// but deviating from it where GUAC heuristics allow for better representation of -// package information. Each path in the trie fully represents a package; we split -// the trie based on the pURL components. -// -// This node matches a pkg: partial pURL. The type field matches the -// pURL types but we might also use "guac" for the cases where the pURL -// representation is not complete or when we have custom rules. -// -// Since this node is at the root of the package trie, it is named Package, not -// PackageType. -type allHasSourceAtPackage struct { - AllPkgTree `json:"-"` +// GetStatusNotes returns VexArtifactAndCveIngestVEXStatementCertifyVEXStatement.StatusNotes, and is useful for accessing the field via an interface. +func (v *VexArtifactAndCveIngestVEXStatementCertifyVEXStatement) GetStatusNotes() string { + return v.AllCertifyVEXStatement.StatusNotes } -// GetId returns allHasSourceAtPackage.Id, and is useful for accessing the field via an interface. -func (v *allHasSourceAtPackage) GetId() string { return v.AllPkgTree.Id } +// GetKnownSince returns VexArtifactAndCveIngestVEXStatementCertifyVEXStatement.KnownSince, and is useful for accessing the field via an interface. +func (v *VexArtifactAndCveIngestVEXStatementCertifyVEXStatement) GetKnownSince() time.Time { + return v.AllCertifyVEXStatement.KnownSince +} -// GetType returns allHasSourceAtPackage.Type, and is useful for accessing the field via an interface. -func (v *allHasSourceAtPackage) GetType() string { return v.AllPkgTree.Type } +// GetOrigin returns VexArtifactAndCveIngestVEXStatementCertifyVEXStatement.Origin, and is useful for accessing the field via an interface. +func (v *VexArtifactAndCveIngestVEXStatementCertifyVEXStatement) GetOrigin() string { + return v.AllCertifyVEXStatement.Origin +} -// GetNamespaces returns allHasSourceAtPackage.Namespaces, and is useful for accessing the field via an interface. -func (v *allHasSourceAtPackage) GetNamespaces() []AllPkgTreeNamespacesPackageNamespace { - return v.AllPkgTree.Namespaces +// GetCollector returns VexArtifactAndCveIngestVEXStatementCertifyVEXStatement.Collector, and is useful for accessing the field via an interface. +func (v *VexArtifactAndCveIngestVEXStatementCertifyVEXStatement) GetCollector() string { + return v.AllCertifyVEXStatement.Collector } -func (v *allHasSourceAtPackage) UnmarshalJSON(b []byte) error { +func (v *VexArtifactAndCveIngestVEXStatementCertifyVEXStatement) UnmarshalJSON(b []byte) error { if string(b) == "null" { return nil } var firstPass struct { - *allHasSourceAtPackage + *VexArtifactAndCveIngestVEXStatementCertifyVEXStatement graphql.NoUnmarshalJSON } - firstPass.allHasSourceAtPackage = v + firstPass.VexArtifactAndCveIngestVEXStatementCertifyVEXStatement = v err := json.Unmarshal(b, &firstPass) if err != nil { @@ -22964,22 +23074,36 @@ func (v *allHasSourceAtPackage) UnmarshalJSON(b []byte) error { } err = json.Unmarshal( - b, &v.AllPkgTree) + b, &v.AllCertifyVEXStatement) if err != nil { return err } return nil } -type __premarshalallHasSourceAtPackage struct { +type __premarshalVexArtifactAndCveIngestVEXStatementCertifyVEXStatement struct { Id string `json:"id"` - Type string `json:"type"` + Subject json.RawMessage `json:"subject"` - Namespaces []AllPkgTreeNamespacesPackageNamespace `json:"namespaces"` + Vulnerability json.RawMessage `json:"vulnerability"` + + Status VexStatus `json:"status"` + + VexJustification VexJustification `json:"vexJustification"` + + Statement string `json:"statement"` + + StatusNotes string `json:"statusNotes"` + + KnownSince time.Time `json:"knownSince"` + + Origin string `json:"origin"` + + Collector string `json:"collector"` } -func (v *allHasSourceAtPackage) MarshalJSON() ([]byte, error) { +func (v *VexArtifactAndCveIngestVEXStatementCertifyVEXStatement) MarshalJSON() ([]byte, error) { premarshaled, err := v.__premarshalJSON() if err != nil { return nil, err @@ -22987,55 +23111,125 @@ func (v *allHasSourceAtPackage) MarshalJSON() ([]byte, error) { return json.Marshal(premarshaled) } -func (v *allHasSourceAtPackage) __premarshalJSON() (*__premarshalallHasSourceAtPackage, error) { - var retval __premarshalallHasSourceAtPackage +func (v *VexArtifactAndCveIngestVEXStatementCertifyVEXStatement) __premarshalJSON() (*__premarshalVexArtifactAndCveIngestVEXStatementCertifyVEXStatement, error) { + var retval __premarshalVexArtifactAndCveIngestVEXStatementCertifyVEXStatement - retval.Id = v.AllPkgTree.Id - retval.Type = v.AllPkgTree.Type - retval.Namespaces = v.AllPkgTree.Namespaces + retval.Id = v.AllCertifyVEXStatement.Id + { + + dst := &retval.Subject + src := v.AllCertifyVEXStatement.Subject + var err error + *dst, err = __marshalAllCertifyVEXStatementSubjectPackageOrArtifact( + &src) + if err != nil { + return nil, fmt.Errorf( + "unable to marshal VexArtifactAndCveIngestVEXStatementCertifyVEXStatement.AllCertifyVEXStatement.Subject: %w", err) + } + } + { + + dst := &retval.Vulnerability + src := v.AllCertifyVEXStatement.Vulnerability + var err error + *dst, err = __marshalAllCertifyVEXStatementVulnerability( + &src) + if err != nil { + return nil, fmt.Errorf( + "unable to marshal VexArtifactAndCveIngestVEXStatementCertifyVEXStatement.AllCertifyVEXStatement.Vulnerability: %w", err) + } + } + retval.Status = v.AllCertifyVEXStatement.Status + retval.VexJustification = v.AllCertifyVEXStatement.VexJustification + retval.Statement = v.AllCertifyVEXStatement.Statement + retval.StatusNotes = v.AllCertifyVEXStatement.StatusNotes + retval.KnownSince = v.AllCertifyVEXStatement.KnownSince + retval.Origin = v.AllCertifyVEXStatement.Origin + retval.Collector = v.AllCertifyVEXStatement.Collector return &retval, nil } -// allHasSourceAtSource includes the requested fields of the GraphQL type Source. +// VexArtifactAndCveResponse is returned by VexArtifactAndCve on success. +type VexArtifactAndCveResponse struct { + // Adds a VEX certification for a package. + IngestVEXStatement VexArtifactAndCveIngestVEXStatementCertifyVEXStatement `json:"ingestVEXStatement"` +} + +// GetIngestVEXStatement returns VexArtifactAndCveResponse.IngestVEXStatement, and is useful for accessing the field via an interface. +func (v *VexArtifactAndCveResponse) GetIngestVEXStatement() VexArtifactAndCveIngestVEXStatementCertifyVEXStatement { + return v.IngestVEXStatement +} + +// VexArtifactAndGhsaIngestVEXStatementCertifyVEXStatement includes the requested fields of the GraphQL type CertifyVEXStatement. // The GraphQL type's documentation follows. // -// Source represents the root of the source trie/tree. -// -// We map source information to a trie, as a derivative of the pURL specification: -// each path in the trie represents a type, namespace, name and an optional -// qualifier that stands for tag/commit information. -// -// This node represents the type part of the trie path. It is used to represent -// the version control system that is being used. -// -// Since this node is at the root of the source trie, it is named Source, not -// SourceType. -type allHasSourceAtSource struct { - AllSourceTree `json:"-"` +// CertifyVEXStatement is an attestation to attach VEX statements to a package or +// artifact to clarify the impact of a specific vulnerability (CVE, GHSA or OSV). +type VexArtifactAndGhsaIngestVEXStatementCertifyVEXStatement struct { + AllCertifyVEXStatement `json:"-"` +} + +// GetId returns VexArtifactAndGhsaIngestVEXStatementCertifyVEXStatement.Id, and is useful for accessing the field via an interface. +func (v *VexArtifactAndGhsaIngestVEXStatementCertifyVEXStatement) GetId() string { + return v.AllCertifyVEXStatement.Id +} + +// GetSubject returns VexArtifactAndGhsaIngestVEXStatementCertifyVEXStatement.Subject, and is useful for accessing the field via an interface. +func (v *VexArtifactAndGhsaIngestVEXStatementCertifyVEXStatement) GetSubject() AllCertifyVEXStatementSubjectPackageOrArtifact { + return v.AllCertifyVEXStatement.Subject +} + +// GetVulnerability returns VexArtifactAndGhsaIngestVEXStatementCertifyVEXStatement.Vulnerability, and is useful for accessing the field via an interface. +func (v *VexArtifactAndGhsaIngestVEXStatementCertifyVEXStatement) GetVulnerability() AllCertifyVEXStatementVulnerability { + return v.AllCertifyVEXStatement.Vulnerability +} + +// GetStatus returns VexArtifactAndGhsaIngestVEXStatementCertifyVEXStatement.Status, and is useful for accessing the field via an interface. +func (v *VexArtifactAndGhsaIngestVEXStatementCertifyVEXStatement) GetStatus() VexStatus { + return v.AllCertifyVEXStatement.Status +} + +// GetVexJustification returns VexArtifactAndGhsaIngestVEXStatementCertifyVEXStatement.VexJustification, and is useful for accessing the field via an interface. +func (v *VexArtifactAndGhsaIngestVEXStatementCertifyVEXStatement) GetVexJustification() VexJustification { + return v.AllCertifyVEXStatement.VexJustification +} + +// GetStatement returns VexArtifactAndGhsaIngestVEXStatementCertifyVEXStatement.Statement, and is useful for accessing the field via an interface. +func (v *VexArtifactAndGhsaIngestVEXStatementCertifyVEXStatement) GetStatement() string { + return v.AllCertifyVEXStatement.Statement +} + +// GetStatusNotes returns VexArtifactAndGhsaIngestVEXStatementCertifyVEXStatement.StatusNotes, and is useful for accessing the field via an interface. +func (v *VexArtifactAndGhsaIngestVEXStatementCertifyVEXStatement) GetStatusNotes() string { + return v.AllCertifyVEXStatement.StatusNotes } -// GetId returns allHasSourceAtSource.Id, and is useful for accessing the field via an interface. -func (v *allHasSourceAtSource) GetId() string { return v.AllSourceTree.Id } +// GetKnownSince returns VexArtifactAndGhsaIngestVEXStatementCertifyVEXStatement.KnownSince, and is useful for accessing the field via an interface. +func (v *VexArtifactAndGhsaIngestVEXStatementCertifyVEXStatement) GetKnownSince() time.Time { + return v.AllCertifyVEXStatement.KnownSince +} -// GetType returns allHasSourceAtSource.Type, and is useful for accessing the field via an interface. -func (v *allHasSourceAtSource) GetType() string { return v.AllSourceTree.Type } +// GetOrigin returns VexArtifactAndGhsaIngestVEXStatementCertifyVEXStatement.Origin, and is useful for accessing the field via an interface. +func (v *VexArtifactAndGhsaIngestVEXStatementCertifyVEXStatement) GetOrigin() string { + return v.AllCertifyVEXStatement.Origin +} -// GetNamespaces returns allHasSourceAtSource.Namespaces, and is useful for accessing the field via an interface. -func (v *allHasSourceAtSource) GetNamespaces() []AllSourceTreeNamespacesSourceNamespace { - return v.AllSourceTree.Namespaces +// GetCollector returns VexArtifactAndGhsaIngestVEXStatementCertifyVEXStatement.Collector, and is useful for accessing the field via an interface. +func (v *VexArtifactAndGhsaIngestVEXStatementCertifyVEXStatement) GetCollector() string { + return v.AllCertifyVEXStatement.Collector } -func (v *allHasSourceAtSource) UnmarshalJSON(b []byte) error { +func (v *VexArtifactAndGhsaIngestVEXStatementCertifyVEXStatement) UnmarshalJSON(b []byte) error { if string(b) == "null" { return nil } var firstPass struct { - *allHasSourceAtSource + *VexArtifactAndGhsaIngestVEXStatementCertifyVEXStatement graphql.NoUnmarshalJSON } - firstPass.allHasSourceAtSource = v + firstPass.VexArtifactAndGhsaIngestVEXStatementCertifyVEXStatement = v err := json.Unmarshal(b, &firstPass) if err != nil { @@ -23043,22 +23237,36 @@ func (v *allHasSourceAtSource) UnmarshalJSON(b []byte) error { } err = json.Unmarshal( - b, &v.AllSourceTree) + b, &v.AllCertifyVEXStatement) if err != nil { return err } return nil } -type __premarshalallHasSourceAtSource struct { +type __premarshalVexArtifactAndGhsaIngestVEXStatementCertifyVEXStatement struct { Id string `json:"id"` - Type string `json:"type"` + Subject json.RawMessage `json:"subject"` - Namespaces []AllSourceTreeNamespacesSourceNamespace `json:"namespaces"` + Vulnerability json.RawMessage `json:"vulnerability"` + + Status VexStatus `json:"status"` + + VexJustification VexJustification `json:"vexJustification"` + + Statement string `json:"statement"` + + StatusNotes string `json:"statusNotes"` + + KnownSince time.Time `json:"knownSince"` + + Origin string `json:"origin"` + + Collector string `json:"collector"` } -func (v *allHasSourceAtSource) MarshalJSON() ([]byte, error) { +func (v *VexArtifactAndGhsaIngestVEXStatementCertifyVEXStatement) MarshalJSON() ([]byte, error) { premarshaled, err := v.__premarshalJSON() if err != nil { return nil, err @@ -23066,80 +23274,125 @@ func (v *allHasSourceAtSource) MarshalJSON() ([]byte, error) { return json.Marshal(premarshaled) } -func (v *allHasSourceAtSource) __premarshalJSON() (*__premarshalallHasSourceAtSource, error) { - var retval __premarshalallHasSourceAtSource +func (v *VexArtifactAndGhsaIngestVEXStatementCertifyVEXStatement) __premarshalJSON() (*__premarshalVexArtifactAndGhsaIngestVEXStatementCertifyVEXStatement, error) { + var retval __premarshalVexArtifactAndGhsaIngestVEXStatementCertifyVEXStatement - retval.Id = v.AllSourceTree.Id - retval.Type = v.AllSourceTree.Type - retval.Namespaces = v.AllSourceTree.Namespaces + retval.Id = v.AllCertifyVEXStatement.Id + { + + dst := &retval.Subject + src := v.AllCertifyVEXStatement.Subject + var err error + *dst, err = __marshalAllCertifyVEXStatementSubjectPackageOrArtifact( + &src) + if err != nil { + return nil, fmt.Errorf( + "unable to marshal VexArtifactAndGhsaIngestVEXStatementCertifyVEXStatement.AllCertifyVEXStatement.Subject: %w", err) + } + } + { + + dst := &retval.Vulnerability + src := v.AllCertifyVEXStatement.Vulnerability + var err error + *dst, err = __marshalAllCertifyVEXStatementVulnerability( + &src) + if err != nil { + return nil, fmt.Errorf( + "unable to marshal VexArtifactAndGhsaIngestVEXStatementCertifyVEXStatement.AllCertifyVEXStatement.Vulnerability: %w", err) + } + } + retval.Status = v.AllCertifyVEXStatement.Status + retval.VexJustification = v.AllCertifyVEXStatement.VexJustification + retval.Statement = v.AllCertifyVEXStatement.Statement + retval.StatusNotes = v.AllCertifyVEXStatement.StatusNotes + retval.KnownSince = v.AllCertifyVEXStatement.KnownSince + retval.Origin = v.AllCertifyVEXStatement.Origin + retval.Collector = v.AllCertifyVEXStatement.Collector return &retval, nil } -// allHashEqualTree includes the GraphQL fields of HashEqual requested by the fragment allHashEqualTree. +// VexArtifactAndGhsaResponse is returned by VexArtifactAndGhsa on success. +type VexArtifactAndGhsaResponse struct { + // Adds a VEX certification for a package. + IngestVEXStatement VexArtifactAndGhsaIngestVEXStatementCertifyVEXStatement `json:"ingestVEXStatement"` +} + +// GetIngestVEXStatement returns VexArtifactAndGhsaResponse.IngestVEXStatement, and is useful for accessing the field via an interface. +func (v *VexArtifactAndGhsaResponse) GetIngestVEXStatement() VexArtifactAndGhsaIngestVEXStatementCertifyVEXStatement { + return v.IngestVEXStatement +} + +// VexArtifactAndOsvIngestVEXStatementCertifyVEXStatement includes the requested fields of the GraphQL type CertifyVEXStatement. // The GraphQL type's documentation follows. // -// HashEqual is an attestation that a set of artifacts are identical. -type allHashEqualTree struct { - Id string `json:"id"` - // Justification for the claim that the artifacts are similar - Justification string `json:"justification"` - // Collection of artifacts that are similar - Artifacts []allHashEqualTreeArtifactsArtifact `json:"artifacts"` - // Document from which this attestation is generated from - Origin string `json:"origin"` - // GUAC collector for the document - Collector string `json:"collector"` +// CertifyVEXStatement is an attestation to attach VEX statements to a package or +// artifact to clarify the impact of a specific vulnerability (CVE, GHSA or OSV). +type VexArtifactAndOsvIngestVEXStatementCertifyVEXStatement struct { + AllCertifyVEXStatement `json:"-"` } -// GetId returns allHashEqualTree.Id, and is useful for accessing the field via an interface. -func (v *allHashEqualTree) GetId() string { return v.Id } +// GetId returns VexArtifactAndOsvIngestVEXStatementCertifyVEXStatement.Id, and is useful for accessing the field via an interface. +func (v *VexArtifactAndOsvIngestVEXStatementCertifyVEXStatement) GetId() string { + return v.AllCertifyVEXStatement.Id +} -// GetJustification returns allHashEqualTree.Justification, and is useful for accessing the field via an interface. -func (v *allHashEqualTree) GetJustification() string { return v.Justification } +// GetSubject returns VexArtifactAndOsvIngestVEXStatementCertifyVEXStatement.Subject, and is useful for accessing the field via an interface. +func (v *VexArtifactAndOsvIngestVEXStatementCertifyVEXStatement) GetSubject() AllCertifyVEXStatementSubjectPackageOrArtifact { + return v.AllCertifyVEXStatement.Subject +} -// GetArtifacts returns allHashEqualTree.Artifacts, and is useful for accessing the field via an interface. -func (v *allHashEqualTree) GetArtifacts() []allHashEqualTreeArtifactsArtifact { return v.Artifacts } +// GetVulnerability returns VexArtifactAndOsvIngestVEXStatementCertifyVEXStatement.Vulnerability, and is useful for accessing the field via an interface. +func (v *VexArtifactAndOsvIngestVEXStatementCertifyVEXStatement) GetVulnerability() AllCertifyVEXStatementVulnerability { + return v.AllCertifyVEXStatement.Vulnerability +} -// GetOrigin returns allHashEqualTree.Origin, and is useful for accessing the field via an interface. -func (v *allHashEqualTree) GetOrigin() string { return v.Origin } +// GetStatus returns VexArtifactAndOsvIngestVEXStatementCertifyVEXStatement.Status, and is useful for accessing the field via an interface. +func (v *VexArtifactAndOsvIngestVEXStatementCertifyVEXStatement) GetStatus() VexStatus { + return v.AllCertifyVEXStatement.Status +} -// GetCollector returns allHashEqualTree.Collector, and is useful for accessing the field via an interface. -func (v *allHashEqualTree) GetCollector() string { return v.Collector } +// GetVexJustification returns VexArtifactAndOsvIngestVEXStatementCertifyVEXStatement.VexJustification, and is useful for accessing the field via an interface. +func (v *VexArtifactAndOsvIngestVEXStatementCertifyVEXStatement) GetVexJustification() VexJustification { + return v.AllCertifyVEXStatement.VexJustification +} -// allHashEqualTreeArtifactsArtifact includes the requested fields of the GraphQL type Artifact. -// The GraphQL type's documentation follows. -// -// Artifact represents an artifact identified by a checksum hash. -// -// The checksum is split into the digest value and the algorithm used to generate -// it. Both fields are mandatory and canonicalized to be lowercase. -// -// If having a checksum Go object, algorithm can be -// strings.ToLower(string(checksum.Algorithm)) and digest can be checksum.Value. -type allHashEqualTreeArtifactsArtifact struct { - AllArtifactTree `json:"-"` +// GetStatement returns VexArtifactAndOsvIngestVEXStatementCertifyVEXStatement.Statement, and is useful for accessing the field via an interface. +func (v *VexArtifactAndOsvIngestVEXStatementCertifyVEXStatement) GetStatement() string { + return v.AllCertifyVEXStatement.Statement +} + +// GetStatusNotes returns VexArtifactAndOsvIngestVEXStatementCertifyVEXStatement.StatusNotes, and is useful for accessing the field via an interface. +func (v *VexArtifactAndOsvIngestVEXStatementCertifyVEXStatement) GetStatusNotes() string { + return v.AllCertifyVEXStatement.StatusNotes } -// GetId returns allHashEqualTreeArtifactsArtifact.Id, and is useful for accessing the field via an interface. -func (v *allHashEqualTreeArtifactsArtifact) GetId() string { return v.AllArtifactTree.Id } +// GetKnownSince returns VexArtifactAndOsvIngestVEXStatementCertifyVEXStatement.KnownSince, and is useful for accessing the field via an interface. +func (v *VexArtifactAndOsvIngestVEXStatementCertifyVEXStatement) GetKnownSince() time.Time { + return v.AllCertifyVEXStatement.KnownSince +} -// GetAlgorithm returns allHashEqualTreeArtifactsArtifact.Algorithm, and is useful for accessing the field via an interface. -func (v *allHashEqualTreeArtifactsArtifact) GetAlgorithm() string { return v.AllArtifactTree.Algorithm } +// GetOrigin returns VexArtifactAndOsvIngestVEXStatementCertifyVEXStatement.Origin, and is useful for accessing the field via an interface. +func (v *VexArtifactAndOsvIngestVEXStatementCertifyVEXStatement) GetOrigin() string { + return v.AllCertifyVEXStatement.Origin +} -// GetDigest returns allHashEqualTreeArtifactsArtifact.Digest, and is useful for accessing the field via an interface. -func (v *allHashEqualTreeArtifactsArtifact) GetDigest() string { return v.AllArtifactTree.Digest } +// GetCollector returns VexArtifactAndOsvIngestVEXStatementCertifyVEXStatement.Collector, and is useful for accessing the field via an interface. +func (v *VexArtifactAndOsvIngestVEXStatementCertifyVEXStatement) GetCollector() string { + return v.AllCertifyVEXStatement.Collector +} -func (v *allHashEqualTreeArtifactsArtifact) UnmarshalJSON(b []byte) error { +func (v *VexArtifactAndOsvIngestVEXStatementCertifyVEXStatement) UnmarshalJSON(b []byte) error { if string(b) == "null" { return nil } var firstPass struct { - *allHashEqualTreeArtifactsArtifact + *VexArtifactAndOsvIngestVEXStatementCertifyVEXStatement graphql.NoUnmarshalJSON } - firstPass.allHashEqualTreeArtifactsArtifact = v + firstPass.VexArtifactAndOsvIngestVEXStatementCertifyVEXStatement = v err := json.Unmarshal(b, &firstPass) if err != nil { @@ -23147,22 +23400,36 @@ func (v *allHashEqualTreeArtifactsArtifact) UnmarshalJSON(b []byte) error { } err = json.Unmarshal( - b, &v.AllArtifactTree) + b, &v.AllCertifyVEXStatement) if err != nil { return err } return nil } -type __premarshalallHashEqualTreeArtifactsArtifact struct { +type __premarshalVexArtifactAndOsvIngestVEXStatementCertifyVEXStatement struct { Id string `json:"id"` - Algorithm string `json:"algorithm"` + Subject json.RawMessage `json:"subject"` - Digest string `json:"digest"` + Vulnerability json.RawMessage `json:"vulnerability"` + + Status VexStatus `json:"status"` + + VexJustification VexJustification `json:"vexJustification"` + + Statement string `json:"statement"` + + StatusNotes string `json:"statusNotes"` + + KnownSince time.Time `json:"knownSince"` + + Origin string `json:"origin"` + + Collector string `json:"collector"` } -func (v *allHashEqualTreeArtifactsArtifact) MarshalJSON() ([]byte, error) { +func (v *VexArtifactAndOsvIngestVEXStatementCertifyVEXStatement) MarshalJSON() ([]byte, error) { premarshaled, err := v.__premarshalJSON() if err != nil { return nil, err @@ -23170,188 +23437,137 @@ func (v *allHashEqualTreeArtifactsArtifact) MarshalJSON() ([]byte, error) { return json.Marshal(premarshaled) } -func (v *allHashEqualTreeArtifactsArtifact) __premarshalJSON() (*__premarshalallHashEqualTreeArtifactsArtifact, error) { - var retval __premarshalallHashEqualTreeArtifactsArtifact +func (v *VexArtifactAndOsvIngestVEXStatementCertifyVEXStatement) __premarshalJSON() (*__premarshalVexArtifactAndOsvIngestVEXStatementCertifyVEXStatement, error) { + var retval __premarshalVexArtifactAndOsvIngestVEXStatementCertifyVEXStatement + + retval.Id = v.AllCertifyVEXStatement.Id + { - retval.Id = v.AllArtifactTree.Id - retval.Algorithm = v.AllArtifactTree.Algorithm - retval.Digest = v.AllArtifactTree.Digest + dst := &retval.Subject + src := v.AllCertifyVEXStatement.Subject + var err error + *dst, err = __marshalAllCertifyVEXStatementSubjectPackageOrArtifact( + &src) + if err != nil { + return nil, fmt.Errorf( + "unable to marshal VexArtifactAndOsvIngestVEXStatementCertifyVEXStatement.AllCertifyVEXStatement.Subject: %w", err) + } + } + { + + dst := &retval.Vulnerability + src := v.AllCertifyVEXStatement.Vulnerability + var err error + *dst, err = __marshalAllCertifyVEXStatementVulnerability( + &src) + if err != nil { + return nil, fmt.Errorf( + "unable to marshal VexArtifactAndOsvIngestVEXStatementCertifyVEXStatement.AllCertifyVEXStatement.Vulnerability: %w", err) + } + } + retval.Status = v.AllCertifyVEXStatement.Status + retval.VexJustification = v.AllCertifyVEXStatement.VexJustification + retval.Statement = v.AllCertifyVEXStatement.Statement + retval.StatusNotes = v.AllCertifyVEXStatement.StatusNotes + retval.KnownSince = v.AllCertifyVEXStatement.KnownSince + retval.Origin = v.AllCertifyVEXStatement.Origin + retval.Collector = v.AllCertifyVEXStatement.Collector return &retval, nil } -// allIsDependencyTree includes the GraphQL fields of IsDependency requested by the fragment allIsDependencyTree. -// The GraphQL type's documentation follows. -// -// IsDependency is an attestation to record that a package depends on another. -type allIsDependencyTree struct { - Id string `json:"id"` - // Justification for the attested relationship - Justification string `json:"justification"` - // Package that has the dependency - Package allIsDependencyTreePackage `json:"package"` - // Package for the dependency; MUST BE PackageName, not PackageVersion - DependentPackage allIsDependencyTreeDependentPackage `json:"dependentPackage"` - // Type of dependency - DependencyType DependencyType `json:"dependencyType"` - // Version range for the dependency link - VersionRange string `json:"versionRange"` - // Document from which this attestation is generated from - Origin string `json:"origin"` - // GUAC collector for the document - Collector string `json:"collector"` +// VexArtifactAndOsvResponse is returned by VexArtifactAndOsv on success. +type VexArtifactAndOsvResponse struct { + // Adds a VEX certification for a package. + IngestVEXStatement VexArtifactAndOsvIngestVEXStatementCertifyVEXStatement `json:"ingestVEXStatement"` } -// GetId returns allIsDependencyTree.Id, and is useful for accessing the field via an interface. -func (v *allIsDependencyTree) GetId() string { return v.Id } - -// GetJustification returns allIsDependencyTree.Justification, and is useful for accessing the field via an interface. -func (v *allIsDependencyTree) GetJustification() string { return v.Justification } - -// GetPackage returns allIsDependencyTree.Package, and is useful for accessing the field via an interface. -func (v *allIsDependencyTree) GetPackage() allIsDependencyTreePackage { return v.Package } - -// GetDependentPackage returns allIsDependencyTree.DependentPackage, and is useful for accessing the field via an interface. -func (v *allIsDependencyTree) GetDependentPackage() allIsDependencyTreeDependentPackage { - return v.DependentPackage +// GetIngestVEXStatement returns VexArtifactAndOsvResponse.IngestVEXStatement, and is useful for accessing the field via an interface. +func (v *VexArtifactAndOsvResponse) GetIngestVEXStatement() VexArtifactAndOsvIngestVEXStatementCertifyVEXStatement { + return v.IngestVEXStatement } -// GetDependencyType returns allIsDependencyTree.DependencyType, and is useful for accessing the field via an interface. -func (v *allIsDependencyTree) GetDependencyType() DependencyType { return v.DependencyType } - -// GetVersionRange returns allIsDependencyTree.VersionRange, and is useful for accessing the field via an interface. -func (v *allIsDependencyTree) GetVersionRange() string { return v.VersionRange } - -// GetOrigin returns allIsDependencyTree.Origin, and is useful for accessing the field via an interface. -func (v *allIsDependencyTree) GetOrigin() string { return v.Origin } +// Records the justification included in the VEX statement. +type VexJustification string -// GetCollector returns allIsDependencyTree.Collector, and is useful for accessing the field via an interface. -func (v *allIsDependencyTree) GetCollector() string { return v.Collector } +const ( + VexJustificationComponentNotPresent VexJustification = "COMPONENT_NOT_PRESENT" + VexJustificationVulnerableCodeNotPresent VexJustification = "VULNERABLE_CODE_NOT_PRESENT" + VexJustificationVulnerableCodeNotInExecutePath VexJustification = "VULNERABLE_CODE_NOT_IN_EXECUTE_PATH" + VexJustificationVulnerableCodeCannotBeControlledByAdversary VexJustification = "VULNERABLE_CODE_CANNOT_BE_CONTROLLED_BY_ADVERSARY" + VexJustificationInlineMitigationsAlreadyExist VexJustification = "INLINE_MITIGATIONS_ALREADY_EXIST" + VexJustificationNotProvided VexJustification = "NOT_PROVIDED" +) -// allIsDependencyTreeDependentPackage includes the requested fields of the GraphQL type Package. +// VexPackageAndCveIngestVEXStatementCertifyVEXStatement includes the requested fields of the GraphQL type CertifyVEXStatement. // The GraphQL type's documentation follows. // -// Package represents the root of the package trie/tree. -// -// We map package information to a trie, closely matching the pURL specification -// (https://github.com/package-url/purl-spec/blob/0dd92f26f8bb11956ffdf5e8acfcee71e8560407/README.rst), -// but deviating from it where GUAC heuristics allow for better representation of -// package information. Each path in the trie fully represents a package; we split -// the trie based on the pURL components. -// -// This node matches a pkg: partial pURL. The type field matches the -// pURL types but we might also use "guac" for the cases where the pURL -// representation is not complete or when we have custom rules. -// -// Since this node is at the root of the package trie, it is named Package, not -// PackageType. -type allIsDependencyTreeDependentPackage struct { - AllPkgTree `json:"-"` +// CertifyVEXStatement is an attestation to attach VEX statements to a package or +// artifact to clarify the impact of a specific vulnerability (CVE, GHSA or OSV). +type VexPackageAndCveIngestVEXStatementCertifyVEXStatement struct { + AllCertifyVEXStatement `json:"-"` } -// GetId returns allIsDependencyTreeDependentPackage.Id, and is useful for accessing the field via an interface. -func (v *allIsDependencyTreeDependentPackage) GetId() string { return v.AllPkgTree.Id } - -// GetType returns allIsDependencyTreeDependentPackage.Type, and is useful for accessing the field via an interface. -func (v *allIsDependencyTreeDependentPackage) GetType() string { return v.AllPkgTree.Type } - -// GetNamespaces returns allIsDependencyTreeDependentPackage.Namespaces, and is useful for accessing the field via an interface. -func (v *allIsDependencyTreeDependentPackage) GetNamespaces() []AllPkgTreeNamespacesPackageNamespace { - return v.AllPkgTree.Namespaces +// GetId returns VexPackageAndCveIngestVEXStatementCertifyVEXStatement.Id, and is useful for accessing the field via an interface. +func (v *VexPackageAndCveIngestVEXStatementCertifyVEXStatement) GetId() string { + return v.AllCertifyVEXStatement.Id } -func (v *allIsDependencyTreeDependentPackage) UnmarshalJSON(b []byte) error { - - if string(b) == "null" { - return nil - } - - var firstPass struct { - *allIsDependencyTreeDependentPackage - graphql.NoUnmarshalJSON - } - firstPass.allIsDependencyTreeDependentPackage = v - - err := json.Unmarshal(b, &firstPass) - if err != nil { - return err - } - - err = json.Unmarshal( - b, &v.AllPkgTree) - if err != nil { - return err - } - return nil +// GetSubject returns VexPackageAndCveIngestVEXStatementCertifyVEXStatement.Subject, and is useful for accessing the field via an interface. +func (v *VexPackageAndCveIngestVEXStatementCertifyVEXStatement) GetSubject() AllCertifyVEXStatementSubjectPackageOrArtifact { + return v.AllCertifyVEXStatement.Subject } -type __premarshalallIsDependencyTreeDependentPackage struct { - Id string `json:"id"` - - Type string `json:"type"` - - Namespaces []AllPkgTreeNamespacesPackageNamespace `json:"namespaces"` +// GetVulnerability returns VexPackageAndCveIngestVEXStatementCertifyVEXStatement.Vulnerability, and is useful for accessing the field via an interface. +func (v *VexPackageAndCveIngestVEXStatementCertifyVEXStatement) GetVulnerability() AllCertifyVEXStatementVulnerability { + return v.AllCertifyVEXStatement.Vulnerability } -func (v *allIsDependencyTreeDependentPackage) MarshalJSON() ([]byte, error) { - premarshaled, err := v.__premarshalJSON() - if err != nil { - return nil, err - } - return json.Marshal(premarshaled) +// GetStatus returns VexPackageAndCveIngestVEXStatementCertifyVEXStatement.Status, and is useful for accessing the field via an interface. +func (v *VexPackageAndCveIngestVEXStatementCertifyVEXStatement) GetStatus() VexStatus { + return v.AllCertifyVEXStatement.Status } -func (v *allIsDependencyTreeDependentPackage) __premarshalJSON() (*__premarshalallIsDependencyTreeDependentPackage, error) { - var retval __premarshalallIsDependencyTreeDependentPackage +// GetVexJustification returns VexPackageAndCveIngestVEXStatementCertifyVEXStatement.VexJustification, and is useful for accessing the field via an interface. +func (v *VexPackageAndCveIngestVEXStatementCertifyVEXStatement) GetVexJustification() VexJustification { + return v.AllCertifyVEXStatement.VexJustification +} - retval.Id = v.AllPkgTree.Id - retval.Type = v.AllPkgTree.Type - retval.Namespaces = v.AllPkgTree.Namespaces - return &retval, nil +// GetStatement returns VexPackageAndCveIngestVEXStatementCertifyVEXStatement.Statement, and is useful for accessing the field via an interface. +func (v *VexPackageAndCveIngestVEXStatementCertifyVEXStatement) GetStatement() string { + return v.AllCertifyVEXStatement.Statement } -// allIsDependencyTreePackage includes the requested fields of the GraphQL type Package. -// The GraphQL type's documentation follows. -// -// Package represents the root of the package trie/tree. -// -// We map package information to a trie, closely matching the pURL specification -// (https://github.com/package-url/purl-spec/blob/0dd92f26f8bb11956ffdf5e8acfcee71e8560407/README.rst), -// but deviating from it where GUAC heuristics allow for better representation of -// package information. Each path in the trie fully represents a package; we split -// the trie based on the pURL components. -// -// This node matches a pkg: partial pURL. The type field matches the -// pURL types but we might also use "guac" for the cases where the pURL -// representation is not complete or when we have custom rules. -// -// Since this node is at the root of the package trie, it is named Package, not -// PackageType. -type allIsDependencyTreePackage struct { - AllPkgTree `json:"-"` +// GetStatusNotes returns VexPackageAndCveIngestVEXStatementCertifyVEXStatement.StatusNotes, and is useful for accessing the field via an interface. +func (v *VexPackageAndCveIngestVEXStatementCertifyVEXStatement) GetStatusNotes() string { + return v.AllCertifyVEXStatement.StatusNotes } -// GetId returns allIsDependencyTreePackage.Id, and is useful for accessing the field via an interface. -func (v *allIsDependencyTreePackage) GetId() string { return v.AllPkgTree.Id } +// GetKnownSince returns VexPackageAndCveIngestVEXStatementCertifyVEXStatement.KnownSince, and is useful for accessing the field via an interface. +func (v *VexPackageAndCveIngestVEXStatementCertifyVEXStatement) GetKnownSince() time.Time { + return v.AllCertifyVEXStatement.KnownSince +} -// GetType returns allIsDependencyTreePackage.Type, and is useful for accessing the field via an interface. -func (v *allIsDependencyTreePackage) GetType() string { return v.AllPkgTree.Type } +// GetOrigin returns VexPackageAndCveIngestVEXStatementCertifyVEXStatement.Origin, and is useful for accessing the field via an interface. +func (v *VexPackageAndCveIngestVEXStatementCertifyVEXStatement) GetOrigin() string { + return v.AllCertifyVEXStatement.Origin +} -// GetNamespaces returns allIsDependencyTreePackage.Namespaces, and is useful for accessing the field via an interface. -func (v *allIsDependencyTreePackage) GetNamespaces() []AllPkgTreeNamespacesPackageNamespace { - return v.AllPkgTree.Namespaces +// GetCollector returns VexPackageAndCveIngestVEXStatementCertifyVEXStatement.Collector, and is useful for accessing the field via an interface. +func (v *VexPackageAndCveIngestVEXStatementCertifyVEXStatement) GetCollector() string { + return v.AllCertifyVEXStatement.Collector } -func (v *allIsDependencyTreePackage) UnmarshalJSON(b []byte) error { +func (v *VexPackageAndCveIngestVEXStatementCertifyVEXStatement) UnmarshalJSON(b []byte) error { if string(b) == "null" { return nil } var firstPass struct { - *allIsDependencyTreePackage + *VexPackageAndCveIngestVEXStatementCertifyVEXStatement graphql.NoUnmarshalJSON } - firstPass.allIsDependencyTreePackage = v + firstPass.VexPackageAndCveIngestVEXStatementCertifyVEXStatement = v err := json.Unmarshal(b, &firstPass) if err != nil { @@ -23359,22 +23575,36 @@ func (v *allIsDependencyTreePackage) UnmarshalJSON(b []byte) error { } err = json.Unmarshal( - b, &v.AllPkgTree) + b, &v.AllCertifyVEXStatement) if err != nil { return err } return nil } -type __premarshalallIsDependencyTreePackage struct { +type __premarshalVexPackageAndCveIngestVEXStatementCertifyVEXStatement struct { Id string `json:"id"` - Type string `json:"type"` + Subject json.RawMessage `json:"subject"` - Namespaces []AllPkgTreeNamespacesPackageNamespace `json:"namespaces"` + Vulnerability json.RawMessage `json:"vulnerability"` + + Status VexStatus `json:"status"` + + VexJustification VexJustification `json:"vexJustification"` + + Statement string `json:"statement"` + + StatusNotes string `json:"statusNotes"` + + KnownSince time.Time `json:"knownSince"` + + Origin string `json:"origin"` + + Collector string `json:"collector"` } -func (v *allIsDependencyTreePackage) MarshalJSON() ([]byte, error) { +func (v *VexPackageAndCveIngestVEXStatementCertifyVEXStatement) MarshalJSON() ([]byte, error) { premarshaled, err := v.__premarshalJSON() if err != nil { return nil, err @@ -23382,101 +23612,162 @@ func (v *allIsDependencyTreePackage) MarshalJSON() ([]byte, error) { return json.Marshal(premarshaled) } -func (v *allIsDependencyTreePackage) __premarshalJSON() (*__premarshalallIsDependencyTreePackage, error) { - var retval __premarshalallIsDependencyTreePackage +func (v *VexPackageAndCveIngestVEXStatementCertifyVEXStatement) __premarshalJSON() (*__premarshalVexPackageAndCveIngestVEXStatementCertifyVEXStatement, error) { + var retval __premarshalVexPackageAndCveIngestVEXStatementCertifyVEXStatement - retval.Id = v.AllPkgTree.Id - retval.Type = v.AllPkgTree.Type - retval.Namespaces = v.AllPkgTree.Namespaces + retval.Id = v.AllCertifyVEXStatement.Id + { + + dst := &retval.Subject + src := v.AllCertifyVEXStatement.Subject + var err error + *dst, err = __marshalAllCertifyVEXStatementSubjectPackageOrArtifact( + &src) + if err != nil { + return nil, fmt.Errorf( + "unable to marshal VexPackageAndCveIngestVEXStatementCertifyVEXStatement.AllCertifyVEXStatement.Subject: %w", err) + } + } + { + + dst := &retval.Vulnerability + src := v.AllCertifyVEXStatement.Vulnerability + var err error + *dst, err = __marshalAllCertifyVEXStatementVulnerability( + &src) + if err != nil { + return nil, fmt.Errorf( + "unable to marshal VexPackageAndCveIngestVEXStatementCertifyVEXStatement.AllCertifyVEXStatement.Vulnerability: %w", err) + } + } + retval.Status = v.AllCertifyVEXStatement.Status + retval.VexJustification = v.AllCertifyVEXStatement.VexJustification + retval.Statement = v.AllCertifyVEXStatement.Statement + retval.StatusNotes = v.AllCertifyVEXStatement.StatusNotes + retval.KnownSince = v.AllCertifyVEXStatement.KnownSince + retval.Origin = v.AllCertifyVEXStatement.Origin + retval.Collector = v.AllCertifyVEXStatement.Collector return &retval, nil } -// allIsVulnerability includes the GraphQL fields of IsVulnerability requested by the fragment allIsVulnerability. +// VexPackageAndCveResponse is returned by VexPackageAndCve on success. +type VexPackageAndCveResponse struct { + // Adds a VEX certification for a package. + IngestVEXStatement VexPackageAndCveIngestVEXStatementCertifyVEXStatement `json:"ingestVEXStatement"` +} + +// GetIngestVEXStatement returns VexPackageAndCveResponse.IngestVEXStatement, and is useful for accessing the field via an interface. +func (v *VexPackageAndCveResponse) GetIngestVEXStatement() VexPackageAndCveIngestVEXStatementCertifyVEXStatement { + return v.IngestVEXStatement +} + +// VexPackageAndOsvIngestVEXStatementCertifyVEXStatement includes the requested fields of the GraphQL type CertifyVEXStatement. // The GraphQL type's documentation follows. // -// IsVulnerability is an attestation to link CVE/GHSA with data in OSV. -type allIsVulnerability struct { - Id string `json:"id"` - // The OSV that encapsulates the vulnerability - Osv allIsVulnerabilityOsvOSV `json:"osv"` - // The upstream vulnerability information - Vulnerability allIsVulnerabilityVulnerabilityCveOrGhsa `json:"-"` - // Justification for the attested relationship - Justification string `json:"justification"` - // Document from which this attestation is generated from - Origin string `json:"origin"` - // GUAC collector for the document - Collector string `json:"collector"` +// CertifyVEXStatement is an attestation to attach VEX statements to a package or +// artifact to clarify the impact of a specific vulnerability (CVE, GHSA or OSV). +type VexPackageAndOsvIngestVEXStatementCertifyVEXStatement struct { + AllCertifyVEXStatement `json:"-"` +} + +// GetId returns VexPackageAndOsvIngestVEXStatementCertifyVEXStatement.Id, and is useful for accessing the field via an interface. +func (v *VexPackageAndOsvIngestVEXStatementCertifyVEXStatement) GetId() string { + return v.AllCertifyVEXStatement.Id } -// GetId returns allIsVulnerability.Id, and is useful for accessing the field via an interface. -func (v *allIsVulnerability) GetId() string { return v.Id } +// GetSubject returns VexPackageAndOsvIngestVEXStatementCertifyVEXStatement.Subject, and is useful for accessing the field via an interface. +func (v *VexPackageAndOsvIngestVEXStatementCertifyVEXStatement) GetSubject() AllCertifyVEXStatementSubjectPackageOrArtifact { + return v.AllCertifyVEXStatement.Subject +} -// GetOsv returns allIsVulnerability.Osv, and is useful for accessing the field via an interface. -func (v *allIsVulnerability) GetOsv() allIsVulnerabilityOsvOSV { return v.Osv } +// GetVulnerability returns VexPackageAndOsvIngestVEXStatementCertifyVEXStatement.Vulnerability, and is useful for accessing the field via an interface. +func (v *VexPackageAndOsvIngestVEXStatementCertifyVEXStatement) GetVulnerability() AllCertifyVEXStatementVulnerability { + return v.AllCertifyVEXStatement.Vulnerability +} -// GetVulnerability returns allIsVulnerability.Vulnerability, and is useful for accessing the field via an interface. -func (v *allIsVulnerability) GetVulnerability() allIsVulnerabilityVulnerabilityCveOrGhsa { - return v.Vulnerability +// GetStatus returns VexPackageAndOsvIngestVEXStatementCertifyVEXStatement.Status, and is useful for accessing the field via an interface. +func (v *VexPackageAndOsvIngestVEXStatementCertifyVEXStatement) GetStatus() VexStatus { + return v.AllCertifyVEXStatement.Status +} + +// GetVexJustification returns VexPackageAndOsvIngestVEXStatementCertifyVEXStatement.VexJustification, and is useful for accessing the field via an interface. +func (v *VexPackageAndOsvIngestVEXStatementCertifyVEXStatement) GetVexJustification() VexJustification { + return v.AllCertifyVEXStatement.VexJustification +} + +// GetStatement returns VexPackageAndOsvIngestVEXStatementCertifyVEXStatement.Statement, and is useful for accessing the field via an interface. +func (v *VexPackageAndOsvIngestVEXStatementCertifyVEXStatement) GetStatement() string { + return v.AllCertifyVEXStatement.Statement +} + +// GetStatusNotes returns VexPackageAndOsvIngestVEXStatementCertifyVEXStatement.StatusNotes, and is useful for accessing the field via an interface. +func (v *VexPackageAndOsvIngestVEXStatementCertifyVEXStatement) GetStatusNotes() string { + return v.AllCertifyVEXStatement.StatusNotes } -// GetJustification returns allIsVulnerability.Justification, and is useful for accessing the field via an interface. -func (v *allIsVulnerability) GetJustification() string { return v.Justification } +// GetKnownSince returns VexPackageAndOsvIngestVEXStatementCertifyVEXStatement.KnownSince, and is useful for accessing the field via an interface. +func (v *VexPackageAndOsvIngestVEXStatementCertifyVEXStatement) GetKnownSince() time.Time { + return v.AllCertifyVEXStatement.KnownSince +} -// GetOrigin returns allIsVulnerability.Origin, and is useful for accessing the field via an interface. -func (v *allIsVulnerability) GetOrigin() string { return v.Origin } +// GetOrigin returns VexPackageAndOsvIngestVEXStatementCertifyVEXStatement.Origin, and is useful for accessing the field via an interface. +func (v *VexPackageAndOsvIngestVEXStatementCertifyVEXStatement) GetOrigin() string { + return v.AllCertifyVEXStatement.Origin +} -// GetCollector returns allIsVulnerability.Collector, and is useful for accessing the field via an interface. -func (v *allIsVulnerability) GetCollector() string { return v.Collector } +// GetCollector returns VexPackageAndOsvIngestVEXStatementCertifyVEXStatement.Collector, and is useful for accessing the field via an interface. +func (v *VexPackageAndOsvIngestVEXStatementCertifyVEXStatement) GetCollector() string { + return v.AllCertifyVEXStatement.Collector +} -func (v *allIsVulnerability) UnmarshalJSON(b []byte) error { +func (v *VexPackageAndOsvIngestVEXStatementCertifyVEXStatement) UnmarshalJSON(b []byte) error { if string(b) == "null" { return nil } var firstPass struct { - *allIsVulnerability - Vulnerability json.RawMessage `json:"vulnerability"` + *VexPackageAndOsvIngestVEXStatementCertifyVEXStatement graphql.NoUnmarshalJSON } - firstPass.allIsVulnerability = v + firstPass.VexPackageAndOsvIngestVEXStatementCertifyVEXStatement = v err := json.Unmarshal(b, &firstPass) if err != nil { return err } - { - dst := &v.Vulnerability - src := firstPass.Vulnerability - if len(src) != 0 && string(src) != "null" { - err = __unmarshalallIsVulnerabilityVulnerabilityCveOrGhsa( - src, dst) - if err != nil { - return fmt.Errorf( - "unable to unmarshal allIsVulnerability.Vulnerability: %w", err) - } - } + err = json.Unmarshal( + b, &v.AllCertifyVEXStatement) + if err != nil { + return err } return nil } -type __premarshalallIsVulnerability struct { +type __premarshalVexPackageAndOsvIngestVEXStatementCertifyVEXStatement struct { Id string `json:"id"` - Osv allIsVulnerabilityOsvOSV `json:"osv"` + Subject json.RawMessage `json:"subject"` Vulnerability json.RawMessage `json:"vulnerability"` - Justification string `json:"justification"` + Status VexStatus `json:"status"` + + VexJustification VexJustification `json:"vexJustification"` + + Statement string `json:"statement"` + + StatusNotes string `json:"statusNotes"` + + KnownSince time.Time `json:"knownSince"` Origin string `json:"origin"` Collector string `json:"collector"` } -func (v *allIsVulnerability) MarshalJSON() ([]byte, error) { +func (v *VexPackageAndOsvIngestVEXStatementCertifyVEXStatement) MarshalJSON() ([]byte, error) { premarshaled, err := v.__premarshalJSON() if err != nil { return nil, err @@ -23484,1238 +23775,947 @@ func (v *allIsVulnerability) MarshalJSON() ([]byte, error) { return json.Marshal(premarshaled) } -func (v *allIsVulnerability) __premarshalJSON() (*__premarshalallIsVulnerability, error) { - var retval __premarshalallIsVulnerability +func (v *VexPackageAndOsvIngestVEXStatementCertifyVEXStatement) __premarshalJSON() (*__premarshalVexPackageAndOsvIngestVEXStatementCertifyVEXStatement, error) { + var retval __premarshalVexPackageAndOsvIngestVEXStatementCertifyVEXStatement - retval.Id = v.Id - retval.Osv = v.Osv + retval.Id = v.AllCertifyVEXStatement.Id + { + + dst := &retval.Subject + src := v.AllCertifyVEXStatement.Subject + var err error + *dst, err = __marshalAllCertifyVEXStatementSubjectPackageOrArtifact( + &src) + if err != nil { + return nil, fmt.Errorf( + "unable to marshal VexPackageAndOsvIngestVEXStatementCertifyVEXStatement.AllCertifyVEXStatement.Subject: %w", err) + } + } { dst := &retval.Vulnerability - src := v.Vulnerability + src := v.AllCertifyVEXStatement.Vulnerability var err error - *dst, err = __marshalallIsVulnerabilityVulnerabilityCveOrGhsa( + *dst, err = __marshalAllCertifyVEXStatementVulnerability( &src) if err != nil { return nil, fmt.Errorf( - "unable to marshal allIsVulnerability.Vulnerability: %w", err) + "unable to marshal VexPackageAndOsvIngestVEXStatementCertifyVEXStatement.AllCertifyVEXStatement.Vulnerability: %w", err) } } - retval.Justification = v.Justification - retval.Origin = v.Origin - retval.Collector = v.Collector + retval.Status = v.AllCertifyVEXStatement.Status + retval.VexJustification = v.AllCertifyVEXStatement.VexJustification + retval.Statement = v.AllCertifyVEXStatement.Statement + retval.StatusNotes = v.AllCertifyVEXStatement.StatusNotes + retval.KnownSince = v.AllCertifyVEXStatement.KnownSince + retval.Origin = v.AllCertifyVEXStatement.Origin + retval.Collector = v.AllCertifyVEXStatement.Collector return &retval, nil } -// allIsVulnerabilityOsvOSV includes the requested fields of the GraphQL type OSV. -// The GraphQL type's documentation follows. -// -// OSV represents an Open Source Vulnerability. -// -// The osvId field is mandatory and canonicalized to be lowercase. -// -// This maps to a vulnerability ID specific to the environment (e.g., GHSA ID or -// CVE ID). -// -// This node can be referred to by other parts of GUAC. -type allIsVulnerabilityOsvOSV struct { - AllOSVTree `json:"-"` +// VexPackageAndOsvResponse is returned by VexPackageAndOsv on success. +type VexPackageAndOsvResponse struct { + // Adds a VEX certification for a package. + IngestVEXStatement VexPackageAndOsvIngestVEXStatementCertifyVEXStatement `json:"ingestVEXStatement"` } -// GetId returns allIsVulnerabilityOsvOSV.Id, and is useful for accessing the field via an interface. -func (v *allIsVulnerabilityOsvOSV) GetId() string { return v.AllOSVTree.Id } +// GetIngestVEXStatement returns VexPackageAndOsvResponse.IngestVEXStatement, and is useful for accessing the field via an interface. +func (v *VexPackageAndOsvResponse) GetIngestVEXStatement() VexPackageAndOsvIngestVEXStatementCertifyVEXStatement { + return v.IngestVEXStatement +} -// GetOsvId returns allIsVulnerabilityOsvOSV.OsvId, and is useful for accessing the field via an interface. -func (v *allIsVulnerabilityOsvOSV) GetOsvId() string { return v.AllOSVTree.OsvId } +// VexStatementInputSpec represents the input to ingest VEX statements. +type VexStatementInputSpec struct { + Status VexStatus `json:"status"` + VexJustification VexJustification `json:"vexJustification"` + Statement string `json:"statement"` + StatusNotes string `json:"statusNotes"` + KnownSince time.Time `json:"knownSince"` + Origin string `json:"origin"` + Collector string `json:"collector"` +} -func (v *allIsVulnerabilityOsvOSV) UnmarshalJSON(b []byte) error { +// GetStatus returns VexStatementInputSpec.Status, and is useful for accessing the field via an interface. +func (v *VexStatementInputSpec) GetStatus() VexStatus { return v.Status } - if string(b) == "null" { - return nil - } +// GetVexJustification returns VexStatementInputSpec.VexJustification, and is useful for accessing the field via an interface. +func (v *VexStatementInputSpec) GetVexJustification() VexJustification { return v.VexJustification } - var firstPass struct { - *allIsVulnerabilityOsvOSV - graphql.NoUnmarshalJSON - } - firstPass.allIsVulnerabilityOsvOSV = v +// GetStatement returns VexStatementInputSpec.Statement, and is useful for accessing the field via an interface. +func (v *VexStatementInputSpec) GetStatement() string { return v.Statement } - err := json.Unmarshal(b, &firstPass) - if err != nil { - return err - } +// GetStatusNotes returns VexStatementInputSpec.StatusNotes, and is useful for accessing the field via an interface. +func (v *VexStatementInputSpec) GetStatusNotes() string { return v.StatusNotes } - err = json.Unmarshal( - b, &v.AllOSVTree) - if err != nil { - return err - } - return nil -} +// GetKnownSince returns VexStatementInputSpec.KnownSince, and is useful for accessing the field via an interface. +func (v *VexStatementInputSpec) GetKnownSince() time.Time { return v.KnownSince } -type __premarshalallIsVulnerabilityOsvOSV struct { - Id string `json:"id"` +// GetOrigin returns VexStatementInputSpec.Origin, and is useful for accessing the field via an interface. +func (v *VexStatementInputSpec) GetOrigin() string { return v.Origin } - OsvId string `json:"osvId"` -} +// GetCollector returns VexStatementInputSpec.Collector, and is useful for accessing the field via an interface. +func (v *VexStatementInputSpec) GetCollector() string { return v.Collector } -func (v *allIsVulnerabilityOsvOSV) MarshalJSON() ([]byte, error) { - premarshaled, err := v.__premarshalJSON() - if err != nil { - return nil, err - } - return json.Marshal(premarshaled) -} +// Records the status of a VEX statement subject. +type VexStatus string -func (v *allIsVulnerabilityOsvOSV) __premarshalJSON() (*__premarshalallIsVulnerabilityOsvOSV, error) { - var retval __premarshalallIsVulnerabilityOsvOSV +const ( + VexStatusNotAffected VexStatus = "NOT_AFFECTED" + VexStatusAffected VexStatus = "AFFECTED" + VexStatusFixed VexStatus = "FIXED" + VexStatusUnderInvestigation VexStatus = "UNDER_INVESTIGATION" +) - retval.Id = v.AllOSVTree.Id - retval.OsvId = v.AllOSVTree.OsvId - return &retval, nil +// VulnerabilityMetaDataInput represents the input for certifying vulnerability +// scans in mutations. +type VulnerabilityMetaDataInput struct { + TimeScanned time.Time `json:"timeScanned"` + DbUri string `json:"dbUri"` + DbVersion string `json:"dbVersion"` + ScannerUri string `json:"scannerUri"` + ScannerVersion string `json:"scannerVersion"` + Origin string `json:"origin"` + Collector string `json:"collector"` } -// allIsVulnerabilityVulnerabilityCVE includes the requested fields of the GraphQL type CVE. -// The GraphQL type's documentation follows. -// -// CVE represents a vulnerability in the Common Vulnerabilities and Exposures -// schema. -// -// The vulnerability identifier contains a year field, so we are extracting that -// to allow matching for vulnerabilities found in a given year. -// -// The vulnerability identifier field is mandatory and canonicalized to be -// lowercase. -// -// This node can be referred to by other parts of GUAC. -type allIsVulnerabilityVulnerabilityCVE struct { - Typename *string `json:"__typename"` - AllCveTree `json:"-"` -} +// GetTimeScanned returns VulnerabilityMetaDataInput.TimeScanned, and is useful for accessing the field via an interface. +func (v *VulnerabilityMetaDataInput) GetTimeScanned() time.Time { return v.TimeScanned } -// GetTypename returns allIsVulnerabilityVulnerabilityCVE.Typename, and is useful for accessing the field via an interface. -func (v *allIsVulnerabilityVulnerabilityCVE) GetTypename() *string { return v.Typename } +// GetDbUri returns VulnerabilityMetaDataInput.DbUri, and is useful for accessing the field via an interface. +func (v *VulnerabilityMetaDataInput) GetDbUri() string { return v.DbUri } -// GetId returns allIsVulnerabilityVulnerabilityCVE.Id, and is useful for accessing the field via an interface. -func (v *allIsVulnerabilityVulnerabilityCVE) GetId() string { return v.AllCveTree.Id } +// GetDbVersion returns VulnerabilityMetaDataInput.DbVersion, and is useful for accessing the field via an interface. +func (v *VulnerabilityMetaDataInput) GetDbVersion() string { return v.DbVersion } -// GetYear returns allIsVulnerabilityVulnerabilityCVE.Year, and is useful for accessing the field via an interface. -func (v *allIsVulnerabilityVulnerabilityCVE) GetYear() int { return v.AllCveTree.Year } +// GetScannerUri returns VulnerabilityMetaDataInput.ScannerUri, and is useful for accessing the field via an interface. +func (v *VulnerabilityMetaDataInput) GetScannerUri() string { return v.ScannerUri } -// GetCveId returns allIsVulnerabilityVulnerabilityCVE.CveId, and is useful for accessing the field via an interface. -func (v *allIsVulnerabilityVulnerabilityCVE) GetCveId() string { return v.AllCveTree.CveId } +// GetScannerVersion returns VulnerabilityMetaDataInput.ScannerVersion, and is useful for accessing the field via an interface. +func (v *VulnerabilityMetaDataInput) GetScannerVersion() string { return v.ScannerVersion } -func (v *allIsVulnerabilityVulnerabilityCVE) UnmarshalJSON(b []byte) error { +// GetOrigin returns VulnerabilityMetaDataInput.Origin, and is useful for accessing the field via an interface. +func (v *VulnerabilityMetaDataInput) GetOrigin() string { return v.Origin } - if string(b) == "null" { - return nil - } +// GetCollector returns VulnerabilityMetaDataInput.Collector, and is useful for accessing the field via an interface. +func (v *VulnerabilityMetaDataInput) GetCollector() string { return v.Collector } - var firstPass struct { - *allIsVulnerabilityVulnerabilityCVE - graphql.NoUnmarshalJSON - } - firstPass.allIsVulnerabilityVulnerabilityCVE = v +// __ArtifactsInput is used internally by genqlient +type __ArtifactsInput struct { + Filter *ArtifactSpec `json:"filter"` +} - err := json.Unmarshal(b, &firstPass) - if err != nil { - return err - } +// GetFilter returns __ArtifactsInput.Filter, and is useful for accessing the field via an interface. +func (v *__ArtifactsInput) GetFilter() *ArtifactSpec { return v.Filter } - err = json.Unmarshal( - b, &v.AllCveTree) - if err != nil { - return err - } - return nil +// __CVEsInput is used internally by genqlient +type __CVEsInput struct { + Filter *CVESpec `json:"filter"` } -type __premarshalallIsVulnerabilityVulnerabilityCVE struct { - Typename *string `json:"__typename"` +// GetFilter returns __CVEsInput.Filter, and is useful for accessing the field via an interface. +func (v *__CVEsInput) GetFilter() *CVESpec { return v.Filter } - Id string `json:"id"` +// __CertifyBadArtifactInput is used internally by genqlient +type __CertifyBadArtifactInput struct { + Artifact ArtifactInputSpec `json:"artifact"` + CertifyBad CertifyBadInputSpec `json:"certifyBad"` +} - Year int `json:"year"` +// GetArtifact returns __CertifyBadArtifactInput.Artifact, and is useful for accessing the field via an interface. +func (v *__CertifyBadArtifactInput) GetArtifact() ArtifactInputSpec { return v.Artifact } - CveId string `json:"cveId"` -} +// GetCertifyBad returns __CertifyBadArtifactInput.CertifyBad, and is useful for accessing the field via an interface. +func (v *__CertifyBadArtifactInput) GetCertifyBad() CertifyBadInputSpec { return v.CertifyBad } -func (v *allIsVulnerabilityVulnerabilityCVE) MarshalJSON() ([]byte, error) { - premarshaled, err := v.__premarshalJSON() - if err != nil { - return nil, err - } - return json.Marshal(premarshaled) +// __CertifyBadPkgInput is used internally by genqlient +type __CertifyBadPkgInput struct { + Pkg PkgInputSpec `json:"pkg"` + PkgMatchType *MatchFlags `json:"pkgMatchType"` + CertifyBad CertifyBadInputSpec `json:"certifyBad"` } -func (v *allIsVulnerabilityVulnerabilityCVE) __premarshalJSON() (*__premarshalallIsVulnerabilityVulnerabilityCVE, error) { - var retval __premarshalallIsVulnerabilityVulnerabilityCVE +// GetPkg returns __CertifyBadPkgInput.Pkg, and is useful for accessing the field via an interface. +func (v *__CertifyBadPkgInput) GetPkg() PkgInputSpec { return v.Pkg } - retval.Typename = v.Typename - retval.Id = v.AllCveTree.Id - retval.Year = v.AllCveTree.Year - retval.CveId = v.AllCveTree.CveId - return &retval, nil -} +// GetPkgMatchType returns __CertifyBadPkgInput.PkgMatchType, and is useful for accessing the field via an interface. +func (v *__CertifyBadPkgInput) GetPkgMatchType() *MatchFlags { return v.PkgMatchType } -// allIsVulnerabilityVulnerabilityCveOrGhsa includes the requested fields of the GraphQL interface CveOrGhsa. -// -// allIsVulnerabilityVulnerabilityCveOrGhsa is implemented by the following types: -// allIsVulnerabilityVulnerabilityCVE -// allIsVulnerabilityVulnerabilityGHSA -// The GraphQL type's documentation follows. -// -// CveOrGhsa is a union of CVE and GHSA. -type allIsVulnerabilityVulnerabilityCveOrGhsa interface { - implementsGraphQLInterfaceallIsVulnerabilityVulnerabilityCveOrGhsa() - // GetTypename returns the receiver's concrete GraphQL type-name (see interface doc for possible values). - GetTypename() *string -} +// GetCertifyBad returns __CertifyBadPkgInput.CertifyBad, and is useful for accessing the field via an interface. +func (v *__CertifyBadPkgInput) GetCertifyBad() CertifyBadInputSpec { return v.CertifyBad } -func (v *allIsVulnerabilityVulnerabilityCVE) implementsGraphQLInterfaceallIsVulnerabilityVulnerabilityCveOrGhsa() { -} -func (v *allIsVulnerabilityVulnerabilityGHSA) implementsGraphQLInterfaceallIsVulnerabilityVulnerabilityCveOrGhsa() { +// __CertifyBadSrcInput is used internally by genqlient +type __CertifyBadSrcInput struct { + Source SourceInputSpec `json:"source"` + CertifyBad CertifyBadInputSpec `json:"certifyBad"` } -func __unmarshalallIsVulnerabilityVulnerabilityCveOrGhsa(b []byte, v *allIsVulnerabilityVulnerabilityCveOrGhsa) error { - if string(b) == "null" { - return nil - } +// GetSource returns __CertifyBadSrcInput.Source, and is useful for accessing the field via an interface. +func (v *__CertifyBadSrcInput) GetSource() SourceInputSpec { return v.Source } - var tn struct { - TypeName string `json:"__typename"` - } - err := json.Unmarshal(b, &tn) - if err != nil { - return err - } +// GetCertifyBad returns __CertifyBadSrcInput.CertifyBad, and is useful for accessing the field via an interface. +func (v *__CertifyBadSrcInput) GetCertifyBad() CertifyBadInputSpec { return v.CertifyBad } - switch tn.TypeName { - case "CVE": - *v = new(allIsVulnerabilityVulnerabilityCVE) - return json.Unmarshal(b, *v) - case "GHSA": - *v = new(allIsVulnerabilityVulnerabilityGHSA) - return json.Unmarshal(b, *v) - case "": - return fmt.Errorf( - "response was missing CveOrGhsa.__typename") - default: - return fmt.Errorf( - `unexpected concrete type for allIsVulnerabilityVulnerabilityCveOrGhsa: "%v"`, tn.TypeName) - } +// __CertifyBadsInput is used internally by genqlient +type __CertifyBadsInput struct { + Filter *CertifyBadSpec `json:"filter"` } -func __marshalallIsVulnerabilityVulnerabilityCveOrGhsa(v *allIsVulnerabilityVulnerabilityCveOrGhsa) ([]byte, error) { +// GetFilter returns __CertifyBadsInput.Filter, and is useful for accessing the field via an interface. +func (v *__CertifyBadsInput) GetFilter() *CertifyBadSpec { return v.Filter } - var typename string - switch v := (*v).(type) { - case *allIsVulnerabilityVulnerabilityCVE: - typename = "CVE" +// __CertifyCVEInput is used internally by genqlient +type __CertifyCVEInput struct { + Pkg PkgInputSpec `json:"pkg"` + Cve CVEInputSpec `json:"cve"` + CertifyVuln VulnerabilityMetaDataInput `json:"certifyVuln"` +} - premarshaled, err := v.__premarshalJSON() - if err != nil { - return nil, err - } - result := struct { - TypeName string `json:"__typename"` - *__premarshalallIsVulnerabilityVulnerabilityCVE - }{typename, premarshaled} - return json.Marshal(result) - case *allIsVulnerabilityVulnerabilityGHSA: - typename = "GHSA" +// GetPkg returns __CertifyCVEInput.Pkg, and is useful for accessing the field via an interface. +func (v *__CertifyCVEInput) GetPkg() PkgInputSpec { return v.Pkg } - premarshaled, err := v.__premarshalJSON() - if err != nil { - return nil, err - } - result := struct { - TypeName string `json:"__typename"` - *__premarshalallIsVulnerabilityVulnerabilityGHSA - }{typename, premarshaled} - return json.Marshal(result) - case nil: - return []byte("null"), nil - default: - return nil, fmt.Errorf( - `unexpected concrete type for allIsVulnerabilityVulnerabilityCveOrGhsa: "%T"`, v) - } -} +// GetCve returns __CertifyCVEInput.Cve, and is useful for accessing the field via an interface. +func (v *__CertifyCVEInput) GetCve() CVEInputSpec { return v.Cve } -// allIsVulnerabilityVulnerabilityGHSA includes the requested fields of the GraphQL type GHSA. -// The GraphQL type's documentation follows. -// -// GHSA represents GitHub security advisories. -// -// The advisory id field is mandatory and canonicalized to be lowercase. -// -// This node can be referred to by other parts of GUAC. -type allIsVulnerabilityVulnerabilityGHSA struct { - Typename *string `json:"__typename"` - AllGHSATree `json:"-"` +// GetCertifyVuln returns __CertifyCVEInput.CertifyVuln, and is useful for accessing the field via an interface. +func (v *__CertifyCVEInput) GetCertifyVuln() VulnerabilityMetaDataInput { return v.CertifyVuln } + +// __CertifyGHSAInput is used internally by genqlient +type __CertifyGHSAInput struct { + Pkg PkgInputSpec `json:"pkg"` + Ghsa GHSAInputSpec `json:"ghsa"` + CertifyVuln VulnerabilityMetaDataInput `json:"certifyVuln"` } -// GetTypename returns allIsVulnerabilityVulnerabilityGHSA.Typename, and is useful for accessing the field via an interface. -func (v *allIsVulnerabilityVulnerabilityGHSA) GetTypename() *string { return v.Typename } +// GetPkg returns __CertifyGHSAInput.Pkg, and is useful for accessing the field via an interface. +func (v *__CertifyGHSAInput) GetPkg() PkgInputSpec { return v.Pkg } + +// GetGhsa returns __CertifyGHSAInput.Ghsa, and is useful for accessing the field via an interface. +func (v *__CertifyGHSAInput) GetGhsa() GHSAInputSpec { return v.Ghsa } -// GetId returns allIsVulnerabilityVulnerabilityGHSA.Id, and is useful for accessing the field via an interface. -func (v *allIsVulnerabilityVulnerabilityGHSA) GetId() string { return v.AllGHSATree.Id } +// GetCertifyVuln returns __CertifyGHSAInput.CertifyVuln, and is useful for accessing the field via an interface. +func (v *__CertifyGHSAInput) GetCertifyVuln() VulnerabilityMetaDataInput { return v.CertifyVuln } -// GetGhsaId returns allIsVulnerabilityVulnerabilityGHSA.GhsaId, and is useful for accessing the field via an interface. -func (v *allIsVulnerabilityVulnerabilityGHSA) GetGhsaId() string { return v.AllGHSATree.GhsaId } +// __CertifyGoodArtifactInput is used internally by genqlient +type __CertifyGoodArtifactInput struct { + Artifact ArtifactInputSpec `json:"artifact"` + CertifyGood CertifyGoodInputSpec `json:"certifyGood"` +} -func (v *allIsVulnerabilityVulnerabilityGHSA) UnmarshalJSON(b []byte) error { +// GetArtifact returns __CertifyGoodArtifactInput.Artifact, and is useful for accessing the field via an interface. +func (v *__CertifyGoodArtifactInput) GetArtifact() ArtifactInputSpec { return v.Artifact } - if string(b) == "null" { - return nil - } +// GetCertifyGood returns __CertifyGoodArtifactInput.CertifyGood, and is useful for accessing the field via an interface. +func (v *__CertifyGoodArtifactInput) GetCertifyGood() CertifyGoodInputSpec { return v.CertifyGood } - var firstPass struct { - *allIsVulnerabilityVulnerabilityGHSA - graphql.NoUnmarshalJSON - } - firstPass.allIsVulnerabilityVulnerabilityGHSA = v +// __CertifyGoodPkgInput is used internally by genqlient +type __CertifyGoodPkgInput struct { + Pkg PkgInputSpec `json:"pkg"` + PkgMatchType *MatchFlags `json:"pkgMatchType"` + CertifyGood CertifyGoodInputSpec `json:"certifyGood"` +} - err := json.Unmarshal(b, &firstPass) - if err != nil { - return err - } +// GetPkg returns __CertifyGoodPkgInput.Pkg, and is useful for accessing the field via an interface. +func (v *__CertifyGoodPkgInput) GetPkg() PkgInputSpec { return v.Pkg } - err = json.Unmarshal( - b, &v.AllGHSATree) - if err != nil { - return err - } - return nil +// GetPkgMatchType returns __CertifyGoodPkgInput.PkgMatchType, and is useful for accessing the field via an interface. +func (v *__CertifyGoodPkgInput) GetPkgMatchType() *MatchFlags { return v.PkgMatchType } + +// GetCertifyGood returns __CertifyGoodPkgInput.CertifyGood, and is useful for accessing the field via an interface. +func (v *__CertifyGoodPkgInput) GetCertifyGood() CertifyGoodInputSpec { return v.CertifyGood } + +// __CertifyGoodSrcInput is used internally by genqlient +type __CertifyGoodSrcInput struct { + Source SourceInputSpec `json:"source"` + CertifyGood CertifyGoodInputSpec `json:"certifyGood"` } -type __premarshalallIsVulnerabilityVulnerabilityGHSA struct { - Typename *string `json:"__typename"` +// GetSource returns __CertifyGoodSrcInput.Source, and is useful for accessing the field via an interface. +func (v *__CertifyGoodSrcInput) GetSource() SourceInputSpec { return v.Source } - Id string `json:"id"` +// GetCertifyGood returns __CertifyGoodSrcInput.CertifyGood, and is useful for accessing the field via an interface. +func (v *__CertifyGoodSrcInput) GetCertifyGood() CertifyGoodInputSpec { return v.CertifyGood } - GhsaId string `json:"ghsaId"` +// __CertifyNoKnownVulnInput is used internally by genqlient +type __CertifyNoKnownVulnInput struct { + Pkg PkgInputSpec `json:"pkg"` + CertifyVuln VulnerabilityMetaDataInput `json:"certifyVuln"` } -func (v *allIsVulnerabilityVulnerabilityGHSA) MarshalJSON() ([]byte, error) { - premarshaled, err := v.__premarshalJSON() - if err != nil { - return nil, err - } - return json.Marshal(premarshaled) -} +// GetPkg returns __CertifyNoKnownVulnInput.Pkg, and is useful for accessing the field via an interface. +func (v *__CertifyNoKnownVulnInput) GetPkg() PkgInputSpec { return v.Pkg } -func (v *allIsVulnerabilityVulnerabilityGHSA) __premarshalJSON() (*__premarshalallIsVulnerabilityVulnerabilityGHSA, error) { - var retval __premarshalallIsVulnerabilityVulnerabilityGHSA +// GetCertifyVuln returns __CertifyNoKnownVulnInput.CertifyVuln, and is useful for accessing the field via an interface. +func (v *__CertifyNoKnownVulnInput) GetCertifyVuln() VulnerabilityMetaDataInput { return v.CertifyVuln } - retval.Typename = v.Typename - retval.Id = v.AllGHSATree.Id - retval.GhsaId = v.AllGHSATree.GhsaId - return &retval, nil +// __CertifyOSVInput is used internally by genqlient +type __CertifyOSVInput struct { + Pkg PkgInputSpec `json:"pkg"` + Osv OSVInputSpec `json:"osv"` + CertifyVuln VulnerabilityMetaDataInput `json:"certifyVuln"` } -// allPkgEqual includes the GraphQL fields of PkgEqual requested by the fragment allPkgEqual. -// The GraphQL type's documentation follows. -// -// PkgEqual is an attestation that a set of packages are similar. -type allPkgEqual struct { - Id string `json:"id"` - // Justification for the claim that the packages are similar - Justification string `json:"justification"` - // Collection of packages that are similar - Packages []allPkgEqualPackagesPackage `json:"packages"` - // Document from which this attestation is generated from - Origin string `json:"origin"` - // GUAC collector for the document - Collector string `json:"collector"` -} +// GetPkg returns __CertifyOSVInput.Pkg, and is useful for accessing the field via an interface. +func (v *__CertifyOSVInput) GetPkg() PkgInputSpec { return v.Pkg } -// GetId returns allPkgEqual.Id, and is useful for accessing the field via an interface. -func (v *allPkgEqual) GetId() string { return v.Id } +// GetOsv returns __CertifyOSVInput.Osv, and is useful for accessing the field via an interface. +func (v *__CertifyOSVInput) GetOsv() OSVInputSpec { return v.Osv } -// GetJustification returns allPkgEqual.Justification, and is useful for accessing the field via an interface. -func (v *allPkgEqual) GetJustification() string { return v.Justification } +// GetCertifyVuln returns __CertifyOSVInput.CertifyVuln, and is useful for accessing the field via an interface. +func (v *__CertifyOSVInput) GetCertifyVuln() VulnerabilityMetaDataInput { return v.CertifyVuln } -// GetPackages returns allPkgEqual.Packages, and is useful for accessing the field via an interface. -func (v *allPkgEqual) GetPackages() []allPkgEqualPackagesPackage { return v.Packages } +// __CertifyScorecardInput is used internally by genqlient +type __CertifyScorecardInput struct { + Source SourceInputSpec `json:"source"` + Scorecard ScorecardInputSpec `json:"scorecard"` +} -// GetOrigin returns allPkgEqual.Origin, and is useful for accessing the field via an interface. -func (v *allPkgEqual) GetOrigin() string { return v.Origin } +// GetSource returns __CertifyScorecardInput.Source, and is useful for accessing the field via an interface. +func (v *__CertifyScorecardInput) GetSource() SourceInputSpec { return v.Source } -// GetCollector returns allPkgEqual.Collector, and is useful for accessing the field via an interface. -func (v *allPkgEqual) GetCollector() string { return v.Collector } +// GetScorecard returns __CertifyScorecardInput.Scorecard, and is useful for accessing the field via an interface. +func (v *__CertifyScorecardInput) GetScorecard() ScorecardInputSpec { return v.Scorecard } -// allPkgEqualPackagesPackage includes the requested fields of the GraphQL type Package. -// The GraphQL type's documentation follows. -// -// Package represents the root of the package trie/tree. -// -// We map package information to a trie, closely matching the pURL specification -// (https://github.com/package-url/purl-spec/blob/0dd92f26f8bb11956ffdf5e8acfcee71e8560407/README.rst), -// but deviating from it where GUAC heuristics allow for better representation of -// package information. Each path in the trie fully represents a package; we split -// the trie based on the pURL components. -// -// This node matches a pkg: partial pURL. The type field matches the -// pURL types but we might also use "guac" for the cases where the pURL -// representation is not complete or when we have custom rules. -// -// Since this node is at the root of the package trie, it is named Package, not -// PackageType. -type allPkgEqualPackagesPackage struct { - AllPkgTree `json:"-"` +// __CertifyScorecardsInput is used internally by genqlient +type __CertifyScorecardsInput struct { + Sources []SourceInputSpec `json:"sources"` + Scorecards []ScorecardInputSpec `json:"scorecards"` } -// GetId returns allPkgEqualPackagesPackage.Id, and is useful for accessing the field via an interface. -func (v *allPkgEqualPackagesPackage) GetId() string { return v.AllPkgTree.Id } +// GetSources returns __CertifyScorecardsInput.Sources, and is useful for accessing the field via an interface. +func (v *__CertifyScorecardsInput) GetSources() []SourceInputSpec { return v.Sources } -// GetType returns allPkgEqualPackagesPackage.Type, and is useful for accessing the field via an interface. -func (v *allPkgEqualPackagesPackage) GetType() string { return v.AllPkgTree.Type } +// GetScorecards returns __CertifyScorecardsInput.Scorecards, and is useful for accessing the field via an interface. +func (v *__CertifyScorecardsInput) GetScorecards() []ScorecardInputSpec { return v.Scorecards } -// GetNamespaces returns allPkgEqualPackagesPackage.Namespaces, and is useful for accessing the field via an interface. -func (v *allPkgEqualPackagesPackage) GetNamespaces() []AllPkgTreeNamespacesPackageNamespace { - return v.AllPkgTree.Namespaces +// __FindSoftwareInput is used internally by genqlient +type __FindSoftwareInput struct { + SearchText string `json:"searchText"` } -func (v *allPkgEqualPackagesPackage) UnmarshalJSON(b []byte) error { - - if string(b) == "null" { - return nil - } +// GetSearchText returns __FindSoftwareInput.SearchText, and is useful for accessing the field via an interface. +func (v *__FindSoftwareInput) GetSearchText() string { return v.SearchText } - var firstPass struct { - *allPkgEqualPackagesPackage - graphql.NoUnmarshalJSON - } - firstPass.allPkgEqualPackagesPackage = v +// __GHSAsInput is used internally by genqlient +type __GHSAsInput struct { + Filter *GHSASpec `json:"filter"` +} - err := json.Unmarshal(b, &firstPass) - if err != nil { - return err - } +// GetFilter returns __GHSAsInput.Filter, and is useful for accessing the field via an interface. +func (v *__GHSAsInput) GetFilter() *GHSASpec { return v.Filter } - err = json.Unmarshal( - b, &v.AllPkgTree) - if err != nil { - return err - } - return nil +// __HasMetadataArtifactInput is used internally by genqlient +type __HasMetadataArtifactInput struct { + Artifact ArtifactInputSpec `json:"artifact"` + HasMetadata HasMetadataInputSpec `json:"hasMetadata"` } -type __premarshalallPkgEqualPackagesPackage struct { - Id string `json:"id"` +// GetArtifact returns __HasMetadataArtifactInput.Artifact, and is useful for accessing the field via an interface. +func (v *__HasMetadataArtifactInput) GetArtifact() ArtifactInputSpec { return v.Artifact } - Type string `json:"type"` +// GetHasMetadata returns __HasMetadataArtifactInput.HasMetadata, and is useful for accessing the field via an interface. +func (v *__HasMetadataArtifactInput) GetHasMetadata() HasMetadataInputSpec { return v.HasMetadata } - Namespaces []AllPkgTreeNamespacesPackageNamespace `json:"namespaces"` +// __HasMetadataPkgInput is used internally by genqlient +type __HasMetadataPkgInput struct { + Pkg PkgInputSpec `json:"pkg"` + PkgMatchType *MatchFlags `json:"pkgMatchType"` + HasMetadata HasMetadataInputSpec `json:"hasMetadata"` } -func (v *allPkgEqualPackagesPackage) MarshalJSON() ([]byte, error) { - premarshaled, err := v.__premarshalJSON() - if err != nil { - return nil, err - } - return json.Marshal(premarshaled) -} +// GetPkg returns __HasMetadataPkgInput.Pkg, and is useful for accessing the field via an interface. +func (v *__HasMetadataPkgInput) GetPkg() PkgInputSpec { return v.Pkg } -func (v *allPkgEqualPackagesPackage) __premarshalJSON() (*__premarshalallPkgEqualPackagesPackage, error) { - var retval __premarshalallPkgEqualPackagesPackage +// GetPkgMatchType returns __HasMetadataPkgInput.PkgMatchType, and is useful for accessing the field via an interface. +func (v *__HasMetadataPkgInput) GetPkgMatchType() *MatchFlags { return v.PkgMatchType } - retval.Id = v.AllPkgTree.Id - retval.Type = v.AllPkgTree.Type - retval.Namespaces = v.AllPkgTree.Namespaces - return &retval, nil -} +// GetHasMetadata returns __HasMetadataPkgInput.HasMetadata, and is useful for accessing the field via an interface. +func (v *__HasMetadataPkgInput) GetHasMetadata() HasMetadataInputSpec { return v.HasMetadata } -// allPointOfContact includes the GraphQL fields of PointOfContact requested by the fragment allPointOfContact. -// The GraphQL type's documentation follows. -// -// PointOfContact is an attestation of how to get in touch with the person(s) responsible -// for a package, source, or artifact. -// -// All evidence trees record a justification for the property they represent as -// well as the document that contains the attestation (origin) and the collector -// that collected the document (collector). -// -// The attestation applies to a subject which is a package, source, or artifact. -// If the attestation targets a package, it must target a PackageName or a -// PackageVersion. If the attestation targets a source, it must target a -// SourceName. -// -// email is the email address (singular) of the point of contact. -// -// info is additional contact information other than email address. This is free -// form. -// -// NOTE: the identifiers for point of contact should be part of software trees. -// This will benefit from identifier look up and traversal as well as organization -// hierarchy. However, until the use case arises, PointOfContact will be a flat -// reference to the contact details. -type allPointOfContact struct { - Id string `json:"id"` - Subject allPointOfContactSubjectPackageSourceOrArtifact `json:"-"` - Email string `json:"email"` - Info string `json:"info"` - Since time.Time `json:"since"` - Justification string `json:"justification"` - Origin string `json:"origin"` - Collector string `json:"collector"` +// __HasMetadataSrcInput is used internally by genqlient +type __HasMetadataSrcInput struct { + Source SourceInputSpec `json:"source"` + HasMetadata HasMetadataInputSpec `json:"hasMetadata"` } -// GetId returns allPointOfContact.Id, and is useful for accessing the field via an interface. -func (v *allPointOfContact) GetId() string { return v.Id } +// GetSource returns __HasMetadataSrcInput.Source, and is useful for accessing the field via an interface. +func (v *__HasMetadataSrcInput) GetSource() SourceInputSpec { return v.Source } -// GetSubject returns allPointOfContact.Subject, and is useful for accessing the field via an interface. -func (v *allPointOfContact) GetSubject() allPointOfContactSubjectPackageSourceOrArtifact { - return v.Subject +// GetHasMetadata returns __HasMetadataSrcInput.HasMetadata, and is useful for accessing the field via an interface. +func (v *__HasMetadataSrcInput) GetHasMetadata() HasMetadataInputSpec { return v.HasMetadata } + +// __HasSBOMArtifactInput is used internally by genqlient +type __HasSBOMArtifactInput struct { + Artifact ArtifactInputSpec `json:"artifact"` + HasSBOM HasSBOMInputSpec `json:"hasSBOM"` } -// GetEmail returns allPointOfContact.Email, and is useful for accessing the field via an interface. -func (v *allPointOfContact) GetEmail() string { return v.Email } +// GetArtifact returns __HasSBOMArtifactInput.Artifact, and is useful for accessing the field via an interface. +func (v *__HasSBOMArtifactInput) GetArtifact() ArtifactInputSpec { return v.Artifact } -// GetInfo returns allPointOfContact.Info, and is useful for accessing the field via an interface. -func (v *allPointOfContact) GetInfo() string { return v.Info } +// GetHasSBOM returns __HasSBOMArtifactInput.HasSBOM, and is useful for accessing the field via an interface. +func (v *__HasSBOMArtifactInput) GetHasSBOM() HasSBOMInputSpec { return v.HasSBOM } -// GetSince returns allPointOfContact.Since, and is useful for accessing the field via an interface. -func (v *allPointOfContact) GetSince() time.Time { return v.Since } +// __HasSBOMPkgInput is used internally by genqlient +type __HasSBOMPkgInput struct { + Pkg PkgInputSpec `json:"pkg"` + HasSBOM HasSBOMInputSpec `json:"hasSBOM"` +} -// GetJustification returns allPointOfContact.Justification, and is useful for accessing the field via an interface. -func (v *allPointOfContact) GetJustification() string { return v.Justification } +// GetPkg returns __HasSBOMPkgInput.Pkg, and is useful for accessing the field via an interface. +func (v *__HasSBOMPkgInput) GetPkg() PkgInputSpec { return v.Pkg } -// GetOrigin returns allPointOfContact.Origin, and is useful for accessing the field via an interface. -func (v *allPointOfContact) GetOrigin() string { return v.Origin } +// GetHasSBOM returns __HasSBOMPkgInput.HasSBOM, and is useful for accessing the field via an interface. +func (v *__HasSBOMPkgInput) GetHasSBOM() HasSBOMInputSpec { return v.HasSBOM } -// GetCollector returns allPointOfContact.Collector, and is useful for accessing the field via an interface. -func (v *allPointOfContact) GetCollector() string { return v.Collector } +// __HasSourceAtInput is used internally by genqlient +type __HasSourceAtInput struct { + Pkg PkgInputSpec `json:"pkg"` + PkgMatchType MatchFlags `json:"pkgMatchType"` + Source SourceInputSpec `json:"source"` + HasSourceAt HasSourceAtInputSpec `json:"hasSourceAt"` +} -func (v *allPointOfContact) UnmarshalJSON(b []byte) error { +// GetPkg returns __HasSourceAtInput.Pkg, and is useful for accessing the field via an interface. +func (v *__HasSourceAtInput) GetPkg() PkgInputSpec { return v.Pkg } - if string(b) == "null" { - return nil - } +// GetPkgMatchType returns __HasSourceAtInput.PkgMatchType, and is useful for accessing the field via an interface. +func (v *__HasSourceAtInput) GetPkgMatchType() MatchFlags { return v.PkgMatchType } - var firstPass struct { - *allPointOfContact - Subject json.RawMessage `json:"subject"` - graphql.NoUnmarshalJSON - } - firstPass.allPointOfContact = v +// GetSource returns __HasSourceAtInput.Source, and is useful for accessing the field via an interface. +func (v *__HasSourceAtInput) GetSource() SourceInputSpec { return v.Source } - err := json.Unmarshal(b, &firstPass) - if err != nil { - return err - } +// GetHasSourceAt returns __HasSourceAtInput.HasSourceAt, and is useful for accessing the field via an interface. +func (v *__HasSourceAtInput) GetHasSourceAt() HasSourceAtInputSpec { return v.HasSourceAt } - { - dst := &v.Subject - src := firstPass.Subject - if len(src) != 0 && string(src) != "null" { - err = __unmarshalallPointOfContactSubjectPackageSourceOrArtifact( - src, dst) - if err != nil { - return fmt.Errorf( - "unable to unmarshal allPointOfContact.Subject: %w", err) - } - } - } - return nil +// __HashEqualInput is used internally by genqlient +type __HashEqualInput struct { + Artifact ArtifactInputSpec `json:"artifact"` + OtherArtifact ArtifactInputSpec `json:"otherArtifact"` + HashEqual HashEqualInputSpec `json:"hashEqual"` } -type __premarshalallPointOfContact struct { - Id string `json:"id"` - - Subject json.RawMessage `json:"subject"` - - Email string `json:"email"` +// GetArtifact returns __HashEqualInput.Artifact, and is useful for accessing the field via an interface. +func (v *__HashEqualInput) GetArtifact() ArtifactInputSpec { return v.Artifact } - Info string `json:"info"` +// GetOtherArtifact returns __HashEqualInput.OtherArtifact, and is useful for accessing the field via an interface. +func (v *__HashEqualInput) GetOtherArtifact() ArtifactInputSpec { return v.OtherArtifact } - Since time.Time `json:"since"` +// GetHashEqual returns __HashEqualInput.HashEqual, and is useful for accessing the field via an interface. +func (v *__HashEqualInput) GetHashEqual() HashEqualInputSpec { return v.HashEqual } - Justification string `json:"justification"` +// __IngestArtifactInput is used internally by genqlient +type __IngestArtifactInput struct { + Artifact ArtifactInputSpec `json:"artifact"` +} - Origin string `json:"origin"` +// GetArtifact returns __IngestArtifactInput.Artifact, and is useful for accessing the field via an interface. +func (v *__IngestArtifactInput) GetArtifact() ArtifactInputSpec { return v.Artifact } - Collector string `json:"collector"` +// __IngestArtifactsInput is used internally by genqlient +type __IngestArtifactsInput struct { + Artifacts []ArtifactInputSpec `json:"artifacts"` } -func (v *allPointOfContact) MarshalJSON() ([]byte, error) { - premarshaled, err := v.__premarshalJSON() - if err != nil { - return nil, err - } - return json.Marshal(premarshaled) -} +// GetArtifacts returns __IngestArtifactsInput.Artifacts, and is useful for accessing the field via an interface. +func (v *__IngestArtifactsInput) GetArtifacts() []ArtifactInputSpec { return v.Artifacts } -func (v *allPointOfContact) __premarshalJSON() (*__premarshalallPointOfContact, error) { - var retval __premarshalallPointOfContact +// __IngestBuilderInput is used internally by genqlient +type __IngestBuilderInput struct { + Builder BuilderInputSpec `json:"builder"` +} - retval.Id = v.Id - { +// GetBuilder returns __IngestBuilderInput.Builder, and is useful for accessing the field via an interface. +func (v *__IngestBuilderInput) GetBuilder() BuilderInputSpec { return v.Builder } - dst := &retval.Subject - src := v.Subject - var err error - *dst, err = __marshalallPointOfContactSubjectPackageSourceOrArtifact( - &src) - if err != nil { - return nil, fmt.Errorf( - "unable to marshal allPointOfContact.Subject: %w", err) - } - } - retval.Email = v.Email - retval.Info = v.Info - retval.Since = v.Since - retval.Justification = v.Justification - retval.Origin = v.Origin - retval.Collector = v.Collector - return &retval, nil +// __IngestBuildersInput is used internally by genqlient +type __IngestBuildersInput struct { + Builders []BuilderInputSpec `json:"builders"` } -// allPointOfContactSubjectArtifact includes the requested fields of the GraphQL type Artifact. -// The GraphQL type's documentation follows. -// -// Artifact represents an artifact identified by a checksum hash. -// -// The checksum is split into the digest value and the algorithm used to generate -// it. Both fields are mandatory and canonicalized to be lowercase. -// -// If having a checksum Go object, algorithm can be -// strings.ToLower(string(checksum.Algorithm)) and digest can be checksum.Value. -type allPointOfContactSubjectArtifact struct { - Typename *string `json:"__typename"` - AllArtifactTree `json:"-"` +// GetBuilders returns __IngestBuildersInput.Builders, and is useful for accessing the field via an interface. +func (v *__IngestBuildersInput) GetBuilders() []BuilderInputSpec { return v.Builders } + +// __IngestCVEInput is used internally by genqlient +type __IngestCVEInput struct { + Cve CVEInputSpec `json:"cve"` } -// GetTypename returns allPointOfContactSubjectArtifact.Typename, and is useful for accessing the field via an interface. -func (v *allPointOfContactSubjectArtifact) GetTypename() *string { return v.Typename } +// GetCve returns __IngestCVEInput.Cve, and is useful for accessing the field via an interface. +func (v *__IngestCVEInput) GetCve() CVEInputSpec { return v.Cve } -// GetId returns allPointOfContactSubjectArtifact.Id, and is useful for accessing the field via an interface. -func (v *allPointOfContactSubjectArtifact) GetId() string { return v.AllArtifactTree.Id } +// __IngestCVEsInput is used internally by genqlient +type __IngestCVEsInput struct { + Cves []CVEInputSpec `json:"cves"` +} -// GetAlgorithm returns allPointOfContactSubjectArtifact.Algorithm, and is useful for accessing the field via an interface. -func (v *allPointOfContactSubjectArtifact) GetAlgorithm() string { return v.AllArtifactTree.Algorithm } +// GetCves returns __IngestCVEsInput.Cves, and is useful for accessing the field via an interface. +func (v *__IngestCVEsInput) GetCves() []CVEInputSpec { return v.Cves } -// GetDigest returns allPointOfContactSubjectArtifact.Digest, and is useful for accessing the field via an interface. -func (v *allPointOfContactSubjectArtifact) GetDigest() string { return v.AllArtifactTree.Digest } +// __IngestGHSAInput is used internally by genqlient +type __IngestGHSAInput struct { + Ghsa GHSAInputSpec `json:"ghsa"` +} -func (v *allPointOfContactSubjectArtifact) UnmarshalJSON(b []byte) error { +// GetGhsa returns __IngestGHSAInput.Ghsa, and is useful for accessing the field via an interface. +func (v *__IngestGHSAInput) GetGhsa() GHSAInputSpec { return v.Ghsa } - if string(b) == "null" { - return nil - } +// __IngestGHSAsInput is used internally by genqlient +type __IngestGHSAsInput struct { + Ghsas []GHSAInputSpec `json:"ghsas"` +} - var firstPass struct { - *allPointOfContactSubjectArtifact - graphql.NoUnmarshalJSON - } - firstPass.allPointOfContactSubjectArtifact = v +// GetGhsas returns __IngestGHSAsInput.Ghsas, and is useful for accessing the field via an interface. +func (v *__IngestGHSAsInput) GetGhsas() []GHSAInputSpec { return v.Ghsas } - err := json.Unmarshal(b, &firstPass) - if err != nil { - return err - } +// __IngestOSVInput is used internally by genqlient +type __IngestOSVInput struct { + Osv OSVInputSpec `json:"osv"` +} - err = json.Unmarshal( - b, &v.AllArtifactTree) - if err != nil { - return err - } - return nil +// GetOsv returns __IngestOSVInput.Osv, and is useful for accessing the field via an interface. +func (v *__IngestOSVInput) GetOsv() OSVInputSpec { return v.Osv } + +// __IngestOSVsInput is used internally by genqlient +type __IngestOSVsInput struct { + Osvs []OSVInputSpec `json:"osvs"` } -type __premarshalallPointOfContactSubjectArtifact struct { - Typename *string `json:"__typename"` +// GetOsvs returns __IngestOSVsInput.Osvs, and is useful for accessing the field via an interface. +func (v *__IngestOSVsInput) GetOsvs() []OSVInputSpec { return v.Osvs } - Id string `json:"id"` +// __IngestPackageInput is used internally by genqlient +type __IngestPackageInput struct { + Pkg PkgInputSpec `json:"pkg"` +} - Algorithm string `json:"algorithm"` +// GetPkg returns __IngestPackageInput.Pkg, and is useful for accessing the field via an interface. +func (v *__IngestPackageInput) GetPkg() PkgInputSpec { return v.Pkg } - Digest string `json:"digest"` +// __IngestPackagesInput is used internally by genqlient +type __IngestPackagesInput struct { + Pkgs []PkgInputSpec `json:"pkgs"` } -func (v *allPointOfContactSubjectArtifact) MarshalJSON() ([]byte, error) { - premarshaled, err := v.__premarshalJSON() - if err != nil { - return nil, err - } - return json.Marshal(premarshaled) +// GetPkgs returns __IngestPackagesInput.Pkgs, and is useful for accessing the field via an interface. +func (v *__IngestPackagesInput) GetPkgs() []PkgInputSpec { return v.Pkgs } + +// __IngestSourceInput is used internally by genqlient +type __IngestSourceInput struct { + Source SourceInputSpec `json:"source"` } -func (v *allPointOfContactSubjectArtifact) __premarshalJSON() (*__premarshalallPointOfContactSubjectArtifact, error) { - var retval __premarshalallPointOfContactSubjectArtifact +// GetSource returns __IngestSourceInput.Source, and is useful for accessing the field via an interface. +func (v *__IngestSourceInput) GetSource() SourceInputSpec { return v.Source } - retval.Typename = v.Typename - retval.Id = v.AllArtifactTree.Id - retval.Algorithm = v.AllArtifactTree.Algorithm - retval.Digest = v.AllArtifactTree.Digest - return &retval, nil +// __IngestSourcesInput is used internally by genqlient +type __IngestSourcesInput struct { + Sources []SourceInputSpec `json:"sources"` } -// allPointOfContactSubjectPackage includes the requested fields of the GraphQL type Package. -// The GraphQL type's documentation follows. -// -// Package represents the root of the package trie/tree. -// -// We map package information to a trie, closely matching the pURL specification -// (https://github.com/package-url/purl-spec/blob/0dd92f26f8bb11956ffdf5e8acfcee71e8560407/README.rst), -// but deviating from it where GUAC heuristics allow for better representation of -// package information. Each path in the trie fully represents a package; we split -// the trie based on the pURL components. -// -// This node matches a pkg: partial pURL. The type field matches the -// pURL types but we might also use "guac" for the cases where the pURL -// representation is not complete or when we have custom rules. -// -// Since this node is at the root of the package trie, it is named Package, not -// PackageType. -type allPointOfContactSubjectPackage struct { - Typename *string `json:"__typename"` - AllPkgTree `json:"-"` +// GetSources returns __IngestSourcesInput.Sources, and is useful for accessing the field via an interface. +func (v *__IngestSourcesInput) GetSources() []SourceInputSpec { return v.Sources } + +// __IsDependenciesInput is used internally by genqlient +type __IsDependenciesInput struct { + Pkgs []PkgInputSpec `json:"pkgs"` + DepPkgs []PkgInputSpec `json:"depPkgs"` + Dependencies []IsDependencyInputSpec `json:"dependencies"` } -// GetTypename returns allPointOfContactSubjectPackage.Typename, and is useful for accessing the field via an interface. -func (v *allPointOfContactSubjectPackage) GetTypename() *string { return v.Typename } +// GetPkgs returns __IsDependenciesInput.Pkgs, and is useful for accessing the field via an interface. +func (v *__IsDependenciesInput) GetPkgs() []PkgInputSpec { return v.Pkgs } -// GetId returns allPointOfContactSubjectPackage.Id, and is useful for accessing the field via an interface. -func (v *allPointOfContactSubjectPackage) GetId() string { return v.AllPkgTree.Id } +// GetDepPkgs returns __IsDependenciesInput.DepPkgs, and is useful for accessing the field via an interface. +func (v *__IsDependenciesInput) GetDepPkgs() []PkgInputSpec { return v.DepPkgs } -// GetType returns allPointOfContactSubjectPackage.Type, and is useful for accessing the field via an interface. -func (v *allPointOfContactSubjectPackage) GetType() string { return v.AllPkgTree.Type } +// GetDependencies returns __IsDependenciesInput.Dependencies, and is useful for accessing the field via an interface. +func (v *__IsDependenciesInput) GetDependencies() []IsDependencyInputSpec { return v.Dependencies } -// GetNamespaces returns allPointOfContactSubjectPackage.Namespaces, and is useful for accessing the field via an interface. -func (v *allPointOfContactSubjectPackage) GetNamespaces() []AllPkgTreeNamespacesPackageNamespace { - return v.AllPkgTree.Namespaces +// __IsDependencyInput is used internally by genqlient +type __IsDependencyInput struct { + Pkg PkgInputSpec `json:"pkg"` + DepPkg PkgInputSpec `json:"depPkg"` + Dependency IsDependencyInputSpec `json:"dependency"` } -func (v *allPointOfContactSubjectPackage) UnmarshalJSON(b []byte) error { - - if string(b) == "null" { - return nil - } +// GetPkg returns __IsDependencyInput.Pkg, and is useful for accessing the field via an interface. +func (v *__IsDependencyInput) GetPkg() PkgInputSpec { return v.Pkg } - var firstPass struct { - *allPointOfContactSubjectPackage - graphql.NoUnmarshalJSON - } - firstPass.allPointOfContactSubjectPackage = v +// GetDepPkg returns __IsDependencyInput.DepPkg, and is useful for accessing the field via an interface. +func (v *__IsDependencyInput) GetDepPkg() PkgInputSpec { return v.DepPkg } - err := json.Unmarshal(b, &firstPass) - if err != nil { - return err - } +// GetDependency returns __IsDependencyInput.Dependency, and is useful for accessing the field via an interface. +func (v *__IsDependencyInput) GetDependency() IsDependencyInputSpec { return v.Dependency } - err = json.Unmarshal( - b, &v.AllPkgTree) - if err != nil { - return err - } - return nil +// __IsOccurrencePkgInput is used internally by genqlient +type __IsOccurrencePkgInput struct { + Pkg PkgInputSpec `json:"pkg"` + Artifact ArtifactInputSpec `json:"artifact"` + Occurrence IsOccurrenceInputSpec `json:"occurrence"` } -type __premarshalallPointOfContactSubjectPackage struct { - Typename *string `json:"__typename"` +// GetPkg returns __IsOccurrencePkgInput.Pkg, and is useful for accessing the field via an interface. +func (v *__IsOccurrencePkgInput) GetPkg() PkgInputSpec { return v.Pkg } - Id string `json:"id"` +// GetArtifact returns __IsOccurrencePkgInput.Artifact, and is useful for accessing the field via an interface. +func (v *__IsOccurrencePkgInput) GetArtifact() ArtifactInputSpec { return v.Artifact } - Type string `json:"type"` +// GetOccurrence returns __IsOccurrencePkgInput.Occurrence, and is useful for accessing the field via an interface. +func (v *__IsOccurrencePkgInput) GetOccurrence() IsOccurrenceInputSpec { return v.Occurrence } - Namespaces []AllPkgTreeNamespacesPackageNamespace `json:"namespaces"` +// __IsOccurrenceSrcInput is used internally by genqlient +type __IsOccurrenceSrcInput struct { + Source SourceInputSpec `json:"source"` + Artifact ArtifactInputSpec `json:"artifact"` + Occurrence IsOccurrenceInputSpec `json:"occurrence"` } -func (v *allPointOfContactSubjectPackage) MarshalJSON() ([]byte, error) { - premarshaled, err := v.__premarshalJSON() - if err != nil { - return nil, err - } - return json.Marshal(premarshaled) +// GetSource returns __IsOccurrenceSrcInput.Source, and is useful for accessing the field via an interface. +func (v *__IsOccurrenceSrcInput) GetSource() SourceInputSpec { return v.Source } + +// GetArtifact returns __IsOccurrenceSrcInput.Artifact, and is useful for accessing the field via an interface. +func (v *__IsOccurrenceSrcInput) GetArtifact() ArtifactInputSpec { return v.Artifact } + +// GetOccurrence returns __IsOccurrenceSrcInput.Occurrence, and is useful for accessing the field via an interface. +func (v *__IsOccurrenceSrcInput) GetOccurrence() IsOccurrenceInputSpec { return v.Occurrence } + +// __IsOccurrencesPkgInput is used internally by genqlient +type __IsOccurrencesPkgInput struct { + Pkgs []PkgInputSpec `json:"pkgs"` + Artifacts []ArtifactInputSpec `json:"artifacts"` + Occurrences []IsOccurrenceInputSpec `json:"occurrences"` } -func (v *allPointOfContactSubjectPackage) __premarshalJSON() (*__premarshalallPointOfContactSubjectPackage, error) { - var retval __premarshalallPointOfContactSubjectPackage +// GetPkgs returns __IsOccurrencesPkgInput.Pkgs, and is useful for accessing the field via an interface. +func (v *__IsOccurrencesPkgInput) GetPkgs() []PkgInputSpec { return v.Pkgs } + +// GetArtifacts returns __IsOccurrencesPkgInput.Artifacts, and is useful for accessing the field via an interface. +func (v *__IsOccurrencesPkgInput) GetArtifacts() []ArtifactInputSpec { return v.Artifacts } - retval.Typename = v.Typename - retval.Id = v.AllPkgTree.Id - retval.Type = v.AllPkgTree.Type - retval.Namespaces = v.AllPkgTree.Namespaces - return &retval, nil -} +// GetOccurrences returns __IsOccurrencesPkgInput.Occurrences, and is useful for accessing the field via an interface. +func (v *__IsOccurrencesPkgInput) GetOccurrences() []IsOccurrenceInputSpec { return v.Occurrences } -// allPointOfContactSubjectPackageSourceOrArtifact includes the requested fields of the GraphQL interface PackageSourceOrArtifact. -// -// allPointOfContactSubjectPackageSourceOrArtifact is implemented by the following types: -// allPointOfContactSubjectArtifact -// allPointOfContactSubjectPackage -// allPointOfContactSubjectSource -// The GraphQL type's documentation follows. -// -// PackageSourceOrArtifact is a union of Package, Source, and Artifact. -type allPointOfContactSubjectPackageSourceOrArtifact interface { - implementsGraphQLInterfaceallPointOfContactSubjectPackageSourceOrArtifact() - // GetTypename returns the receiver's concrete GraphQL type-name (see interface doc for possible values). - GetTypename() *string +// __IsOccurrencesSrcInput is used internally by genqlient +type __IsOccurrencesSrcInput struct { + Sources []SourceInputSpec `json:"sources"` + Artifacts []ArtifactInputSpec `json:"artifacts"` + Occurrences []IsOccurrenceInputSpec `json:"occurrences"` } -func (v *allPointOfContactSubjectArtifact) implementsGraphQLInterfaceallPointOfContactSubjectPackageSourceOrArtifact() { -} -func (v *allPointOfContactSubjectPackage) implementsGraphQLInterfaceallPointOfContactSubjectPackageSourceOrArtifact() { -} -func (v *allPointOfContactSubjectSource) implementsGraphQLInterfaceallPointOfContactSubjectPackageSourceOrArtifact() { -} +// GetSources returns __IsOccurrencesSrcInput.Sources, and is useful for accessing the field via an interface. +func (v *__IsOccurrencesSrcInput) GetSources() []SourceInputSpec { return v.Sources } -func __unmarshalallPointOfContactSubjectPackageSourceOrArtifact(b []byte, v *allPointOfContactSubjectPackageSourceOrArtifact) error { - if string(b) == "null" { - return nil - } +// GetArtifacts returns __IsOccurrencesSrcInput.Artifacts, and is useful for accessing the field via an interface. +func (v *__IsOccurrencesSrcInput) GetArtifacts() []ArtifactInputSpec { return v.Artifacts } - var tn struct { - TypeName string `json:"__typename"` - } - err := json.Unmarshal(b, &tn) - if err != nil { - return err - } +// GetOccurrences returns __IsOccurrencesSrcInput.Occurrences, and is useful for accessing the field via an interface. +func (v *__IsOccurrencesSrcInput) GetOccurrences() []IsOccurrenceInputSpec { return v.Occurrences } - switch tn.TypeName { - case "Artifact": - *v = new(allPointOfContactSubjectArtifact) - return json.Unmarshal(b, *v) - case "Package": - *v = new(allPointOfContactSubjectPackage) - return json.Unmarshal(b, *v) - case "Source": - *v = new(allPointOfContactSubjectSource) - return json.Unmarshal(b, *v) - case "": - return fmt.Errorf( - "response was missing PackageSourceOrArtifact.__typename") - default: - return fmt.Errorf( - `unexpected concrete type for allPointOfContactSubjectPackageSourceOrArtifact: "%v"`, tn.TypeName) - } +// __IsVulnerabilityCVEInput is used internally by genqlient +type __IsVulnerabilityCVEInput struct { + Osv OSVInputSpec `json:"osv"` + Cve CVEInputSpec `json:"cve"` + IsVulnerability IsVulnerabilityInputSpec `json:"isVulnerability"` } -func __marshalallPointOfContactSubjectPackageSourceOrArtifact(v *allPointOfContactSubjectPackageSourceOrArtifact) ([]byte, error) { - - var typename string - switch v := (*v).(type) { - case *allPointOfContactSubjectArtifact: - typename = "Artifact" - - premarshaled, err := v.__premarshalJSON() - if err != nil { - return nil, err - } - result := struct { - TypeName string `json:"__typename"` - *__premarshalallPointOfContactSubjectArtifact - }{typename, premarshaled} - return json.Marshal(result) - case *allPointOfContactSubjectPackage: - typename = "Package" +// GetOsv returns __IsVulnerabilityCVEInput.Osv, and is useful for accessing the field via an interface. +func (v *__IsVulnerabilityCVEInput) GetOsv() OSVInputSpec { return v.Osv } - premarshaled, err := v.__premarshalJSON() - if err != nil { - return nil, err - } - result := struct { - TypeName string `json:"__typename"` - *__premarshalallPointOfContactSubjectPackage - }{typename, premarshaled} - return json.Marshal(result) - case *allPointOfContactSubjectSource: - typename = "Source" +// GetCve returns __IsVulnerabilityCVEInput.Cve, and is useful for accessing the field via an interface. +func (v *__IsVulnerabilityCVEInput) GetCve() CVEInputSpec { return v.Cve } - premarshaled, err := v.__premarshalJSON() - if err != nil { - return nil, err - } - result := struct { - TypeName string `json:"__typename"` - *__premarshalallPointOfContactSubjectSource - }{typename, premarshaled} - return json.Marshal(result) - case nil: - return []byte("null"), nil - default: - return nil, fmt.Errorf( - `unexpected concrete type for allPointOfContactSubjectPackageSourceOrArtifact: "%T"`, v) - } +// GetIsVulnerability returns __IsVulnerabilityCVEInput.IsVulnerability, and is useful for accessing the field via an interface. +func (v *__IsVulnerabilityCVEInput) GetIsVulnerability() IsVulnerabilityInputSpec { + return v.IsVulnerability } -// allPointOfContactSubjectSource includes the requested fields of the GraphQL type Source. -// The GraphQL type's documentation follows. -// -// Source represents the root of the source trie/tree. -// -// We map source information to a trie, as a derivative of the pURL specification: -// each path in the trie represents a type, namespace, name and an optional -// qualifier that stands for tag/commit information. -// -// This node represents the type part of the trie path. It is used to represent -// the version control system that is being used. -// -// Since this node is at the root of the source trie, it is named Source, not -// SourceType. -type allPointOfContactSubjectSource struct { - Typename *string `json:"__typename"` - AllSourceTree `json:"-"` +// __IsVulnerabilityGHSAInput is used internally by genqlient +type __IsVulnerabilityGHSAInput struct { + Osv OSVInputSpec `json:"osv"` + Ghsa GHSAInputSpec `json:"ghsa"` + IsVulnerability IsVulnerabilityInputSpec `json:"isVulnerability"` } -// GetTypename returns allPointOfContactSubjectSource.Typename, and is useful for accessing the field via an interface. -func (v *allPointOfContactSubjectSource) GetTypename() *string { return v.Typename } - -// GetId returns allPointOfContactSubjectSource.Id, and is useful for accessing the field via an interface. -func (v *allPointOfContactSubjectSource) GetId() string { return v.AllSourceTree.Id } +// GetOsv returns __IsVulnerabilityGHSAInput.Osv, and is useful for accessing the field via an interface. +func (v *__IsVulnerabilityGHSAInput) GetOsv() OSVInputSpec { return v.Osv } -// GetType returns allPointOfContactSubjectSource.Type, and is useful for accessing the field via an interface. -func (v *allPointOfContactSubjectSource) GetType() string { return v.AllSourceTree.Type } +// GetGhsa returns __IsVulnerabilityGHSAInput.Ghsa, and is useful for accessing the field via an interface. +func (v *__IsVulnerabilityGHSAInput) GetGhsa() GHSAInputSpec { return v.Ghsa } -// GetNamespaces returns allPointOfContactSubjectSource.Namespaces, and is useful for accessing the field via an interface. -func (v *allPointOfContactSubjectSource) GetNamespaces() []AllSourceTreeNamespacesSourceNamespace { - return v.AllSourceTree.Namespaces +// GetIsVulnerability returns __IsVulnerabilityGHSAInput.IsVulnerability, and is useful for accessing the field via an interface. +func (v *__IsVulnerabilityGHSAInput) GetIsVulnerability() IsVulnerabilityInputSpec { + return v.IsVulnerability } -func (v *allPointOfContactSubjectSource) UnmarshalJSON(b []byte) error { - - if string(b) == "null" { - return nil - } +// __NeighborsInput is used internally by genqlient +type __NeighborsInput struct { + Node string `json:"node"` + UsingOnly []Edge `json:"usingOnly"` +} - var firstPass struct { - *allPointOfContactSubjectSource - graphql.NoUnmarshalJSON - } - firstPass.allPointOfContactSubjectSource = v +// GetNode returns __NeighborsInput.Node, and is useful for accessing the field via an interface. +func (v *__NeighborsInput) GetNode() string { return v.Node } - err := json.Unmarshal(b, &firstPass) - if err != nil { - return err - } +// GetUsingOnly returns __NeighborsInput.UsingOnly, and is useful for accessing the field via an interface. +func (v *__NeighborsInput) GetUsingOnly() []Edge { return v.UsingOnly } - err = json.Unmarshal( - b, &v.AllSourceTree) - if err != nil { - return err - } - return nil +// __NodeInput is used internally by genqlient +type __NodeInput struct { + Node string `json:"node"` } -type __premarshalallPointOfContactSubjectSource struct { - Typename *string `json:"__typename"` +// GetNode returns __NodeInput.Node, and is useful for accessing the field via an interface. +func (v *__NodeInput) GetNode() string { return v.Node } - Id string `json:"id"` +// __NodesInput is used internally by genqlient +type __NodesInput struct { + Nodes []string `json:"nodes"` +} - Type string `json:"type"` +// GetNodes returns __NodesInput.Nodes, and is useful for accessing the field via an interface. +func (v *__NodesInput) GetNodes() []string { return v.Nodes } - Namespaces []AllSourceTreeNamespacesSourceNamespace `json:"namespaces"` +// __OSVsInput is used internally by genqlient +type __OSVsInput struct { + Filter *OSVSpec `json:"filter"` } -func (v *allPointOfContactSubjectSource) MarshalJSON() ([]byte, error) { - premarshaled, err := v.__premarshalJSON() - if err != nil { - return nil, err - } - return json.Marshal(premarshaled) +// GetFilter returns __OSVsInput.Filter, and is useful for accessing the field via an interface. +func (v *__OSVsInput) GetFilter() *OSVSpec { return v.Filter } + +// __PackagesInput is used internally by genqlient +type __PackagesInput struct { + Filter *PkgSpec `json:"filter"` } -func (v *allPointOfContactSubjectSource) __premarshalJSON() (*__premarshalallPointOfContactSubjectSource, error) { - var retval __premarshalallPointOfContactSubjectSource +// GetFilter returns __PackagesInput.Filter, and is useful for accessing the field via an interface. +func (v *__PackagesInput) GetFilter() *PkgSpec { return v.Filter } - retval.Typename = v.Typename - retval.Id = v.AllSourceTree.Id - retval.Type = v.AllSourceTree.Type - retval.Namespaces = v.AllSourceTree.Namespaces - return &retval, nil +// __PathInput is used internally by genqlient +type __PathInput struct { + Subject string `json:"subject"` + Target string `json:"target"` + MaxPathLength int `json:"maxPathLength"` + UsingOnly []Edge `json:"usingOnly"` } -// allSLSATree includes the GraphQL fields of HasSLSA requested by the fragment allSLSATree. -// The GraphQL type's documentation follows. -// -// HasSLSA records that a subject node has a SLSA attestation. -type allSLSATree struct { - Id string `json:"id"` - // The subject of SLSA attestation - Subject allSLSATreeSubjectArtifact `json:"subject"` - // The SLSA attestation - Slsa allSLSATreeSlsaSLSA `json:"slsa"` -} +// GetSubject returns __PathInput.Subject, and is useful for accessing the field via an interface. +func (v *__PathInput) GetSubject() string { return v.Subject } -// GetId returns allSLSATree.Id, and is useful for accessing the field via an interface. -func (v *allSLSATree) GetId() string { return v.Id } +// GetTarget returns __PathInput.Target, and is useful for accessing the field via an interface. +func (v *__PathInput) GetTarget() string { return v.Target } -// GetSubject returns allSLSATree.Subject, and is useful for accessing the field via an interface. -func (v *allSLSATree) GetSubject() allSLSATreeSubjectArtifact { return v.Subject } +// GetMaxPathLength returns __PathInput.MaxPathLength, and is useful for accessing the field via an interface. +func (v *__PathInput) GetMaxPathLength() int { return v.MaxPathLength } -// GetSlsa returns allSLSATree.Slsa, and is useful for accessing the field via an interface. -func (v *allSLSATree) GetSlsa() allSLSATreeSlsaSLSA { return v.Slsa } +// GetUsingOnly returns __PathInput.UsingOnly, and is useful for accessing the field via an interface. +func (v *__PathInput) GetUsingOnly() []Edge { return v.UsingOnly } -// allSLSATreeSlsaSLSA includes the requested fields of the GraphQL type SLSA. -// The GraphQL type's documentation follows. -// -// SLSA contains all of the fields present in a SLSA attestation. -// -// The materials and builders are objects of the HasSLSA predicate, everything -// else are properties extracted from the attestation. -// -// We also include fields to specify under what conditions the check was performed -// (time of scan, version of scanners, etc.) as well as how this information got -// included into GUAC (origin document and the collector for that document). -type allSLSATreeSlsaSLSA struct { - // Materials of the build resulting in subject - BuiltFrom []allSLSATreeSlsaSLSABuiltFromArtifact `json:"builtFrom"` - // Builder performing the build - BuiltBy allSLSATreeSlsaSLSABuiltByBuilder `json:"builtBy"` - // Type of the builder - BuildType string `json:"buildType"` - // Individual predicates found in the attestation - SlsaPredicate []allSLSATreeSlsaSLSASlsaPredicateSLSAPredicate `json:"slsaPredicate"` - // Version of the SLSA predicate - SlsaVersion string `json:"slsaVersion"` - // Timestamp (RFC3339Nano format) of build start time - StartedOn *time.Time `json:"startedOn"` - // Timestamp (RFC3339Nano format) of build end time - FinishedOn *time.Time `json:"finishedOn"` - // Document from which this attestation is generated from - Origin string `json:"origin"` - // GUAC collector for the document - Collector string `json:"collector"` +// __PkgEqualInput is used internally by genqlient +type __PkgEqualInput struct { + Pkg PkgInputSpec `json:"pkg"` + OtherPackage PkgInputSpec `json:"otherPackage"` + PkgEqual PkgEqualInputSpec `json:"pkgEqual"` } -// GetBuiltFrom returns allSLSATreeSlsaSLSA.BuiltFrom, and is useful for accessing the field via an interface. -func (v *allSLSATreeSlsaSLSA) GetBuiltFrom() []allSLSATreeSlsaSLSABuiltFromArtifact { - return v.BuiltFrom +// GetPkg returns __PkgEqualInput.Pkg, and is useful for accessing the field via an interface. +func (v *__PkgEqualInput) GetPkg() PkgInputSpec { return v.Pkg } + +// GetOtherPackage returns __PkgEqualInput.OtherPackage, and is useful for accessing the field via an interface. +func (v *__PkgEqualInput) GetOtherPackage() PkgInputSpec { return v.OtherPackage } + +// GetPkgEqual returns __PkgEqualInput.PkgEqual, and is useful for accessing the field via an interface. +func (v *__PkgEqualInput) GetPkgEqual() PkgEqualInputSpec { return v.PkgEqual } + +// __PointOfContactArtifactInput is used internally by genqlient +type __PointOfContactArtifactInput struct { + Artifact ArtifactInputSpec `json:"artifact"` + PointOfContact PointOfContactInputSpec `json:"pointOfContact"` } -// GetBuiltBy returns allSLSATreeSlsaSLSA.BuiltBy, and is useful for accessing the field via an interface. -func (v *allSLSATreeSlsaSLSA) GetBuiltBy() allSLSATreeSlsaSLSABuiltByBuilder { return v.BuiltBy } +// GetArtifact returns __PointOfContactArtifactInput.Artifact, and is useful for accessing the field via an interface. +func (v *__PointOfContactArtifactInput) GetArtifact() ArtifactInputSpec { return v.Artifact } -// GetBuildType returns allSLSATreeSlsaSLSA.BuildType, and is useful for accessing the field via an interface. -func (v *allSLSATreeSlsaSLSA) GetBuildType() string { return v.BuildType } +// GetPointOfContact returns __PointOfContactArtifactInput.PointOfContact, and is useful for accessing the field via an interface. +func (v *__PointOfContactArtifactInput) GetPointOfContact() PointOfContactInputSpec { + return v.PointOfContact +} -// GetSlsaPredicate returns allSLSATreeSlsaSLSA.SlsaPredicate, and is useful for accessing the field via an interface. -func (v *allSLSATreeSlsaSLSA) GetSlsaPredicate() []allSLSATreeSlsaSLSASlsaPredicateSLSAPredicate { - return v.SlsaPredicate +// __PointOfContactPkgInput is used internally by genqlient +type __PointOfContactPkgInput struct { + Pkg PkgInputSpec `json:"pkg"` + PkgMatchType *MatchFlags `json:"pkgMatchType"` + PointOfContact PointOfContactInputSpec `json:"pointOfContact"` } -// GetSlsaVersion returns allSLSATreeSlsaSLSA.SlsaVersion, and is useful for accessing the field via an interface. -func (v *allSLSATreeSlsaSLSA) GetSlsaVersion() string { return v.SlsaVersion } +// GetPkg returns __PointOfContactPkgInput.Pkg, and is useful for accessing the field via an interface. +func (v *__PointOfContactPkgInput) GetPkg() PkgInputSpec { return v.Pkg } -// GetStartedOn returns allSLSATreeSlsaSLSA.StartedOn, and is useful for accessing the field via an interface. -func (v *allSLSATreeSlsaSLSA) GetStartedOn() *time.Time { return v.StartedOn } +// GetPkgMatchType returns __PointOfContactPkgInput.PkgMatchType, and is useful for accessing the field via an interface. +func (v *__PointOfContactPkgInput) GetPkgMatchType() *MatchFlags { return v.PkgMatchType } -// GetFinishedOn returns allSLSATreeSlsaSLSA.FinishedOn, and is useful for accessing the field via an interface. -func (v *allSLSATreeSlsaSLSA) GetFinishedOn() *time.Time { return v.FinishedOn } +// GetPointOfContact returns __PointOfContactPkgInput.PointOfContact, and is useful for accessing the field via an interface. +func (v *__PointOfContactPkgInput) GetPointOfContact() PointOfContactInputSpec { + return v.PointOfContact +} -// GetOrigin returns allSLSATreeSlsaSLSA.Origin, and is useful for accessing the field via an interface. -func (v *allSLSATreeSlsaSLSA) GetOrigin() string { return v.Origin } +// __PointOfContactSrcInput is used internally by genqlient +type __PointOfContactSrcInput struct { + Source SourceInputSpec `json:"source"` + PointOfContact PointOfContactInputSpec `json:"pointOfContact"` +} -// GetCollector returns allSLSATreeSlsaSLSA.Collector, and is useful for accessing the field via an interface. -func (v *allSLSATreeSlsaSLSA) GetCollector() string { return v.Collector } +// GetSource returns __PointOfContactSrcInput.Source, and is useful for accessing the field via an interface. +func (v *__PointOfContactSrcInput) GetSource() SourceInputSpec { return v.Source } -// allSLSATreeSlsaSLSABuiltByBuilder includes the requested fields of the GraphQL type Builder. -// The GraphQL type's documentation follows. -// -// Builder represents the builder (e.g., FRSCA or GitHub Actions). -// -// Currently builders are identified by the uri field. -type allSLSATreeSlsaSLSABuiltByBuilder struct { - Id string `json:"id"` - Uri string `json:"uri"` +// GetPointOfContact returns __PointOfContactSrcInput.PointOfContact, and is useful for accessing the field via an interface. +func (v *__PointOfContactSrcInput) GetPointOfContact() PointOfContactInputSpec { + return v.PointOfContact } -// GetId returns allSLSATreeSlsaSLSABuiltByBuilder.Id, and is useful for accessing the field via an interface. -func (v *allSLSATreeSlsaSLSABuiltByBuilder) GetId() string { return v.Id } +// __SLSAForArtifactInput is used internally by genqlient +type __SLSAForArtifactInput struct { + Artifact ArtifactInputSpec `json:"artifact"` + Materials []ArtifactInputSpec `json:"materials"` + Builder BuilderInputSpec `json:"builder"` + Slsa SLSAInputSpec `json:"slsa"` +} -// GetUri returns allSLSATreeSlsaSLSABuiltByBuilder.Uri, and is useful for accessing the field via an interface. -func (v *allSLSATreeSlsaSLSABuiltByBuilder) GetUri() string { return v.Uri } +// GetArtifact returns __SLSAForArtifactInput.Artifact, and is useful for accessing the field via an interface. +func (v *__SLSAForArtifactInput) GetArtifact() ArtifactInputSpec { return v.Artifact } -// allSLSATreeSlsaSLSABuiltFromArtifact includes the requested fields of the GraphQL type Artifact. -// The GraphQL type's documentation follows. -// -// Artifact represents an artifact identified by a checksum hash. -// -// The checksum is split into the digest value and the algorithm used to generate -// it. Both fields are mandatory and canonicalized to be lowercase. -// -// If having a checksum Go object, algorithm can be -// strings.ToLower(string(checksum.Algorithm)) and digest can be checksum.Value. -type allSLSATreeSlsaSLSABuiltFromArtifact struct { - AllArtifactTree `json:"-"` -} +// GetMaterials returns __SLSAForArtifactInput.Materials, and is useful for accessing the field via an interface. +func (v *__SLSAForArtifactInput) GetMaterials() []ArtifactInputSpec { return v.Materials } -// GetId returns allSLSATreeSlsaSLSABuiltFromArtifact.Id, and is useful for accessing the field via an interface. -func (v *allSLSATreeSlsaSLSABuiltFromArtifact) GetId() string { return v.AllArtifactTree.Id } +// GetBuilder returns __SLSAForArtifactInput.Builder, and is useful for accessing the field via an interface. +func (v *__SLSAForArtifactInput) GetBuilder() BuilderInputSpec { return v.Builder } -// GetAlgorithm returns allSLSATreeSlsaSLSABuiltFromArtifact.Algorithm, and is useful for accessing the field via an interface. -func (v *allSLSATreeSlsaSLSABuiltFromArtifact) GetAlgorithm() string { - return v.AllArtifactTree.Algorithm -} +// GetSlsa returns __SLSAForArtifactInput.Slsa, and is useful for accessing the field via an interface. +func (v *__SLSAForArtifactInput) GetSlsa() SLSAInputSpec { return v.Slsa } -// GetDigest returns allSLSATreeSlsaSLSABuiltFromArtifact.Digest, and is useful for accessing the field via an interface. -func (v *allSLSATreeSlsaSLSABuiltFromArtifact) GetDigest() string { return v.AllArtifactTree.Digest } +// __SLSAForArtifactsInput is used internally by genqlient +type __SLSAForArtifactsInput struct { + Artifacts []ArtifactInputSpec `json:"artifacts"` + MaterialsList [][]ArtifactInputSpec `json:"materialsList"` + Builders []BuilderInputSpec `json:"builders"` + SlsaList []SLSAInputSpec `json:"slsaList"` +} -func (v *allSLSATreeSlsaSLSABuiltFromArtifact) UnmarshalJSON(b []byte) error { +// GetArtifacts returns __SLSAForArtifactsInput.Artifacts, and is useful for accessing the field via an interface. +func (v *__SLSAForArtifactsInput) GetArtifacts() []ArtifactInputSpec { return v.Artifacts } - if string(b) == "null" { - return nil - } +// GetMaterialsList returns __SLSAForArtifactsInput.MaterialsList, and is useful for accessing the field via an interface. +func (v *__SLSAForArtifactsInput) GetMaterialsList() [][]ArtifactInputSpec { return v.MaterialsList } - var firstPass struct { - *allSLSATreeSlsaSLSABuiltFromArtifact - graphql.NoUnmarshalJSON - } - firstPass.allSLSATreeSlsaSLSABuiltFromArtifact = v +// GetBuilders returns __SLSAForArtifactsInput.Builders, and is useful for accessing the field via an interface. +func (v *__SLSAForArtifactsInput) GetBuilders() []BuilderInputSpec { return v.Builders } - err := json.Unmarshal(b, &firstPass) - if err != nil { - return err - } +// GetSlsaList returns __SLSAForArtifactsInput.SlsaList, and is useful for accessing the field via an interface. +func (v *__SLSAForArtifactsInput) GetSlsaList() []SLSAInputSpec { return v.SlsaList } - err = json.Unmarshal( - b, &v.AllArtifactTree) - if err != nil { - return err - } - return nil +// __SourcesInput is used internally by genqlient +type __SourcesInput struct { + Filter *SourceSpec `json:"filter"` } -type __premarshalallSLSATreeSlsaSLSABuiltFromArtifact struct { - Id string `json:"id"` - - Algorithm string `json:"algorithm"` +// GetFilter returns __SourcesInput.Filter, and is useful for accessing the field via an interface. +func (v *__SourcesInput) GetFilter() *SourceSpec { return v.Filter } - Digest string `json:"digest"` +// __VEXPackageAndGhsaInput is used internally by genqlient +type __VEXPackageAndGhsaInput struct { + Pkg PkgInputSpec `json:"pkg"` + Ghsa GHSAInputSpec `json:"ghsa"` + VexStatement VexStatementInputSpec `json:"vexStatement"` } -func (v *allSLSATreeSlsaSLSABuiltFromArtifact) MarshalJSON() ([]byte, error) { - premarshaled, err := v.__premarshalJSON() - if err != nil { - return nil, err - } - return json.Marshal(premarshaled) -} +// GetPkg returns __VEXPackageAndGhsaInput.Pkg, and is useful for accessing the field via an interface. +func (v *__VEXPackageAndGhsaInput) GetPkg() PkgInputSpec { return v.Pkg } -func (v *allSLSATreeSlsaSLSABuiltFromArtifact) __premarshalJSON() (*__premarshalallSLSATreeSlsaSLSABuiltFromArtifact, error) { - var retval __premarshalallSLSATreeSlsaSLSABuiltFromArtifact +// GetGhsa returns __VEXPackageAndGhsaInput.Ghsa, and is useful for accessing the field via an interface. +func (v *__VEXPackageAndGhsaInput) GetGhsa() GHSAInputSpec { return v.Ghsa } - retval.Id = v.AllArtifactTree.Id - retval.Algorithm = v.AllArtifactTree.Algorithm - retval.Digest = v.AllArtifactTree.Digest - return &retval, nil -} +// GetVexStatement returns __VEXPackageAndGhsaInput.VexStatement, and is useful for accessing the field via an interface. +func (v *__VEXPackageAndGhsaInput) GetVexStatement() VexStatementInputSpec { return v.VexStatement } -// allSLSATreeSlsaSLSASlsaPredicateSLSAPredicate includes the requested fields of the GraphQL type SLSAPredicate. -// The GraphQL type's documentation follows. -// -// SLSAPredicate are the values from the SLSA predicate in key-value pair form. -// -// # For example, given the following predicate -// -// ``` -// "predicate": { -// "buildDefinition": { -// "externalParameters": { -// "repository": "https://github.com/octocat/hello-world", -// ... -// }, -// ... -// }, -// ... -// } -// ``` -// -// we have -// -// ``` -// key = "buildDefinition.externalParameters.repository" -// value = "https://github.com/octocat/hello-world" -// ``` -// -// This node cannot be directly referred by other parts of GUAC. -type allSLSATreeSlsaSLSASlsaPredicateSLSAPredicate struct { - Key string `json:"key"` - Value string `json:"value"` +// __VexArtifactAndCveInput is used internally by genqlient +type __VexArtifactAndCveInput struct { + Artifact ArtifactInputSpec `json:"artifact"` + Cve CVEInputSpec `json:"cve"` + VexStatement VexStatementInputSpec `json:"vexStatement"` } -// GetKey returns allSLSATreeSlsaSLSASlsaPredicateSLSAPredicate.Key, and is useful for accessing the field via an interface. -func (v *allSLSATreeSlsaSLSASlsaPredicateSLSAPredicate) GetKey() string { return v.Key } +// GetArtifact returns __VexArtifactAndCveInput.Artifact, and is useful for accessing the field via an interface. +func (v *__VexArtifactAndCveInput) GetArtifact() ArtifactInputSpec { return v.Artifact } -// GetValue returns allSLSATreeSlsaSLSASlsaPredicateSLSAPredicate.Value, and is useful for accessing the field via an interface. -func (v *allSLSATreeSlsaSLSASlsaPredicateSLSAPredicate) GetValue() string { return v.Value } +// GetCve returns __VexArtifactAndCveInput.Cve, and is useful for accessing the field via an interface. +func (v *__VexArtifactAndCveInput) GetCve() CVEInputSpec { return v.Cve } -// allSLSATreeSubjectArtifact includes the requested fields of the GraphQL type Artifact. -// The GraphQL type's documentation follows. -// -// Artifact represents an artifact identified by a checksum hash. -// -// The checksum is split into the digest value and the algorithm used to generate -// it. Both fields are mandatory and canonicalized to be lowercase. -// -// If having a checksum Go object, algorithm can be -// strings.ToLower(string(checksum.Algorithm)) and digest can be checksum.Value. -type allSLSATreeSubjectArtifact struct { - AllArtifactTree `json:"-"` +// GetVexStatement returns __VexArtifactAndCveInput.VexStatement, and is useful for accessing the field via an interface. +func (v *__VexArtifactAndCveInput) GetVexStatement() VexStatementInputSpec { return v.VexStatement } + +// __VexArtifactAndGhsaInput is used internally by genqlient +type __VexArtifactAndGhsaInput struct { + Artifact ArtifactInputSpec `json:"artifact"` + Ghsa GHSAInputSpec `json:"ghsa"` + VexStatement VexStatementInputSpec `json:"vexStatement"` } -// GetId returns allSLSATreeSubjectArtifact.Id, and is useful for accessing the field via an interface. -func (v *allSLSATreeSubjectArtifact) GetId() string { return v.AllArtifactTree.Id } +// GetArtifact returns __VexArtifactAndGhsaInput.Artifact, and is useful for accessing the field via an interface. +func (v *__VexArtifactAndGhsaInput) GetArtifact() ArtifactInputSpec { return v.Artifact } -// GetAlgorithm returns allSLSATreeSubjectArtifact.Algorithm, and is useful for accessing the field via an interface. -func (v *allSLSATreeSubjectArtifact) GetAlgorithm() string { return v.AllArtifactTree.Algorithm } +// GetGhsa returns __VexArtifactAndGhsaInput.Ghsa, and is useful for accessing the field via an interface. +func (v *__VexArtifactAndGhsaInput) GetGhsa() GHSAInputSpec { return v.Ghsa } -// GetDigest returns allSLSATreeSubjectArtifact.Digest, and is useful for accessing the field via an interface. -func (v *allSLSATreeSubjectArtifact) GetDigest() string { return v.AllArtifactTree.Digest } +// GetVexStatement returns __VexArtifactAndGhsaInput.VexStatement, and is useful for accessing the field via an interface. +func (v *__VexArtifactAndGhsaInput) GetVexStatement() VexStatementInputSpec { return v.VexStatement } -func (v *allSLSATreeSubjectArtifact) UnmarshalJSON(b []byte) error { +// __VexArtifactAndOsvInput is used internally by genqlient +type __VexArtifactAndOsvInput struct { + Artifact ArtifactInputSpec `json:"artifact"` + Osv OSVInputSpec `json:"osv"` + VexStatement VexStatementInputSpec `json:"vexStatement"` +} - if string(b) == "null" { - return nil - } +// GetArtifact returns __VexArtifactAndOsvInput.Artifact, and is useful for accessing the field via an interface. +func (v *__VexArtifactAndOsvInput) GetArtifact() ArtifactInputSpec { return v.Artifact } - var firstPass struct { - *allSLSATreeSubjectArtifact - graphql.NoUnmarshalJSON - } - firstPass.allSLSATreeSubjectArtifact = v +// GetOsv returns __VexArtifactAndOsvInput.Osv, and is useful for accessing the field via an interface. +func (v *__VexArtifactAndOsvInput) GetOsv() OSVInputSpec { return v.Osv } - err := json.Unmarshal(b, &firstPass) - if err != nil { - return err - } +// GetVexStatement returns __VexArtifactAndOsvInput.VexStatement, and is useful for accessing the field via an interface. +func (v *__VexArtifactAndOsvInput) GetVexStatement() VexStatementInputSpec { return v.VexStatement } - err = json.Unmarshal( - b, &v.AllArtifactTree) - if err != nil { - return err - } - return nil +// __VexPackageAndCveInput is used internally by genqlient +type __VexPackageAndCveInput struct { + Pkg PkgInputSpec `json:"pkg"` + Cve CVEInputSpec `json:"cve"` + VexStatement VexStatementInputSpec `json:"vexStatement"` } -type __premarshalallSLSATreeSubjectArtifact struct { - Id string `json:"id"` +// GetPkg returns __VexPackageAndCveInput.Pkg, and is useful for accessing the field via an interface. +func (v *__VexPackageAndCveInput) GetPkg() PkgInputSpec { return v.Pkg } - Algorithm string `json:"algorithm"` +// GetCve returns __VexPackageAndCveInput.Cve, and is useful for accessing the field via an interface. +func (v *__VexPackageAndCveInput) GetCve() CVEInputSpec { return v.Cve } - Digest string `json:"digest"` -} +// GetVexStatement returns __VexPackageAndCveInput.VexStatement, and is useful for accessing the field via an interface. +func (v *__VexPackageAndCveInput) GetVexStatement() VexStatementInputSpec { return v.VexStatement } -func (v *allSLSATreeSubjectArtifact) MarshalJSON() ([]byte, error) { - premarshaled, err := v.__premarshalJSON() - if err != nil { - return nil, err - } - return json.Marshal(premarshaled) +// __VexPackageAndOsvInput is used internally by genqlient +type __VexPackageAndOsvInput struct { + Pkg PkgInputSpec `json:"pkg"` + Osv OSVInputSpec `json:"osv"` + VexStatement VexStatementInputSpec `json:"vexStatement"` } -func (v *allSLSATreeSubjectArtifact) __premarshalJSON() (*__premarshalallSLSATreeSubjectArtifact, error) { - var retval __premarshalallSLSATreeSubjectArtifact +// GetPkg returns __VexPackageAndOsvInput.Pkg, and is useful for accessing the field via an interface. +func (v *__VexPackageAndOsvInput) GetPkg() PkgInputSpec { return v.Pkg } - retval.Id = v.AllArtifactTree.Id - retval.Algorithm = v.AllArtifactTree.Algorithm - retval.Digest = v.AllArtifactTree.Digest - return &retval, nil -} +// GetOsv returns __VexPackageAndOsvInput.Osv, and is useful for accessing the field via an interface. +func (v *__VexPackageAndOsvInput) GetOsv() OSVInputSpec { return v.Osv } + +// GetVexStatement returns __VexPackageAndOsvInput.VexStatement, and is useful for accessing the field via an interface. +func (v *__VexPackageAndOsvInput) GetVexStatement() VexStatementInputSpec { return v.VexStatement } // The query or mutation executed by Artifacts. const Artifacts_Operation = ` @@ -25387,10 +25387,10 @@ func CertifyGHSA( const CertifyGoodArtifact_Operation = ` mutation CertifyGoodArtifact ($artifact: ArtifactInputSpec!, $certifyGood: CertifyGoodInputSpec!) { ingestCertifyGood(subject: {artifact:$artifact}, certifyGood: $certifyGood) { - ... allCertifyGood + ... AllCertifyGood } } -fragment allCertifyGood on CertifyGood { +fragment AllCertifyGood on CertifyGood { id justification subject { @@ -25482,10 +25482,10 @@ func CertifyGoodArtifact( const CertifyGoodPkg_Operation = ` mutation CertifyGoodPkg ($pkg: PkgInputSpec!, $pkgMatchType: MatchFlags, $certifyGood: CertifyGoodInputSpec!) { ingestCertifyGood(subject: {package:$pkg}, pkgMatchType: $pkgMatchType, certifyGood: $certifyGood) { - ... allCertifyGood + ... AllCertifyGood } } -fragment allCertifyGood on CertifyGood { +fragment AllCertifyGood on CertifyGood { id justification subject { @@ -25579,10 +25579,10 @@ func CertifyGoodPkg( const CertifyGoodSrc_Operation = ` mutation CertifyGoodSrc ($source: SourceInputSpec!, $certifyGood: CertifyGoodInputSpec!) { ingestCertifyGood(subject: {source:$source}, certifyGood: $certifyGood) { - ... allCertifyGood + ... AllCertifyGood } } -fragment allCertifyGood on CertifyGood { +fragment AllCertifyGood on CertifyGood { id justification subject { @@ -26139,10 +26139,10 @@ func GHSAs( const HasMetadataArtifact_Operation = ` mutation HasMetadataArtifact ($artifact: ArtifactInputSpec!, $hasMetadata: HasMetadataInputSpec!) { ingestHasMetadata(subject: {artifact:$artifact}, hasMetadata: $hasMetadata) { - ... allHasMetadata + ... AllHasMetadata } } -fragment allHasMetadata on HasMetadata { +fragment AllHasMetadata on HasMetadata { id subject { __typename @@ -26237,10 +26237,10 @@ func HasMetadataArtifact( const HasMetadataPkg_Operation = ` mutation HasMetadataPkg ($pkg: PkgInputSpec!, $pkgMatchType: MatchFlags, $hasMetadata: HasMetadataInputSpec!) { ingestHasMetadata(subject: {package:$pkg}, pkgMatchType: $pkgMatchType, hasMetadata: $hasMetadata) { - ... allHasMetadata + ... AllHasMetadata } } -fragment allHasMetadata on HasMetadata { +fragment AllHasMetadata on HasMetadata { id subject { __typename @@ -26337,10 +26337,10 @@ func HasMetadataPkg( const HasMetadataSrc_Operation = ` mutation HasMetadataSrc ($source: SourceInputSpec!, $hasMetadata: HasMetadataInputSpec!) { ingestHasMetadata(subject: {source:$source}, hasMetadata: $hasMetadata) { - ... allHasMetadata + ... AllHasMetadata } } -fragment allHasMetadata on HasMetadata { +fragment AllHasMetadata on HasMetadata { id subject { __typename @@ -26435,10 +26435,10 @@ func HasMetadataSrc( const HasSBOMArtifact_Operation = ` mutation HasSBOMArtifact ($artifact: ArtifactInputSpec!, $hasSBOM: HasSBOMInputSpec!) { ingestHasSBOM(subject: {artifact:$artifact}, hasSBOM: $hasSBOM) { - ... allHasSBOMTree + ... AllHasSBOMTree } } -fragment allHasSBOMTree on HasSBOM { +fragment AllHasSBOMTree on HasSBOM { id subject { __typename @@ -26516,10 +26516,10 @@ func HasSBOMArtifact( const HasSBOMPkg_Operation = ` mutation HasSBOMPkg ($pkg: PkgInputSpec!, $hasSBOM: HasSBOMInputSpec!) { ingestHasSBOM(subject: {package:$pkg}, hasSBOM: $hasSBOM) { - ... allHasSBOMTree + ... AllHasSBOMTree } } -fragment allHasSBOMTree on HasSBOM { +fragment AllHasSBOMTree on HasSBOM { id subject { __typename @@ -26597,10 +26597,10 @@ func HasSBOMPkg( const HasSourceAt_Operation = ` mutation HasSourceAt ($pkg: PkgInputSpec!, $pkgMatchType: MatchFlags!, $source: SourceInputSpec!, $hasSourceAt: HasSourceAtInputSpec!) { ingestHasSourceAt(pkg: $pkg, pkgMatchType: $pkgMatchType, source: $source, hasSourceAt: $hasSourceAt) { - ... allHasSourceAt + ... AllHasSourceAt } } -fragment allHasSourceAt on HasSourceAt { +fragment AllHasSourceAt on HasSourceAt { id justification knownSince @@ -26686,10 +26686,10 @@ func HasSourceAt( const HashEqual_Operation = ` mutation HashEqual ($artifact: ArtifactInputSpec!, $otherArtifact: ArtifactInputSpec!, $hashEqual: HashEqualInputSpec!) { ingestHashEqual(artifact: $artifact, otherArtifact: $otherArtifact, hashEqual: $hashEqual) { - ... allHashEqualTree + ... AllHashEqualTree } } -fragment allHashEqualTree on HashEqual { +fragment AllHashEqualTree on HashEqual { id justification artifacts { @@ -27335,10 +27335,10 @@ func IngestSources( const IsDependencies_Operation = ` mutation IsDependencies ($pkgs: [PkgInputSpec!]!, $depPkgs: [PkgInputSpec!]!, $dependencies: [IsDependencyInputSpec!]!) { ingestDependencies(pkgs: $pkgs, depPkgs: $depPkgs, dependencies: $dependencies) { - ... allIsDependencyTree + ... AllIsDependencyTree } } -fragment allIsDependencyTree on IsDependency { +fragment AllIsDependencyTree on IsDependency { id justification package { @@ -27409,10 +27409,10 @@ func IsDependencies( const IsDependency_Operation = ` mutation IsDependency ($pkg: PkgInputSpec!, $depPkg: PkgInputSpec!, $dependency: IsDependencyInputSpec!) { ingestDependency(pkg: $pkg, depPkg: $depPkg, dependency: $dependency) { - ... allIsDependencyTree + ... AllIsDependencyTree } } -fragment allIsDependencyTree on IsDependency { +fragment AllIsDependencyTree on IsDependency { id justification package { @@ -27871,10 +27871,10 @@ func IsOccurrencesSrc( const IsVulnerabilityCVE_Operation = ` mutation IsVulnerabilityCVE ($osv: OSVInputSpec!, $cve: CVEInputSpec!, $isVulnerability: IsVulnerabilityInputSpec!) { ingestIsVulnerability(osv: $osv, vulnerability: {cve:$cve}, isVulnerability: $isVulnerability) { - ... allIsVulnerability + ... AllIsVulnerability } } -fragment allIsVulnerability on IsVulnerability { +fragment AllIsVulnerability on IsVulnerability { id osv { ... AllOSVTree @@ -27941,10 +27941,10 @@ func IsVulnerabilityCVE( const IsVulnerabilityGHSA_Operation = ` mutation IsVulnerabilityGHSA ($osv: OSVInputSpec!, $ghsa: GHSAInputSpec!, $isVulnerability: IsVulnerabilityInputSpec!) { ingestIsVulnerability(osv: $osv, vulnerability: {ghsa:$ghsa}, isVulnerability: $isVulnerability) { - ... allIsVulnerability + ... AllIsVulnerability } } -fragment allIsVulnerability on IsVulnerability { +fragment AllIsVulnerability on IsVulnerability { id osv { ... AllOSVTree @@ -28022,7 +28022,7 @@ query Neighbors ($node: ID!, $usingOnly: [Edge!]!) { ... AllArtifactTree } ... on Builder { - ... allBuilderTree + ... AllBuilderTree } ... on OSV { ... AllOSVTree @@ -28040,43 +28040,43 @@ query Neighbors ($node: ID!, $usingOnly: [Edge!]!) { ... AllCertifyScorecard } ... on PkgEqual { - ... allPkgEqual + ... AllPkgEqual } ... on IsOccurrence { ... AllIsOccurrencesTree } ... on IsDependency { - ... allIsDependencyTree + ... AllIsDependencyTree } ... on HasSLSA { - ... allSLSATree + ... AllSLSATree } ... on CertifyBad { ... AllCertifyBad } ... on CertifyGood { - ... allCertifyGood + ... AllCertifyGood } ... on HashEqual { - ... allHashEqualTree + ... AllHashEqualTree } ... on HasSBOM { - ... allHasSBOMTree + ... AllHasSBOMTree } ... on HasSourceAt { - ... allHasSourceAt + ... AllHasSourceAt } ... on CertifyVuln { ... AllCertifyVuln } ... on IsVulnerability { - ... allIsVulnerability + ... AllIsVulnerability } ... on CertifyVEXStatement { - ... allCertifyVEXStatement + ... AllCertifyVEXStatement } ... on Builder { - ... allBuilderTree + ... AllBuilderTree } } } @@ -28120,7 +28120,7 @@ fragment AllArtifactTree on Artifact { algorithm digest } -fragment allBuilderTree on Builder { +fragment AllBuilderTree on Builder { id uri } @@ -28155,7 +28155,7 @@ fragment AllCertifyScorecard on CertifyScorecard { collector } } -fragment allPkgEqual on PkgEqual { +fragment AllPkgEqual on PkgEqual { id justification packages { @@ -28182,7 +28182,7 @@ fragment AllIsOccurrencesTree on IsOccurrence { origin collector } -fragment allIsDependencyTree on IsDependency { +fragment AllIsDependencyTree on IsDependency { id justification package { @@ -28196,7 +28196,7 @@ fragment allIsDependencyTree on IsDependency { origin collector } -fragment allSLSATree on HasSLSA { +fragment AllSLSATree on HasSLSA { id subject { ... AllArtifactTree @@ -28239,7 +28239,7 @@ fragment AllCertifyBad on CertifyBad { origin collector } -fragment allCertifyGood on CertifyGood { +fragment AllCertifyGood on CertifyGood { id justification subject { @@ -28257,7 +28257,7 @@ fragment allCertifyGood on CertifyGood { origin collector } -fragment allHashEqualTree on HashEqual { +fragment AllHashEqualTree on HashEqual { id justification artifacts { @@ -28266,7 +28266,7 @@ fragment allHashEqualTree on HashEqual { origin collector } -fragment allHasSBOMTree on HasSBOM { +fragment AllHasSBOMTree on HasSBOM { id subject { __typename @@ -28284,7 +28284,7 @@ fragment allHasSBOMTree on HasSBOM { origin collector } -fragment allHasSourceAt on HasSourceAt { +fragment AllHasSourceAt on HasSourceAt { id justification knownSince @@ -28327,7 +28327,7 @@ fragment AllCertifyVuln on CertifyVuln { collector } } -fragment allIsVulnerability on IsVulnerability { +fragment AllIsVulnerability on IsVulnerability { id osv { ... AllOSVTree @@ -28345,7 +28345,7 @@ fragment allIsVulnerability on IsVulnerability { origin collector } -fragment allCertifyVEXStatement on CertifyVEXStatement { +fragment AllCertifyVEXStatement on CertifyVEXStatement { id subject { __typename @@ -28421,7 +28421,7 @@ query Node ($node: ID!) { ... AllArtifactTree } ... on Builder { - ... allBuilderTree + ... AllBuilderTree } ... on OSV { ... AllOSVTree @@ -28439,43 +28439,43 @@ query Node ($node: ID!) { ... AllCertifyScorecard } ... on PkgEqual { - ... allPkgEqual + ... AllPkgEqual } ... on IsOccurrence { ... AllIsOccurrencesTree } ... on IsDependency { - ... allIsDependencyTree + ... AllIsDependencyTree } ... on HasSLSA { - ... allSLSATree + ... AllSLSATree } ... on CertifyBad { ... AllCertifyBad } ... on CertifyGood { - ... allCertifyGood + ... AllCertifyGood } ... on HashEqual { - ... allHashEqualTree + ... AllHashEqualTree } ... on HasSBOM { - ... allHasSBOMTree + ... AllHasSBOMTree } ... on HasSourceAt { - ... allHasSourceAt + ... AllHasSourceAt } ... on CertifyVuln { ... AllCertifyVuln } ... on IsVulnerability { - ... allIsVulnerability + ... AllIsVulnerability } ... on CertifyVEXStatement { - ... allCertifyVEXStatement + ... AllCertifyVEXStatement } ... on Builder { - ... allBuilderTree + ... AllBuilderTree } } } @@ -28519,7 +28519,7 @@ fragment AllArtifactTree on Artifact { algorithm digest } -fragment allBuilderTree on Builder { +fragment AllBuilderTree on Builder { id uri } @@ -28554,7 +28554,7 @@ fragment AllCertifyScorecard on CertifyScorecard { collector } } -fragment allPkgEqual on PkgEqual { +fragment AllPkgEqual on PkgEqual { id justification packages { @@ -28581,7 +28581,7 @@ fragment AllIsOccurrencesTree on IsOccurrence { origin collector } -fragment allIsDependencyTree on IsDependency { +fragment AllIsDependencyTree on IsDependency { id justification package { @@ -28595,7 +28595,7 @@ fragment allIsDependencyTree on IsDependency { origin collector } -fragment allSLSATree on HasSLSA { +fragment AllSLSATree on HasSLSA { id subject { ... AllArtifactTree @@ -28638,7 +28638,7 @@ fragment AllCertifyBad on CertifyBad { origin collector } -fragment allCertifyGood on CertifyGood { +fragment AllCertifyGood on CertifyGood { id justification subject { @@ -28656,7 +28656,7 @@ fragment allCertifyGood on CertifyGood { origin collector } -fragment allHashEqualTree on HashEqual { +fragment AllHashEqualTree on HashEqual { id justification artifacts { @@ -28665,7 +28665,7 @@ fragment allHashEqualTree on HashEqual { origin collector } -fragment allHasSBOMTree on HasSBOM { +fragment AllHasSBOMTree on HasSBOM { id subject { __typename @@ -28683,7 +28683,7 @@ fragment allHasSBOMTree on HasSBOM { origin collector } -fragment allHasSourceAt on HasSourceAt { +fragment AllHasSourceAt on HasSourceAt { id justification knownSince @@ -28726,7 +28726,7 @@ fragment AllCertifyVuln on CertifyVuln { collector } } -fragment allIsVulnerability on IsVulnerability { +fragment AllIsVulnerability on IsVulnerability { id osv { ... AllOSVTree @@ -28744,7 +28744,7 @@ fragment allIsVulnerability on IsVulnerability { origin collector } -fragment allCertifyVEXStatement on CertifyVEXStatement { +fragment AllCertifyVEXStatement on CertifyVEXStatement { id subject { __typename @@ -28818,7 +28818,7 @@ query Nodes ($nodes: [ID!]!) { ... AllArtifactTree } ... on Builder { - ... allBuilderTree + ... AllBuilderTree } ... on OSV { ... AllOSVTree @@ -28836,43 +28836,43 @@ query Nodes ($nodes: [ID!]!) { ... AllCertifyScorecard } ... on PkgEqual { - ... allPkgEqual + ... AllPkgEqual } ... on IsOccurrence { ... AllIsOccurrencesTree } ... on IsDependency { - ... allIsDependencyTree + ... AllIsDependencyTree } ... on HasSLSA { - ... allSLSATree + ... AllSLSATree } ... on CertifyBad { ... AllCertifyBad } ... on CertifyGood { - ... allCertifyGood + ... AllCertifyGood } ... on HashEqual { - ... allHashEqualTree + ... AllHashEqualTree } ... on HasSBOM { - ... allHasSBOMTree + ... AllHasSBOMTree } ... on HasSourceAt { - ... allHasSourceAt + ... AllHasSourceAt } ... on CertifyVuln { ... AllCertifyVuln } ... on IsVulnerability { - ... allIsVulnerability + ... AllIsVulnerability } ... on CertifyVEXStatement { - ... allCertifyVEXStatement + ... AllCertifyVEXStatement } ... on Builder { - ... allBuilderTree + ... AllBuilderTree } } } @@ -28916,7 +28916,7 @@ fragment AllArtifactTree on Artifact { algorithm digest } -fragment allBuilderTree on Builder { +fragment AllBuilderTree on Builder { id uri } @@ -28951,7 +28951,7 @@ fragment AllCertifyScorecard on CertifyScorecard { collector } } -fragment allPkgEqual on PkgEqual { +fragment AllPkgEqual on PkgEqual { id justification packages { @@ -28978,7 +28978,7 @@ fragment AllIsOccurrencesTree on IsOccurrence { origin collector } -fragment allIsDependencyTree on IsDependency { +fragment AllIsDependencyTree on IsDependency { id justification package { @@ -28992,7 +28992,7 @@ fragment allIsDependencyTree on IsDependency { origin collector } -fragment allSLSATree on HasSLSA { +fragment AllSLSATree on HasSLSA { id subject { ... AllArtifactTree @@ -29035,7 +29035,7 @@ fragment AllCertifyBad on CertifyBad { origin collector } -fragment allCertifyGood on CertifyGood { +fragment AllCertifyGood on CertifyGood { id justification subject { @@ -29053,7 +29053,7 @@ fragment allCertifyGood on CertifyGood { origin collector } -fragment allHashEqualTree on HashEqual { +fragment AllHashEqualTree on HashEqual { id justification artifacts { @@ -29062,7 +29062,7 @@ fragment allHashEqualTree on HashEqual { origin collector } -fragment allHasSBOMTree on HasSBOM { +fragment AllHasSBOMTree on HasSBOM { id subject { __typename @@ -29080,7 +29080,7 @@ fragment allHasSBOMTree on HasSBOM { origin collector } -fragment allHasSourceAt on HasSourceAt { +fragment AllHasSourceAt on HasSourceAt { id justification knownSince @@ -29123,7 +29123,7 @@ fragment AllCertifyVuln on CertifyVuln { collector } } -fragment allIsVulnerability on IsVulnerability { +fragment AllIsVulnerability on IsVulnerability { id osv { ... AllOSVTree @@ -29141,7 +29141,7 @@ fragment allIsVulnerability on IsVulnerability { origin collector } -fragment allCertifyVEXStatement on CertifyVEXStatement { +fragment AllCertifyVEXStatement on CertifyVEXStatement { id subject { __typename @@ -29310,7 +29310,7 @@ query Path ($subject: ID!, $target: ID!, $maxPathLength: Int!, $usingOnly: [Edge ... AllArtifactTree } ... on Builder { - ... allBuilderTree + ... AllBuilderTree } ... on OSV { ... AllOSVTree @@ -29328,43 +29328,43 @@ query Path ($subject: ID!, $target: ID!, $maxPathLength: Int!, $usingOnly: [Edge ... AllCertifyScorecard } ... on PkgEqual { - ... allPkgEqual + ... AllPkgEqual } ... on IsOccurrence { ... AllIsOccurrencesTree } ... on IsDependency { - ... allIsDependencyTree + ... AllIsDependencyTree } ... on HasSLSA { - ... allSLSATree + ... AllSLSATree } ... on CertifyBad { ... AllCertifyBad } ... on CertifyGood { - ... allCertifyGood + ... AllCertifyGood } ... on HashEqual { - ... allHashEqualTree + ... AllHashEqualTree } ... on HasSBOM { - ... allHasSBOMTree + ... AllHasSBOMTree } ... on HasSourceAt { - ... allHasSourceAt + ... AllHasSourceAt } ... on CertifyVuln { ... AllCertifyVuln } ... on IsVulnerability { - ... allIsVulnerability + ... AllIsVulnerability } ... on CertifyVEXStatement { - ... allCertifyVEXStatement + ... AllCertifyVEXStatement } ... on Builder { - ... allBuilderTree + ... AllBuilderTree } } } @@ -29408,7 +29408,7 @@ fragment AllArtifactTree on Artifact { algorithm digest } -fragment allBuilderTree on Builder { +fragment AllBuilderTree on Builder { id uri } @@ -29443,7 +29443,7 @@ fragment AllCertifyScorecard on CertifyScorecard { collector } } -fragment allPkgEqual on PkgEqual { +fragment AllPkgEqual on PkgEqual { id justification packages { @@ -29470,7 +29470,7 @@ fragment AllIsOccurrencesTree on IsOccurrence { origin collector } -fragment allIsDependencyTree on IsDependency { +fragment AllIsDependencyTree on IsDependency { id justification package { @@ -29484,7 +29484,7 @@ fragment allIsDependencyTree on IsDependency { origin collector } -fragment allSLSATree on HasSLSA { +fragment AllSLSATree on HasSLSA { id subject { ... AllArtifactTree @@ -29527,7 +29527,7 @@ fragment AllCertifyBad on CertifyBad { origin collector } -fragment allCertifyGood on CertifyGood { +fragment AllCertifyGood on CertifyGood { id justification subject { @@ -29545,7 +29545,7 @@ fragment allCertifyGood on CertifyGood { origin collector } -fragment allHashEqualTree on HashEqual { +fragment AllHashEqualTree on HashEqual { id justification artifacts { @@ -29554,7 +29554,7 @@ fragment allHashEqualTree on HashEqual { origin collector } -fragment allHasSBOMTree on HasSBOM { +fragment AllHasSBOMTree on HasSBOM { id subject { __typename @@ -29572,7 +29572,7 @@ fragment allHasSBOMTree on HasSBOM { origin collector } -fragment allHasSourceAt on HasSourceAt { +fragment AllHasSourceAt on HasSourceAt { id justification knownSince @@ -29615,7 +29615,7 @@ fragment AllCertifyVuln on CertifyVuln { collector } } -fragment allIsVulnerability on IsVulnerability { +fragment AllIsVulnerability on IsVulnerability { id osv { ... AllOSVTree @@ -29633,7 +29633,7 @@ fragment allIsVulnerability on IsVulnerability { origin collector } -fragment allCertifyVEXStatement on CertifyVEXStatement { +fragment AllCertifyVEXStatement on CertifyVEXStatement { id subject { __typename @@ -29708,7 +29708,7 @@ mutation PkgEqual ($pkg: PkgInputSpec!, $otherPackage: PkgInputSpec!, $pkgEqual: ... AllPkgTree } ingestPkgEqual(pkg: $pkg, otherPackage: $otherPackage, pkgEqual: $pkgEqual) { - ... allPkgEqual + ... AllPkgEqual } } fragment AllPkgTree on Package { @@ -29732,7 +29732,7 @@ fragment AllPkgTree on Package { } } } -fragment allPkgEqual on PkgEqual { +fragment AllPkgEqual on PkgEqual { id justification packages { @@ -29777,10 +29777,10 @@ func PkgEqual( const PointOfContactArtifact_Operation = ` mutation PointOfContactArtifact ($artifact: ArtifactInputSpec!, $pointOfContact: PointOfContactInputSpec!) { ingestPointOfContact(subject: {artifact:$artifact}, pointOfContact: $pointOfContact) { - ... allPointOfContact + ... AllPointOfContact } } -fragment allPointOfContact on PointOfContact { +fragment AllPointOfContact on PointOfContact { id subject { __typename @@ -29875,10 +29875,10 @@ func PointOfContactArtifact( const PointOfContactPkg_Operation = ` mutation PointOfContactPkg ($pkg: PkgInputSpec!, $pkgMatchType: MatchFlags, $pointOfContact: PointOfContactInputSpec!) { ingestPointOfContact(subject: {package:$pkg}, pkgMatchType: $pkgMatchType, pointOfContact: $pointOfContact) { - ... allPointOfContact + ... AllPointOfContact } } -fragment allPointOfContact on PointOfContact { +fragment AllPointOfContact on PointOfContact { id subject { __typename @@ -29975,10 +29975,10 @@ func PointOfContactPkg( const PointOfContactSrc_Operation = ` mutation PointOfContactSrc ($source: SourceInputSpec!, $pointOfContact: PointOfContactInputSpec!) { ingestPointOfContact(subject: {source:$source}, pointOfContact: $pointOfContact) { - ... allPointOfContact + ... AllPointOfContact } } -fragment allPointOfContact on PointOfContact { +fragment AllPointOfContact on PointOfContact { id subject { __typename @@ -30073,10 +30073,10 @@ func PointOfContactSrc( const SLSAForArtifact_Operation = ` mutation SLSAForArtifact ($artifact: ArtifactInputSpec!, $materials: [ArtifactInputSpec!]!, $builder: BuilderInputSpec!, $slsa: SLSAInputSpec!) { ingestSLSA(subject: $artifact, builtFrom: $materials, builtBy: $builder, slsa: $slsa) { - ... allSLSATree + ... AllSLSATree } } -fragment allSLSATree on HasSLSA { +fragment AllSLSATree on HasSLSA { id subject { ... AllArtifactTree @@ -30144,10 +30144,10 @@ func SLSAForArtifact( const SLSAForArtifacts_Operation = ` mutation SLSAForArtifacts ($artifacts: [ArtifactInputSpec!]!, $materialsList: [[ArtifactInputSpec!]!]!, $builders: [BuilderInputSpec!]!, $slsaList: [SLSAInputSpec!]!) { ingestSLSAs(subjects: $artifacts, builtFromList: $materialsList, builtByList: $builders, slsaList: $slsaList) { - ... allSLSATree + ... AllSLSATree } } -fragment allSLSATree on HasSLSA { +fragment AllSLSATree on HasSLSA { id subject { ... AllArtifactTree @@ -30264,10 +30264,10 @@ func Sources( const VEXPackageAndGhsa_Operation = ` mutation VEXPackageAndGhsa ($pkg: PkgInputSpec!, $ghsa: GHSAInputSpec!, $vexStatement: VexStatementInputSpec!) { ingestVEXStatement(subject: {package:$pkg}, vulnerability: {ghsa:$ghsa}, vexStatement: $vexStatement) { - ... allCertifyVEXStatement + ... AllCertifyVEXStatement } } -fragment allCertifyVEXStatement on CertifyVEXStatement { +fragment AllCertifyVEXStatement on CertifyVEXStatement { id subject { __typename @@ -30373,10 +30373,10 @@ func VEXPackageAndGhsa( const VexArtifactAndCve_Operation = ` mutation VexArtifactAndCve ($artifact: ArtifactInputSpec!, $cve: CVEInputSpec!, $vexStatement: VexStatementInputSpec!) { ingestVEXStatement(subject: {artifact:$artifact}, vulnerability: {cve:$cve}, vexStatement: $vexStatement) { - ... allCertifyVEXStatement + ... AllCertifyVEXStatement } } -fragment allCertifyVEXStatement on CertifyVEXStatement { +fragment AllCertifyVEXStatement on CertifyVEXStatement { id subject { __typename @@ -30482,10 +30482,10 @@ func VexArtifactAndCve( const VexArtifactAndGhsa_Operation = ` mutation VexArtifactAndGhsa ($artifact: ArtifactInputSpec!, $ghsa: GHSAInputSpec!, $vexStatement: VexStatementInputSpec!) { ingestVEXStatement(subject: {artifact:$artifact}, vulnerability: {ghsa:$ghsa}, vexStatement: $vexStatement) { - ... allCertifyVEXStatement + ... AllCertifyVEXStatement } } -fragment allCertifyVEXStatement on CertifyVEXStatement { +fragment AllCertifyVEXStatement on CertifyVEXStatement { id subject { __typename @@ -30591,10 +30591,10 @@ func VexArtifactAndGhsa( const VexArtifactAndOsv_Operation = ` mutation VexArtifactAndOsv ($artifact: ArtifactInputSpec!, $osv: OSVInputSpec!, $vexStatement: VexStatementInputSpec!) { ingestVEXStatement(subject: {artifact:$artifact}, vulnerability: {osv:$osv}, vexStatement: $vexStatement) { - ... allCertifyVEXStatement + ... AllCertifyVEXStatement } } -fragment allCertifyVEXStatement on CertifyVEXStatement { +fragment AllCertifyVEXStatement on CertifyVEXStatement { id subject { __typename @@ -30700,10 +30700,10 @@ func VexArtifactAndOsv( const VexPackageAndCve_Operation = ` mutation VexPackageAndCve ($pkg: PkgInputSpec!, $cve: CVEInputSpec!, $vexStatement: VexStatementInputSpec!) { ingestVEXStatement(subject: {package:$pkg}, vulnerability: {cve:$cve}, vexStatement: $vexStatement) { - ... allCertifyVEXStatement + ... AllCertifyVEXStatement } } -fragment allCertifyVEXStatement on CertifyVEXStatement { +fragment AllCertifyVEXStatement on CertifyVEXStatement { id subject { __typename @@ -30809,10 +30809,10 @@ func VexPackageAndCve( const VexPackageAndOsv_Operation = ` mutation VexPackageAndOsv ($pkg: PkgInputSpec!, $osv: OSVInputSpec!, $vexStatement: VexStatementInputSpec!) { ingestVEXStatement(subject: {package:$pkg}, vulnerability: {osv:$osv}, vexStatement: $vexStatement) { - ... allCertifyVEXStatement + ... AllCertifyVEXStatement } } -fragment allCertifyVEXStatement on CertifyVEXStatement { +fragment AllCertifyVEXStatement on CertifyVEXStatement { id subject { __typename diff --git a/pkg/assembler/clients/operations/certifyGood.graphql b/pkg/assembler/clients/operations/certifyGood.graphql index eea39f9795..fe545bacf5 100644 --- a/pkg/assembler/clients/operations/certifyGood.graphql +++ b/pkg/assembler/clients/operations/certifyGood.graphql @@ -19,18 +19,18 @@ mutation CertifyGoodPkg($pkg: PkgInputSpec!, $pkgMatchType: MatchFlags, $certifyGood: CertifyGoodInputSpec!) { ingestCertifyGood(subject: {package: $pkg}, pkgMatchType: $pkgMatchType, certifyGood: $certifyGood) { - ...allCertifyGood + ...AllCertifyGood } } mutation CertifyGoodSrc($source: SourceInputSpec!, $certifyGood: CertifyGoodInputSpec!) { ingestCertifyGood(subject: {source: $source}, certifyGood: $certifyGood) { - ...allCertifyGood + ...AllCertifyGood } } mutation CertifyGoodArtifact($artifact: ArtifactInputSpec!, $certifyGood: CertifyGoodInputSpec!) { ingestCertifyGood(subject: {artifact: $artifact}, certifyGood: $certifyGood) { - ...allCertifyGood + ...AllCertifyGood } } diff --git a/pkg/assembler/clients/operations/certifyVEXStatement.graphql b/pkg/assembler/clients/operations/certifyVEXStatement.graphql index b4f2c7b544..5b36343ceb 100644 --- a/pkg/assembler/clients/operations/certifyVEXStatement.graphql +++ b/pkg/assembler/clients/operations/certifyVEXStatement.graphql @@ -19,36 +19,36 @@ mutation VexPackageAndCve($pkg: PkgInputSpec!, $cve: CVEInputSpec!, $vexStatement: VexStatementInputSpec!) { ingestVEXStatement(subject: {package: $pkg}, vulnerability: {cve: $cve}, vexStatement: $vexStatement) { - ...allCertifyVEXStatement + ...AllCertifyVEXStatement } } mutation VEXPackageAndGhsa($pkg: PkgInputSpec!, $ghsa: GHSAInputSpec!, $vexStatement: VexStatementInputSpec!) { ingestVEXStatement(subject: {package: $pkg}, vulnerability: {ghsa: $ghsa}, vexStatement: $vexStatement) { - ...allCertifyVEXStatement + ...AllCertifyVEXStatement } } mutation VexPackageAndOsv($pkg: PkgInputSpec!, $osv: OSVInputSpec!, $vexStatement: VexStatementInputSpec!) { ingestVEXStatement(subject: {package: $pkg}, vulnerability: {osv: $osv}, vexStatement: $vexStatement) { - ...allCertifyVEXStatement + ...AllCertifyVEXStatement } } mutation VexArtifactAndCve($artifact: ArtifactInputSpec!, $cve: CVEInputSpec!, $vexStatement: VexStatementInputSpec!) { ingestVEXStatement(subject: {artifact: $artifact}, vulnerability: {cve: $cve}, vexStatement: $vexStatement) { - ...allCertifyVEXStatement + ...AllCertifyVEXStatement } } mutation VexArtifactAndGhsa($artifact: ArtifactInputSpec!, $ghsa: GHSAInputSpec!, $vexStatement: VexStatementInputSpec!) { ingestVEXStatement(subject: {artifact: $artifact}, vulnerability: {ghsa: $ghsa}, vexStatement: $vexStatement) { - ...allCertifyVEXStatement + ...AllCertifyVEXStatement } } mutation VexArtifactAndOsv($artifact: ArtifactInputSpec!, $osv: OSVInputSpec!, $vexStatement: VexStatementInputSpec!) { ingestVEXStatement(subject: {artifact: $artifact}, vulnerability: {osv: $osv}, vexStatement: $vexStatement) { - ...allCertifyVEXStatement + ...AllCertifyVEXStatement } } diff --git a/pkg/assembler/clients/operations/contact.graphql b/pkg/assembler/clients/operations/contact.graphql index 9079fcd48d..fc32c645b0 100644 --- a/pkg/assembler/clients/operations/contact.graphql +++ b/pkg/assembler/clients/operations/contact.graphql @@ -19,18 +19,18 @@ mutation PointOfContactPkg($pkg: PkgInputSpec!, $pkgMatchType: MatchFlags, $pointOfContact: PointOfContactInputSpec!) { ingestPointOfContact(subject: {package: $pkg}, pkgMatchType: $pkgMatchType, pointOfContact: $pointOfContact) { - ...allPointOfContact + ...AllPointOfContact } } mutation PointOfContactSrc($source: SourceInputSpec!, $pointOfContact: PointOfContactInputSpec!) { ingestPointOfContact(subject: {source: $source}, pointOfContact: $pointOfContact) { - ...allPointOfContact + ...AllPointOfContact } } mutation PointOfContactArtifact($artifact: ArtifactInputSpec!, $pointOfContact: PointOfContactInputSpec!) { ingestPointOfContact(subject: {artifact: $artifact}, pointOfContact: $pointOfContact) { - ...allPointOfContact + ...AllPointOfContact } } diff --git a/pkg/assembler/clients/operations/hasSBOM.graphql b/pkg/assembler/clients/operations/hasSBOM.graphql index 66c553f8ab..7356a857cf 100644 --- a/pkg/assembler/clients/operations/hasSBOM.graphql +++ b/pkg/assembler/clients/operations/hasSBOM.graphql @@ -19,12 +19,12 @@ mutation HasSBOMPkg($pkg: PkgInputSpec!, $hasSBOM: HasSBOMInputSpec!) { ingestHasSBOM(subject: {package: $pkg}, hasSBOM: $hasSBOM) { - ...allHasSBOMTree + ...AllHasSBOMTree } } mutation HasSBOMArtifact($artifact: ArtifactInputSpec!, $hasSBOM: HasSBOMInputSpec!) { ingestHasSBOM(subject: {artifact: $artifact}, hasSBOM: $hasSBOM) { - ...allHasSBOMTree + ...AllHasSBOMTree } } diff --git a/pkg/assembler/clients/operations/hasSLSA.graphql b/pkg/assembler/clients/operations/hasSLSA.graphql index cdea8f7c4d..c1cc95c264 100644 --- a/pkg/assembler/clients/operations/hasSLSA.graphql +++ b/pkg/assembler/clients/operations/hasSLSA.graphql @@ -19,7 +19,7 @@ mutation SLSAForArtifact($artifact: ArtifactInputSpec!, $materials: [ArtifactInputSpec!]!, $builder: BuilderInputSpec!, $slsa: SLSAInputSpec!) { ingestSLSA(subject: $artifact, builtFrom: $materials, builtBy: $builder, slsa: $slsa) { - ...allSLSATree + ...AllSLSATree } } @@ -27,6 +27,6 @@ mutation SLSAForArtifact($artifact: ArtifactInputSpec!, $materials: [ArtifactInp mutation SLSAForArtifacts($artifacts: [ArtifactInputSpec!]!, $materialsList: [[ArtifactInputSpec!]!]!, $builders: [BuilderInputSpec!]!, $slsaList: [SLSAInputSpec!]!) { ingestSLSAs(subjects: $artifacts, builtFromList: $materialsList, builtByList: $builders, slsaList: $slsaList) { - ...allSLSATree + ...AllSLSATree } } diff --git a/pkg/assembler/clients/operations/hasSourceAt.graphql b/pkg/assembler/clients/operations/hasSourceAt.graphql index 9cb078eb94..30a517e283 100644 --- a/pkg/assembler/clients/operations/hasSourceAt.graphql +++ b/pkg/assembler/clients/operations/hasSourceAt.graphql @@ -19,6 +19,6 @@ mutation HasSourceAt($pkg: PkgInputSpec!, $pkgMatchType: MatchFlags!, $source: SourceInputSpec!, $hasSourceAt: HasSourceAtInputSpec!) { ingestHasSourceAt(pkg: $pkg, pkgMatchType: $pkgMatchType, source: $source, hasSourceAt: $hasSourceAt) { - ...allHasSourceAt + ...AllHasSourceAt } } diff --git a/pkg/assembler/clients/operations/hashEqual.graphql b/pkg/assembler/clients/operations/hashEqual.graphql index 88bb331735..ce0f2a94f1 100644 --- a/pkg/assembler/clients/operations/hashEqual.graphql +++ b/pkg/assembler/clients/operations/hashEqual.graphql @@ -19,6 +19,6 @@ mutation HashEqual($artifact: ArtifactInputSpec!, $otherArtifact: ArtifactInputSpec!, $hashEqual: HashEqualInputSpec!) { ingestHashEqual(artifact: $artifact, otherArtifact: $otherArtifact, hashEqual: $hashEqual) { - ...allHashEqualTree + ...AllHashEqualTree } } diff --git a/pkg/assembler/clients/operations/isDependency.graphql b/pkg/assembler/clients/operations/isDependency.graphql index 3bb59ca02a..394217f0b1 100644 --- a/pkg/assembler/clients/operations/isDependency.graphql +++ b/pkg/assembler/clients/operations/isDependency.graphql @@ -19,7 +19,7 @@ mutation IsDependency($pkg: PkgInputSpec!, $depPkg: PkgInputSpec!, $dependency: IsDependencyInputSpec!) { ingestDependency(pkg: $pkg, depPkg: $depPkg, dependency: $dependency) { - ...allIsDependencyTree + ...AllIsDependencyTree } } @@ -27,6 +27,6 @@ mutation IsDependency($pkg: PkgInputSpec!, $depPkg: PkgInputSpec!, $dependency: mutation IsDependencies($pkgs: [PkgInputSpec!]!, $depPkgs: [PkgInputSpec!]!, $dependencies: [IsDependencyInputSpec!]!) { ingestDependencies(pkgs: $pkgs, depPkgs: $depPkgs, dependencies: $dependencies) { - ...allIsDependencyTree + ...AllIsDependencyTree } } diff --git a/pkg/assembler/clients/operations/isVulnerability.graphql b/pkg/assembler/clients/operations/isVulnerability.graphql index 8de2fe8409..f04d366e6e 100644 --- a/pkg/assembler/clients/operations/isVulnerability.graphql +++ b/pkg/assembler/clients/operations/isVulnerability.graphql @@ -19,12 +19,12 @@ mutation IsVulnerabilityCVE($osv: OSVInputSpec!, $cve: CVEInputSpec!, $isVulnerability: IsVulnerabilityInputSpec!) { ingestIsVulnerability(osv: $osv, vulnerability: {cve: $cve}, isVulnerability: $isVulnerability) { - ...allIsVulnerability + ...AllIsVulnerability } } mutation IsVulnerabilityGHSA($osv: OSVInputSpec!, $ghsa: GHSAInputSpec!, $isVulnerability: IsVulnerabilityInputSpec!) { ingestIsVulnerability(osv: $osv, vulnerability: {ghsa: $ghsa}, isVulnerability: $isVulnerability) { - ...allIsVulnerability + ...AllIsVulnerability } } diff --git a/pkg/assembler/clients/operations/metadata.graphql b/pkg/assembler/clients/operations/metadata.graphql index 9b2a8f0519..681b172780 100644 --- a/pkg/assembler/clients/operations/metadata.graphql +++ b/pkg/assembler/clients/operations/metadata.graphql @@ -19,18 +19,18 @@ mutation HasMetadataPkg($pkg: PkgInputSpec!, $pkgMatchType: MatchFlags, $hasMetadata: HasMetadataInputSpec!) { ingestHasMetadata(subject: {package: $pkg}, pkgMatchType: $pkgMatchType, hasMetadata: $hasMetadata) { - ...allHasMetadata + ...AllHasMetadata } } mutation HasMetadataSrc($source: SourceInputSpec!, $hasMetadata: HasMetadataInputSpec!) { ingestHasMetadata(subject: {source: $source}, hasMetadata: $hasMetadata) { - ...allHasMetadata + ...AllHasMetadata } } mutation HasMetadataArtifact($artifact: ArtifactInputSpec!, $hasMetadata: HasMetadataInputSpec!) { ingestHasMetadata(subject: {artifact: $artifact}, hasMetadata: $hasMetadata) { - ...allHasMetadata + ...AllHasMetadata } } diff --git a/pkg/assembler/clients/operations/path.graphql b/pkg/assembler/clients/operations/path.graphql index 8689e24c32..03562802ca 100644 --- a/pkg/assembler/clients/operations/path.graphql +++ b/pkg/assembler/clients/operations/path.graphql @@ -30,7 +30,7 @@ query Path($subject: ID!, $target: ID!, $maxPathLength: Int!, $usingOnly: [Edge! ...AllArtifactTree } ... on Builder { - ...allBuilderTree + ...AllBuilderTree } ... on OSV { ...AllOSVTree @@ -48,43 +48,43 @@ query Path($subject: ID!, $target: ID!, $maxPathLength: Int!, $usingOnly: [Edge! ...AllCertifyScorecard } ... on PkgEqual { - ...allPkgEqual + ...AllPkgEqual } ... on IsOccurrence { ...AllIsOccurrencesTree } ... on IsDependency { - ...allIsDependencyTree + ...AllIsDependencyTree } ... on HasSLSA { - ...allSLSATree + ...AllSLSATree } ... on CertifyBad { ...AllCertifyBad } ... on CertifyGood { - ...allCertifyGood + ...AllCertifyGood } ... on HashEqual { - ...allHashEqualTree + ...AllHashEqualTree } ... on HasSBOM { - ...allHasSBOMTree + ...AllHasSBOMTree } ... on HasSourceAt { - ...allHasSourceAt + ...AllHasSourceAt } ... on CertifyVuln { ...AllCertifyVuln } ... on IsVulnerability { - ...allIsVulnerability + ...AllIsVulnerability } ... on CertifyVEXStatement { - ...allCertifyVEXStatement + ...AllCertifyVEXStatement } ... on Builder { - ...allBuilderTree + ...AllBuilderTree } } } @@ -102,7 +102,7 @@ query Neighbors($node: ID!, $usingOnly: [Edge!]!) { ...AllArtifactTree } ... on Builder { - ...allBuilderTree + ...AllBuilderTree } ... on OSV { ...AllOSVTree @@ -120,43 +120,43 @@ query Neighbors($node: ID!, $usingOnly: [Edge!]!) { ...AllCertifyScorecard } ... on PkgEqual { - ...allPkgEqual + ...AllPkgEqual } ... on IsOccurrence { ...AllIsOccurrencesTree } ... on IsDependency { - ...allIsDependencyTree + ...AllIsDependencyTree } ... on HasSLSA { - ...allSLSATree + ...AllSLSATree } ... on CertifyBad { ...AllCertifyBad } ... on CertifyGood { - ...allCertifyGood + ...AllCertifyGood } ... on HashEqual { - ...allHashEqualTree + ...AllHashEqualTree } ... on HasSBOM { - ...allHasSBOMTree + ...AllHasSBOMTree } ... on HasSourceAt { - ...allHasSourceAt + ...AllHasSourceAt } ... on CertifyVuln { ...AllCertifyVuln } ... on IsVulnerability { - ...allIsVulnerability + ...AllIsVulnerability } ... on CertifyVEXStatement { - ...allCertifyVEXStatement + ...AllCertifyVEXStatement } ... on Builder { - ...allBuilderTree + ...AllBuilderTree } } } @@ -174,7 +174,7 @@ query Node($node: ID!) { ...AllArtifactTree } ... on Builder { - ...allBuilderTree + ...AllBuilderTree } ... on OSV { ...AllOSVTree @@ -192,43 +192,43 @@ query Node($node: ID!) { ...AllCertifyScorecard } ... on PkgEqual { - ...allPkgEqual + ...AllPkgEqual } ... on IsOccurrence { ...AllIsOccurrencesTree } ... on IsDependency { - ...allIsDependencyTree + ...AllIsDependencyTree } ... on HasSLSA { - ...allSLSATree + ...AllSLSATree } ... on CertifyBad { ...AllCertifyBad } ... on CertifyGood { - ...allCertifyGood + ...AllCertifyGood } ... on HashEqual { - ...allHashEqualTree + ...AllHashEqualTree } ... on HasSBOM { - ...allHasSBOMTree + ...AllHasSBOMTree } ... on HasSourceAt { - ...allHasSourceAt + ...AllHasSourceAt } ... on CertifyVuln { ...AllCertifyVuln } ... on IsVulnerability { - ...allIsVulnerability + ...AllIsVulnerability } ... on CertifyVEXStatement { - ...allCertifyVEXStatement + ...AllCertifyVEXStatement } ... on Builder { - ...allBuilderTree + ...AllBuilderTree } } } @@ -246,7 +246,7 @@ query Nodes($nodes: [ID!]!) { ...AllArtifactTree } ... on Builder { - ...allBuilderTree + ...AllBuilderTree } ... on OSV { ...AllOSVTree @@ -264,43 +264,43 @@ query Nodes($nodes: [ID!]!) { ...AllCertifyScorecard } ... on PkgEqual { - ...allPkgEqual + ...AllPkgEqual } ... on IsOccurrence { ...AllIsOccurrencesTree } ... on IsDependency { - ...allIsDependencyTree + ...AllIsDependencyTree } ... on HasSLSA { - ...allSLSATree + ...AllSLSATree } ... on CertifyBad { ...AllCertifyBad } ... on CertifyGood { - ...allCertifyGood + ...AllCertifyGood } ... on HashEqual { - ...allHashEqualTree + ...AllHashEqualTree } ... on HasSBOM { - ...allHasSBOMTree + ...AllHasSBOMTree } ... on HasSourceAt { - ...allHasSourceAt + ...AllHasSourceAt } ... on CertifyVuln { ...AllCertifyVuln } ... on IsVulnerability { - ...allIsVulnerability + ...AllIsVulnerability } ... on CertifyVEXStatement { - ...allCertifyVEXStatement + ...AllCertifyVEXStatement } ... on Builder { - ...allBuilderTree + ...AllBuilderTree } } } diff --git a/pkg/assembler/clients/operations/pkgEqual.graphql b/pkg/assembler/clients/operations/pkgEqual.graphql index 4c47002a54..b24227ee99 100644 --- a/pkg/assembler/clients/operations/pkgEqual.graphql +++ b/pkg/assembler/clients/operations/pkgEqual.graphql @@ -25,6 +25,6 @@ mutation PkgEqual($pkg: PkgInputSpec!, $otherPackage: PkgInputSpec!, $pkgEqual: ...AllPkgTree } ingestPkgEqual(pkg: $pkg, otherPackage: $otherPackage, pkgEqual: $pkgEqual) { - ...allPkgEqual + ...AllPkgEqual } } diff --git a/pkg/assembler/clients/operations/trees.graphql b/pkg/assembler/clients/operations/trees.graphql index 6b551a4488..bafad388ac 100644 --- a/pkg/assembler/clients/operations/trees.graphql +++ b/pkg/assembler/clients/operations/trees.graphql @@ -17,7 +17,7 @@ # Defines GraphQL fragments used in the operations -# TODO(mihaimaruseac): Clean this up: do we want all of these to be returned? +# TODO(mihaimaruseac): Clean this up: do we want All of these to be returned? fragment AllPkgTree on Package { id @@ -62,7 +62,7 @@ fragment AllArtifactTree on Artifact { digest } -fragment allBuilderTree on Builder { +fragment AllBuilderTree on Builder { id uri } @@ -121,7 +121,7 @@ fragment AllIsOccurrencesTree on IsOccurrence { collector } -fragment allIsDependencyTree on IsDependency { +fragment AllIsDependencyTree on IsDependency { id justification package { @@ -136,7 +136,7 @@ fragment allIsDependencyTree on IsDependency { collector } -fragment allSLSATree on HasSLSA { +fragment AllSLSATree on HasSLSA { id subject { ...AllArtifactTree @@ -181,7 +181,7 @@ fragment AllCertifyBad on CertifyBad { collector } -fragment allCertifyGood on CertifyGood { +fragment AllCertifyGood on CertifyGood { id justification subject { @@ -200,7 +200,7 @@ fragment allCertifyGood on CertifyGood { collector } -fragment allHashEqualTree on HashEqual { +fragment AllHashEqualTree on HashEqual { id justification artifacts { @@ -210,7 +210,7 @@ fragment allHashEqualTree on HashEqual { collector } -fragment allHasSBOMTree on HasSBOM { +fragment AllHasSBOMTree on HasSBOM { id subject { __typename @@ -229,7 +229,7 @@ fragment allHasSBOMTree on HasSBOM { collector } -fragment allHasSourceAt on HasSourceAt { +fragment AllHasSourceAt on HasSourceAt { id justification knownSince @@ -274,7 +274,7 @@ fragment AllCertifyVuln on CertifyVuln { } } -fragment allPkgEqual on PkgEqual { +fragment AllPkgEqual on PkgEqual { id justification packages { @@ -284,7 +284,7 @@ fragment allPkgEqual on PkgEqual { collector } -fragment allIsVulnerability on IsVulnerability { +fragment AllIsVulnerability on IsVulnerability { id osv { ...AllOSVTree @@ -303,7 +303,7 @@ fragment allIsVulnerability on IsVulnerability { collector } -fragment allCertifyVEXStatement on CertifyVEXStatement { +fragment AllCertifyVEXStatement on CertifyVEXStatement { id subject { __typename @@ -335,7 +335,7 @@ fragment allCertifyVEXStatement on CertifyVEXStatement { collector } -fragment allHasMetadata on HasMetadata { +fragment AllHasMetadata on HasMetadata { id subject { __typename @@ -358,7 +358,7 @@ fragment allHasMetadata on HasMetadata { collector } -fragment allPointOfContact on PointOfContact { +fragment AllPointOfContact on PointOfContact { id subject { __typename