diff --git a/assets/AnchoreHarborAdapter.png b/assets/AnchoreHarborAdapter.png index 11e12ee..fb46bad 100644 Binary files a/assets/AnchoreHarborAdapter.png and b/assets/AnchoreHarborAdapter.png differ diff --git a/go.sum b/go.sum index c56e18a..98dcc1a 100644 --- a/go.sum +++ b/go.sum @@ -1,3 +1,5 @@ +github.com/aws/aws-sdk-go v1.25.48 h1:J82DYDGZHOKHdhx6hD24Tm30c2C3GchYGfN0mf9iKUk= +github.com/aws/aws-sdk-go v1.25.48/go.mod h1:KmX6BPdI08NWTb3/sm4ZGu5ShLoqVDhKgpiN924inxo= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/elazarl/goproxy v0.0.0-20190711103511-473e67f1d7d2 h1:aZtFdDNWY/yH86JPR2WX/PN63635VsE/f/nXNPAbYxY= @@ -10,6 +12,8 @@ github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1 h1:EGx4pi6eqNxGa github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY= github.com/gorilla/mux v1.7.3 h1:gnP5JzjVOuiZD07fKKToCAOjS0yOpj/qPETTXCCS6hw= github.com/gorilla/mux v1.7.3/go.mod h1:1lud6UwP+6orDFRuTfBEV8e9/aOM/c4fVVCaMa2zaAs= +github.com/jmespath/go-jmespath v0.0.0-20180206201540-c2b33e8439af h1:pmfjZENx5imkbgOkpRUYLnmbU7UEFbjtDA2hxJ1ichM= +github.com/jmespath/go-jmespath v0.0.0-20180206201540-c2b33e8439af/go.mod h1:Nht3zPeWKUH0NzdCt2Blrr5ys8VGpn0CEB0cQHVjt7k= github.com/jtolds/gls v4.20.0+incompatible h1:xdiiI2gbIgH/gLH7ADydsJ1uDOEzR8yvV7C0MuV77Wo= github.com/jtolds/gls v4.20.0+incompatible/go.mod h1:QJZ7F/aHp+rZTRtaJ1ow/lLfFfVYBRgL+9YlvaHOwJU= github.com/konsorten/go-windows-terminal-sequences v1.0.1 h1:mweAR1A6xJ3oS2pRaGiHgQ4OO8tzTaLawm8vnODuwDk= diff --git a/pkg/adapter/adapter.go b/pkg/adapter/adapter.go index a2c58e7..dd18016 100644 --- a/pkg/adapter/adapter.go +++ b/pkg/adapter/adapter.go @@ -7,7 +7,7 @@ import ( const ( HarborVulnReportv1MimeType = "application/vnd.scanner.adapter.vuln.report.harbor+json; version=1.0" RawVulnReportMimeType = "application/vnd.scanner.adapter.vuln.report.raw+json" - DockerImageMimeType = "application/vnd.oci.image.manifest.v1+json" + DockerImageMimeType = "application/vnd.oci.image.manifest.v2+json" OciImageMimeType = "application/vnd.docker.distribution.manifest.v2+json" HarborMetadataVulnDbUpdateKey = "harbor.scanner-adapter/vulnerability-database-updated-at" HarborMetadataScannerTypeKey = "harbor.scanner-adapter/scanner-type" diff --git a/pkg/http/api/v1/handler.go b/pkg/http/api/v1/handler.go index 5f70c5b..5344371 100644 --- a/pkg/http/api/v1/handler.go +++ b/pkg/http/api/v1/handler.go @@ -3,13 +3,14 @@ package v1 import ( "encoding/json" "fmt" + "net/http" + "strings" + "github.com/anchore/harbor-scanner-adapter/pkg/adapter" "github.com/anchore/harbor-scanner-adapter/pkg/adapter/anchore" "github.com/anchore/harbor-scanner-adapter/pkg/model/harbor" "github.com/gorilla/mux" log "github.com/sirupsen/logrus" - "net/http" - "strings" ) const ( @@ -21,7 +22,7 @@ const ( JSONRequestMimeType = "application/json" HarborVulnReportv1MimeType = "application/vnd.scanner.adapter.vuln.report.harbor+json; version=1.0" RawVulnReportMimeType = "application/vnd.scanner.adapter.vuln.report.raw+json" - DockerImageMimeType = "application/vnd.oci.image.manifest.v1+json" + DockerImageMimeType = "application/vnd.oci.image.manifest.v2+json" OciImageMimeType = "application/vnd.docker.distribution.manifest.v2+json" HarborMetadataVulnDbUpdateKey = "harbor.scanner-adapter/vulnerability-database-updated-at" HarborMetadataScannerTypeKey = "harbor.scanner-adapter/scanner-type"