Skip to content

Commit

Permalink
changing mutationAPI to only return IDs instead of whole struct to fi… (
Browse files Browse the repository at this point in the history
#1169)

* changing mutationAPI to only return IDs instead of whole struct to fix #1116

Signed-off-by: pxp928 <parth.psu@gmail.com>

* static analysis

Signed-off-by: pxp928 <parth.psu@gmail.com>

* removing comment

Signed-off-by: pxp928 <parth.psu@gmail.com>

* add missing HasMetadata to path query

Signed-off-by: pxp928 <parth.psu@gmail.com>

* add comment that IDs can be empty strings

Signed-off-by: pxp928 <parth.psu@gmail.com>

---------

Signed-off-by: pxp928 <parth.psu@gmail.com>
Co-authored-by: pxp928 <parth.psu@gmail.com>
  • Loading branch information
arorasoham9 and pxp928 committed Aug 28, 2023
1 parent b8b130d commit 9c793a9
Show file tree
Hide file tree
Showing 104 changed files with 9,685 additions and 16,535 deletions.
23,213 changes: 8,051 additions & 15,162 deletions pkg/assembler/clients/generated/operations.go

Large diffs are not rendered by default.

9 changes: 2 additions & 7 deletions pkg/assembler/clients/operations/artifact.graphql
Expand Up @@ -18,19 +18,14 @@
# Ingest Artifact

mutation IngestArtifact($artifact: ArtifactInputSpec!) {
ingestArtifact(artifact: $artifact) {
...AllArtifactTree
}
ingestArtifact(artifact: $artifact)
}

# Bulk Ingest Artifacts

mutation IngestArtifacts($artifacts: [ArtifactInputSpec!]!) {
ingestArtifacts(artifacts: $artifacts) {
...AllArtifactTree
}
ingestArtifacts(artifacts: $artifacts)
}

# Exposes GraphQL queries to retrieve GUAC sources

query Artifacts($filter: ArtifactSpec!) {
Expand Down
8 changes: 2 additions & 6 deletions pkg/assembler/clients/operations/builder.graphql
Expand Up @@ -18,15 +18,11 @@
# Ingest Builder

mutation IngestBuilder($builder: BuilderInputSpec!) {
ingestBuilder(builder: $builder) {
uri
}
ingestBuilder(builder: $builder)
}

# Bulk Ingest Builder

mutation IngestBuilders($builders: [BuilderInputSpec!]!) {
ingestBuilders(builders: $builders) {
uri
}
ingestBuilders(builders: $builders)
}
80 changes: 56 additions & 24 deletions pkg/assembler/clients/operations/certifyBad.graphql
Expand Up @@ -17,42 +17,74 @@

# Defines the GraphQL operations to ingest a CertifyBad into GUAC

mutation CertifyBadPkg($pkg: PkgInputSpec!, $pkgMatchType: MatchFlags!, $certifyBad: CertifyBadInputSpec!) {
ingestCertifyBad(subject: {package: $pkg}, pkgMatchType: $pkgMatchType, certifyBad: $certifyBad) {
...AllCertifyBad
}
mutation CertifyBadPkg(
$pkg: PkgInputSpec!
$pkgMatchType: MatchFlags!
$certifyBad: CertifyBadInputSpec!
) {
ingestCertifyBad(
subject: { package: $pkg }
pkgMatchType: $pkgMatchType
certifyBad: $certifyBad
)
}

mutation CertifyBadSrc($source: SourceInputSpec!, $certifyBad: CertifyBadInputSpec!) {
ingestCertifyBad(subject: {source: $source}, pkgMatchType: {pkg: ALL_VERSIONS}, certifyBad: $certifyBad) {
...AllCertifyBad
}
mutation CertifyBadSrc(
$source: SourceInputSpec!
$certifyBad: CertifyBadInputSpec!
) {
ingestCertifyBad(
subject: { source: $source }
pkgMatchType: { pkg: ALL_VERSIONS }
certifyBad: $certifyBad
)
}

mutation CertifyBadArtifact($artifact: ArtifactInputSpec!, $certifyBad: CertifyBadInputSpec!) {
ingestCertifyBad(subject: {artifact: $artifact}, pkgMatchType: {pkg: ALL_VERSIONS}, certifyBad: $certifyBad) {
...AllCertifyBad
}
mutation CertifyBadArtifact(
$artifact: ArtifactInputSpec!
$certifyBad: CertifyBadInputSpec!
) {
ingestCertifyBad(
subject: { artifact: $artifact }
pkgMatchType: { pkg: ALL_VERSIONS }
certifyBad: $certifyBad
)
}

# Defines the GraphQL operations to bulk ingest a CertifyBad into GUAC

mutation CertifyBadPkgs($pkgs: [PkgInputSpec!]!, $pkgMatchType: MatchFlags!, $certifyBads: [CertifyBadInputSpec!]!) {
ingestCertifyBads(subjects: {packages: $pkgs}, pkgMatchType: $pkgMatchType, certifyBads: $certifyBads) {
...AllCertifyBad
}
mutation CertifyBadPkgs(
$pkgs: [PkgInputSpec!]!
$pkgMatchType: MatchFlags!
$certifyBads: [CertifyBadInputSpec!]!
) {
ingestCertifyBads(
subjects: { packages: $pkgs }
pkgMatchType: $pkgMatchType
certifyBads: $certifyBads
)
}

mutation CertifyBadSrcs($sources: [SourceInputSpec!]!, $certifyBads: [CertifyBadInputSpec!]!) {
ingestCertifyBads(subjects: {sources: $sources}, pkgMatchType: {pkg: ALL_VERSIONS}, certifyBads: $certifyBads) {
...AllCertifyBad
}
mutation CertifyBadSrcs(
$sources: [SourceInputSpec!]!
$certifyBads: [CertifyBadInputSpec!]!
) {
ingestCertifyBads(
subjects: { sources: $sources }
pkgMatchType: { pkg: ALL_VERSIONS }
certifyBads: $certifyBads
)
}

mutation CertifyBadArtifacts($artifacts: [ArtifactInputSpec!]!, $certifyBads: [CertifyBadInputSpec!]!) {
ingestCertifyBads(subjects: {artifacts: $artifacts}, pkgMatchType: {pkg: ALL_VERSIONS}, certifyBads: $certifyBads) {
...AllCertifyBad
}
mutation CertifyBadArtifacts(
$artifacts: [ArtifactInputSpec!]!
$certifyBads: [CertifyBadInputSpec!]!
) {
ingestCertifyBads(
subjects: { artifacts: $artifacts }
pkgMatchType: { pkg: ALL_VERSIONS }
certifyBads: $certifyBads
)
}

# Exposes GraphQL queries to retrieve GUAC CertifyBads
Expand Down
81 changes: 56 additions & 25 deletions pkg/assembler/clients/operations/certifyGood.graphql
Expand Up @@ -17,41 +17,72 @@

# Defines the GraphQL operations to ingest a CertifyGood into GUAC

mutation CertifyGoodPkg($pkg: PkgInputSpec!, $pkgMatchType: MatchFlags!, $certifyGood: CertifyGoodInputSpec!) {
ingestCertifyGood(subject: {package: $pkg}, pkgMatchType: $pkgMatchType, certifyGood: $certifyGood) {
...AllCertifyGood
}
mutation CertifyGoodPkg(
$pkg: PkgInputSpec!
$pkgMatchType: MatchFlags!
$certifyGood: CertifyGoodInputSpec!
) {
ingestCertifyGood(
subject: { package: $pkg }
pkgMatchType: $pkgMatchType
certifyGood: $certifyGood
)
}

mutation CertifyGoodSrc($source: SourceInputSpec!, $certifyGood: CertifyGoodInputSpec!) {
ingestCertifyGood(subject: {source: $source}, pkgMatchType: {pkg: ALL_VERSIONS}, certifyGood: $certifyGood) {
...AllCertifyGood
}
mutation CertifyGoodSrc(
$source: SourceInputSpec!
$certifyGood: CertifyGoodInputSpec!
) {
ingestCertifyGood(
subject: { source: $source }
pkgMatchType: { pkg: ALL_VERSIONS }
certifyGood: $certifyGood
)
}

mutation CertifyGoodArtifact($artifact: ArtifactInputSpec!, $certifyGood: CertifyGoodInputSpec!) {
ingestCertifyGood(subject: {artifact: $artifact}, pkgMatchType: {pkg: ALL_VERSIONS}, certifyGood: $certifyGood) {
...AllCertifyGood
}
mutation CertifyGoodArtifact(
$artifact: ArtifactInputSpec!
$certifyGood: CertifyGoodInputSpec!
) {
ingestCertifyGood(
subject: { artifact: $artifact }
pkgMatchType: { pkg: ALL_VERSIONS }
certifyGood: $certifyGood
)
}

# Defines the GraphQL operations to bulk ingest a CertifyGood into GUAC

mutation CertifyGoodPkgs($pkgs: [PkgInputSpec!]!, $pkgMatchType: MatchFlags!, $certifyGoods: [CertifyGoodInputSpec!]!) {
ingestCertifyGoods(subjects: {packages: $pkgs}, pkgMatchType: $pkgMatchType, certifyGoods: $certifyGoods) {
...AllCertifyGood
}
mutation CertifyGoodPkgs(
$pkgs: [PkgInputSpec!]!
$pkgMatchType: MatchFlags!
$certifyGoods: [CertifyGoodInputSpec!]!
) {
ingestCertifyGoods(
subjects: { packages: $pkgs }
pkgMatchType: $pkgMatchType
certifyGoods: $certifyGoods
)
}

mutation CertifyGoodSrcs($sources: [SourceInputSpec!]!, $certifyGoods: [CertifyGoodInputSpec!]!) {
ingestCertifyGoods(subjects: {sources: $sources}, pkgMatchType: {pkg: ALL_VERSIONS}, certifyGoods: $certifyGoods) {
...AllCertifyGood
}
mutation CertifyGoodSrcs(
$sources: [SourceInputSpec!]!
$certifyGoods: [CertifyGoodInputSpec!]!
) {
ingestCertifyGoods(
subjects: { sources: $sources }
pkgMatchType: { pkg: ALL_VERSIONS }
certifyGoods: $certifyGoods
)
}

mutation CertifyGoodArtifacts($artifacts: [ArtifactInputSpec!]!, $certifyGoods: [CertifyGoodInputSpec!]!) {
ingestCertifyGoods(subjects: {artifacts: $artifacts}, pkgMatchType: {pkg: ALL_VERSIONS}, certifyGoods: $certifyGoods) {
...AllCertifyGood
}
mutation CertifyGoodArtifacts(
$artifacts: [ArtifactInputSpec!]!
$certifyGoods: [CertifyGoodInputSpec!]!
) {
ingestCertifyGoods(
subjects: { artifacts: $artifacts }
pkgMatchType: { pkg: ALL_VERSIONS }
certifyGoods: $certifyGoods
)
}

18 changes: 10 additions & 8 deletions pkg/assembler/clients/operations/certifyScorecard.graphql
Expand Up @@ -17,16 +17,18 @@

# Defines the GraphQL operations to ingest a Scorecard certification into GUAC

mutation CertifyScorecard($source: SourceInputSpec!, $scorecard: ScorecardInputSpec!) {
ingestScorecard(source: $source, scorecard: $scorecard) {
...AllCertifyScorecard
}
mutation CertifyScorecard(
$source: SourceInputSpec!
$scorecard: ScorecardInputSpec!
) {
ingestScorecard(source: $source, scorecard: $scorecard)
}

# Defines the GraphQL operations to bulk ingest Scorecard certifications into GUAC

mutation CertifyScorecards($sources: [SourceInputSpec!]!, $scorecards: [ScorecardInputSpec!]!) {
ingestScorecards(sources: $sources, scorecards: $scorecards) {
...AllCertifyScorecard
}
mutation CertifyScorecards(
$sources: [SourceInputSpec!]!
$scorecards: [ScorecardInputSpec!]!
) {
ingestScorecards(sources: $sources, scorecards: $scorecards)
}
28 changes: 20 additions & 8 deletions pkg/assembler/clients/operations/certifyVEXStatement.graphql
Expand Up @@ -17,14 +17,26 @@

# Defines the GraphQL operations to ingest VEX statements into GUAC

mutation CertifyVexPkg($pkg: PkgInputSpec!, $vulnerability: VulnerabilityInputSpec!, $vexStatement: VexStatementInputSpec!) {
ingestVEXStatement(subject: {package: $pkg}, vulnerability: $vulnerability, vexStatement: $vexStatement) {
...AllCertifyVEXStatement
}
mutation CertifyVexPkg(
$pkg: PkgInputSpec!
$vulnerability: VulnerabilityInputSpec!
$vexStatement: VexStatementInputSpec!
) {
ingestVEXStatement(
subject: { package: $pkg }
vulnerability: $vulnerability
vexStatement: $vexStatement
)
}

mutation CertifyVexArtifact($artifact: ArtifactInputSpec!, $vulnerability: VulnerabilityInputSpec!, $vexStatement: VexStatementInputSpec!) {
ingestVEXStatement(subject: {artifact: $artifact}, vulnerability: $vulnerability,, vexStatement: $vexStatement) {
...AllCertifyVEXStatement
}
mutation CertifyVexArtifact(
$artifact: ArtifactInputSpec!
$vulnerability: VulnerabilityInputSpec!
$vexStatement: VexStatementInputSpec!
) {
ingestVEXStatement(
subject: { artifact: $artifact }
vulnerability: $vulnerability
vexStatement: $vexStatement
)
}
28 changes: 20 additions & 8 deletions pkg/assembler/clients/operations/certifyVuln.graphql
Expand Up @@ -17,16 +17,28 @@

# Defines the GraphQL operations to ingest a vulnerability certification into GUAC

mutation CertifyVulnPkg($pkg: PkgInputSpec!, $vulnerability: VulnerabilityInputSpec!, $certifyVuln: ScanMetadataInput!) {
ingestCertifyVuln(pkg: $pkg, vulnerability: $vulnerability, certifyVuln: $certifyVuln) {
...AllCertifyVuln
}
mutation CertifyVulnPkg(
$pkg: PkgInputSpec!
$vulnerability: VulnerabilityInputSpec!
$certifyVuln: ScanMetadataInput!
) {
ingestCertifyVuln(
pkg: $pkg
vulnerability: $vulnerability
certifyVuln: $certifyVuln
)
}

# Defines the GraphQL operations to bulk ingest vulnerability certifications into GUAC

mutation CertifyVulnPkgs($pkgs: [PkgInputSpec!]!, $vulnerabilities: [VulnerabilityInputSpec!]!, $certifyVulns: [ScanMetadataInput!]!) {
ingestCertifyVulns(pkgs: $pkgs, vulnerabilities: $vulnerabilities, certifyVulns: $certifyVulns) {
...AllCertifyVuln
}
mutation CertifyVulnPkgs(
$pkgs: [PkgInputSpec!]!
$vulnerabilities: [VulnerabilityInputSpec!]!
$certifyVulns: [ScanMetadataInput!]!
) {
ingestCertifyVulns(
pkgs: $pkgs
vulnerabilities: $vulnerabilities
certifyVulns: $certifyVulns
)
}
40 changes: 28 additions & 12 deletions pkg/assembler/clients/operations/contact.graphql
Expand Up @@ -17,20 +17,36 @@

# Defines the GraphQL operations to ingest a PointOfContact into GUAC

mutation PointOfContactPkg($pkg: PkgInputSpec!, $pkgMatchType: MatchFlags!, $pointOfContact: PointOfContactInputSpec!) {
ingestPointOfContact(subject: {package: $pkg}, pkgMatchType: $pkgMatchType, pointOfContact: $pointOfContact) {
...AllPointOfContact
}
mutation PointOfContactPkg(
$pkg: PkgInputSpec!
$pkgMatchType: MatchFlags!
$pointOfContact: PointOfContactInputSpec!
) {
ingestPointOfContact(
subject: { package: $pkg }
pkgMatchType: $pkgMatchType
pointOfContact: $pointOfContact
)
}

mutation PointOfContactSrc($source: SourceInputSpec!, $pointOfContact: PointOfContactInputSpec!) {
ingestPointOfContact(subject: {source: $source}, pkgMatchType: {pkg: ALL_VERSIONS}, pointOfContact: $pointOfContact) {
...AllPointOfContact
}
mutation PointOfContactSrc(
$source: SourceInputSpec!
$pointOfContact: PointOfContactInputSpec!
) {
ingestPointOfContact(
subject: { source: $source }
pkgMatchType: { pkg: ALL_VERSIONS }
pointOfContact: $pointOfContact
)
}

mutation PointOfContactArtifact($artifact: ArtifactInputSpec!, $pointOfContact: PointOfContactInputSpec!) {
ingestPointOfContact(subject: {artifact: $artifact}, pkgMatchType: {pkg: ALL_VERSIONS}, pointOfContact: $pointOfContact) {
...AllPointOfContact
}
mutation PointOfContactArtifact(
$artifact: ArtifactInputSpec!
$pointOfContact: PointOfContactInputSpec!
) {
ingestPointOfContact(
subject: { artifact: $artifact }
pkgMatchType: { pkg: ALL_VERSIONS }
pointOfContact: $pointOfContact
)
}

0 comments on commit 9c793a9

Please sign in to comment.