Skip to content

Commit

Permalink
feat: remove use_csaf from request
Browse files Browse the repository at this point in the history
RHINENG-7872
  • Loading branch information
psegedy authored and jdobes committed Oct 15, 2024
1 parent 1513a35 commit 50420e9
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 26 deletions.
2 changes: 1 addition & 1 deletion vmaas-go/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ require (
github.com/prometheus/client_golang v1.19.1
github.com/redhatinsights/app-common-go v1.6.7
github.com/redhatinsights/platform-go-middlewares v1.0.0
github.com/redhatinsights/vmaas-lib v1.11.1
github.com/redhatinsights/vmaas-lib v1.12.0
github.com/sirupsen/logrus v1.9.3
github.com/stretchr/testify v1.9.0
github.com/zsais/go-gin-prometheus v0.1.0
Expand Down
4 changes: 2 additions & 2 deletions vmaas-go/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -109,8 +109,8 @@ github.com/redhatinsights/app-common-go v1.6.7 h1:cXWW0F6ZW53RLRr54gn7Azo9CLTysY
github.com/redhatinsights/app-common-go v1.6.7/go.mod h1:6gzRyg8ZyejwMCksukeAhh2ZXOB3uHSmBsbP06fG2PQ=
github.com/redhatinsights/platform-go-middlewares v1.0.0 h1:OxyiYt+VmNo+UucK/ey0b6UDFnpCni6JoGPeisGmmNI=
github.com/redhatinsights/platform-go-middlewares v1.0.0/go.mod h1:dRH6XOjiZDbw8STvk6NNC7mMwqhTaV7X+1tn1oXOs24=
github.com/redhatinsights/vmaas-lib v1.11.1 h1:U+xBEAq7jJwI7Wl8BbtCQsYTjS8FcaFNPFNe/snPEKI=
github.com/redhatinsights/vmaas-lib v1.11.1/go.mod h1:fCpKKAkaxgxSSLTgJYPgA4xi3qizDiUiboeDWst1j2Q=
github.com/redhatinsights/vmaas-lib v1.12.0 h1:hPuzmHRJ5KWpMjvYNrBsZSRSZb5RIHy00rzSLgn5n4k=
github.com/redhatinsights/vmaas-lib v1.12.0/go.mod h1:fCpKKAkaxgxSSLTgJYPgA4xi3qizDiUiboeDWst1j2Q=
github.com/rogpeppe/go-internal v1.10.0 h1:TMyTOH3F/DB16zRVcYyreMH6GnZZrwQVAoYjRBZyWFQ=
github.com/rogpeppe/go-internal v1.10.0/go.mod h1:UQnix2H7Ngw/k4C5ijL5+65zddjncjaFoBhdsK/akog=
github.com/sirupsen/logrus v1.8.1/go.mod h1:yWOB1SBYBC5VeMP7gHvWumXLIWorT60ONWic61uBYv0=
Expand Down
21 changes: 0 additions & 21 deletions vmaas-go/webapp/controllers/utils_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,27 +53,6 @@ func TestBindValidateJSON(t *testing.T) {
"module", &request, []byte(`{"modules_list": [{"module_name": "virt", "module_stream": "rhel"}]}`),
func(t *testing.T, err error, _ *vmaas.Request) { assert.NoError(t, err) },
},
{"use_csaf_default", &vmaas.Request{UseCsaf: true}, []byte(`{}`), func(t *testing.T, err error, r *vmaas.Request) {
if assert.NoError(t, err) {
assert.True(t, r.UseCsaf)
}
}},
{
"use_csaf_true", &vmaas.Request{UseCsaf: true}, []byte(`{"use_csaf": true}`),
func(t *testing.T, err error, r *vmaas.Request) {
if assert.NoError(t, err) {
assert.True(t, r.UseCsaf)
}
},
},
{
"use_csaf_false", &vmaas.Request{UseCsaf: true}, []byte(`{"use_csaf": false}`),
func(t *testing.T, err error, r *vmaas.Request) {
if assert.NoError(t, err) {
assert.False(t, r.UseCsaf)
}
},
},
}

for _, test := range tests {
Expand Down
4 changes: 2 additions & 2 deletions vmaas-go/webapp/controllers/vulnerabilities.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ func VulnerabilitiesHandler(c *gin.Context) {
return
}
pkg := c.Param("package")
request := vmaas.Request{Packages: []string{pkg}, UseCsaf: true}
request := vmaas.Request{Packages: []string{pkg}}

vulnerabilities, err := core.VmaasAPI.Vulnerabilities(&request)
if err != nil {
Expand All @@ -28,7 +28,7 @@ func VulnerabilitiesPostHandler(c *gin.Context) {
if !isCacheLoaded(c) {
return
}
request := vmaas.Request{UseCsaf: true}
request := vmaas.Request{}
err := bindValidateJSON(c, &request)
if err != nil {
utils.LogAndRespBadRequest(c, err)
Expand Down

0 comments on commit 50420e9

Please sign in to comment.