-
Notifications
You must be signed in to change notification settings - Fork 640
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
#1454 Add queries and controler for shares in v1
- Loading branch information
Showing
12 changed files
with
383 additions
and
39 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
package org.thp.thehive.dto.v1 | ||
|
||
import org.thp.thehive.dto.v1.ObservablesFilter.ObservablesFilter | ||
import org.thp.thehive.dto.v1.TasksFilter.TasksFilter | ||
import play.api.libs.json.{Format, Json, Writes} | ||
|
||
import java.util.Date | ||
|
||
case class InputShare(organisationName: String, profile: String, tasks: TasksFilter, observables: ObservablesFilter) | ||
|
||
object TasksFilter extends Enumeration { | ||
type TasksFilter = Value | ||
|
||
val all: TasksFilter = Value("all") | ||
val none: TasksFilter = Value("none") | ||
|
||
implicit val format: Format[TasksFilter] = Json.formatEnum(TasksFilter) | ||
} | ||
|
||
object ObservablesFilter extends Enumeration { | ||
type ObservablesFilter = Value | ||
|
||
val all: ObservablesFilter = Value("all") | ||
val none: ObservablesFilter = Value("none") | ||
|
||
implicit val format: Format[ObservablesFilter] = Json.formatEnum(ObservablesFilter) | ||
} | ||
|
||
object InputShare { | ||
implicit val writes: Writes[InputShare] = Json.writes[InputShare] | ||
} | ||
|
||
case class OutputShare( | ||
_id: String, | ||
_type: String, | ||
_createdBy: String, | ||
_updatedBy: Option[String] = None, | ||
_createdAt: Date, | ||
_updatedAt: Option[Date] = None, | ||
caseId: String, | ||
profileName: String, | ||
organisationName: String, | ||
owner: Boolean | ||
) | ||
|
||
object OutputShare { | ||
implicit val format: Format[OutputShare] = Json.format[OutputShare] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.