diff --git a/dto/src/main/scala/org/thp/thehive/dto/v1/Tag.scala b/dto/src/main/scala/org/thp/thehive/dto/v1/Tag.scala index 30fb572fa5..c2291cd4a3 100644 --- a/dto/src/main/scala/org/thp/thehive/dto/v1/Tag.scala +++ b/dto/src/main/scala/org/thp/thehive/dto/v1/Tag.scala @@ -2,7 +2,15 @@ package org.thp.thehive.dto.v1 import play.api.libs.json.{Json, OFormat} +import java.util.Date + case class OutputTag( + _id: String, + _type: String, + _createdBy: String, + _updatedBy: Option[String] = None, + _createdAt: Date, + _updatedAt: Option[Date] = None, namespace: String, predicate: String, value: Option[String], diff --git a/thehive/app/org/thp/thehive/controllers/v1/Conversion.scala b/thehive/app/org/thp/thehive/controllers/v1/Conversion.scala index 9b5358c624..3a3d21270c 100644 --- a/thehive/app/org/thp/thehive/controllers/v1/Conversion.scala +++ b/thehive/app/org/thp/thehive/controllers/v1/Conversion.scala @@ -304,6 +304,12 @@ object Conversion { tag .asInstanceOf[Tag] .into[OutputTag] + .withFieldConst(_._id, tag._id.toString) + .withFieldConst(_._updatedAt, tag._updatedAt) + .withFieldConst(_._updatedBy, tag._updatedBy) + .withFieldConst(_._createdAt, tag._createdAt) + .withFieldConst(_._createdBy, tag._createdBy) + .withFieldConst(_._type, "Profile") .withFieldComputed(_.namespace, t => if (t.isFreeTag) "_freetags_" else t.namespace) .transform ) diff --git a/thehive/app/org/thp/thehive/controllers/v1/TheHiveQueryExecutor.scala b/thehive/app/org/thp/thehive/controllers/v1/TheHiveQueryExecutor.scala index b46fdea04d..7e91472879 100644 --- a/thehive/app/org/thp/thehive/controllers/v1/TheHiveQueryExecutor.scala +++ b/thehive/app/org/thp/thehive/controllers/v1/TheHiveQueryExecutor.scala @@ -34,6 +34,7 @@ class TheHiveQueryExecutor @Inject() ( procedureCtrl: ProcedureCtrl, profileCtrl: ProfileCtrl, shareCtrl: ShareCtrl, + tagCtrl: TagCtrl, taskCtrl: TaskCtrl, userCtrl: UserCtrl, taxonomyCtrl: TaxonomyCtrl, @@ -59,7 +60,7 @@ class TheHiveQueryExecutor @Inject() ( procedureCtrl, profileCtrl, shareCtrl, -// tagCtrl, + tagCtrl, taskCtrl, userCtrl, taxonomyCtrl