unified-storage: Reduce calls to the user service (#102934)

* Create ListByIdOrUID in user service

* create UnstructuredToLegacyFolderList 

* update GetFolders to use list parser

* update GetDescendants to use list parser

* update UnstructuredToLegacyFolder to also make a single call to the user service

---------

Co-authored-by: Stephanie Hingtgen <stephanie.hingtgen@grafana.com>
This commit is contained in:
Will Assis
2025-03-27 22:01:07 +02:00
committed by GitHub
co-authored by Stephanie Hingtgen
parent 7e3efb3df2
commit 51825cfffe
13 changed files with 643 additions and 63 deletions
+5
View File
@@ -274,6 +274,7 @@ type FakeUserStore struct {
ExpectedError error
ExpectedDeleteUserError error
ExpectedCountUserAccountsWithEmptyRoles int64
ExpectedListUsersByIdOrUid []*user.User
}
func newUserStoreFake() *FakeUserStore {
@@ -296,6 +297,10 @@ func (f *FakeUserStore) GetByUID(context.Context, string) (*user.User, error) {
return f.ExpectedUser, f.ExpectedError
}
func (f *FakeUserStore) ListByIdOrUID(context.Context, []string, []int64) ([]*user.User, error) {
return f.ExpectedListUsersByIdOrUid, f.ExpectedError
}
func (f *FakeUserStore) LoginConflict(context.Context, string, string) error {
return f.ExpectedError
}