Authz: add support to use folder api to fetch folder tree (#100038)
* Add FolderStore interface * Authz: add implementation to use folders api and use it inproc with loopback config * Add tracing and add rest.Config for talking with folder api using access tokens * Restructure test to get rid of circular dependencies in tests * use correct group version kind --------- Co-authored-by: gamab <gabriel.mabille@grafana.com>
This commit is contained in:
@@ -620,6 +620,7 @@ func setupService() *Service {
|
||||
folderCache: newCacheWrap[folderTree](cache, logger, shortCacheTTL),
|
||||
store: fStore,
|
||||
permissionStore: fStore,
|
||||
folderStore: fStore,
|
||||
identityStore: &fakeIdentityStore{},
|
||||
sf: new(singleflight.Group),
|
||||
}
|
||||
@@ -663,7 +664,7 @@ func (f *fakeStore) GetUserPermissions(ctx context.Context, namespace claims.Nam
|
||||
return f.userPermissions, nil
|
||||
}
|
||||
|
||||
func (f *fakeStore) GetFolders(ctx context.Context, namespace claims.NamespaceInfo) ([]store.Folder, error) {
|
||||
func (f *fakeStore) ListFolders(ctx context.Context, namespace claims.NamespaceInfo) ([]store.Folder, error) {
|
||||
f.calls++
|
||||
if f.err {
|
||||
return nil, fmt.Errorf("store error")
|
||||
|
||||
Reference in New Issue
Block a user