Remove account IDs in favor of just account names

These were a "security" feature but pre-emptive and just add complications when we can implement secrets later
This commit is contained in:
Marc Di Luzio 2020-06-10 18:56:24 +01:00
parent b3b369f608
commit 7749854eb7
8 changed files with 23 additions and 53 deletions

View file

@ -36,11 +36,6 @@ func TestAccountant_RegisterAccount(t *testing.T) {
t.Errorf("Missmatched account name after register, expected: %s, actual: %s", nameb, acca.Name)
}
// Verify our accounts have differing IDs
if acca.Id == accb.Id {
t.Error("Duplicate account IDs fo separate accounts")
}
// Verify another request gets rejected
_, err = accountant.RegisterAccount(namea)
if err == nil {
@ -62,12 +57,12 @@ func TestAccountant_AssignGetRover(t *testing.T) {
inst := uuid.New()
err = accountant.AssignRover(a.Id, inst)
err = accountant.AssignRover(a.Name, inst)
if err != nil {
t.Error("Failed to set rover for created account")
} else if accountant.Accounts[a.Id].Rover != inst {
} else if accountant.Accounts[a.Name].Rover != inst {
t.Error("Rover for assigned account is incorrect")
} else if id, err := accountant.GetRover(a.Id); err != nil {
} else if id, err := accountant.GetRover(a.Name); err != nil {
t.Error("Failed to get rover for account")
} else if id != inst {
t.Error("Fetched rover is incorrect for account")