From 5b9965ee4751e4f6848f9422a546e82d84bae941 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jean-Philippe=20Qu=C3=A9m=C3=A9ner?= Date: Tue, 9 Dec 2025 12:20:37 +0100 Subject: [PATCH] fix(unified-storage): check auth before getting value (#114995) --- pkg/storage/unified/resource/server.go | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/pkg/storage/unified/resource/server.go b/pkg/storage/unified/resource/server.go index dd091c6e2d4..15d3b39b85c 100644 --- a/pkg/storage/unified/resource/server.go +++ b/pkg/storage/unified/resource/server.go @@ -1084,10 +1084,6 @@ func (s *server) List(ctx context.Context, req *resourcepb.ListRequest) (*resour return err } - item := &resourcepb.ResourceWrapper{ - ResourceVersion: iter.ResourceVersion(), - Value: iter.Value(), - } // Trash is only accessible to admins or the user who deleted the object if req.Source == resourcepb.ListRequest_TRASH { if !s.isTrashItemAuthorized(ctx, iter, trashChecker) { @@ -1097,6 +1093,11 @@ func (s *server) List(ctx context.Context, req *resourcepb.ListRequest) (*resour continue } + item := &resourcepb.ResourceWrapper{ + ResourceVersion: iter.ResourceVersion(), + Value: iter.Value(), + } + pageBytes += len(item.Value) rsp.Items = append(rsp.Items, item) if (req.Limit > 0 && len(rsp.Items) >= int(req.Limit)) || pageBytes >= maxPageBytes {