Skip to content

Commit

Permalink
#1772 Add missing routes for stats and search
Browse files Browse the repository at this point in the history
  • Loading branch information
To-om committed Feb 4, 2021
1 parent 609522b commit 3a5a4e6
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 9 deletions.
6 changes: 3 additions & 3 deletions thehive/app/org/thp/thehive/controllers/v0/DescribeCtrl.scala
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ class DescribeCtrl @Inject() (
observableCtrl: ObservableCtrl,
observableTypeCtrl: ObservableTypeCtrl,
organisationCtrl: OrganisationCtrl,
pageCtrl: PageCtrl,
// pageCtrl: PageCtrl,
profileCtrl: ProfileCtrl,
taskCtrl: TaskCtrl,
userCtrl: UserCtrl,
Expand Down Expand Up @@ -118,8 +118,8 @@ class DescribeCtrl @Inject() (
organisationCtrl.publicData.publicProperties.list.flatMap(propertyToJson("organisation", _))
),
EntityDescription("profile", "/profile", profileCtrl.publicData.publicProperties.list.flatMap(propertyToJson("profile", _))),
EntityDescription("dashboard", "/dashboard", dashboardCtrl.publicData.publicProperties.list.flatMap(propertyToJson("dashboard", _))),
EntityDescription("page", "/page", pageCtrl.publicData.publicProperties.list.flatMap(propertyToJson("page", _)))
EntityDescription("dashboard", "/dashboard", dashboardCtrl.publicData.publicProperties.list.flatMap(propertyToJson("dashboard", _)))
// EntityDescription("page", "/page", pageCtrl.publicData.publicProperties.list.flatMap(propertyToJson("page", _)))
) ++ describeCortexEntity("case_artifact_job", "/connector/cortex/job", "JobCtrl") ++
describeCortexEntity("action", "/connector/cortex/action", "ActionCtrl")
}
Expand Down
21 changes: 15 additions & 6 deletions thehive/app/org/thp/thehive/controllers/v0/Router.scala
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,8 @@ class Router @Inject() (
case PATCH(p"/case/template/$caseTemplateId") => caseTemplateCtrl.update(caseTemplateId) // Audit ok
case POST(p"/case/template/_search") => caseTemplateCtrl.search
case DELETE(p"/case/template/$caseTemplateId") => caseTemplateCtrl.delete(caseTemplateId) // Audit ok
case POST(p"/case/template/_search") => caseTemplateCtrl.search
case POST(p"/case/template/_stats") => caseTemplateCtrl.stats

case GET(p"/user") => userCtrl.search
case POST(p"/user") => userCtrl.create // Audit ok
Expand All @@ -121,6 +123,7 @@ class Router @Inject() (
case DELETE(p"/user/$userId/key") => userCtrl.removeKey(userId) // Audit ok
case POST(p"/user/$userId/key/renew") => userCtrl.renewKey(userId) // Audit ok
case POST(p"/user/_search") => userCtrl.search
case POST(p"/user/_stats") => userCtrl.stats

case GET(p"/list") => listCtrl.list
case DELETE(p"/list/$itemId") => listCtrl.deleteItem(itemId)
Expand All @@ -131,19 +134,23 @@ class Router @Inject() (

case GET(p"/organisation") => organisationCtrl.list
case POST(p"/organisation") => organisationCtrl.create // Audit ok
case POST(p"/organisation/type/_search") => organisationCtrl.search
case POST(p"/organisation/type/_stats") => organisationCtrl.stats
case GET(p"/organisation/$organisationId") => organisationCtrl.get(organisationId)
case GET(p"/organisation/$organisationId/links") => organisationCtrl.listLinks(organisationId)
case PATCH(p"/organisation/$organisationId") => organisationCtrl.update(organisationId) // Audit ok
case PUT(p"/organisation/$organisationId1/link/$organisationId2") => organisationCtrl.link(organisationId1, organisationId2)
case PUT(p"/organisation/$organisationId1/links") => organisationCtrl.bulkLink(organisationId1)
case DELETE(p"/organisation/$organisationId1/link/$organisationId2") => organisationCtrl.unlink(organisationId1, organisationId2)

case GET(p"/customField") => customFieldCtrl.list
case POST(p"/customField") => customFieldCtrl.create
case GET(p"/customField/$id") => customFieldCtrl.get(id)
case DELETE(p"/customField/$id") => customFieldCtrl.delete(id)
case PATCH(p"/customField/$id") => customFieldCtrl.update(id)
case GET(p"/customFields/$id/use") => customFieldCtrl.useCount(id)
case GET(p"/customField") => customFieldCtrl.list
case POST(p"/customField") => customFieldCtrl.create
case GET(p"/customField/$id") => customFieldCtrl.get(id)
case DELETE(p"/customField/$id") => customFieldCtrl.delete(id)
case PATCH(p"/customField/$id") => customFieldCtrl.update(id)
case GET(p"/customFields/$id/use") => customFieldCtrl.useCount(id)
case POST(p"/customFields/_search") => customFieldCtrl.search
case POST(p"/customFields/_stats") => customFieldCtrl.stats

case GET(p"/alert") => alertCtrl.search
case POST(p"/alert") => alertCtrl.create // Audit ok
Expand Down Expand Up @@ -217,6 +224,8 @@ class Router @Inject() (

case GET(p"/permission") => permissionCtrl.list

case POST(p"/observable/type/_search") => observableTypeCtrl.search
case POST(p"/observable/type/_stats") => observableTypeCtrl.stats
case GET(p"/observable/type") => observableTypeCtrl.search
case GET(p"/observable/type/$idOrName") => observableTypeCtrl.get(idOrName)
case POST(p"/observable/type") => observableTypeCtrl.create
Expand Down

0 comments on commit 3a5a4e6

Please sign in to comment.