diff --git a/ScalliGraph b/ScalliGraph index aacd88969a..3bac19220e 160000 --- a/ScalliGraph +++ b/ScalliGraph @@ -1 +1 @@ -Subproject commit aacd88969aa15ce126304b2d4c986adc5fb23e0e +Subproject commit 3bac19220e9b47bb95b65867608088ba037728c0 diff --git a/misp/connector/src/test/scala/org/thp/thehive/connector/misp/services/MispImportSrvTest.scala b/misp/connector/src/test/scala/org/thp/thehive/connector/misp/services/MispImportSrvTest.scala index 59ec8ed3bd..45e2ee97cb 100644 --- a/misp/connector/src/test/scala/org/thp/thehive/connector/misp/services/MispImportSrvTest.scala +++ b/misp/connector/src/test/scala/org/thp/thehive/connector/misp/services/MispImportSrvTest.scala @@ -92,7 +92,7 @@ class MispImportSrvTest(implicit ec: ExecutionContext) extends PlaySpecification pap = 2, read = false, follow = true, - tags = Nil, + tags = Seq("TH-test", "TH-test-2"), organisationId = alert.organisationId, caseId = None ) diff --git a/thehive/app/org/thp/thehive/services/AlertSrv.scala b/thehive/app/org/thp/thehive/services/AlertSrv.scala index c367361c4b..e8cad90b65 100644 --- a/thehive/app/org/thp/thehive/services/AlertSrv.scala +++ b/thehive/app/org/thp/thehive/services/AlertSrv.scala @@ -106,9 +106,9 @@ class AlertSrv @Inject() ( authContext: AuthContext ): Try[(Seq[Tag with Entity], Seq[Tag with Entity])] = for { - tagsToAdd <- (tags -- alert.tags).toTry(tagSrv.getOrCreate) - tagsToRemove <- (alert.tags.toSet -- tags).toTry(tagSrv.getOrCreate) - _ <- tagsToAdd.toTry(alertTagSrv.create(AlertTag(), alert, _)) + tagsToAdd <- (tags -- alert.tags).toTry(tagSrv.getOrCreate) + tagsToRemove = get(alert).tags.toSeq.filterNot(t => tags.contains(t.toString)) + _ <- tagsToAdd.toTry(alertTagSrv.create(AlertTag(), alert, _)) _ = if (tags.nonEmpty) get(alert).outE[AlertTag].filter(_.otherV.hasId(tagsToRemove.map(_._id): _*)).remove() _ <- get(alert).update(_.tags, tags.toSeq).getOrFail("Alert") _ <- auditSrv.alert.update(alert, Json.obj("tags" -> tags)) diff --git a/thehive/app/org/thp/thehive/services/CaseSrv.scala b/thehive/app/org/thp/thehive/services/CaseSrv.scala index ed6eb3a721..4867633b08 100644 --- a/thehive/app/org/thp/thehive/services/CaseSrv.scala +++ b/thehive/app/org/thp/thehive/services/CaseSrv.scala @@ -156,9 +156,9 @@ class CaseSrv @Inject() ( authContext: AuthContext ): Try[(Seq[Tag with Entity], Seq[Tag with Entity])] = for { - tagsToAdd <- (tags -- `case`.tags).toTry(tagSrv.getOrCreate) - tagsToRemove <- (`case`.tags.toSet -- tags).toTry(tagSrv.getOrCreate) - _ <- tagsToAdd.toTry(caseTagSrv.create(CaseTag(), `case`, _)) + tagsToAdd <- (tags -- `case`.tags).toTry(tagSrv.getOrCreate) + tagsToRemove = get(`case`).tags.toSeq.filterNot(t => tags.contains(t.toString)) + _ <- tagsToAdd.toTry(caseTagSrv.create(CaseTag(), `case`, _)) _ = if (tags.nonEmpty) get(`case`).outE[CaseTag].filter(_.otherV.hasId(tagsToRemove.map(_._id): _*)).remove() _ <- get(`case`).update(_.tags, tags.toSeq).getOrFail("Case") _ <- auditSrv.`case`.update(`case`, Json.obj("tags" -> tags)) diff --git a/thehive/app/org/thp/thehive/services/CaseTemplateSrv.scala b/thehive/app/org/thp/thehive/services/CaseTemplateSrv.scala index d83e8c6216..cda9c8d8e1 100644 --- a/thehive/app/org/thp/thehive/services/CaseTemplateSrv.scala +++ b/thehive/app/org/thp/thehive/services/CaseTemplateSrv.scala @@ -90,9 +90,9 @@ class CaseTemplateSrv @Inject() ( authContext: AuthContext ): Try[(Seq[Tag with Entity], Seq[Tag with Entity])] = for { - tagsToAdd <- (tags -- caseTemplate.tags).toTry(tagSrv.getOrCreate) - tagsToRemove <- (caseTemplate.tags.toSet -- tags).toTry(tagSrv.getOrCreate) - _ <- tagsToAdd.toTry(caseTemplateTagSrv.create(CaseTemplateTag(), caseTemplate, _)) + tagsToAdd <- (tags -- caseTemplate.tags).toTry(tagSrv.getOrCreate) + tagsToRemove = get(caseTemplate).tags.toSeq.filterNot(t => tags.contains(t.toString)) + _ <- tagsToAdd.toTry(caseTemplateTagSrv.create(CaseTemplateTag(), caseTemplate, _)) _ = if (tags.nonEmpty) get(caseTemplate).outE[CaseTemplateTag].filter(_.otherV.hasId(tagsToRemove.map(_._id): _*)).remove() _ <- get(caseTemplate).update(_.tags, tags.toSeq).getOrFail("CaseTemplate") _ <- auditSrv.caseTemplate.update(caseTemplate, Json.obj("tags" -> tags)) diff --git a/thehive/app/org/thp/thehive/services/DataSrv.scala b/thehive/app/org/thp/thehive/services/DataSrv.scala index ecfdfb84e6..d615a7b089 100644 --- a/thehive/app/org/thp/thehive/services/DataSrv.scala +++ b/thehive/app/org/thp/thehive/services/DataSrv.scala @@ -2,7 +2,7 @@ package org.thp.thehive.services import akka.actor.ActorRef import org.apache.tinkerpop.gremlin.process.traversal.P -import org.apache.tinkerpop.gremlin.structure.T +import org.apache.tinkerpop.gremlin.structure.{T, Vertex} import org.thp.scalligraph.auth.AuthContext import org.thp.scalligraph.models.{Database, Entity} import org.thp.scalligraph.services.{VertexSrv, _} @@ -30,6 +30,9 @@ class DataSrv @Inject() (@Named("integrity-check-actor") integrityCheckActor: Ac .fold(createEntity(e))(Success(_)) override def exists(e: Data)(implicit graph: Graph): Boolean = startTraversal.getByData(e.data).exists + + override def getByName(name: String)(implicit graph: Graph): Traversal.V[Data] = + startTraversal.getByData(name) } object DataOps { diff --git a/thehive/app/org/thp/thehive/services/LogSrv.scala b/thehive/app/org/thp/thehive/services/LogSrv.scala index f89cf89c1b..2e41fc9f3e 100644 --- a/thehive/app/org/thp/thehive/services/LogSrv.scala +++ b/thehive/app/org/thp/thehive/services/LogSrv.scala @@ -62,6 +62,9 @@ object LogOps { def get(idOrName: EntityIdOrName): Traversal.V[Log] = idOrName.fold(traversal.getByIds(_), _ => traversal.empty) + def organisations: Traversal.V[Organisation] = + task.organisations + def visible(organisationSrv: OrganisationSrv)(implicit authContext: AuthContext): Traversal.V[Log] = traversal.has(_.organisationIds, organisationSrv.currentId(traversal.graph, authContext)) diff --git a/thehive/app/org/thp/thehive/services/ObservableSrv.scala b/thehive/app/org/thp/thehive/services/ObservableSrv.scala index 82b1d8bf90..66f8a8834d 100644 --- a/thehive/app/org/thp/thehive/services/ObservableSrv.scala +++ b/thehive/app/org/thp/thehive/services/ObservableSrv.scala @@ -123,9 +123,9 @@ class ObservableSrv @Inject() ( authContext: AuthContext ): Try[(Seq[Tag with Entity], Seq[Tag with Entity])] = for { - tagsToAdd <- (tags -- observable.tags).toTry(tagSrv.getOrCreate) - tagsToRemove <- (observable.tags.toSet -- tags).toTry(tagSrv.getOrCreate) - _ <- tagsToAdd.toTry(observableTagSrv.create(ObservableTag(), observable, _)) + tagsToAdd <- (tags -- observable.tags).toTry(tagSrv.getOrCreate) + tagsToRemove = get(observable).tags.toSeq.filterNot(t => tags.contains(t.toString)) + _ <- tagsToAdd.toTry(observableTagSrv.create(ObservableTag(), observable, _)) _ = if (tags.nonEmpty) get(observable).outE[ObservableTag].filter(_.otherV.hasId(tagsToRemove.map(_._id): _*)).remove() _ <- get(observable).update(_.tags, tags.toSeq).getOrFail("Observable") _ <- auditSrv.observable.update(observable, Json.obj("tags" -> tags)) diff --git a/thehive/test/org/thp/thehive/DatabaseBuilder.scala b/thehive/test/org/thp/thehive/DatabaseBuilder.scala index d748181e3a..f87dfd613b 100644 --- a/thehive/test/org/thp/thehive/DatabaseBuilder.scala +++ b/thehive/test/org/thp/thehive/DatabaseBuilder.scala @@ -1,17 +1,21 @@ package org.thp.thehive -import org.apache.tinkerpop.gremlin.structure.Vertex -import org.apache.tinkerpop.gremlin.structure.VertexProperty.Cardinality import org.scalactic.Or -import org.thp.scalligraph.auth.AuthContext +import org.thp.scalligraph.auth.{AuthContext, AuthContextImpl} import org.thp.scalligraph.controllers._ -import org.thp.scalligraph.models.{Database, Entity, Schema, UMapping} +import org.thp.scalligraph.models.{Database, Entity, Schema} import org.thp.scalligraph.services.{EdgeSrv, GenIntegrityCheckOps, VertexSrv} +import org.thp.scalligraph.traversal.Graph import org.thp.scalligraph.traversal.TraversalOps._ -import org.thp.scalligraph.traversal.{Converter, Graph} import org.thp.scalligraph.{EntityId, EntityName, RichOption} import org.thp.thehive.models._ +import org.thp.thehive.services.AlertOps._ +import org.thp.thehive.services.CaseOps._ +import org.thp.thehive.services.CaseTemplateOps._ +import org.thp.thehive.services.LogOps._ +import org.thp.thehive.services.ObservableOps._ import org.thp.thehive.services.OrganisationOps._ +import org.thp.thehive.services.TaskOps._ import org.thp.thehive.services.TaxonomyOps._ import org.thp.thehive.services._ import play.api.Logger @@ -55,20 +59,21 @@ class DatabaseBuilder @Inject() ( lazy val logger: Logger = Logger(getClass) - def build()(implicit db: Database, authContext: AuthContext): Try[Unit] = { + def build()(implicit db: Database): Try[Unit] = { lazy val logger: Logger = Logger(getClass) logger.info("Initialize database schema") - db.createSchemaFrom(schema) + db.createSchemaFrom(schema)(LocalUserSrv.getSystemAuthContext) .flatMap(_ => db.addSchemaIndexes(schema)) .flatMap { _ => integrityChecks.foreach { check => db.tryTransaction { implicit graph => - Success(check.initialCheck()) + Success(check.initialCheck()(graph, LocalUserSrv.getSystemAuthContext)) } () } db.tryTransaction { implicit graph => + implicit val authContext: AuthContext = LocalUserSrv.getSystemAuthContext val idMap = createVertex(caseSrv, FieldsParser[Case]) ++ createVertex(alertSrv, FieldsParser[Alert]) ++ @@ -149,179 +154,122 @@ class DatabaseBuilder @Inject() ( createEdge(procedureSrv.caseProcedureSrv, caseSrv, procedureSrv, FieldsParser[CaseProcedure], idMap) createEdge(procedureSrv.procedurePatternSrv, procedureSrv, patternSrv, FieldsParser[ProcedurePattern], idMap) + Success(()) + } + db.tryTransaction { implicit graph => + val (defaultOrganisation, defaultUser) = organisationSrv.startTraversal.notAdmin.project(_.by.by(_.users)).head + implicit val authContext: AuthContext = + AuthContextImpl(defaultUser.login, defaultUser.name, defaultOrganisation._id, "init", Permissions.all) // For each organisation, if there is no custom taxonomy, create it organisationSrv .startTraversal .hasNot(_.name, "admin") .filterNot(_.taxonomies.freetags) - .foreach(o => taxonomySrv.createFreetagTaxonomy(o)) - - // TODO: get tags from entity and create freetag for each -// // Add each tag to its Organisation's FreeTags taxonomy -// caseSrv -// .startTraversal -// .project(_.by -// .by(_.value(_.tags).fold) -// .by(_.organisations.taxonomies.freetags)) -// .foreach { -// case (case0, tags, freeTaxo) => -// for { -// t <- tags.toTry(tagSrv.getOrCreate) -// _ <- t.toTry(caseSrv.caseTagSrv.create(CaseTag(), case0, _)) -// } -// } + .foreach(o => taxonomySrv.createFreetagTaxonomy(o).get) - alertSrv + caseSrv .startTraversal - .setConverter[Vertex, Converter.Identity[Vertex]](Converter.identity[Vertex]) .project( _.by - .by(_.out("AlertTag").valueMap("namespace", "predicate", "value").fold) - .by(_.out("AlertOrganisation")._id.option) - .by(_.out("AlertCase")._id.option) + .by(_.organisations._id.fold) ) .foreach { - case (vertex, tagMaps, Some(organisationId), caseId) => - val tags = for { - tag <- tagMaps.asInstanceOf[Seq[Map[String, String]]] - namespace = tag.getOrElse("namespace", "_autocreate") - predicate <- tag.get("predicate") - value = tag.get("value") - } yield - (if (namespace.headOption.getOrElse('_') == '_') "" else namespace + ':') + - (if (predicate.headOption.getOrElse('_') == '_') "" else predicate) + - value.fold("")(v => f"""="$v"""") - - tags.foreach(vertex.property(Cardinality.list, "tags", _)) - vertex.property("organisationId", organisationId.value) - caseId.foreach(vertex.property("caseId", _)) - case _ => + case (case0, organisationIds) => + case0.tags.foreach(tag => tagSrv.getOrCreate(tag).flatMap(caseSrv.caseTagSrv.create(CaseTag(), case0, _)).get) + case0.assignee.foreach(userSrv.getByName(_).getOrFail("User").flatMap(caseSrv.caseUserSrv.create(CaseUser(), case0, _)).get) + case0 + .resolutionStatus + .foreach( + resolutionStatusSrv + .getByName(_) + .getOrFail("ResolutionStatus") + .flatMap(caseSrv.caseResolutionStatusSrv.create(CaseResolutionStatus(), case0, _)) + .get + ) + case0 + .impactStatus + .foreach( + impactStatusSrv + .getByName(_) + .getOrFail("ImpectStatus") + .flatMap(caseSrv.caseImpactStatusSrv.create(CaseImpactStatus(), case0, _)) + .get + ) + case0 + .caseTemplate + .foreach( + caseTemplateSrv + .getByName(_) + .getOrFail("CaseTemplate") + .flatMap(caseSrv.caseCaseTemplateSrv.create(CaseCaseTemplate(), case0, _)) + .get + ) + caseSrv.get(case0).update(_.organisationIds, organisationIds.toSet).iterate() } - caseSrv + alertSrv .startTraversal - .setConverter[Vertex, Converter.Identity[Vertex]](Converter.identity[Vertex]) - .project( - _.by - .by(_.out("CaseTag").valueMap("namespace", "predicate", "value").fold) - .by(_.out("CaseUser").property("login", UMapping.string).option) - .by(_.in("ShareCase").in("OrganisationShare")._id.fold) - .by(_.out("CaseImpactStatus").property("value", UMapping.string).option) - .by(_.out("CaseResolutionStatus").property("value", UMapping.string).option) - .by(_.out("CaseCaseTemplate").property("name", UMapping.string).option) - ) + .project(_.by.by(_.organisation._id).by(_.`case`._id.option)) .foreach { - case (vertex, tagMaps, assignee, organisationIds, impactStatus, resolutionStatus, caseTemplate) => - val tags = for { - tag <- tagMaps.asInstanceOf[Seq[Map[String, String]]] - namespace = tag.getOrElse("namespace", "_autocreate") - predicate <- tag.get("predicate") - value = tag.get("value") - } yield - (if (namespace.headOption.getOrElse('_') == '_') "" else namespace + ':') + - (if (predicate.headOption.getOrElse('_') == '_') "" else predicate) + - value.fold("")(v => f"""="$v"""") - - tags.foreach(vertex.property(Cardinality.list, "tags", _)) - assignee.foreach(vertex.property("assignee", _)) - organisationIds.foreach(id => vertex.property(Cardinality.set, "organisationIds", id.value)) - impactStatus.foreach(vertex.property("impactStatus", _)) - resolutionStatus.foreach(vertex.property("resolutionStatus", _)) - caseTemplate.foreach(vertex.property("caseTemplate", _)) + case (alert, organisationId, caseId) => + alert.tags.foreach(tag => tagSrv.getOrCreate(tag).flatMap(alertSrv.alertTagSrv.create(AlertTag(), alert, _)).get) + alertSrv.get(alert).update(_.organisationId, organisationId).update(_.caseId, caseId).iterate() } - caseTemplateSrv + observableSrv .startTraversal - .setConverter[Vertex, Converter.Identity[Vertex]](Converter.identity[Vertex]) - .project( - _.by - .by(_.out("CaseTemplateTag").valueMap("namespace", "predicate", "value").fold) - ) + .project(_.by.by(_.coalesceIdent(_.`case`, _.alert)._id).by(_.organisations._id.fold)) .foreach { - case (vertex, tagMaps) => - val tags = for { - tag <- tagMaps.asInstanceOf[Seq[Map[String, String]]] - namespace = tag.getOrElse("namespace", "_autocreate") - predicate <- tag.get("predicate") - value = tag.get("value") - } yield - (if (namespace.headOption.getOrElse('_') == '_') "" else namespace + ':') + - (if (predicate.headOption.getOrElse('_') == '_') "" else predicate) + - value.fold("")(v => f"""="$v"""") - - tags.foreach(vertex.property(Cardinality.list, "tags", _)) + case (observable, relatedId, organisationIds) => + observable + .tags + .foreach(tag => tagSrv.getOrCreate(tag).flatMap(observableSrv.observableTagSrv.create(ObservableTag(), observable, _)).get) + observableTypeSrv + .getByName(observable.dataType) + .getOrFail("ObservableType") + .flatMap(observableSrv.observableObservableType.create(ObservableObservableType(), observable, _)) + .get + observable + .data + .foreach(data => + dataSrv + .getByName(data) + .getOrFail("data") + .orElse(dataSrv.create(Data(data))) + .flatMap(observableSrv.observableDataSrv.create(ObservableData(), observable, _)) + .get + ) + observableSrv.get(observable).update(_.relatedId, relatedId).update(_.organisationIds, organisationIds.toSet).iterate() } - logSrv + caseTemplateSrv .startTraversal - .setConverter[Vertex, Converter.Identity[Vertex]](Converter.identity[Vertex]) - .project( - _.by - .by(_.in("TaskLog")._id) - .by(_.in("TaskLog").in("ShareTask").in("OrganisationShare")._id.fold) - ) - .foreach { - case (vertex, taskId, organisationIds) => - vertex.property("taskId", taskId) - organisationIds.foreach(id => vertex.property(Cardinality.set, "organisationIds", id.value)) + .foreach { caseTemplate => + caseTemplate + .tags + .foreach(tag => tagSrv.getOrCreate(tag).flatMap(caseTemplateSrv.caseTemplateTagSrv.create(CaseTemplateTag(), caseTemplate, _)).get) } - observableSrv + logSrv .startTraversal - .setConverter[Vertex, Converter.Identity[Vertex]](Converter.identity[Vertex]) - .project( - _.by - .by(_.out("ObservableObservableType").property("name", UMapping.string)) - .by(_.out("ObservableTag").valueMap("namespace", "predicate", "value").fold) - .by(_.out("ObservableData").property("data", UMapping.string).option) - .by(_.out("ObservableAttachment").property("attachmentId", UMapping.string).option) - .by(_.coalesceIdent(_.in("ShareObservable").out("ShareCase"), _.in("AlertObservable"), _.in("ReportObservable"))._id.option) - .by( - _.coalesceIdent( - _.optional(_.in("ReportObservable").in("ObservableJob")).in("ShareObservable").in("OrganisationShare"), - _.in("AlertObservable").out("AlertOrganisation") - ) - ._id - .fold - ) - ) + .project(_.by.by(_.task._id).by(_.organisations._id.fold)) .foreach { - case (vertex, dataType, tagMaps, data, attachmentId, Some(relatedId), organisationIds) => - val tags = for { - tag <- tagMaps.asInstanceOf[Seq[Map[String, String]]] - namespace = tag.getOrElse("namespace", "_autocreate") - predicate <- tag.get("predicate") - value = tag.get("value") - } yield - (if (namespace.headOption.getOrElse('_') == '_') "" else namespace + ':') + - (if (predicate.headOption.getOrElse('_') == '_') "" else predicate) + - value.fold("")(v => f"""="$v"""") - - vertex.property("dataType", dataType) - tags.foreach(vertex.property(Cardinality.list, "tags", _)) - data.foreach(vertex.property("data", _)) - attachmentId.foreach(vertex.property("attachmentId", _)) - vertex.property("relatedId", relatedId.value) - organisationIds.foreach(id => vertex.property(Cardinality.set, "organisationIds", id.value)) - case _ => + case (log, taskId, organisationIds) => + logSrv.get(log).update(_.taskId, taskId).update(_.organisationIds, organisationIds.toSet).iterate() } taskSrv .startTraversal - .setConverter[Vertex, Converter.Identity[Vertex]](Converter.identity[Vertex]) .project( _.by - .by(_.out("TaskUser").property("login", UMapping.string).option) - .by(_.coalesceIdent(_.in("ShareTask").out("ShareCase"), _.in("CaseTemplateTask"))._id.option) - .by(_.coalesceIdent(_.in("ShareTask").in("OrganisationShare"), _.in("CaseTemplateTask").out("CaseTemplateOrganisation"))._id.fold) + .by(_.coalesceIdent(_.`case`, _.caseTemplate)._id) + .by(_.coalesceIdent(_.organisations, _.caseTemplate.organisation)._id.fold) ) .foreach { - case (vertex, assignee, Some(relatedId), organisationIds) => - assignee.foreach(vertex.property("assignee", _)) - vertex.property("relatedId", relatedId.value) - organisationIds.foreach(id => vertex.property(Cardinality.set, "organisationIds", id.value)) - case _ => + case (task, relatedId, organisationIds) => + task.assignee.foreach(userSrv.getByName(_).getOrFail("User").flatMap(taskSrv.taskUserSrv.create(TaskUser(), task, _)).get) + taskSrv.get(task).update(_.relatedId, relatedId).update(_.organisationIds, organisationIds.toSet).iterate() } Success(()) } diff --git a/thehive/test/org/thp/thehive/TestAppBuilder.scala b/thehive/test/org/thp/thehive/TestAppBuilder.scala index 5b1e69cfde..f947769405 100644 --- a/thehive/test/org/thp/thehive/TestAppBuilder.scala +++ b/thehive/test/org/thp/thehive/TestAppBuilder.scala @@ -88,7 +88,7 @@ trait TestAppBuilder { |""".stripMargin) .bindToProvider[Database, JanusDatabaseProvider] - app[DatabaseBuilder].build()(app[Database], app[UserSrv].getSystemAuthContext) + app[DatabaseBuilder].build()(app[Database]) app[Database].close() } FileUtils.copyDirectory(new File(s"target/janusgraph-test-database-$databaseName"), storageDirectory) diff --git a/thehive/test/org/thp/thehive/controllers/v0/AlertCtrlTest.scala b/thehive/test/org/thp/thehive/controllers/v0/AlertCtrlTest.scala index 51b5512013..a4de95d8b2 100644 --- a/thehive/test/org/thp/thehive/controllers/v0/AlertCtrlTest.scala +++ b/thehive/test/org/thp/thehive/controllers/v0/AlertCtrlTest.scala @@ -145,7 +145,7 @@ class AlertCtrlTest extends PlaySpecification with TestAppBuilder { description = "description of alert #1", severity = 2, date = new Date(1555359572000L), - tags = Set("testNamespace:testPredicate=\"alert\"", "testNamespace:testPredicate=\"test\""), + tags = Set("alert", "test"), tlp = 2, pap = 2, status = "New", @@ -163,7 +163,7 @@ class AlertCtrlTest extends PlaySpecification with TestAppBuilder { Some("h.fr"), None, 1, - Set("testNamespace:testPredicate=\"hello\""), + Set("hello"), ioc = true, sighted = true, Some("observable from alert") @@ -267,10 +267,10 @@ class AlertCtrlTest extends PlaySpecification with TestAppBuilder { pap = 2, status = "Open", tags = Set( - "testNamespace:testPredicate=\"alert\"", - "testNamespace:testPredicate=\"test\"", - "testNamespace:testPredicate=\"spam\"", - "testNamespace:testPredicate=\"src:mail\"" + "alert", + "test", + "spam", + "src:mail" ), summary = None, owner = Some("certuser@thehive.local"), diff --git a/thehive/test/org/thp/thehive/controllers/v0/CaseCtrlTest.scala b/thehive/test/org/thp/thehive/controllers/v0/CaseCtrlTest.scala index edbc06388d..a4523dbfcb 100644 --- a/thehive/test/org/thp/thehive/controllers/v0/CaseCtrlTest.scala +++ b/thehive/test/org/thp/thehive/controllers/v0/CaseCtrlTest.scala @@ -86,7 +86,7 @@ class CaseCtrlTest extends PlaySpecification with TestAppBuilder { tlp = 1, pap = 3, status = "Open", - tags = Set("testNamespace:testPredicate=\"spam\"", "testNamespace:testPredicate=\"src:mail\"", "tag1", "tag2"), + tags = Set("spam", "src:mail", "tag1", "tag2"), summary = None, owner = Some("certuser@thehive.local"), customFields = Json.obj( @@ -182,7 +182,7 @@ class CaseCtrlTest extends PlaySpecification with TestAppBuilder { tlp = 2, pap = 2, status = "Open", - tags = Set("testNamespace:testPredicate=\"t2\"", "testNamespace:testPredicate=\"t1\""), + tags = Set("t2", "t1"), summary = None, owner = Some("certuser@thehive.local"), customFields = JsObject.empty, @@ -328,9 +328,9 @@ class CaseCtrlTest extends PlaySpecification with TestAppBuilder { val resultCase = contentAsJson(result) (resultCase \ "count").asOpt[Int] must beSome(3) - (resultCase \ "testNamespace:testPredicate=\"t1\"" \ "count").asOpt[Int] must beSome(2) - (resultCase \ "testNamespace:testPredicate=\"t2\"" \ "count").asOpt[Int] must beSome(1) - (resultCase \ "testNamespace:testPredicate=\"t3\"" \ "count").asOpt[Int] must beSome(1) + (resultCase \ "t1" \ "count").asOpt[Int] must beSome(2) + (resultCase \ "t2" \ "count").asOpt[Int] must beSome(1) + (resultCase \ "t3" \ "count").asOpt[Int] must beSome(1) } "assign a case to an user" in testApp { app => diff --git a/thehive/test/org/thp/thehive/controllers/v0/ShareCtrlTest.scala b/thehive/test/org/thp/thehive/controllers/v0/ShareCtrlTest.scala index b0fb75e1c5..0200582d11 100644 --- a/thehive/test/org/thp/thehive/controllers/v0/ShareCtrlTest.scala +++ b/thehive/test/org/thp/thehive/controllers/v0/ShareCtrlTest.scala @@ -43,7 +43,7 @@ class ShareCtrlTest extends PlaySpecification with TestAppBuilder { status(result) must equalTo(204).updateMessage(s => s"$s\n${contentAsString(result)}") app[Database].roTransaction { implicit graph => - app[CaseSrv].get(EntityName("2")).visible(app[OrganisationSrv])(DummyUserSrv(organisation = "cert").authContext).exists + app[CaseSrv].get(EntityName("2")).visible(app[OrganisationSrv])(DummyUserSrv(organisation = "soc").authContext).exists } must beFalse } diff --git a/thehive/test/org/thp/thehive/controllers/v0/TagCtrlTest.scala b/thehive/test/org/thp/thehive/controllers/v0/TagCtrlTest.scala index 3d143dee34..24870d5b2e 100644 --- a/thehive/test/org/thp/thehive/controllers/v0/TagCtrlTest.scala +++ b/thehive/test/org/thp/thehive/controllers/v0/TagCtrlTest.scala @@ -140,18 +140,13 @@ class TagCtrlTest extends PlaySpecification with TestAppBuilder { ], "query":{ "_and":[ - { - "_is":{ - "namespace":"testNamespace" - } - }, { "_or":[ { - "value":"testDomain" + "predicate":"testDomain" }, { - "value":"hello" + "predicate":"hello" } ] } @@ -169,7 +164,7 @@ class TagCtrlTest extends PlaySpecification with TestAppBuilder { val l = contentAsJson(result)(defaultAwaitTimeout, app[Materializer]).as[List[OutputTag]] l.length shouldEqual 2 - l.find(_.value.get == "testDomain") must beSome + l.find(_.predicate == "testDomain") must beSome } } } diff --git a/thehive/test/org/thp/thehive/controllers/v1/AlertCtrlTest.scala b/thehive/test/org/thp/thehive/controllers/v1/AlertCtrlTest.scala index d12bc94044..bff36e7231 100644 --- a/thehive/test/org/thp/thehive/controllers/v1/AlertCtrlTest.scala +++ b/thehive/test/org/thp/thehive/controllers/v1/AlertCtrlTest.scala @@ -150,7 +150,7 @@ class AlertCtrlTest extends PlaySpecification with TestAppBuilder { description = "description of alert #1", severity = 2, date = new Date(1555359572000L), - tags = Set("testNamespace:testPredicate=\"alert\"", "testNamespace:testPredicate=\"test\""), + tags = Set("alert", "test"), tlp = 2, pap = 2, read = false, diff --git a/thehive/test/org/thp/thehive/controllers/v1/CaseCtrlTest.scala b/thehive/test/org/thp/thehive/controllers/v1/CaseCtrlTest.scala index a7726a858e..d2a527c6bf 100644 --- a/thehive/test/org/thp/thehive/controllers/v1/CaseCtrlTest.scala +++ b/thehive/test/org/thp/thehive/controllers/v1/CaseCtrlTest.scala @@ -124,7 +124,7 @@ class CaseCtrlTest extends PlaySpecification with TestAppBuilder { severity = 1, startDate = now, endDate = None, - tags = Set("tag1", "tag2", "testNamespace:testPredicate=\"spam\"", "testNamespace:testPredicate=\"src:mail\""), + tags = Set("tag1", "tag2", "spam", "src:mail"), flag = false, tlp = 1, pap = 3, @@ -151,7 +151,7 @@ class CaseCtrlTest extends PlaySpecification with TestAppBuilder { severity = 2, startDate = new Date(1531667370000L), endDate = None, - tags = Set("testNamespace:testPredicate=\"t1\"", "testNamespace:testPredicate=\"t3\""), + tags = Set("t1", "t3"), flag = false, tlp = 2, pap = 2, diff --git a/thehive/test/org/thp/thehive/services/AlertSrvTest.scala b/thehive/test/org/thp/thehive/services/AlertSrvTest.scala index a52bb8cbdc..c373e7c1be 100644 --- a/thehive/test/org/thp/thehive/services/AlertSrvTest.scala +++ b/thehive/test/org/thp/thehive/services/AlertSrvTest.scala @@ -96,9 +96,7 @@ class AlertSrvTest extends PlaySpecification with TestAppBuilder { } yield app[AlertSrv].get(EntityName("testType;testSource;ref1")).tags.toSeq } - tags must beSuccessfulTry.which(t => - t.map(_.toString) must contain(exactly("testNamespace:testPredicate=\"alert\"", "testNamespace:testPredicate=\"test\"", "tag7")) - ) + tags must beSuccessfulTry.which(t => t.map(_.toString) must contain(exactly("alert", "test", "tag7"))) } // "add an observable if not existing" in testApp { app => // TODO clarify the expectation @@ -210,7 +208,7 @@ class AlertSrvTest extends PlaySpecification with TestAppBuilder { observables must have size 1 observables must contain { (o: RichObservable) => o.data must beSome("h.fr") - o.tags must contain("testNamespace:testPredicate=\"testDomain\"", "testNamespace:testPredicate=\"hello\"").exactly + o.tags must contain("testDomain") } } } diff --git a/thehive/test/org/thp/thehive/services/CaseSrvTest.scala b/thehive/test/org/thp/thehive/services/CaseSrvTest.scala index d5f8f34c58..e05c249017 100644 --- a/thehive/test/org/thp/thehive/services/CaseSrvTest.scala +++ b/thehive/test/org/thp/thehive/services/CaseSrvTest.scala @@ -65,7 +65,7 @@ class CaseSrvTest extends PlaySpecification with TestAppBuilder { ), richCase.`case`.organisationIds ) - richCase.tags must contain(exactly("testNamespace:testPredicate=\"t1\"", "testNamespace:testPredicate=\"t3\"")) + richCase.tags must contain(exactly("t1", "t3")) } } @@ -107,7 +107,7 @@ class CaseSrvTest extends PlaySpecification with TestAppBuilder { ), richCase.`case`.organisationIds ) - richCase.tags must contain(exactly("testNamespace:testPredicate=\"t2\"", "testNamespace:testPredicate=\"t1\"")) + richCase.tags must contain(exactly("t2", "t1")) richCase._createdBy must_=== "system@thehive.local" } } @@ -122,7 +122,7 @@ class CaseSrvTest extends PlaySpecification with TestAppBuilder { richCase.severity must_=== 2 richCase.startDate must_=== new Date(1531667370000L) richCase.endDate must beNone - richCase.tags must contain(exactly("testNamespace:testPredicate=\"t1\"", "testNamespace:testPredicate=\"t2\"")) + richCase.tags must contain(exactly("t1", "t2")) richCase.flag must_=== false richCase.tlp must_=== 2 richCase.pap must_=== 2 @@ -228,10 +228,10 @@ class CaseSrvTest extends PlaySpecification with TestAppBuilder { app[Database].tryTransaction { implicit graph => for { c3 <- app[CaseSrv].get(EntityName("3")).getOrFail("Case") - _ <- app[CaseSrv].updateTags(c3, Set("""testNamespace:testPredicate="t2"""", """testNamespace:testPredicate="yolo"""")) + _ <- app[CaseSrv].updateTags(c3, Set("t2", "yolo")) } yield app[CaseSrv].get(c3).tags.toList.map(_.toString) } must beASuccessfulTry.which { tags => - tags must contain(exactly("""testNamespace:testPredicate="t2"""", """testNamespace:testPredicate="yolo"""")) + tags must contain(exactly("t2", "yolo")) } } diff --git a/thehive/test/org/thp/thehive/services/CaseTemplateSrvTest.scala b/thehive/test/org/thp/thehive/services/CaseTemplateSrvTest.scala index 1b4d321462..2035fd8c55 100644 --- a/thehive/test/org/thp/thehive/services/CaseTemplateSrvTest.scala +++ b/thehive/test/org/thp/thehive/services/CaseTemplateSrvTest.scala @@ -24,7 +24,7 @@ class CaseTemplateSrvTest extends PlaySpecification with TestAppBuilder { titlePrefix = Some("[CTT]"), description = Some("description ctt1"), severity = Some(2), - tags = Seq("""testNamespace:testPredicate="t2"""", """testNamespace:testPredicate="newOne""""), + tags = Seq("""t2""", """newOne"""), flag = false, tlp = Some(1), pap = Some(3), @@ -51,7 +51,7 @@ class CaseTemplateSrvTest extends PlaySpecification with TestAppBuilder { app[Database].roTransaction { implicit graph => val orgId = app[OrganisationSrv].currentId.value - app[TagSrv].startTraversal.getByName(s"_freetags_$orgId", "testNamespace:testPredicate=\"newOne\"", None).exists must beTrue + app[TagSrv].startTraversal.getByName(s"_freetags_$orgId", "newOne", None).exists must beTrue app[TaskSrv].startTraversal.has(_.title, "task case template case template test 1").exists must beTrue val richCT = app[CaseTemplateSrv].startTraversal.getByName("case template test 1").richCaseTemplate.getOrFail("CaseTemplate").get richCT.customFields.length shouldEqual 2 @@ -91,14 +91,14 @@ class CaseTemplateSrvTest extends PlaySpecification with TestAppBuilder { caseTemplate <- app[CaseTemplateSrv].getOrFail(EntityName("spam")) _ <- app[CaseTemplateSrv].updateTags( caseTemplate, - Set("""testNamespace:testPredicate="t2"""", """testNamespace:testPredicate="newOne2"""", """newNspc:newPred="newOne3"""") + Set("""t2""", """newOne2""", """newNspc:newPred="newOne3"""") ) } yield () } must beSuccessfulTry app[Database].roTransaction { implicit graph => app[CaseTemplateSrv].get(EntityName("spam")).tags.toList.map(_.toString) } must containTheSameElementsAs( - Seq("testNamespace:testPredicate=\"t2\"", "testNamespace:testPredicate=\"newOne2\"", "newNspc:newPred=\"newOne3\"") + Seq("t2", "newOne2", "newNspc:newPred=\"newOne3\"") ) } @@ -106,17 +106,17 @@ class CaseTemplateSrvTest extends PlaySpecification with TestAppBuilder { app[Database].tryTransaction { implicit graph => for { caseTemplate <- app[CaseTemplateSrv].getOrFail(EntityName("spam")) - _ <- app[CaseTemplateSrv].addTags(caseTemplate, Set("""testNamespace:testPredicate="t2"""", """testNamespace:testPredicate="newOne2"""")) + _ <- app[CaseTemplateSrv].addTags(caseTemplate, Set("""t2""", """newOne2""")) } yield () } must beSuccessfulTry app[Database].roTransaction { implicit graph => app[CaseTemplateSrv].get(EntityName("spam")).tags.toList.map(_.toString) } must containTheSameElementsAs( Seq( - "testNamespace:testPredicate=\"t2\"", - "testNamespace:testPredicate=\"newOne2\"", - "testNamespace:testPredicate=\"spam\"", - "testNamespace:testPredicate=\"src:mail\"" + "t2", + "newOne2", + "spam", + "src:mail" ) ) } diff --git a/thehive/test/org/thp/thehive/services/notification/notifiers/NotificationTemplateTest.scala b/thehive/test/org/thp/thehive/services/notification/notifiers/NotificationTemplateTest.scala index 882f1f1491..1d60745561 100644 --- a/thehive/test/org/thp/thehive/services/notification/notifiers/NotificationTemplateTest.scala +++ b/thehive/test/org/thp/thehive/services/notification/notifiers/NotificationTemplateTest.scala @@ -13,7 +13,7 @@ import play.api.test.PlaySpecification import scala.collection.JavaConverters._ class NotificationTemplateTest extends PlaySpecification with TestAppBuilder { - implicit val authContext: AuthContext = DummyUserSrv(userId = "certuser@thehive.local").authContext + implicit val authContext: AuthContext = DummyUserSrv(userId = "certuser@thehive.local", organisation = "cert").authContext def templateEngine(testSchema: Schema): Template = new Object with Template { override val schema: Schema = testSchema diff --git a/thehive/test/resources/data/Alert.json b/thehive/test/resources/data/Alert.json index 833359a4d0..b998935604 100644 --- a/thehive/test/resources/data/Alert.json +++ b/thehive/test/resources/data/Alert.json @@ -14,7 +14,8 @@ "pap": 2, "read": false, "follow": true, - "organisationId": "" + "organisationId": "", + "tags": ["test", "alert"] }, { "id": "alert2", @@ -31,7 +32,8 @@ "pap": 2, "read": false, "follow": true, - "organisationId": "" + "organisationId": "", + "tags": ["test", "alert"] }, { "id": "alert3", @@ -48,7 +50,8 @@ "pap": 2, "read": false, "follow": true, - "organisationId": "" + "organisationId": "", + "tags": ["test", "alert"] }, { "id": "alert4", @@ -65,7 +68,8 @@ "pap": 2, "read": false, "follow": true, - "organisationId": "" + "organisationId": "", + "tags": ["test", "alert"] }, { "id": "alert5", @@ -82,6 +86,7 @@ "pap": 2, "read": false, "follow": true, - "organisationId": "" + "organisationId": "", + "tags": ["test", "alert"] } ] diff --git a/thehive/test/resources/data/AlertTag.json b/thehive/test/resources/data/AlertTag.json deleted file mode 100644 index a6e2661284..0000000000 --- a/thehive/test/resources/data/AlertTag.json +++ /dev/null @@ -1,12 +0,0 @@ -[ - {"from": "alert1", "to": "tagtest"}, - {"from": "alert1", "to": "tagalert"}, - {"from": "alert2", "to": "tagtest"}, - {"from": "alert2", "to": "tagalert"}, - {"from": "alert3", "to": "tagtest"}, - {"from": "alert3", "to": "tagalert"}, - {"from": "alert4", "to": "tagtest"}, - {"from": "alert4", "to": "tagalert"}, - {"from": "alert5", "to": "tagtest"}, - {"from": "alert5", "to": "tagalert"} -] \ No newline at end of file diff --git a/thehive/test/resources/data/Case.json b/thehive/test/resources/data/Case.json index 15a632b69a..a992296012 100644 --- a/thehive/test/resources/data/Case.json +++ b/thehive/test/resources/data/Case.json @@ -9,7 +9,9 @@ "flag": false, "tlp": 2, "pap": 2, - "status": "Open" + "status": "Open", + "tags": ["t1", "t3"], + "assignee": "certuser@thehive.local" }, { "id": "case2", @@ -21,7 +23,10 @@ "flag": false, "tlp": 2, "pap": 2, - "status": "Open" + "status": "Open", + "tags": ["t1","t2"], + "impactStatus": "NoImpact", + "assignee": "certuser@thehive.local" }, { "id": "case3", @@ -33,7 +38,10 @@ "flag": false, "tlp": 2, "pap": 2, - "status": "Open" + "status": "Open", + "caseTemplate": "spam", + "tags": ["t1","t2"], + "assignee": "socuser@thehive.local" }, { "id": "caseActionRequired1", @@ -59,4 +67,4 @@ "pap": 2, "status": "Open" } -] \ No newline at end of file +] diff --git a/thehive/test/resources/data/CaseCaseTemplate.json b/thehive/test/resources/data/CaseCaseTemplate.json deleted file mode 100644 index fc3499ffe6..0000000000 --- a/thehive/test/resources/data/CaseCaseTemplate.json +++ /dev/null @@ -1,3 +0,0 @@ -[ - {"from": "case3", "to": "spam"} -] \ No newline at end of file diff --git a/thehive/test/resources/data/CaseImpactStatus.json b/thehive/test/resources/data/CaseImpactStatus.json deleted file mode 100644 index b25a6ea0dd..0000000000 --- a/thehive/test/resources/data/CaseImpactStatus.json +++ /dev/null @@ -1,6 +0,0 @@ -[ - { - "from": "case2", - "to": "NoImpact" - } -] \ No newline at end of file diff --git a/thehive/test/resources/data/CaseResolutionStatus.json b/thehive/test/resources/data/CaseResolutionStatus.json deleted file mode 100644 index 0637a088a0..0000000000 --- a/thehive/test/resources/data/CaseResolutionStatus.json +++ /dev/null @@ -1 +0,0 @@ -[] \ No newline at end of file diff --git a/thehive/test/resources/data/CaseTag.json b/thehive/test/resources/data/CaseTag.json deleted file mode 100644 index 781e8159a3..0000000000 --- a/thehive/test/resources/data/CaseTag.json +++ /dev/null @@ -1,8 +0,0 @@ -[ - {"from": "case3", "to": "tagt1"}, - {"from": "case3", "to": "tagt2"}, - {"from": "case2", "to": "tagt1"}, - {"from": "case2", "to": "tagt2"}, - {"from": "case1", "to": "tagt1"}, - {"from": "case1", "to": "tagt3"} -] \ No newline at end of file diff --git a/thehive/test/resources/data/CaseTemplateTag.json b/thehive/test/resources/data/CaseTemplateTag.json deleted file mode 100644 index 25e6c2d4e9..0000000000 --- a/thehive/test/resources/data/CaseTemplateTag.json +++ /dev/null @@ -1,4 +0,0 @@ -[ - {"from": "spam", "to": "tagspam"}, - {"from": "spam", "to": "tagsrc:mail"} -] \ No newline at end of file diff --git a/thehive/test/resources/data/Data.json b/thehive/test/resources/data/Data.json deleted file mode 100644 index 3cb9acf636..0000000000 --- a/thehive/test/resources/data/Data.json +++ /dev/null @@ -1,14 +0,0 @@ -[ - { - "id": "data-h.fr", - "data": "h.fr" - }, - { - "id": "data-c.fr", - "data": "c.fr" - }, - { - "id": "data-perdu.com", - "data": "perdu.com" - } -] \ No newline at end of file diff --git a/thehive/test/resources/data/Observable.json b/thehive/test/resources/data/Observable.json index ce18608a62..9bd5fbb400 100644 --- a/thehive/test/resources/data/Observable.json +++ b/thehive/test/resources/data/Observable.json @@ -7,6 +7,7 @@ "sighted": false, "dataType": "domain", "data": "h.fr", + "tags": ["testDomain"], "relatedId": "" }, { @@ -17,6 +18,7 @@ "sighted": false, "dataType": "domain", "data": "c.fr", + "tags": ["testDomain"], "relatedId": "" }, { @@ -26,6 +28,7 @@ "ioc": false, "sighted": false, "dataType": "file", + "tags": ["hello", "world"], "relatedId": "" }, { @@ -46,6 +49,7 @@ "sighted": true, "dataType": "domain", "data": "h.fr", + "tags": ["hello"], "relatedId": "" } ] diff --git a/thehive/test/resources/data/ObservableData.json b/thehive/test/resources/data/ObservableData.json deleted file mode 100644 index 344dc8f62b..0000000000 --- a/thehive/test/resources/data/ObservableData.json +++ /dev/null @@ -1,6 +0,0 @@ -[ - {"from": "h.fr", "to": "data-h.fr"}, - {"from": "c.fr", "to": "data-c.fr"}, - {"from": "perdu.com", "to": "data-perdu.com"}, - {"from": "alert-h.fr", "to": "data-h.fr"} -] diff --git a/thehive/test/resources/data/ObservableObservableType.json b/thehive/test/resources/data/ObservableObservableType.json deleted file mode 100644 index bf3337b719..0000000000 --- a/thehive/test/resources/data/ObservableObservableType.json +++ /dev/null @@ -1,7 +0,0 @@ -[ - {"from": "h.fr", "to": "domain"}, - {"from": "c.fr", "to": "domain"}, - {"from": "helloworld", "to": "file"}, - {"from": "perdu.com", "to": "domain"}, - {"from": "alert-h.fr", "to": "domain"} -] diff --git a/thehive/test/resources/data/ObservableTag.json b/thehive/test/resources/data/ObservableTag.json deleted file mode 100644 index f5b3cb72a8..0000000000 --- a/thehive/test/resources/data/ObservableTag.json +++ /dev/null @@ -1,7 +0,0 @@ -[ - {"from": "h.fr", "to": "tagtestDomain"}, - {"from": "c.fr", "to": "tagtestDomain"}, - {"from": "helloworld", "to": "taghello"}, - {"from": "helloworld", "to": "tagworld"}, - {"from": "alert-h.fr", "to": "taghello"} -] diff --git a/thehive/test/resources/data/Tag.json b/thehive/test/resources/data/Tag.json index a26f487b8e..376f95d305 100644 --- a/thehive/test/resources/data/Tag.json +++ b/thehive/test/resources/data/Tag.json @@ -1,74 +1,4 @@ [ - { - "id": "tagt1", - "namespace": "testNamespace", - "predicate": "testPredicate", - "value": "t1", - "colour": "#000000" - }, - { - "id": "tagt2", - "namespace": "testNamespace", - "predicate": "testPredicate", - "value": "t2", - "colour": "#000000" - }, - { - "id": "tagt3", - "namespace": "testNamespace", - "predicate": "testPredicate", - "value": "t3", - "colour": "#000000" - }, - { - "id": "tagalert", - "namespace": "testNamespace", - "predicate": "testPredicate", - "value": "alert", - "colour": "#000000" - }, - { - "id": "tagtest", - "namespace": "testNamespace", - "predicate": "testPredicate", - "value": "test", - "colour": "#000000" - }, - { - "id": "tagspam", - "namespace": "testNamespace", - "predicate": "testPredicate", - "value": "spam", - "colour": "#000000" - }, - { - "id": "tagsrc:mail", - "namespace": "testNamespace", - "predicate": "testPredicate", - "value": "src:mail", - "colour": "#000000" - }, - { - "id": "tagtestDomain", - "namespace": "testNamespace", - "predicate": "testPredicate", - "value": "testDomain", - "colour": "#000000" - }, - { - "id": "taghello", - "namespace": "testNamespace", - "predicate": "testPredicate", - "value": "hello", - "colour": "#000000" - }, - { - "id": "tagworld", - "namespace": "testNamespace", - "predicate": "testPredicate", - "value": "world", - "colour": "#000000" - }, { "id": "taxonomy-tag1", "namespace": "taxonomy1", @@ -76,4 +6,4 @@ "value": "value1", "colour": "#00f300" } -] \ No newline at end of file +] diff --git a/thehive/test/resources/data/Task.json b/thehive/test/resources/data/Task.json index 5eb7e554a4..c40db42b5d 100644 --- a/thehive/test/resources/data/Task.json +++ b/thehive/test/resources/data/Task.json @@ -7,6 +7,7 @@ "status": "Waiting", "flag": false, "order": 0, + "assignee": "certuser@thehive.local", "relatedId": "" }, { @@ -27,6 +28,7 @@ "status": "Waiting", "flag": true, "order": 0, + "assignee": "certuser@thehive.local", "relatedId": "" }, { diff --git a/thehive/test/resources/data/TaskUser.json b/thehive/test/resources/data/TaskUser.json deleted file mode 100644 index f14868e601..0000000000 --- a/thehive/test/resources/data/TaskUser.json +++ /dev/null @@ -1,4 +0,0 @@ -[ - {"from": "task1", "to": "certuser@thehive.local"}, - {"from": "task3", "to": "certuser@thehive.local"} -]