Skip to content

Commit

Permalink
Update LAPI swagger (crowdsecurity#1155)
Browse files Browse the repository at this point in the history
  • Loading branch information
blotus authored and kcbark committed Jan 12, 2022
1 parent 39d37b8 commit f2ee453
Show file tree
Hide file tree
Showing 24 changed files with 585 additions and 7 deletions.
2 changes: 1 addition & 1 deletion go.mod
Expand Up @@ -24,7 +24,7 @@ require (
github.com/fsnotify/fsnotify v1.4.9
github.com/gin-gonic/gin v1.6.3
github.com/go-co-op/gocron v1.9.0
github.com/go-openapi/errors v0.19.9
github.com/go-openapi/errors v0.20.1
github.com/go-openapi/strfmt v0.19.11
github.com/go-openapi/swag v0.19.12
github.com/go-openapi/validate v0.20.0
Expand Down
2 changes: 2 additions & 0 deletions go.sum
Expand Up @@ -202,6 +202,8 @@ github.com/go-openapi/errors v0.19.7/go.mod h1:cM//ZKUKyO06HSwqAelJ5NsEMMcpa6VpX
github.com/go-openapi/errors v0.19.8/go.mod h1:cM//ZKUKyO06HSwqAelJ5NsEMMcpa6VpXe8DOa1Mi1M=
github.com/go-openapi/errors v0.19.9 h1:9SnKdGhiPZHF3ttwFMiCBEb8jQ4IDdrK+5+a0oTygA4=
github.com/go-openapi/errors v0.19.9/go.mod h1:cM//ZKUKyO06HSwqAelJ5NsEMMcpa6VpXe8DOa1Mi1M=
github.com/go-openapi/errors v0.20.1 h1:j23mMDtRxMwIobkpId7sWh7Ddcx4ivaoqUbfXx5P+a8=
github.com/go-openapi/errors v0.20.1/go.mod h1:cM//ZKUKyO06HSwqAelJ5NsEMMcpa6VpXe8DOa1Mi1M=
github.com/go-openapi/inflect v0.19.0/go.mod h1:lHpZVlpIQqLyKwJ4N+YSc9hchQy/i12fJykb83CRBH4=
github.com/go-openapi/jsonpointer v0.17.0/go.mod h1:cOnomiV+CVVwFLk0A/MExoFMjwdsUdVpsRhURCKh+3M=
github.com/go-openapi/jsonpointer v0.18.0/go.mod h1:cOnomiV+CVVwFLk0A/MExoFMjwdsUdVpsRhURCKh+3M=
Expand Down
2 changes: 1 addition & 1 deletion pkg/apiserver/alerts_test.go
Expand Up @@ -123,7 +123,7 @@ func TestCreateAlert(t *testing.T) {
router.ServeHTTP(w, req)

assert.Equal(t, 500, w.Code)
assert.Equal(t, "{\"message\":\"validation failure list:\\nscenario in body is required\\nscenario_hash in body is required\\nscenario_version in body is required\\nsimulated in body is required\\nsource in body is required\"}", w.Body.String())
assert.Equal(t, "{\"message\":\"validation failure list:\\n0.scenario in body is required\\n0.scenario_hash in body is required\\n0.scenario_version in body is required\\n0.simulated in body is required\\n0.source in body is required\"}", w.Body.String())

// Create Valid Alert
alertContentBytes, err = ioutil.ReadFile("./tests/alert_sample.json")
Expand Down
28 changes: 28 additions & 0 deletions pkg/models/add_alerts_request.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 7 additions & 0 deletions pkg/models/add_alerts_response.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

28 changes: 28 additions & 0 deletions pkg/models/add_signals_request.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

34 changes: 34 additions & 0 deletions pkg/models/add_signals_request_item.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

146 changes: 144 additions & 2 deletions pkg/models/alert.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit f2ee453

Please sign in to comment.