Skip to content

Commit

Permalink
#1611 Fix text containing predicate (don't tokenize)
Browse files Browse the repository at this point in the history
  • Loading branch information
To-om committed Nov 5, 2020
1 parent 58fb2d3 commit 53a8bb4
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 2 deletions.
2 changes: 1 addition & 1 deletion ScalliGraph
18 changes: 17 additions & 1 deletion thehive/app/org/thp/thehive/controllers/v0/TagCtrl.scala
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,22 @@ class PublicTag @Inject() (tagSrv: TagSrv) extends PublicData {
.property("predicate", UMapping.string)(_.field.readonly)
.property("value", UMapping.string.optional)(_.field.readonly)
.property("description", UMapping.string.optional)(_.field.readonly)
.property("text", UMapping.string)(_.select(_.displayName).readonly)
.property("text", UMapping.string)(
_.select(_.displayName)
.filter((_, tags) =>
tags
.graphMap[String, String, Converter.Identity[String]](
{ v =>
val namespace = UMapping.string.getProperty(v, "namespace")
val predicate = UMapping.string.getProperty(v, "predicate")
val value = UMapping.string.optional.getProperty(v, "value")
Tag(namespace, predicate, value, None, 0).toString
},
Converter.identity[String]
)
)
.converter(_ => Converter.identity[String])
.readonly
)
.build
}

0 comments on commit 53a8bb4

Please sign in to comment.