Add User HTTP Endpoint to the Management service (#303)

Exposes endpoint under "/users/" that returns information on users.
Calls IDP manager to get information not stored locally (email, name), 
which in the case of the managed version is auth0.
This commit is contained in:
shatoboar
2022-05-05 08:58:34 +02:00
committed by GitHub
parent 219888254e
commit c7e5e5c7c9
11 changed files with 437 additions and 19 deletions

View File

@@ -33,6 +33,15 @@ type MockAccountManager struct {
GroupAddPeerFunc func(accountID, groupID, peerKey string) error
GroupDeletePeerFunc func(accountID, groupID, peerKey string) error
GroupListPeersFunc func(accountID, groupID string) ([]*server.Peer, error)
GetUsersFromAccountFunc func(accountID string) ([]*server.UserInfo, error)
}
func (am *MockAccountManager) GetUsersFromAccount(accountID string) ([]*server.UserInfo, error) {
if am.GetUsersFromAccountFunc != nil {
return am.GetUsersFromAccountFunc(accountID)
}
return nil, status.Errorf(codes.Unimplemented, "method GetUsersFromAccount not implemented")
}
func (am *MockAccountManager) GetOrCreateAccountByUser(