-
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.
#1404 Move initial values from service to model layer
- Loading branch information
Showing
14 changed files
with
166 additions
and
74 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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,6 +5,7 @@ import java.util.Date | |
import org.thp.scalligraph.auth.{Permission, User => ScalligraphUser} | ||
import org.thp.scalligraph.models._ | ||
import org.thp.scalligraph.{EdgeEntity, VertexEntity} | ||
import org.thp.thehive.services.LocalPasswordAuthSrv | ||
|
||
@EdgeEntity[User, Role] | ||
case class UserRole() | ||
|
@@ -22,6 +23,24 @@ case class User(login: String, name: String, apikey: Option[String], locked: Boo | |
override def toString: String = s"User($login,$name,$locked)" | ||
} | ||
|
||
object User { | ||
val initPassword: String = "secret" | ||
|
||
val init: User = User( | ||
login = "[email protected]", | ||
name = "Default admin user", | ||
apikey = None, | ||
locked = false, | ||
password = Some(LocalPasswordAuthSrv.hashPassword(initPassword)), | ||
totpSecret = None | ||
) | ||
|
||
val system: User = | ||
User(login = "[email protected]", name = "TheHive system user", apikey = None, locked = false, password = None, totpSecret = None) | ||
|
||
val initialValues: Seq[User] = Seq(init, system) | ||
} | ||
|
||
// avatar: Array[Byte], | ||
// preference: JsObject) | ||
|
||
|
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.