@@ -93,7 +93,7 @@ func informationSourceToString(source informationSource) string {
9393// @Param assetVersionSlug path string true "Asset version slug"
9494// @Param body body object true "Artifact data"
9595// @Success 201 {object} models.Artifact
96- // @Router /organizations/{organization}/projects/{projectSlug}/assets/{assetSlug}/refs/{assetVersionSlug}/artifacts [post]
96+ // @Router /organizations/{organization}/projects/{projectSlug}/assets/{assetSlug}/refs/{assetVersionSlug}/artifacts/ [post]
9797func (c * ArtifactController ) Create (ctx shared.Context ) error {
9898 asset := shared .GetAsset (ctx )
9999
@@ -225,7 +225,7 @@ func (c *ArtifactController) Create(ctx shared.Context) error {
225225// @Param assetVersionSlug path string true "Asset version slug"
226226// @Param artifactName path string true "Artifact name"
227227// @Success 200
228- // @Router /organizations/{organization}/projects/{projectSlug}/assets/{assetSlug}/refs/{assetVersionSlug}/artifacts/{artifactName} [delete]
228+ // @Router /organizations/{organization}/projects/{projectSlug}/assets/{assetSlug}/refs/{assetVersionSlug}/artifacts/{artifactName}/ [delete]
229229func (c * ArtifactController ) DeleteArtifact (ctx shared.Context ) error {
230230 asset := shared .GetAsset (ctx )
231231 reqCtx := ctx .Request ().Context ()
@@ -286,7 +286,7 @@ func (c *ArtifactController) DeleteArtifact(ctx shared.Context) error {
286286// @Param artifactName path string true "Artifact name"
287287// @Param body body object true "Artifact data"
288288// @Success 200 {object} object
289- // @Router /organizations/{organization}/projects/{projectSlug}/assets/{assetSlug}/refs/{assetVersionSlug}/artifacts/{artifactName} [put]
289+ // @Router /organizations/{organization}/projects/{projectSlug}/assets/{assetSlug}/refs/{assetVersionSlug}/artifacts/{artifactName}/ [put]
290290func (c * ArtifactController ) UpdateArtifact (ctx shared.Context ) error {
291291
292292 asset := shared .GetAsset (ctx )
@@ -439,7 +439,7 @@ func (c *ArtifactController) UpdateArtifact(ctx shared.Context) error {
439439// @Param assetVersionSlug path string true "Asset version slug"
440440// @Param artifactName path string true "Artifact name"
441441// @Success 200 {object} object
442- // @Router /organizations/{organization}/projects/{projectSlug}/assets/{assetSlug}/refs/{assetVersionSlug}/artifacts/{artifactName}/sbom.json [get]
442+ // @Router /organizations/{organization}/projects/{projectSlug}/assets/{assetSlug}/refs/{assetVersionSlug}/artifacts/{artifactName}/sbom.json/ [get]
443443func (c * ArtifactController ) SBOMJSON (ctx shared.Context ) error {
444444 assetVersion := shared .GetAssetVersion (ctx )
445445
@@ -461,6 +461,17 @@ func (c *ArtifactController) SBOMJSON(ctx shared.Context) error {
461461 return encoder .Encode (sbom .ToCycloneDX (ctxToBOMMetadata (ctx )))
462462}
463463
464+ // @Summary Get SBOM in XML format
465+ // @Tags Artifacts
466+ // @Security CookieAuth
467+ // @Security PATAuth
468+ // @Param organization path string true "Organization slug"
469+ // @Param projectSlug path string true "Project slug"
470+ // @Param assetSlug path string true "Asset slug"
471+ // @Param assetVersionSlug path string true "Asset version slug"
472+ // @Param artifactName path string true "Artifact name"
473+ // @Success 200 {object} object
474+ // @Router /organizations/{organization}/projects/{projectSlug}/assets/{assetSlug}/refs/{assetVersionSlug}/artifacts/{artifactName}/sbom.xml/ [get]
464475func (c * ArtifactController ) SBOMXML (ctx shared.Context ) error {
465476 assetVersion := shared .GetAssetVersion (ctx )
466477 sbom , err := c .assetVersionService .LoadFullSBOMGraph (ctx .Request ().Context (), nil , assetVersion )
@@ -476,6 +487,17 @@ func (c *ArtifactController) SBOMXML(ctx shared.Context) error {
476487 return encoder .Encode (sbom .ToCycloneDX (ctxToBOMMetadata (ctx )))
477488}
478489
490+ // @Summary Get VEX in XML format
491+ // @Tags Artifacts
492+ // @Security CookieAuth
493+ // @Security PATAuth
494+ // @Param organization path string true "Organization slug"
495+ // @Param projectSlug path string true "Project slug"
496+ // @Param assetSlug path string true "Asset slug"
497+ // @Param assetVersionSlug path string true "Asset version slug"
498+ // @Param artifactName path string true "Artifact name"
499+ // @Success 200 {object} object
500+ // @Router /organizations/{organization}/projects/{projectSlug}/assets/{assetSlug}/refs/{assetVersionSlug}/artifacts/{artifactName}/vex.xml/ [get]
479501func (c * ArtifactController ) VEXXML (ctx shared.Context ) error {
480502 sbom , err := c .buildVeX (ctx )
481503 if err != nil {
@@ -497,7 +519,7 @@ func (c *ArtifactController) VEXXML(ctx shared.Context) error {
497519// @Param assetVersionSlug path string true "Asset version slug"
498520// @Param artifactName path string true "Artifact name"
499521// @Success 200 {object} object
500- // @Router /organizations/{organization}/projects/{projectSlug}/assets/{assetSlug}/refs/{assetVersionSlug}/artifacts/{artifactName}/vex.json [get]
522+ // @Router /organizations/{organization}/projects/{projectSlug}/assets/{assetSlug}/refs/{assetVersionSlug}/artifacts/{artifactName}/vex.json/ [get]
501523func (c * ArtifactController ) VEXJSON (ctx shared.Context ) error {
502524 sbom , err := c .buildVeX (ctx )
503525 if err != nil {
@@ -510,6 +532,17 @@ func (c *ArtifactController) VEXJSON(ctx shared.Context) error {
510532 return encoder .Encode (sbom .ToCycloneDX (ctxToBOMMetadata (ctx )))
511533}
512534
535+ // @Summary Get VEX in OpenVEX JSON format
536+ // @Tags Artifacts
537+ // @Security CookieAuth
538+ // @Security PATAuth
539+ // @Param organization path string true "Organization slug"
540+ // @Param projectSlug path string true "Project slug"
541+ // @Param assetSlug path string true "Asset slug"
542+ // @Param assetVersionSlug path string true "Asset version slug"
543+ // @Param artifactName path string true "Artifact name"
544+ // @Success 200 {object} object
545+ // @Router /organizations/{organization}/projects/{projectSlug}/assets/{assetSlug}/refs/{assetVersionSlug}/artifacts/{artifactName}/openvex.json/ [get]
513546func (c * ArtifactController ) OpenVEXJSON (ctx shared.Context ) error {
514547 vex , err := c .buildOpenVeX (ctx )
515548 if err != nil {
@@ -553,6 +586,17 @@ func (c *ArtifactController) buildVeX(ctx shared.Context) (*normalize.SBOMGraph,
553586 return c .assetVersionService .BuildVeX (ctx .Request ().Context (), nil , frontendURL , org .Name , org .Slug , project .Slug , asset , assetVersion , dependencyVulns ), nil
554587}
555588
589+ // @Summary Get vulnerability report as PDF
590+ // @Tags Artifacts
591+ // @Security CookieAuth
592+ // @Security PATAuth
593+ // @Param organization path string true "Organization slug"
594+ // @Param projectSlug path string true "Project slug"
595+ // @Param assetSlug path string true "Asset slug"
596+ // @Param assetVersionSlug path string true "Asset version slug"
597+ // @Param artifactName path string true "Artifact name"
598+ // @Success 200 {object} object
599+ // @Router /organizations/{organization}/projects/{projectSlug}/assets/{assetSlug}/refs/{assetVersionSlug}/artifacts/{artifactName}/vulnerability-report.pdf/ [get]
556600func (c * ArtifactController ) BuildVulnerabilityReportPDF (ctx shared.Context ) error {
557601 assetVersion := shared .GetAssetVersion (ctx )
558602 org := shared .GetOrg (ctx )
@@ -763,6 +807,17 @@ func (c *ArtifactController) BuildVulnerabilityReportPDF(ctx shared.Context) err
763807 return err
764808}
765809
810+ // @Summary Get SBOM as PDF
811+ // @Tags Artifacts
812+ // @Security CookieAuth
813+ // @Security PATAuth
814+ // @Param organization path string true "Organization slug"
815+ // @Param projectSlug path string true "Project slug"
816+ // @Param assetSlug path string true "Asset slug"
817+ // @Param assetVersionSlug path string true "Asset version slug"
818+ // @Param artifactName path string true "Artifact name"
819+ // @Success 200 {object} object
820+ // @Router /organizations/{organization}/projects/{projectSlug}/assets/{assetSlug}/refs/{assetVersionSlug}/artifacts/{artifactName}/sbom.pdf/ [get]
766821func (c * ArtifactController ) BuildPDFFromSBOM (ctx shared.Context ) error {
767822 assetVersion := shared .GetAssetVersion (ctx )
768823 sbom , err := c .assetVersionService .LoadFullSBOMGraph (ctx .Request ().Context (), nil , assetVersion )
0 commit comments