Skip to content

Commit

Permalink
Fixing swagger in horusec-analytics (#27)
Browse files Browse the repository at this point in the history
  • Loading branch information
wiliansilvazup authored Oct 1, 2020
1 parent 3927cd3 commit f106361
Show file tree
Hide file tree
Showing 6 changed files with 220 additions and 6 deletions.
4 changes: 4 additions & 0 deletions horusec-analytic/cmd/app/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,10 @@ import (
// @contact.name Horusec
// @contact.url https://github.com/ZupIT/horusec
// @contact.email horusec@zup.com.br

// @securityDefinitions.apikey ApiKeyAuth
// @in header
// @name Authorization
func main() {
postgresRead := adapter.NewRepositoryRead()

Expand Down
82 changes: 82 additions & 0 deletions horusec-analytic/docs/docs.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,11 @@ var doc = `{
"paths": {
"/api/dashboard/companies/{companyID}/all-vulnerabilities": {
"get": {
"security": [
{
"ApiKeyAuth": []
}
],
"description": "get total vulnerabilities by severity",
"consumes": [
"application/json"
Expand Down Expand Up @@ -93,6 +98,11 @@ var doc = `{
},
"/api/dashboard/companies/{companyID}/details": {
"get": {
"security": [
{
"ApiKeyAuth": []
}
],
"description": "get vuln details",
"consumes": [
"application/json"
Expand Down Expand Up @@ -143,6 +153,11 @@ var doc = `{
},
"/api/dashboard/companies/{companyID}/repositories/{repositoryID}/all-vulnerabilities": {
"get": {
"security": [
{
"ApiKeyAuth": []
}
],
"description": "get vuln by severity",
"consumes": [
"application/json"
Expand Down Expand Up @@ -197,6 +212,11 @@ var doc = `{
},
"/api/dashboard/companies/{companyID}/repositories/{repositoryID}/total-developers": {
"get": {
"security": [
{
"ApiKeyAuth": []
}
],
"description": "get total developers",
"consumes": [
"application/json"
Expand Down Expand Up @@ -251,6 +271,11 @@ var doc = `{
},
"/api/dashboard/companies/{companyID}/repositories/{repositoryID}/total-repositories": {
"get": {
"security": [
{
"ApiKeyAuth": []
}
],
"description": "get total repositories",
"consumes": [
"application/json"
Expand Down Expand Up @@ -305,6 +330,11 @@ var doc = `{
},
"/api/dashboard/companies/{companyID}/repositories/{repositoryID}/vulnerabilities-by-author": {
"get": {
"security": [
{
"ApiKeyAuth": []
}
],
"description": "get vuln by developer",
"consumes": [
"application/json"
Expand Down Expand Up @@ -359,6 +389,11 @@ var doc = `{
},
"/api/dashboard/companies/{companyID}/repositories/{repositoryID}/vulnerabilities-by-language": {
"get": {
"security": [
{
"ApiKeyAuth": []
}
],
"description": "get vuln by language",
"consumes": [
"application/json"
Expand Down Expand Up @@ -413,6 +448,11 @@ var doc = `{
},
"/api/dashboard/companies/{companyID}/repositories/{repositoryID}/vulnerabilities-by-repository": {
"get": {
"security": [
{
"ApiKeyAuth": []
}
],
"description": "get vuln by repository",
"consumes": [
"application/json"
Expand Down Expand Up @@ -467,6 +507,11 @@ var doc = `{
},
"/api/dashboard/companies/{companyID}/repositories/{repositoryID}/vulnerabilities-by-time": {
"get": {
"security": [
{
"ApiKeyAuth": []
}
],
"description": "get vuln by time",
"consumes": [
"application/json"
Expand Down Expand Up @@ -521,6 +566,11 @@ var doc = `{
},
"/api/dashboard/companies/{companyID}/total-developers": {
"get": {
"security": [
{
"ApiKeyAuth": []
}
],
"description": "get total developers",
"consumes": [
"application/json"
Expand Down Expand Up @@ -568,6 +618,11 @@ var doc = `{
},
"/api/dashboard/companies/{companyID}/total-repositories": {
"get": {
"security": [
{
"ApiKeyAuth": []
}
],
"description": "get total repositories",
"consumes": [
"application/json"
Expand Down Expand Up @@ -615,6 +670,11 @@ var doc = `{
},
"/api/dashboard/companies/{companyID}/vulnerabilities-by-author": {
"get": {
"security": [
{
"ApiKeyAuth": []
}
],
"description": "get total vulnerabilities by author",
"consumes": [
"application/json"
Expand Down Expand Up @@ -662,6 +722,11 @@ var doc = `{
},
"/api/dashboard/companies/{companyID}/vulnerabilities-by-language": {
"get": {
"security": [
{
"ApiKeyAuth": []
}
],
"description": "get total vulnerabilities by language",
"consumes": [
"application/json"
Expand Down Expand Up @@ -709,6 +774,11 @@ var doc = `{
},
"/api/dashboard/companies/{companyID}/vulnerabilities-by-repository": {
"get": {
"security": [
{
"ApiKeyAuth": []
}
],
"description": "get total vulnerabilities by repository",
"consumes": [
"application/json"
Expand Down Expand Up @@ -756,6 +826,11 @@ var doc = `{
},
"/api/dashboard/companies/{companyID}/vulnerabilities-by-time": {
"get": {
"security": [
{
"ApiKeyAuth": []
}
],
"description": "get total vulnerabilities by time",
"consumes": [
"application/json"
Expand Down Expand Up @@ -870,6 +945,13 @@ var doc = `{
}
}
}
},
"securityDefinitions": {
"ApiKeyAuth": {
"type": "apiKey",
"name": "Authorization",
"in": "header"
}
}
}`

Expand Down
82 changes: 82 additions & 0 deletions horusec-analytic/docs/swagger.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,11 @@
"paths": {
"/api/dashboard/companies/{companyID}/all-vulnerabilities": {
"get": {
"security": [
{
"ApiKeyAuth": []
}
],
"description": "get total vulnerabilities by severity",
"consumes": [
"application/json"
Expand Down Expand Up @@ -61,6 +66,11 @@
},
"/api/dashboard/companies/{companyID}/details": {
"get": {
"security": [
{
"ApiKeyAuth": []
}
],
"description": "get vuln details",
"consumes": [
"application/json"
Expand Down Expand Up @@ -111,6 +121,11 @@
},
"/api/dashboard/companies/{companyID}/repositories/{repositoryID}/all-vulnerabilities": {
"get": {
"security": [
{
"ApiKeyAuth": []
}
],
"description": "get vuln by severity",
"consumes": [
"application/json"
Expand Down Expand Up @@ -165,6 +180,11 @@
},
"/api/dashboard/companies/{companyID}/repositories/{repositoryID}/total-developers": {
"get": {
"security": [
{
"ApiKeyAuth": []
}
],
"description": "get total developers",
"consumes": [
"application/json"
Expand Down Expand Up @@ -219,6 +239,11 @@
},
"/api/dashboard/companies/{companyID}/repositories/{repositoryID}/total-repositories": {
"get": {
"security": [
{
"ApiKeyAuth": []
}
],
"description": "get total repositories",
"consumes": [
"application/json"
Expand Down Expand Up @@ -273,6 +298,11 @@
},
"/api/dashboard/companies/{companyID}/repositories/{repositoryID}/vulnerabilities-by-author": {
"get": {
"security": [
{
"ApiKeyAuth": []
}
],
"description": "get vuln by developer",
"consumes": [
"application/json"
Expand Down Expand Up @@ -327,6 +357,11 @@
},
"/api/dashboard/companies/{companyID}/repositories/{repositoryID}/vulnerabilities-by-language": {
"get": {
"security": [
{
"ApiKeyAuth": []
}
],
"description": "get vuln by language",
"consumes": [
"application/json"
Expand Down Expand Up @@ -381,6 +416,11 @@
},
"/api/dashboard/companies/{companyID}/repositories/{repositoryID}/vulnerabilities-by-repository": {
"get": {
"security": [
{
"ApiKeyAuth": []
}
],
"description": "get vuln by repository",
"consumes": [
"application/json"
Expand Down Expand Up @@ -435,6 +475,11 @@
},
"/api/dashboard/companies/{companyID}/repositories/{repositoryID}/vulnerabilities-by-time": {
"get": {
"security": [
{
"ApiKeyAuth": []
}
],
"description": "get vuln by time",
"consumes": [
"application/json"
Expand Down Expand Up @@ -489,6 +534,11 @@
},
"/api/dashboard/companies/{companyID}/total-developers": {
"get": {
"security": [
{
"ApiKeyAuth": []
}
],
"description": "get total developers",
"consumes": [
"application/json"
Expand Down Expand Up @@ -536,6 +586,11 @@
},
"/api/dashboard/companies/{companyID}/total-repositories": {
"get": {
"security": [
{
"ApiKeyAuth": []
}
],
"description": "get total repositories",
"consumes": [
"application/json"
Expand Down Expand Up @@ -583,6 +638,11 @@
},
"/api/dashboard/companies/{companyID}/vulnerabilities-by-author": {
"get": {
"security": [
{
"ApiKeyAuth": []
}
],
"description": "get total vulnerabilities by author",
"consumes": [
"application/json"
Expand Down Expand Up @@ -630,6 +690,11 @@
},
"/api/dashboard/companies/{companyID}/vulnerabilities-by-language": {
"get": {
"security": [
{
"ApiKeyAuth": []
}
],
"description": "get total vulnerabilities by language",
"consumes": [
"application/json"
Expand Down Expand Up @@ -677,6 +742,11 @@
},
"/api/dashboard/companies/{companyID}/vulnerabilities-by-repository": {
"get": {
"security": [
{
"ApiKeyAuth": []
}
],
"description": "get total vulnerabilities by repository",
"consumes": [
"application/json"
Expand Down Expand Up @@ -724,6 +794,11 @@
},
"/api/dashboard/companies/{companyID}/vulnerabilities-by-time": {
"get": {
"security": [
{
"ApiKeyAuth": []
}
],
"description": "get total vulnerabilities by time",
"consumes": [
"application/json"
Expand Down Expand Up @@ -838,5 +913,12 @@
}
}
}
},
"securityDefinitions": {
"ApiKeyAuth": {
"type": "apiKey",
"name": "Authorization",
"in": "header"
}
}
}
Loading

0 comments on commit f106361

Please sign in to comment.