diff --git a/ScalliGraph b/ScalliGraph index 8da222bbbf..451bedb861 160000 --- a/ScalliGraph +++ b/ScalliGraph @@ -1 +1 @@ -Subproject commit 8da222bbbf77c41d68c951419a6de2cfd9c4e0e4 +Subproject commit 451bedb861ab43d232dbd98c742183abd87e8f87 diff --git a/cortex/connector/src/main/scala/org/thp/thehive/connector/cortex/controllers/v0/ActionCtrl.scala b/cortex/connector/src/main/scala/org/thp/thehive/connector/cortex/controllers/v0/ActionCtrl.scala index 1d8c6ecc44..ccbe2999bd 100644 --- a/cortex/connector/src/main/scala/org/thp/thehive/connector/cortex/controllers/v0/ActionCtrl.scala +++ b/cortex/connector/src/main/scala/org/thp/thehive/connector/cortex/controllers/v0/ActionCtrl.scala @@ -83,7 +83,6 @@ class PublicAction @Inject() (actionSrv: ActionSrv, organisationSrv: Organisatio Query.init[Traversal.V[Action]]("listAction", (graph, authContext) => actionSrv.startTraversal(graph).visible(organisationSrv)(authContext)) override val getQuery: ParamQuery[EntityIdOrName] = Query.initWithParam[EntityIdOrName, Traversal.V[Action]]( "getAction", - FieldsParser[EntityIdOrName], (idOrName, graph, authContext) => actionSrv.get(idOrName)(graph).visible(organisationSrv)(authContext) ) override val pageQuery: ParamQuery[OutputParam] = Query.withParam[OutputParam, Traversal.V[Action], IteratorOutput]( diff --git a/cortex/connector/src/main/scala/org/thp/thehive/connector/cortex/controllers/v0/AnalyzerTemplateCtrl.scala b/cortex/connector/src/main/scala/org/thp/thehive/connector/cortex/controllers/v0/AnalyzerTemplateCtrl.scala index acc665c1b2..554f94221e 100644 --- a/cortex/connector/src/main/scala/org/thp/thehive/connector/cortex/controllers/v0/AnalyzerTemplateCtrl.scala +++ b/cortex/connector/src/main/scala/org/thp/thehive/connector/cortex/controllers/v0/AnalyzerTemplateCtrl.scala @@ -99,7 +99,6 @@ class PublicAnalyzerTemplate @Inject() (analyzerTemplateSrv: AnalyzerTemplateSrv Query.init[Traversal.V[AnalyzerTemplate]]("listAnalyzerTemplate", (graph, _) => analyzerTemplateSrv.startTraversal(graph)) override val getQuery: ParamQuery[EntityIdOrName] = Query.initWithParam[EntityIdOrName, Traversal.V[AnalyzerTemplate]]( "getReportTemplate", - FieldsParser[EntityIdOrName], (idOrName, graph, _) => analyzerTemplateSrv.get(idOrName)(graph) ) override val pageQuery: ParamQuery[OutputParam] = diff --git a/cortex/connector/src/main/scala/org/thp/thehive/connector/cortex/controllers/v0/JobCtrl.scala b/cortex/connector/src/main/scala/org/thp/thehive/connector/cortex/controllers/v0/JobCtrl.scala index ccc79a5f79..9f6fd2f9c6 100644 --- a/cortex/connector/src/main/scala/org/thp/thehive/connector/cortex/controllers/v0/JobCtrl.scala +++ b/cortex/connector/src/main/scala/org/thp/thehive/connector/cortex/controllers/v0/JobCtrl.scala @@ -78,7 +78,6 @@ class PublicJob @Inject() (jobSrv: JobSrv) extends PublicData with JobRenderer { Query.init[Traversal.V[Job]]("listJob", (graph, authContext) => jobSrv.startTraversal(graph).visible(authContext)) override val getQuery: ParamQuery[EntityIdOrName] = Query.initWithParam[EntityIdOrName, Traversal.V[Job]]( "getJob", - FieldsParser[EntityIdOrName], (idOrName, graph, authContext) => jobSrv.get(idOrName)(graph).visible(authContext) ) override val pageQuery: ParamQuery[OutputParam] = diff --git a/thehive/app/org/thp/thehive/controllers/v0/AlertCtrl.scala b/thehive/app/org/thp/thehive/controllers/v0/AlertCtrl.scala index d6279b8ebe..26f66f924e 100644 --- a/thehive/app/org/thp/thehive/controllers/v0/AlertCtrl.scala +++ b/thehive/app/org/thp/thehive/controllers/v0/AlertCtrl.scala @@ -357,7 +357,6 @@ class PublicAlert @Inject() ( ) override val getQuery: ParamQuery[EntityIdOrName] = Query.initWithParam[EntityIdOrName, Traversal.V[Alert]]( "getAlert", - FieldsParser[EntityIdOrName], (idOrName, graph, authContext) => alertSrv.get(idOrName)(graph).visible(organisationSrv)(authContext) ) override val pageQuery: ParamQuery[OutputParam] = diff --git a/thehive/app/org/thp/thehive/controllers/v0/AuditCtrl.scala b/thehive/app/org/thp/thehive/controllers/v0/AuditCtrl.scala index dfb523862a..1062143f3e 100644 --- a/thehive/app/org/thp/thehive/controllers/v0/AuditCtrl.scala +++ b/thehive/app/org/thp/thehive/controllers/v0/AuditCtrl.scala @@ -3,9 +3,8 @@ package org.thp.thehive.controllers.v0 import akka.actor.ActorRef import akka.pattern.ask import akka.util.Timeout -import javax.inject.{Inject, Named, Singleton} import org.thp.scalligraph.EntityIdOrName -import org.thp.scalligraph.controllers.{Entrypoint, FieldsParser} +import org.thp.scalligraph.controllers.Entrypoint import org.thp.scalligraph.models.{Database, UMapping} import org.thp.scalligraph.query._ import org.thp.scalligraph.traversal.TraversalOps._ @@ -17,6 +16,7 @@ import org.thp.thehive.services._ import play.api.libs.json.{JsArray, JsObject, Json} import play.api.mvc.{Action, AnyContent, Results} +import javax.inject.{Inject, Named, Singleton} import scala.concurrent.ExecutionContext import scala.concurrent.duration.DurationInt @@ -67,7 +67,6 @@ class AuditCtrl @Inject() ( class PublicAudit @Inject() (auditSrv: AuditSrv, organisationSrv: OrganisationSrv, db: Database) extends PublicData { override val getQuery: ParamQuery[EntityIdOrName] = Query.initWithParam[EntityIdOrName, Traversal.V[Audit]]( "getAudit", - FieldsParser[EntityIdOrName], (idOrName, graph, authContext) => auditSrv.get(idOrName)(graph).visible(organisationSrv)(authContext) ) diff --git a/thehive/app/org/thp/thehive/controllers/v0/CaseCtrl.scala b/thehive/app/org/thp/thehive/controllers/v0/CaseCtrl.scala index 134a6c2f84..e62d81911f 100644 --- a/thehive/app/org/thp/thehive/controllers/v0/CaseCtrl.scala +++ b/thehive/app/org/thp/thehive/controllers/v0/CaseCtrl.scala @@ -197,7 +197,6 @@ class PublicCase @Inject() ( override val getQuery: ParamQuery[EntityIdOrName] = Query.initWithParam[EntityIdOrName, Traversal.V[Case]]( "getCase", - FieldsParser[EntityIdOrName], (idOrName, graph, authContext) => caseSrv.get(idOrName)(graph).visible(organisationSrv)(authContext) ) override val pageQuery: ParamQuery[OutputParam] = diff --git a/thehive/app/org/thp/thehive/controllers/v0/CaseTemplateCtrl.scala b/thehive/app/org/thp/thehive/controllers/v0/CaseTemplateCtrl.scala index 33d8ee4801..a0c435e2d9 100644 --- a/thehive/app/org/thp/thehive/controllers/v0/CaseTemplateCtrl.scala +++ b/thehive/app/org/thp/thehive/controllers/v0/CaseTemplateCtrl.scala @@ -102,7 +102,6 @@ class PublicCaseTemplate @Inject() ( .init[Traversal.V[CaseTemplate]]("listCaseTemplate", (graph, authContext) => organisationSrv.get(authContext.organisation)(graph).caseTemplates) override val getQuery: ParamQuery[EntityIdOrName] = Query.initWithParam[EntityIdOrName, Traversal.V[CaseTemplate]]( "getCaseTemplate", - FieldsParser[EntityIdOrName], (idOrName, graph, authContext) => caseTemplateSrv.get(idOrName)(graph).visible(authContext) ) override val pageQuery: ParamQuery[OutputParam] = Query.withParam[OutputParam, Traversal.V[CaseTemplate], IteratorOutput]( diff --git a/thehive/app/org/thp/thehive/controllers/v0/CustomFieldCtrl.scala b/thehive/app/org/thp/thehive/controllers/v0/CustomFieldCtrl.scala index 2e19b83402..7f97070d87 100644 --- a/thehive/app/org/thp/thehive/controllers/v0/CustomFieldCtrl.scala +++ b/thehive/app/org/thp/thehive/controllers/v0/CustomFieldCtrl.scala @@ -100,7 +100,6 @@ class PublicCustomField @Inject() (customFieldSrv: CustomFieldSrv) extends Publi override val outputQuery: Query = Query.output[CustomField with Entity] override val getQuery: ParamQuery[EntityIdOrName] = Query.initWithParam[EntityIdOrName, Traversal.V[CustomField]]( "getCustomField", - FieldsParser[EntityIdOrName], (idOrName, graph, _) => customFieldSrv.get(idOrName)(graph) ) override val publicProperties: PublicProperties = diff --git a/thehive/app/org/thp/thehive/controllers/v0/DashboardCtrl.scala b/thehive/app/org/thp/thehive/controllers/v0/DashboardCtrl.scala index 19eca002fb..de832c66d8 100644 --- a/thehive/app/org/thp/thehive/controllers/v0/DashboardCtrl.scala +++ b/thehive/app/org/thp/thehive/controllers/v0/DashboardCtrl.scala @@ -95,7 +95,6 @@ class PublicDashboard @Inject() ( override val getQuery: ParamQuery[EntityIdOrName] = Query.initWithParam[EntityIdOrName, Traversal.V[Dashboard]]( "getDashboard", - FieldsParser[EntityIdOrName], (idOrName, graph, authContext) => dashboardSrv.get(idOrName)(graph).visible(authContext) ) diff --git a/thehive/app/org/thp/thehive/controllers/v0/LogCtrl.scala b/thehive/app/org/thp/thehive/controllers/v0/LogCtrl.scala index 20e953b941..8df7862ff2 100644 --- a/thehive/app/org/thp/thehive/controllers/v0/LogCtrl.scala +++ b/thehive/app/org/thp/thehive/controllers/v0/LogCtrl.scala @@ -78,7 +78,6 @@ class PublicLog @Inject() (logSrv: LogSrv, organisationSrv: OrganisationSrv) ext Query.init[Traversal.V[Log]]("listLog", (graph, authContext) => logSrv.startTraversal(graph).visible(organisationSrv)(authContext)) override val getQuery: ParamQuery[EntityIdOrName] = Query.initWithParam[EntityIdOrName, Traversal.V[Log]]( "getLog", - FieldsParser[EntityIdOrName], (idOrName, graph, authContext) => logSrv.get(idOrName)(graph).visible(organisationSrv)(authContext) ) override val pageQuery: ParamQuery[OutputParam] = Query.withParam[OutputParam, Traversal.V[Log], IteratorOutput]( diff --git a/thehive/app/org/thp/thehive/controllers/v0/ObservableCtrl.scala b/thehive/app/org/thp/thehive/controllers/v0/ObservableCtrl.scala index 8e6b82c4ef..6455d27d78 100644 --- a/thehive/app/org/thp/thehive/controllers/v0/ObservableCtrl.scala +++ b/thehive/app/org/thp/thehive/controllers/v0/ObservableCtrl.scala @@ -368,7 +368,6 @@ class PublicObservable @Inject() ( ) override val getQuery: ParamQuery[EntityIdOrName] = Query.initWithParam[EntityIdOrName, Traversal.V[Observable]]( "getObservable", - FieldsParser[EntityIdOrName], (idOrName, graph, authContext) => observableSrv.get(idOrName)(graph).visible(organisationSrv)(authContext) ) override val pageQuery: ParamQuery[OutputParam] = diff --git a/thehive/app/org/thp/thehive/controllers/v0/ObservableTypeCtrl.scala b/thehive/app/org/thp/thehive/controllers/v0/ObservableTypeCtrl.scala index 283c5320cd..68c43e40b1 100644 --- a/thehive/app/org/thp/thehive/controllers/v0/ObservableTypeCtrl.scala +++ b/thehive/app/org/thp/thehive/controllers/v0/ObservableTypeCtrl.scala @@ -59,7 +59,6 @@ class PublicObservableType @Inject() (observableTypeSrv: ObservableTypeSrv) exte override val outputQuery: Query = Query.output[ObservableType with Entity] override val getQuery: ParamQuery[EntityIdOrName] = Query.initWithParam[EntityIdOrName, Traversal.V[ObservableType]]( "getObservableType", - FieldsParser[EntityIdOrName], (idOrName, graph, _) => observableTypeSrv.get(idOrName)(graph) ) override val publicProperties: PublicProperties = PublicPropertyListBuilder[ObservableType] diff --git a/thehive/app/org/thp/thehive/controllers/v0/OrganisationCtrl.scala b/thehive/app/org/thp/thehive/controllers/v0/OrganisationCtrl.scala index 1f3972b130..a11627556b 100644 --- a/thehive/app/org/thp/thehive/controllers/v0/OrganisationCtrl.scala +++ b/thehive/app/org/thp/thehive/controllers/v0/OrganisationCtrl.scala @@ -138,7 +138,6 @@ class PublicOrganisation @Inject() (organisationSrv: OrganisationSrv) extends Pu override val outputQuery: Query = Query.output[Organisation with Entity] override val getQuery: ParamQuery[EntityIdOrName] = Query.initWithParam[EntityIdOrName, Traversal.V[Organisation]]( "getOrganisation", - FieldsParser[EntityIdOrName], (idOrName, graph, authContext) => organisationSrv.get(idOrName)(graph).visible(authContext) ) override val extraQueries: Seq[ParamQuery[_]] = Seq( diff --git a/thehive/app/org/thp/thehive/controllers/v0/PageCtrl.scala b/thehive/app/org/thp/thehive/controllers/v0/PageCtrl.scala index 39490e2dc9..3d95c4d1dc 100644 --- a/thehive/app/org/thp/thehive/controllers/v0/PageCtrl.scala +++ b/thehive/app/org/thp/thehive/controllers/v0/PageCtrl.scala @@ -73,7 +73,6 @@ class PublicPage @Inject() (pageSrv: PageSrv, organisationSrv: OrganisationSrv) Query.init[Traversal.V[Page]]("listPage", (graph, authContext) => organisationSrv.get(authContext.organisation)(graph).pages) override val getQuery: ParamQuery[EntityIdOrName] = Query.initWithParam[EntityIdOrName, Traversal.V[Page]]( "getPage", - FieldsParser[EntityIdOrName], (idOrName, graph, authContext) => pageSrv.get(idOrName)(graph).visible(authContext) ) val pageQuery: ParamQuery[OutputParam] = Query.withParam[OutputParam, Traversal.V[Page], IteratorOutput]( diff --git a/thehive/app/org/thp/thehive/controllers/v0/ProfileCtrl.scala b/thehive/app/org/thp/thehive/controllers/v0/ProfileCtrl.scala index cdb66c4928..2287778ac9 100644 --- a/thehive/app/org/thp/thehive/controllers/v0/ProfileCtrl.scala +++ b/thehive/app/org/thp/thehive/controllers/v0/ProfileCtrl.scala @@ -75,7 +75,6 @@ class PublicProfile @Inject() (profileSrv: ProfileSrv) extends PublicData { override val getQuery: ParamQuery[EntityIdOrName] = Query.initWithParam[EntityIdOrName, Traversal.V[Profile]]( "getProfile", - FieldsParser[EntityIdOrName], (idOrName, graph, _) => profileSrv.get(idOrName)(graph) ) val initialQuery: Query = diff --git a/thehive/app/org/thp/thehive/controllers/v0/TagCtrl.scala b/thehive/app/org/thp/thehive/controllers/v0/TagCtrl.scala index f291927063..58ac256022 100644 --- a/thehive/app/org/thp/thehive/controllers/v0/TagCtrl.scala +++ b/thehive/app/org/thp/thehive/controllers/v0/TagCtrl.scala @@ -113,7 +113,6 @@ class PublicTag @Inject() (tagSrv: TagSrv, organisationSrv: OrganisationSrv) ext override val outputQuery: Query = Query.output[Tag with Entity] override val getQuery: ParamQuery[EntityIdOrName] = Query.initWithParam[EntityIdOrName, Traversal.V[Tag]]( "getTag", - FieldsParser[EntityIdOrName], (idOrName, graph, _) => tagSrv.get(idOrName)(graph) ) implicit val stringRenderer: Renderer[String] = Renderer.toJson[String, String](identity) diff --git a/thehive/app/org/thp/thehive/controllers/v0/TaskCtrl.scala b/thehive/app/org/thp/thehive/controllers/v0/TaskCtrl.scala index 0d9c0a9e5b..fa30e87e71 100644 --- a/thehive/app/org/thp/thehive/controllers/v0/TaskCtrl.scala +++ b/thehive/app/org/thp/thehive/controllers/v0/TaskCtrl.scala @@ -117,7 +117,6 @@ class PublicTask @Inject() (taskSrv: TaskSrv, organisationSrv: OrganisationSrv, ) override val getQuery: ParamQuery[EntityIdOrName] = Query.initWithParam[EntityIdOrName, Traversal.V[Task]]( "getTask", - FieldsParser[EntityIdOrName], (idOrName, graph, authContext) => taskSrv.get(idOrName)(graph).inOrganisation(organisationSrv.currentId(graph, authContext)) ) override val outputQuery: Query = diff --git a/thehive/app/org/thp/thehive/controllers/v0/UserCtrl.scala b/thehive/app/org/thp/thehive/controllers/v0/UserCtrl.scala index e2211b72c5..8a330aa14b 100644 --- a/thehive/app/org/thp/thehive/controllers/v0/UserCtrl.scala +++ b/thehive/app/org/thp/thehive/controllers/v0/UserCtrl.scala @@ -232,7 +232,6 @@ class PublicUser @Inject() (userSrv: UserSrv, organisationSrv: OrganisationSrv) Query.init[Traversal.V[User]]("listUser", (graph, authContext) => organisationSrv.get(authContext.organisation)(graph).users) override val getQuery: ParamQuery[EntityIdOrName] = Query.initWithParam[EntityIdOrName, Traversal.V[User]]( "getUser", - FieldsParser[EntityIdOrName], (idOrName, graph, authContext) => userSrv.get(idOrName)(graph).visible(authContext) ) override val pageQuery: ParamQuery[OutputParam] = Query.withParam[OutputParam, Traversal.V[User], IteratorOutput]( diff --git a/thehive/app/org/thp/thehive/controllers/v1/AlertCtrl.scala b/thehive/app/org/thp/thehive/controllers/v1/AlertCtrl.scala index dc3f3243e3..304d373db6 100644 --- a/thehive/app/org/thp/thehive/controllers/v1/AlertCtrl.scala +++ b/thehive/app/org/thp/thehive/controllers/v1/AlertCtrl.scala @@ -41,7 +41,6 @@ class AlertCtrl @Inject() ( override val getQuery: ParamQuery[EntityIdOrName] = Query.initWithParam[EntityIdOrName, Traversal.V[Alert]]( "getAlert", - FieldsParser[EntityIdOrName], (idOrName, graph, authContext) => alertSrv.get(idOrName)(graph).visible(organisationSrv)(authContext) ) override val pageQuery: ParamQuery[OutputParam] = Query.withParam[OutputParam, Traversal.V[Alert], IteratorOutput]( diff --git a/thehive/app/org/thp/thehive/controllers/v1/AuditCtrl.scala b/thehive/app/org/thp/thehive/controllers/v1/AuditCtrl.scala index 46b5af472e..9d389a7720 100644 --- a/thehive/app/org/thp/thehive/controllers/v1/AuditCtrl.scala +++ b/thehive/app/org/thp/thehive/controllers/v1/AuditCtrl.scala @@ -1,7 +1,7 @@ package org.thp.thehive.controllers.v1 import org.thp.scalligraph.EntityIdOrName -import org.thp.scalligraph.controllers.{Entrypoint, FieldsParser} +import org.thp.scalligraph.controllers.Entrypoint import org.thp.scalligraph.models.{Database, Schema} import org.thp.scalligraph.query.{ParamQuery, PublicProperties, Query} import org.thp.scalligraph.traversal.TraversalOps._ @@ -32,7 +32,6 @@ class AuditCtrl @Inject() ( val publicProperties: PublicProperties = properties.audit override val getQuery: ParamQuery[EntityIdOrName] = Query.initWithParam[EntityIdOrName, Traversal.V[Audit]]( "getAudit", - FieldsParser[EntityIdOrName], (idOrName, graph, authContext) => auditSrv.get(idOrName)(graph).visible(organisationSrv)(authContext) ) diff --git a/thehive/app/org/thp/thehive/controllers/v1/CaseCtrl.scala b/thehive/app/org/thp/thehive/controllers/v1/CaseCtrl.scala index 24e9a8d014..7b288025dd 100644 --- a/thehive/app/org/thp/thehive/controllers/v1/CaseCtrl.scala +++ b/thehive/app/org/thp/thehive/controllers/v1/CaseCtrl.scala @@ -43,7 +43,6 @@ class CaseCtrl @Inject() ( Query.init[Traversal.V[Case]]("listCase", (graph, authContext) => caseSrv.startTraversal(graph).visible(organisationSrv)(authContext)) override val getQuery: ParamQuery[EntityIdOrName] = Query.initWithParam[EntityIdOrName, Traversal.V[Case]]( "getCase", - FieldsParser[EntityIdOrName], (idOrName, graph, authContext) => caseSrv.get(idOrName)(graph).visible(organisationSrv)(authContext) ) override val pageQuery: ParamQuery[OutputParam] = Query.withParam[OutputParam, Traversal.V[Case], IteratorOutput]( diff --git a/thehive/app/org/thp/thehive/controllers/v1/CaseTemplateCtrl.scala b/thehive/app/org/thp/thehive/controllers/v1/CaseTemplateCtrl.scala index 9f39060ddc..3e78ea966f 100644 --- a/thehive/app/org/thp/thehive/controllers/v1/CaseTemplateCtrl.scala +++ b/thehive/app/org/thp/thehive/controllers/v1/CaseTemplateCtrl.scala @@ -33,7 +33,6 @@ class CaseTemplateCtrl @Inject() ( .init[Traversal.V[CaseTemplate]]("listCaseTemplate", (graph, authContext) => organisationSrv.get(authContext.organisation)(graph).caseTemplates) override val getQuery: ParamQuery[EntityIdOrName] = Query.initWithParam[EntityIdOrName, Traversal.V[CaseTemplate]]( "getCaseTemplate", - FieldsParser[EntityIdOrName], (idOrName, graph, authContext) => caseTemplateSrv.get(idOrName)(graph).visible(authContext) ) override val pageQuery: ParamQuery[OutputParam] = Query.withParam[OutputParam, Traversal.V[CaseTemplate], IteratorOutput]( diff --git a/thehive/app/org/thp/thehive/controllers/v1/CustomFieldCtrl.scala b/thehive/app/org/thp/thehive/controllers/v1/CustomFieldCtrl.scala index 62369c8e50..344755ea12 100644 --- a/thehive/app/org/thp/thehive/controllers/v1/CustomFieldCtrl.scala +++ b/thehive/app/org/thp/thehive/controllers/v1/CustomFieldCtrl.scala @@ -29,7 +29,6 @@ class CustomFieldCtrl @Inject() (entrypoint: Entrypoint, db: Database, customFie override val outputQuery: Query = Query.output[CustomField with Entity] override val getQuery: ParamQuery[EntityIdOrName] = Query.initWithParam[EntityIdOrName, Traversal.V[CustomField]]( "getCustomField", - FieldsParser[EntityIdOrName], (idOrName, graph, _) => customFieldSrv.get(idOrName)(graph) ) override val publicProperties: PublicProperties = PublicPropertyListBuilder[CustomField] diff --git a/thehive/app/org/thp/thehive/controllers/v1/LogCtrl.scala b/thehive/app/org/thp/thehive/controllers/v1/LogCtrl.scala index 72c5e2d9fd..06d1d31824 100644 --- a/thehive/app/org/thp/thehive/controllers/v1/LogCtrl.scala +++ b/thehive/app/org/thp/thehive/controllers/v1/LogCtrl.scala @@ -34,7 +34,6 @@ class LogCtrl @Inject() ( Query.init[Traversal.V[Log]]("listLog", (graph, authContext) => logSrv.startTraversal(graph).visible(organisationSrv)(authContext)) override val getQuery: ParamQuery[EntityIdOrName] = Query.initWithParam[EntityIdOrName, Traversal.V[Log]]( "getLog", - FieldsParser[EntityIdOrName], (idOrName, graph, authContext) => logSrv.get(idOrName)(graph).visible(organisationSrv)(authContext) ) override val pageQuery: ParamQuery[OutputParam] = Query.withParam[OutputParam, Traversal.V[Log], IteratorOutput]( diff --git a/thehive/app/org/thp/thehive/controllers/v1/ObservableCtrl.scala b/thehive/app/org/thp/thehive/controllers/v1/ObservableCtrl.scala index 1c52c79703..985ae16b4a 100644 --- a/thehive/app/org/thp/thehive/controllers/v1/ObservableCtrl.scala +++ b/thehive/app/org/thp/thehive/controllers/v1/ObservableCtrl.scala @@ -60,7 +60,6 @@ class ObservableCtrl @Inject() ( ) override val getQuery: ParamQuery[EntityIdOrName] = Query.initWithParam[EntityIdOrName, Traversal.V[Observable]]( "getObservable", - FieldsParser[EntityIdOrName], (idOrName, graph, authContext) => observableSrv.get(idOrName)(graph).visible(organisationSrv)(authContext) ) override val pageQuery: ParamQuery[OutputParam] = Query.withParam[OutputParam, Traversal.V[Observable], IteratorOutput]( diff --git a/thehive/app/org/thp/thehive/controllers/v1/ObservableTypeCtrl.scala b/thehive/app/org/thp/thehive/controllers/v1/ObservableTypeCtrl.scala index 126e5e5172..e88f7ad107 100644 --- a/thehive/app/org/thp/thehive/controllers/v1/ObservableTypeCtrl.scala +++ b/thehive/app/org/thp/thehive/controllers/v1/ObservableTypeCtrl.scala @@ -31,7 +31,6 @@ class ObservableTypeCtrl @Inject() ( override val outputQuery: Query = Query.output[ObservableType with Entity] override val getQuery: ParamQuery[EntityIdOrName] = Query.initWithParam[EntityIdOrName, Traversal.V[ObservableType]]( "getObservableType", - FieldsParser[EntityIdOrName], (idOrName, graph, _) => observableTypeSrv.get(idOrName)(graph) ) override val publicProperties: PublicProperties = PublicPropertyListBuilder[ObservableType] diff --git a/thehive/app/org/thp/thehive/controllers/v1/OrganisationCtrl.scala b/thehive/app/org/thp/thehive/controllers/v1/OrganisationCtrl.scala index 68c0c68720..f4f5f70f2d 100644 --- a/thehive/app/org/thp/thehive/controllers/v1/OrganisationCtrl.scala +++ b/thehive/app/org/thp/thehive/controllers/v1/OrganisationCtrl.scala @@ -42,7 +42,6 @@ class OrganisationCtrl @Inject() ( override val outputQuery: Query = Query.output[RichOrganisation, Traversal.V[Organisation]](_.richOrganisation) override val getQuery: ParamQuery[EntityIdOrName] = Query.initWithParam[EntityIdOrName, Traversal.V[Organisation]]( "getOrganisation", - FieldsParser[EntityIdOrName], (idOrName, graph, authContext) => organisationSrv.get(idOrName)(graph).visible(authContext) ) override val extraQueries: Seq[ParamQuery[_]] = Seq( diff --git a/thehive/app/org/thp/thehive/controllers/v1/PatternCtrl.scala b/thehive/app/org/thp/thehive/controllers/v1/PatternCtrl.scala index adb672f072..ae208183bb 100644 --- a/thehive/app/org/thp/thehive/controllers/v1/PatternCtrl.scala +++ b/thehive/app/org/thp/thehive/controllers/v1/PatternCtrl.scala @@ -41,7 +41,6 @@ class PatternCtrl @Inject() ( override val outputQuery: Query = Query.output[RichPattern, Traversal.V[Pattern]](_.richPattern) override val getQuery: ParamQuery[EntityIdOrName] = Query.initWithParam[EntityIdOrName, Traversal.V[Pattern]]( "getPattern", - FieldsParser[EntityIdOrName], (idOrName, graph, _) => patternSrv.get(idOrName)(graph) ) @@ -72,7 +71,7 @@ class PatternCtrl @Inject() ( def get(patternId: String): Action[AnyContent] = entrypoint("get pattern") - .authRoTransaction(db) { implicit request => implicit graph => + .authRoTransaction(db) { _ => implicit graph => patternSrv .get(EntityIdOrName(patternId)) .richPattern diff --git a/thehive/app/org/thp/thehive/controllers/v1/ProcedureCtrl.scala b/thehive/app/org/thp/thehive/controllers/v1/ProcedureCtrl.scala index 747cf74dc4..a2fa5f6854 100644 --- a/thehive/app/org/thp/thehive/controllers/v1/ProcedureCtrl.scala +++ b/thehive/app/org/thp/thehive/controllers/v1/ProcedureCtrl.scala @@ -37,7 +37,6 @@ class ProcedureCtrl @Inject() ( override val outputQuery: Query = Query.output[RichProcedure, Traversal.V[Procedure]](_.richProcedure) override val getQuery: ParamQuery[EntityIdOrName] = Query.initWithParam[EntityIdOrName, Traversal.V[Procedure]]( "getProcedure", - FieldsParser[EntityIdOrName], (idOrName, graph, _) => procedureSrv.get(idOrName)(graph) ) diff --git a/thehive/app/org/thp/thehive/controllers/v1/ProfileCtrl.scala b/thehive/app/org/thp/thehive/controllers/v1/ProfileCtrl.scala index 2811e22ea2..778074801d 100644 --- a/thehive/app/org/thp/thehive/controllers/v1/ProfileCtrl.scala +++ b/thehive/app/org/thp/thehive/controllers/v1/ProfileCtrl.scala @@ -26,7 +26,6 @@ class ProfileCtrl @Inject() ( override val getQuery: ParamQuery[EntityIdOrName] = Query.initWithParam[EntityIdOrName, Traversal.V[Profile]]( "getProfile", - FieldsParser[EntityIdOrName], (idOrName, graph, _) => profileSrv.get(idOrName)(graph) ) val entityName: String = "profile" diff --git a/thehive/app/org/thp/thehive/controllers/v1/ShareCtrl.scala b/thehive/app/org/thp/thehive/controllers/v1/ShareCtrl.scala index 3b0159ca6e..1dad6a1066 100644 --- a/thehive/app/org/thp/thehive/controllers/v1/ShareCtrl.scala +++ b/thehive/app/org/thp/thehive/controllers/v1/ShareCtrl.scala @@ -43,7 +43,6 @@ class ShareCtrl @Inject() ( override val outputQuery: Query = Query.outputWithContext[RichShare, Traversal.V[Share]]((shareSteps, _) => shareSteps.richShare) override val getQuery: ParamQuery[EntityIdOrName] = Query.initWithParam[EntityIdOrName, Traversal.V[Share]]( "getShare", - FieldsParser[EntityIdOrName], (idOrName, graph, authContext) => shareSrv.get(idOrName)(graph).visible(authContext) ) override val extraQueries: Seq[ParamQuery[_]] = Seq( diff --git a/thehive/app/org/thp/thehive/controllers/v1/TaskCtrl.scala b/thehive/app/org/thp/thehive/controllers/v1/TaskCtrl.scala index 6993fcfabd..caf9f61a98 100644 --- a/thehive/app/org/thp/thehive/controllers/v1/TaskCtrl.scala +++ b/thehive/app/org/thp/thehive/controllers/v1/TaskCtrl.scala @@ -48,7 +48,6 @@ class TaskCtrl @Inject() ( ) override val getQuery: ParamQuery[EntityIdOrName] = Query.initWithParam[EntityIdOrName, Traversal.V[Task]]( "getTask", - FieldsParser[EntityIdOrName], (idOrName, graph, authContext) => taskSrv.get(idOrName)(graph).visible(organisationSrv)(authContext) ) override val outputQuery: Query = diff --git a/thehive/app/org/thp/thehive/controllers/v1/TaxonomyCtrl.scala b/thehive/app/org/thp/thehive/controllers/v1/TaxonomyCtrl.scala index dfb4179b7a..6e89c55b60 100644 --- a/thehive/app/org/thp/thehive/controllers/v1/TaxonomyCtrl.scala +++ b/thehive/app/org/thp/thehive/controllers/v1/TaxonomyCtrl.scala @@ -37,7 +37,6 @@ class TaxonomyCtrl @Inject() ( override val getQuery: ParamQuery[EntityIdOrName] = Query.initWithParam[EntityIdOrName, Traversal.V[Taxonomy]]( "getTaxonomy", - FieldsParser[EntityIdOrName], (idOrName, graph, authContext) => taxonomySrv.get(idOrName)(graph).visible(authContext) ) override val pageQuery: ParamQuery[OutputParam] = diff --git a/thehive/app/org/thp/thehive/controllers/v1/UserCtrl.scala b/thehive/app/org/thp/thehive/controllers/v1/UserCtrl.scala index 61d0eaecc9..13cc120eb4 100644 --- a/thehive/app/org/thp/thehive/controllers/v1/UserCtrl.scala +++ b/thehive/app/org/thp/thehive/controllers/v1/UserCtrl.scala @@ -45,7 +45,6 @@ class UserCtrl @Inject() ( override val getQuery: ParamQuery[EntityIdOrName] = Query.initWithParam[EntityIdOrName, Traversal.V[User]]( "getUser", - FieldsParser[EntityIdOrName], (idOrName, graph, authContext) => userSrv.get(idOrName)(graph).visible(authContext) )