Skip to content

Commit

Permalink
Fix entity ID property type in describe
Browse files Browse the repository at this point in the history
  • Loading branch information
To-om committed Dec 21, 2020
1 parent 089e896 commit 76a484b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions thehive/app/org/thp/thehive/controllers/v0/DescribeCtrl.scala
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,8 @@ package org.thp.thehive.controllers.v0

import java.lang.{Boolean => JBoolean}
import java.util.Date

import javax.inject.{Inject, Named, Singleton}
import org.thp.scalligraph.NotFoundError
import org.thp.scalligraph.{EntityId, NotFoundError}
import org.thp.scalligraph.controllers.Entrypoint
import org.thp.scalligraph.models.Database
import org.thp.scalligraph.query.PublicProperty
Expand Down Expand Up @@ -218,6 +217,7 @@ class DescribeCtrl @Inject() (
case c if c == classOf[Hash] => Seq(PropertyDescription(prop.propertyName, "string"))
case c if classOf[Number].isAssignableFrom(c) => Seq(PropertyDescription(prop.propertyName, "number"))
case c if c == classOf[String] => Seq(PropertyDescription(prop.propertyName, "string"))
case c if c == classOf[EntityId] => Seq(PropertyDescription(prop.propertyName, "string"))
case _ =>
logger.warn(s"Unrecognized property $prop. Add a custom description")
Seq(PropertyDescription(prop.propertyName, "unknown"))
Expand Down
4 changes: 2 additions & 2 deletions thehive/app/org/thp/thehive/controllers/v1/DescribeCtrl.scala
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,8 @@ package org.thp.thehive.controllers.v1

import java.lang.{Boolean => JBoolean}
import java.util.Date

import javax.inject.{Inject, Named, Singleton}
import org.thp.scalligraph.NotFoundError
import org.thp.scalligraph.{EntityId, NotFoundError}
import org.thp.scalligraph.controllers.Entrypoint
import org.thp.scalligraph.models.Database
import org.thp.scalligraph.query.PublicProperty
Expand Down Expand Up @@ -212,6 +211,7 @@ class DescribeCtrl @Inject() (
case c if c == classOf[Hash] => Seq(PropertyDescription(prop.propertyName, "string"))
case c if classOf[Number].isAssignableFrom(c) => Seq(PropertyDescription(prop.propertyName, "number"))
case c if c == classOf[String] => Seq(PropertyDescription(prop.propertyName, "string"))
case c if c == classOf[EntityId] => Seq(PropertyDescription(prop.propertyName, "string"))
case _ =>
logger.warn(s"Unrecognized property $prop. Add a custom description")
Seq(PropertyDescription(prop.propertyName, "unknown"))
Expand Down

0 comments on commit 76a484b

Please sign in to comment.