refactor handlers to get account when necessary

Signed-off-by: bcmmbaga <bethuelmbaga12@gmail.com>
This commit is contained in:
bcmmbaga
2024-09-17 23:15:54 +03:00
parent 3cf1b02f31
commit e5d55d3c10
29 changed files with 221 additions and 224 deletions

View File

@@ -90,8 +90,8 @@ func initNameserversTestData() *NameserversHandler {
}
return status.Errorf(status.NotFound, "nameserver group with ID %s was not found", nsGroupToSave.ID)
},
GetAccountFromTokenFunc: func(_ context.Context, _ jwtclaims.AuthorizationClaims) (*server.Account, *server.User, error) {
return testingNSAccount, testingAccount.Users["test_user"], nil
GetAccountFromTokenFunc: func(_ context.Context, _ jwtclaims.AuthorizationClaims) (string, string, error) {
return testingNSAccount.Id, "test_user", nil
},
},
claimsExtractor: jwtclaims.NewClaimsExtractor(