From 2397a64ebb0431a44f86e0452dbb94d4563ddbb9 Mon Sep 17 00:00:00 2001 From: To-om Date: Mon, 12 Apr 2021 14:47:43 +0200 Subject: [PATCH] #1946 Use indexed fields in observable --- .../app/org/thp/thehive/controllers/v0/ObservableCtrl.scala | 6 +++--- thehive/app/org/thp/thehive/controllers/v1/Properties.scala | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/thehive/app/org/thp/thehive/controllers/v0/ObservableCtrl.scala b/thehive/app/org/thp/thehive/controllers/v0/ObservableCtrl.scala index af294c2a2e..eb5bd6564d 100644 --- a/thehive/app/org/thp/thehive/controllers/v0/ObservableCtrl.scala +++ b/thehive/app/org/thp/thehive/controllers/v0/ObservableCtrl.scala @@ -422,13 +422,13 @@ class PublicObservable @Inject() ( ) .property("message", UMapping.string)(_.field.updatable) .property("tlp", UMapping.int)(_.field.updatable) - .property("dataType", UMapping.string)(_.select(_.observableType.value(_.name)).readonly) - .property("data", UMapping.string.optional)(_.select(_.data.value(_.data)).readonly) + .property("dataType", UMapping.string)(_.field.readonly) + .property("data", UMapping.string.optional)(_.field.readonly) .property("attachment.name", UMapping.string.optional)(_.select(_.attachments.value(_.name)).readonly) .property("attachment.hashes", UMapping.hash.sequence)(_.select(_.attachments.value(_.hashes)).readonly) .property("attachment.size", UMapping.long.optional)(_.select(_.attachments.value(_.size)).readonly) .property("attachment.contentType", UMapping.string.optional)(_.select(_.attachments.value(_.contentType)).readonly) - .property("attachment.id", UMapping.string.optional)(_.select(_.attachments.value(_.attachmentId)).readonly) + .property("attachment.id", UMapping.string.optional)(_.field.readonly) .property("relatedId", UMapping.entityId)(_.field.readonly) .build } diff --git a/thehive/app/org/thp/thehive/controllers/v1/Properties.scala b/thehive/app/org/thp/thehive/controllers/v1/Properties.scala index 590f33d7f0..8b11e044c4 100644 --- a/thehive/app/org/thp/thehive/controllers/v1/Properties.scala +++ b/thehive/app/org/thp/thehive/controllers/v1/Properties.scala @@ -421,13 +421,13 @@ class Properties @Inject() ( ) .property("message", UMapping.string)(_.field.updatable) .property("tlp", UMapping.int)(_.field.updatable) - .property("dataType", UMapping.string)(_.select(_.observableType.value(_.name)).readonly) - .property("data", UMapping.string.optional)(_.select(_.data.value(_.data)).readonly) + .property("dataType", UMapping.string)(_.field.readonly) + .property("data", UMapping.string.optional)(_.field.readonly) .property("attachment.name", UMapping.string.optional)(_.select(_.attachments.value(_.name)).readonly) .property("attachment.hashes", UMapping.hash.sequence)(_.select(_.attachments.value(_.hashes)).readonly) .property("attachment.size", UMapping.long.optional)(_.select(_.attachments.value(_.size)).readonly) .property("attachment.contentType", UMapping.string.optional)(_.select(_.attachments.value(_.contentType)).readonly) - .property("attachment.id", UMapping.string.optional)(_.select(_.attachments.value(_.attachmentId)).readonly) + .property("attachment.id", UMapping.string.optional)(_.field.readonly) .build lazy val taxonomy: PublicProperties =