Create account in once place (#358)

There are a few places where an account is created.
When we create a new account, there should be
some defaults set. E.g. created by and group ALL.
It makes sense to add it in one place to avoid inconsistencies.
This commit is contained in:
Misha Bragin
2022-06-09 13:14:34 +02:00
committed by GitHub
parent a88ac40b05
commit a454a1aa28
6 changed files with 131 additions and 87 deletions

View File

@ -34,7 +34,6 @@ func TestSaveAccount(t *testing.T) {
store := newStore(t)
account := NewAccount("testuser", "")
account.Users["testuser"] = NewAdminUser("testuser")
setupKey := GenerateDefaultSetupKey()
account.SetupKeys[setupKey.Key] = setupKey
account.Peers["testpeer"] = &Peer{
@ -74,7 +73,6 @@ func TestStore(t *testing.T) {
store := newStore(t)
account := NewAccount("testuser", "")
account.Users["testuser"] = NewAdminUser("testuser")
account.Peers["testpeer"] = &Peer{
Key: "peerkey",
SetupKey: "peerkeysetupkey",