mirror of
https://github.com/pushbits/server.git
synced 2025-06-05 20:22:01 +02:00
add tests for config
This commit is contained in:
parent
d39e2ea9a4
commit
e87f775b1d
11 changed files with 461 additions and 6 deletions
21
tests/mockups/user.go
Normal file
21
tests/mockups/user.go
Normal file
|
@ -0,0 +1,21 @@
|
|||
package mockups
|
||||
|
||||
import (
|
||||
"github.com/pushbits/server/internal/authentication/credentials"
|
||||
"github.com/pushbits/server/internal/configuration"
|
||||
"github.com/pushbits/server/internal/model"
|
||||
)
|
||||
|
||||
// GetAdminUser returns an admin user
|
||||
func GetAdminUser(c *configuration.Configuration) *model.User {
|
||||
credentialsManager := credentials.CreateManager(false, c.Crypto)
|
||||
hash, _ := credentialsManager.CreatePasswordHash(c.Admin.Password)
|
||||
|
||||
return &model.User{
|
||||
ID: 1,
|
||||
Name: c.Admin.Name,
|
||||
PasswordHash: hash,
|
||||
IsAdmin: true,
|
||||
MatrixID: c.Admin.MatrixID,
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue