Skip to content

Commit b3c920e

Browse files
author
To-om
committed
#127 Exclude report content of job when using search API
1 parent 3f086bf commit b3c920e

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

thehive-cortex/app/connectors/cortex/controllers/CortextCtrl.scala

+4-2
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ import play.api.routing.sird.{ DELETE, GET, PATCH, POST, UrlContext }
1414
import org.elastic4play.{ BadRequestError, NotFoundError, Timed }
1515
import org.elastic4play.controllers.{ Authenticated, FieldsBodyParser, Renderer }
1616
import org.elastic4play.models.JsonFormat.baseModelEntityWrites
17-
import org.elastic4play.services.{ QueryDef, QueryDSL, Role }
17+
import org.elastic4play.services.{ AuxSrv, QueryDef, QueryDSL, Role }
1818
import org.elastic4play.services.JsonFormat.queryReads
1919

2020
import connectors.Connector
@@ -26,6 +26,7 @@ class CortextCtrl @Inject() (
2626
reportTemplateCtrl: ReportTemplateCtrl,
2727
cortexConfig: CortexConfig,
2828
cortexSrv: CortexSrv,
29+
auxSrv: AuxSrv,
2930
authenticated: Authenticated,
3031
fieldsBodyParser: FieldsBodyParser,
3132
renderer: Renderer,
@@ -74,7 +75,8 @@ class CortextCtrl @Inject() (
7475
val sort = request.body.getStrings("sort").getOrElse(Nil)
7576

7677
val (jobs, total) = cortexSrv.find(query, range, sort)
77-
renderer.toOutput(OK, jobs, total)
78+
val jobWithoutReport = auxSrv.apply(jobs, 0, false, true)
79+
renderer.toOutput(OK, jobWithoutReport, total)
7880
}
7981

8082
@Timed

0 commit comments

Comments
 (0)