bump reva to 02af5a266

Signed-off-by: Jörn Friedrich Dreyer <jfd@butonic.de>
This commit is contained in:
Jörn Friedrich Dreyer
2024-09-26 15:02:18 +02:00
parent e6d5c96c64
commit ebe89910ca
5 changed files with 42 additions and 13 deletions
@@ -789,21 +789,26 @@ func (s *service) Stat(ctx context.Context, req *provider.StatRequest) (*provide
return nil, err
}
// TODO return reference?
return gatewayClient.Stat(ctx, &provider.StatRequest{
statRes, err := gatewayClient.Stat(ctx, &provider.StatRequest{
Opaque: req.Opaque,
Ref: buildReferenceInShare(req.Ref, receivedShare),
ArbitraryMetadataKeys: req.ArbitraryMetadataKeys,
})
if err != nil {
return nil, err
}
// FIXME when stating a share jail child we need to rewrite the id and use the share
// when stating a share jail mountpoint we need to rewrite the id and use the share
// jail space id as the mountpoint has a different id than the grant
// but that might be problematic for eg. wopi because it needs the correct id? ...
// ... but that should stat the grant anyway
// FIXME when navigating via /dav/spaces/a0ca6a90-a365-4782-871e-d44447bbc668 the web ui seems
// to continue navigating based on the id of resources, causing the path to change. Is that related to WOPI?
if statRes.GetStatus().GetCode() == rpc.Code_CODE_OK && receivedShare.MountPoint.Path == strings.TrimPrefix(req.Ref.Path, "./") && statRes.Info != nil {
statRes.Info.Id = &provider.ResourceId{
StorageId: utils.ShareStorageProviderID,
SpaceId: utils.ShareStorageSpaceID,
OpaqueId: receivedShare.GetShare().GetId().GetOpaqueId(),
}
}
return statRes, nil
}
func (s *service) ListContainerStream(req *provider.ListContainerStreamRequest, ss provider.ProviderAPI_ListContainerStreamServer) error {
+23 -2
View File
@@ -22,6 +22,7 @@ import (
"bytes"
"context"
"errors"
"fmt"
"io"
"net/http"
"os"
@@ -107,6 +108,27 @@ func (cs3 *CS3) Init(ctx context.Context, spaceid string) (err error) {
if err != nil {
return err
}
lsRes, err := client.ListStorageSpaces(ctx, &provider.ListStorageSpacesRequest{
Filters: []*provider.ListStorageSpacesRequest_Filter{
{
Type: provider.ListStorageSpacesRequest_Filter_TYPE_ID,
Term: &provider.ListStorageSpacesRequest_Filter_Id{
Id: &provider.StorageSpaceId{OpaqueId: spaceid + "!" + spaceid},
},
},
},
})
switch {
case err != nil:
return err
case lsRes.Status.Code == rpc.Code_CODE_OK && len(lsRes.StorageSpaces) > 0:
if len(lsRes.StorageSpaces) > 0 {
cs3.SpaceRoot = lsRes.StorageSpaces[0].Root
return nil
}
}
// FIXME change CS3 api to allow sending a space id
cssr, err := client.CreateStorageSpace(ctx, &provider.CreateStorageSpaceRequest{
Opaque: &types.Opaque{
@@ -127,8 +149,7 @@ func (cs3 *CS3) Init(ctx context.Context, spaceid string) (err error) {
case cssr.Status.Code == rpc.Code_CODE_OK:
cs3.SpaceRoot = cssr.StorageSpace.Root
case cssr.Status.Code == rpc.Code_CODE_ALREADY_EXISTS:
// TODO make CreateStorageSpace return existing space?
cs3.SpaceRoot = &provider.ResourceId{SpaceId: spaceid, OpaqueId: spaceid}
return errtypes.AlreadyExists(fmt.Sprintf("user %s does not have access to metadata space %s, but it exists", cs3.serviceUser.Id.OpaqueId, spaceid))
default:
return errtypes.NewErrtypeFromStatus(cssr.Status)
}