fix(validate): don't list all objects in bucket when validating permissions
This commit is contained in:
1 parent
f021286b33
commit
bff5f27aa8
1 file changed
+2
-1
@@ -893,7 +893,8 @@ func validateReadPermission(ctx context.Context, cl *minio.Client, bucket *stora
|
||||
combinedErrors = multierror.Append(combinedErrors, fmt.Errorf("failed to get object at %q: %w", objectKey, err))
|
||||
}
|
||||
|
||||
oiCh := cl.ListObjects(ctx, bucket.GetBucketName(), minio.ListObjectsOptions{Recursive: true})
|
||||
// List just the object we created above
|
||||
oiCh := cl.ListObjects(ctx, bucket.GetBucketName(), minio.ListObjectsOptions{Prefix: objectKey, MaxKeys: 1})
|
||||
for oi := range oiCh {
|
||||
if oi.Err != nil {
|
||||
if permission.GetState() == pb.StateType_STATE_TYPE_OK {
|
||||
|
||||
Reference in new issue
Block a user