Skip to content

Commit

Permalink
#1734 Add imported property in alert
Browse files Browse the repository at this point in the history
  • Loading branch information
To-om committed Jan 7, 2021
1 parent 6f87452 commit b676098
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions thehive/app/org/thp/thehive/controllers/v0/AlertCtrl.scala
Original file line number Diff line number Diff line change
Expand Up @@ -449,6 +449,7 @@ class PublicAlert @Inject() (
case _ => Failure(BadRequestError("Invalid custom fields format"))
})
.property("case", db.idMapping)(_.select(_.`case`._id).readonly)
.property("imported", UMapping.boolean)(_.select(_.imported).readonly)
.property("importDate", UMapping.date.optional)(_.select(_.importDate).readonly)
.property("computed.handlingDuration", UMapping.long)(_.select(_.handlingDuration).readonly)
.property("computed.handlingDurationInSeconds", UMapping.long)(_.select(_.handlingDuration.math("_ / 1000").domainMap(_.toLong)).readonly)
Expand Down
2 changes: 2 additions & 0 deletions thehive/app/org/thp/thehive/controllers/v1/Properties.scala
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,8 @@ class Properties @Inject() (
} yield Json.obj("customFields" -> values)
case _ => Failure(BadRequestError("Invalid custom fields format"))
})
.property("case", db.idMapping)(_.select(_.`case`._id).readonly)
.property("imported", UMapping.boolean)(_.select(_.imported).readonly)
.property("importDate", UMapping.date.optional)(_.select(_.importDate).readonly)
.property("computed.handlingDuration", UMapping.long)(_.select(_.handlingDuration).readonly)
.property("computed.handlingDurationInSeconds", UMapping.long)(_.select(_.handlingDuration.math("_ / 1000").domainMap(_.toLong)).readonly)
Expand Down

0 comments on commit b676098

Please sign in to comment.