Skip to content

Commit

Permalink
#1546 Fix audit and user url in describe API
Browse files Browse the repository at this point in the history
  • Loading branch information
To-om committed Nov 13, 2020
1 parent 6c48c56 commit c6f66e0
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions thehive/app/org/thp/thehive/controllers/v0/DescribeCtrl.scala
Original file line number Diff line number Diff line change
Expand Up @@ -80,9 +80,9 @@ class DescribeCtrl @Inject() (
EntityDescription("case_task", "/case/task", taskCtrl.publicData.publicProperties.list.flatMap(propertyToJson("case_task", _))),
EntityDescription("alert", "/alert", alertCtrl.publicData.publicProperties.list.flatMap(propertyToJson("alert", _))),
EntityDescription("case_artifact", "/case/artifact", observableCtrl.publicData.publicProperties.list.flatMap(propertyToJson("case_artifact", _))),
EntityDescription("user", "user", userCtrl.publicData.publicProperties.list.flatMap(propertyToJson("user", _))),
EntityDescription("user", "/user", userCtrl.publicData.publicProperties.list.flatMap(propertyToJson("user", _))),
EntityDescription("case_task_log", "/case/task/log", logCtrl.publicData.publicProperties.list.flatMap(propertyToJson("case_task_log", _))),
EntityDescription("audit", "audit", auditCtrl.publicData.publicProperties.list.flatMap(propertyToJson("audit", _)))
EntityDescription("audit", "/audit", auditCtrl.publicData.publicProperties.list.flatMap(propertyToJson("audit", _)))
) ++ describeCortexEntity("case_artifact_job", "/connector/cortex/job", "JobCtrl") ++
describeCortexEntity("action", "/connector/cortex/action", "ActionCtrl")

Expand Down
4 changes: 2 additions & 2 deletions thehive/app/org/thp/thehive/services/th3/Aggregation.scala
Original file line number Diff line number Diff line change
Expand Up @@ -283,8 +283,8 @@ case class FieldAggregation(
case order => order -> Order.asc
}
.foldLeft(groupedVertices) {
case (acc, (field, order)) if field == fieldName => acc.sort(_.by(_.selectKeys, order))
case (acc, (field, order)) if field == "count" => acc.sort(_.by(_.selectValues.localCount, order))
case (acc, (field, order)) if field == fieldName => acc.sort(_.by(_.selectKeys, order))
case (acc, (field, order)) if field == "count" || field == "_count" => acc.sort(_.by(_.selectValues.localCount, order))
case (acc, (field, _)) =>
logger.warn(s"In field aggregation you can only sort by the field ($fieldName) or by count, not by $field")
acc
Expand Down

0 comments on commit c6f66e0

Please sign in to comment.