Skip to content

Commit

Permalink
update to embedded reference
Browse files Browse the repository at this point in the history
Signed-off-by: Jörn Friedrich Dreyer <jfd@butonic.de>
  • Loading branch information
butonic committed Jun 11, 2021
1 parent e95be4a commit bf15aeb
Show file tree
Hide file tree
Showing 54 changed files with 243 additions and 215 deletions.
4 changes: 2 additions & 2 deletions cmd/reva/ocm-share-list.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,9 @@ func ocmShareListCommand() *command {
if len(tokens) != 2 {
return fmt.Errorf("resource id invalid")
}
id := &provider.Reference{
id := &provider.ResourceId{
StorageId: tokens[0],
NodeId: tokens[1],
OpaqueId: tokens[1],
}
shareRequest.Filters = []*ocm.ListOCMSharesRequest_Filter{
&ocm.ListOCMSharesRequest_Filter{
Expand Down
4 changes: 2 additions & 2 deletions cmd/reva/public-share-list.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,9 @@ func publicShareListCommand() *command {
if len(tokens) != 2 {
return fmt.Errorf("resource id invalid")
}
id := &provider.Reference{
id := &provider.ResourceId{
StorageId: tokens[0],
NodeId: tokens[1],
OpaqueId: tokens[1],
}
shareRequest.Filters = []*link.ListPublicSharesRequest_Filter{
&link.ListPublicSharesRequest_Filter{
Expand Down
2 changes: 1 addition & 1 deletion cmd/reva/recycle-list.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ func recycleListCommand() *command {
}

req := &gateway.ListRecycleRequest{
Ref: getHomeRes.Ref,
Ref: &provider.Reference{Path: getHomeRes.Path},
}
res, err := client.ListRecycle(ctx, req)
if err != nil {
Expand Down
2 changes: 1 addition & 1 deletion cmd/reva/recycle-purge.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ func recyclePurgeCommand() *command {
return err
}

req := &gateway.PurgeRecycleRequest{Ref: getHomeRes.Ref}
req := &gateway.PurgeRecycleRequest{Ref: &provider.Reference{Path: getHomeRes.Path}}

res, err := client.PurgeRecycle(ctx, req)
if err != nil {
Expand Down
2 changes: 1 addition & 1 deletion cmd/reva/recycle-restore.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ func recycleRestoreCommand() *command {
}

req := &provider.RestoreRecycleItemRequest{
Ref: getHomeRes.Ref,
Ref: &provider.Reference{Path: getHomeRes.Path},
Key: key,
}

Expand Down
4 changes: 2 additions & 2 deletions cmd/reva/share-list.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,9 @@ func shareListCommand() *command {
if len(tokens) != 2 {
return fmt.Errorf("resource id invalid")
}
id := &provider.Reference{
id := &provider.ResourceId{
StorageId: tokens[0],
NodeId: tokens[1],
OpaqueId: tokens[1],
}
shareRequest.Filters = []*collaboration.ListSharesRequest_Filter{
&collaboration.ListSharesRequest_Filter{
Expand Down
2 changes: 1 addition & 1 deletion cmd/reva/upload.go
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ func uploadCommand() *command {

info := res2.Info

fmt.Printf("File uploaded: %s:%s %d %s\n", info.Id.StorageId, info.Id.NodeId, info.Size, info.Path)
fmt.Printf("File uploaded: %s:%s %d %s\n", info.Id.StorageId, info.Id.OpaqueId, info.Size, info.Path)

return nil
}
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ require (
go 1.16

replace (
github.com/cs3org/go-cs3apis => github.com/butonic/go-cs3apis v0.0.0-20210608111428-0b2c079174c9
github.com/cs3org/go-cs3apis => github.com/butonic/go-cs3apis v0.0.0-20210611201603-ddc97e244f3d
github.com/eventials/go-tus => github.com/andrewmostello/go-tus v0.0.0-20200314041820-904a9904af9a
github.com/oleiade/reflections => github.com/oleiade/reflections v1.0.1
google.golang.org/grpc => google.golang.org/grpc v1.26.0 // temporary downgrade
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -103,8 +103,8 @@ github.com/bmatcuk/doublestar/v2 v2.0.3/go.mod h1:QMmcs3H2AUQICWhfzLXz+IYln8lRQm
github.com/bmizerany/assert v0.0.0-20160611221934-b7ed37b82869/go.mod h1:Ekp36dRnpXw/yCqJaO+ZrUyxD+3VXMFFr56k5XYrpB4=
github.com/bmizerany/pat v0.0.0-20170815010413-6226ea591a40 h1:y4B3+GPxKlrigF1ha5FFErxK+sr6sWxQovRMzwMhejo=
github.com/bmizerany/pat v0.0.0-20170815010413-6226ea591a40/go.mod h1:8rLXio+WjiTceGBHIoTvn60HIbs7Hm7bcHjyrSqYB9c=
github.com/butonic/go-cs3apis v0.0.0-20210608111428-0b2c079174c9 h1:q2UFrmiIZwdFOislnGjUWlyqIpttjBRIB6K3QOUmZkY=
github.com/butonic/go-cs3apis v0.0.0-20210608111428-0b2c079174c9/go.mod h1:UXha4TguuB52H14EMoSsCqDj7k8a/t7g4gVP+bgY5LY=
github.com/butonic/go-cs3apis v0.0.0-20210611201603-ddc97e244f3d h1:kcfcU1gtVWN1atA0gV6dfi7gOSDzGAUc9Ng7X7kGLRY=
github.com/butonic/go-cs3apis v0.0.0-20210611201603-ddc97e244f3d/go.mod h1:UXha4TguuB52H14EMoSsCqDj7k8a/t7g4gVP+bgY5LY=
github.com/c-bata/go-prompt v0.2.5 h1:3zg6PecEywxNn0xiqcXHD96fkbxghD+gdB2tbsYfl+Y=
github.com/c-bata/go-prompt v0.2.5/go.mod h1:vFnjEGDIIA/Lib7giyE4E9c50Lvl8j0S+7FVlAwDAVw=
github.com/casbin/casbin/v2 v2.1.2/go.mod h1:YcPU1XXisHhLzuxH9coDNf2FbKpjGlbCg3n9yuLkIJQ=
Expand Down
2 changes: 1 addition & 1 deletion internal/grpc/interceptors/auth/auth.go
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,7 @@ func dismantleToken(ctx context.Context, tkn string, req interface{}, mgr token.

// Since the public share is obtained from the scope, the current token
// has access to it.
statReq := &provider.StatRequest{Ref: share.ResourceId}
statReq := &provider.StatRequest{Ref: &provider.Reference{ResourceId: share.ResourceId}}

statResponse, err := client.Stat(ctx, statReq)
if err != nil || statResponse.Status.Code != rpc.Code_CODE_OK {
Expand Down
2 changes: 1 addition & 1 deletion internal/grpc/services/appprovider/appprovider.go
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ func (s *service) OpenInApp(ctx context.Context, req *providerpb.OpenInAppReques
}

q := httpReq.URL.Query()
q.Add("fileid", req.ResourceInfo.GetId().NodeId)
q.Add("fileid", req.ResourceInfo.GetId().OpaqueId)
q.Add("endpoint", req.ResourceInfo.GetId().StorageId)
q.Add("viewmode", req.ViewMode.String())
// TODO the folder URL should be resolved as e.g. `'https://cernbox.cern.ch/index.php/apps/files/?dir=' + filepath.Dir(req.Ref.GetPath())`
Expand Down
10 changes: 5 additions & 5 deletions internal/grpc/services/gateway/ocmshareprovider.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ func (s *svc) CreateOCMShare(ctx context.Context, req *ocm.CreateOCMShareRequest

// TODO(labkode): if both commits are enabled they could be done concurrently.
if s.c.CommitShareToStorageGrant {
addGrantStatus, err := s.addGrant(ctx, req.ResourceId, req.Grant.Grantee, req.Grant.Permissions.Permissions)
addGrantStatus, err := s.addGrant(ctx, &provider.Reference{ResourceId: req.ResourceId}, req.Grant.Grantee, req.Grant.Permissions.Permissions)
if err != nil {
return nil, errors.Wrap(err, "gateway: error adding OCM grant to storage")
}
Expand Down Expand Up @@ -109,7 +109,7 @@ func (s *svc) RemoveOCMShare(ctx context.Context, req *ocm.RemoveOCMShareRequest

// TODO(labkode): if both commits are enabled they could be done concurrently.
if s.c.CommitShareToStorageGrant {
removeGrantStatus, err := s.removeGrant(ctx, share.ResourceId, share.Grantee, share.Permissions.Permissions)
removeGrantStatus, err := s.removeGrant(ctx, &provider.Reference{ResourceId: share.ResourceId}, share.Grantee, share.Permissions.Permissions)
if err != nil {
return nil, errors.Wrap(err, "gateway: error removing OCM grant from storage")
}
Expand Down Expand Up @@ -318,7 +318,7 @@ func (s *svc) createOCMReference(ctx context.Context, share *ocm.Share) (*rpc.St
if share.ShareType == ocm.Share_SHARE_TYPE_TRANSFER {
createTransferDir, err := s.CreateContainer(ctx, &provider.CreateContainerRequest{
Ref: &provider.Reference{
Path: path.Join(homeRes.Ref.Path, s.c.DataTransfersFolder),
Path: path.Join(homeRes.Path, s.c.DataTransfersFolder),
},
})
if err != nil {
Expand All @@ -329,14 +329,14 @@ func (s *svc) createOCMReference(ctx context.Context, share *ocm.Share) (*rpc.St
return status.NewInternal(ctx, err, "error creating transfers directory"), nil
}

refPath = path.Join(homeRes.Ref.Path, s.c.DataTransfersFolder, path.Base(share.Name))
refPath = path.Join(homeRes.Path, s.c.DataTransfersFolder, path.Base(share.Name))
targetURI = fmt.Sprintf("datatx://%s@%s?name=%s", token, share.Creator.Idp, share.Name)
} else {
// reference path is the home path + some name on the corresponding
// mesh provider (/home/MyShares/x)
// It is the responsibility of the gateway to resolve these references and merge the response back
// from the main request.
refPath = path.Join(homeRes.Ref.Path, s.c.ShareFolder, path.Base(share.Name))
refPath = path.Join(homeRes.Path, s.c.ShareFolder, path.Base(share.Name))
// webdav is the scheme, token@host the opaque part and the share name the query of the URL.
targetURI = fmt.Sprintf("webdav://%s@%s?name=%s", token, share.Creator.Idp, share.Name)
}
Expand Down
44 changes: 22 additions & 22 deletions internal/grpc/services/gateway/storageprovider.go
Original file line number Diff line number Diff line change
Expand Up @@ -128,10 +128,10 @@ func (s *svc) ListStorageSpaces(ctx context.Context, req *provider.ListStorageSp
Status: status.NewInvalidArg(ctx, "space id must be separated by !"),
}, nil
}
c, err := s.find(ctx, &provider.Reference{
c, err := s.find(ctx, &provider.Reference{ResourceId: &provider.ResourceId{
StorageId: parts[0], // FIXME REFERENCE the StorageSpaceId is a storageid + a nodeid
NodeId: parts[1],
})
OpaqueId: parts[1],
}})
if err != nil {
return &provider.ListStorageSpacesResponse{
Status: status.NewStatusFromErrType(ctx, "error finding path", err),
Expand All @@ -151,7 +151,7 @@ func (s *svc) ListStorageSpaces(ctx context.Context, req *provider.ListStorageSp
func (s *svc) UpdateStorageSpace(ctx context.Context, req *provider.UpdateStorageSpaceRequest) (*provider.UpdateStorageSpaceResponse, error) {
log := appctx.GetLogger(ctx)
// TODO: needs to be fixed
c, err := s.find(ctx, req.StorageSpace.Root)
c, err := s.find(ctx, &provider.Reference{ResourceId: req.StorageSpace.Root})
if err != nil {
return &provider.UpdateStorageSpaceResponse{
Status: status.NewStatusFromErrType(ctx, "error finding ID", err),
Expand All @@ -171,9 +171,9 @@ func (s *svc) UpdateStorageSpace(ctx context.Context, req *provider.UpdateStorag
func (s *svc) DeleteStorageSpace(ctx context.Context, req *provider.DeleteStorageSpaceRequest) (*provider.DeleteStorageSpaceResponse, error) {
log := appctx.GetLogger(ctx)
// TODO: needs to be fixed
c, err := s.find(ctx, &provider.Reference{
c, err := s.find(ctx, &provider.Reference{ResourceId: &provider.ResourceId{
StorageId: req.Id.OpaqueId, // FIXME REFERENCE the StorageSpaceId is a storageid + a nodeid
})
}})
if err != nil {
return &provider.DeleteStorageSpaceResponse{
Status: status.NewStatusFromErrType(ctx, "error finding path", err),
Expand All @@ -192,7 +192,7 @@ func (s *svc) DeleteStorageSpace(ctx context.Context, req *provider.DeleteStorag

func (s *svc) GetHome(ctx context.Context, _ *provider.GetHomeRequest) (*provider.GetHomeResponse, error) {
home := s.getHome(ctx)
homeRes := &provider.GetHomeResponse{Ref: &provider.Reference{Path: home}, Status: status.NewOK(ctx)}
homeRes := &provider.GetHomeResponse{Path: home, Status: status.NewOK(ctx)}
return homeRes, nil
}

Expand Down Expand Up @@ -295,7 +295,7 @@ func (s *svc) InitiateFileDownload(ctx context.Context, req *provider.InitiateFi
if ri.Type == provider.ResourceType_RESOURCE_TYPE_FILE {
log.Debug().Str("path", p).Interface("ri", ri).Msg("path points to share name file")
req.Ref.Path = ri.Path
log.Debug().Str("storage", ri.Id.StorageId).Str("node", ri.Id.NodeId).Str("path", req.Ref.Path).Msg("download")
log.Debug().Str("storage", ri.Id.StorageId).Str("node", ri.Id.OpaqueId).Str("path", req.Ref.Path).Msg("download")
return s.initiateFileDownload(ctx, req)
}

Expand Down Expand Up @@ -357,7 +357,7 @@ func (s *svc) InitiateFileDownload(ctx context.Context, req *provider.InitiateFi

// append child to target
req.Ref.Path = path.Join(ri.Path, shareChild)
log.Debug().Str("storage", ri.Id.StorageId).Str("node", ri.Id.NodeId).Str("path", req.Ref.Path).Msg("download")
log.Debug().Str("storage", ri.Id.StorageId).Str("node", ri.Id.OpaqueId).Str("path", req.Ref.Path).Msg("download")
return s.initiateFileDownload(ctx, req)
}

Expand Down Expand Up @@ -497,7 +497,7 @@ func (s *svc) InitiateFileUpload(ctx context.Context, req *provider.InitiateFile
if ri.Type == provider.ResourceType_RESOURCE_TYPE_FILE {
log.Debug().Str("path", p).Interface("ri", ri).Msg("path points to share name file")
req.Ref.Path = ri.Path
log.Debug().Str("storage", req.Ref.StorageId).Str("node", req.Ref.NodeId).Str("path", req.Ref.Path).Msg("upload")
log.Debug().Str("storage", req.Ref.ResourceId.StorageId).Str("node", req.Ref.ResourceId.OpaqueId).Str("path", req.Ref.Path).Msg("upload")
return s.initiateFileUpload(ctx, req)
}

Expand Down Expand Up @@ -622,7 +622,7 @@ func (s *svc) initiateFileUpload(ctx context.Context, req *provider.InitiateFile
}

func (s *svc) GetPath(ctx context.Context, req *provider.GetPathRequest) (*provider.GetPathResponse, error) {
statReq := &provider.StatRequest{Ref: req.ResourceId}
statReq := &provider.StatRequest{Ref: &provider.Reference{ResourceId: req.ResourceId}}
statRes, err := s.stat(ctx, statReq)
if err != nil {
err = errors.Wrap(err, "gateway: error stating ref:"+statReq.Ref.String())
Expand Down Expand Up @@ -1133,9 +1133,9 @@ func (s *svc) stat(ctx context.Context, req *provider.StatRequest) (*provider.St
return &provider.StatResponse{
Status: status.NewOK(ctx),
Info: &provider.ResourceInfo{
Id: &provider.Reference{
Id: &provider.ResourceId{
StorageId: "/",
NodeId: uuid.New().String(),
OpaqueId: uuid.New().String(),
},
Type: provider.ResourceType_RESOURCE_TYPE_CONTAINER,
Path: resPath,
Expand Down Expand Up @@ -1339,11 +1339,11 @@ func (s *svc) handleCS3Ref(ctx context.Context, opaque string) (*provider.Resour
// we could call here the Stat method again, but that is calling for problems in case
// there is a loop of targets pointing to targets, so better avoid it.

req := &provider.StatRequest{
Ref: &provider.Reference{
req := &provider.StatRequest{Ref: &provider.Reference{
ResourceId: &provider.ResourceId{
StorageId: parts[0],
NodeId: parts[1],
},
OpaqueId: parts[1],
}},
}
res, err := s.stat(ctx, req)
if err != nil {
Expand Down Expand Up @@ -1455,7 +1455,7 @@ func (s *svc) listSharesFolder(ctx context.Context) (*provider.ListContainerResp
}

func isStorageSpaceReference(ref *provider.Reference) bool {
return ref.StorageId != "" && ref.NodeId != "" && ref.Path != ""
return ref.ResourceId != nil && strings.HasPrefix(ref.Path, ".")
}

func (s *svc) listContainer(ctx context.Context, req *provider.ListContainerRequest) (*provider.ListContainerResponse, error) {
Expand Down Expand Up @@ -1498,9 +1498,9 @@ func (s *svc) listContainer(ctx context.Context, req *provider.ListContainerRequ

for k, v := range indirects {
inf := &provider.ResourceInfo{
Id: &provider.Reference{
Id: &provider.ResourceId{
StorageId: "/",
NodeId: uuid.New().String(),
OpaqueId: uuid.New().String(),
},
Type: provider.ResourceType_RESOURCE_TYPE_CONTAINER,
Etag: etag.GenerateEtagFromResources(nil, v),
Expand Down Expand Up @@ -1727,7 +1727,7 @@ func (s *svc) ListContainer(ctx context.Context, req *provider.ListContainerRequ
func (s *svc) getPath(ctx context.Context, ref *provider.Reference, keys ...string) (string, *rpc.Status) {

// check if it is an id based or combined reference first
if ref.StorageId != "" && ref.NodeId != "" {
if ref.ResourceId != nil {
req := &provider.StatRequest{Ref: ref, ArbitraryMetadataKeys: keys}
res, err := s.stat(ctx, req)
if (res != nil && res.Status.Code != rpc.Code_CODE_OK) || err != nil {
Expand All @@ -1737,7 +1737,7 @@ func (s *svc) getPath(ctx context.Context, ref *provider.Reference, keys ...stri
return res.Info.Path, res.Status
}

if ref.StorageId == "" && ref.NodeId == "" && ref.Path != "" {
if ref.ResourceId == nil && strings.HasPrefix(ref.Path, "/") {
return ref.Path, &rpc.Status{Code: rpc.Code_CODE_OK}
}
return "", &rpc.Status{Code: rpc.Code_CODE_INTERNAL}
Expand Down
17 changes: 9 additions & 8 deletions internal/grpc/services/gateway/usershareprovider.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ func (s *svc) CreateShare(ctx context.Context, req *collaboration.CreateShareReq

// TODO(labkode): if both commits are enabled they could be done concurrently.
if s.c.CommitShareToStorageGrant {
addGrantStatus, err := s.addGrant(ctx, req.ResourceInfo.Id, req.Grant.Grantee, req.Grant.Permissions.Permissions)
addGrantStatus, err := s.addGrant(ctx, &provider.Reference{ResourceId: req.ResourceInfo.Id}, req.Grant.Grantee, req.Grant.Permissions.Permissions)
if err != nil {
return nil, errors.Wrap(err, "gateway: error adding grant to storage")
}
Expand Down Expand Up @@ -118,7 +118,7 @@ func (s *svc) RemoveShare(ctx context.Context, req *collaboration.RemoveShareReq

// TODO(labkode): if both commits are enabled they could be done concurrently.
if s.c.CommitShareToStorageGrant {
removeGrantStatus, err := s.removeGrant(ctx, share.ResourceId, share.Grantee, share.Permissions.Permissions)
removeGrantStatus, err := s.removeGrant(ctx, &provider.Reference{ResourceId: share.ResourceId}, share.Grantee, share.Permissions.Permissions)
if err != nil {
return nil, errors.Wrap(err, "gateway: error removing grant from storage")
}
Expand Down Expand Up @@ -196,7 +196,7 @@ func (s *svc) UpdateShare(ctx context.Context, req *collaboration.UpdateShareReq
// TODO(labkode): if both commits are enabled they could be done concurrently.

if s.c.CommitShareToStorageGrant {
updateGrantStatus, err := s.updateGrant(ctx, res.GetShare().GetResourceId(),
updateGrantStatus, err := s.updateGrant(ctx, &provider.Reference{ResourceId: res.GetShare().GetResourceId()},
res.GetShare().GetGrantee(),
res.GetShare().GetPermissions().GetPermissions())

Expand Down Expand Up @@ -320,12 +320,13 @@ func (s *svc) UpdateReceivedShare(ctx context.Context, req *collaboration.Update
}, nil
}

func (s *svc) createReference(ctx context.Context, resourceID *provider.Reference) *rpc.Status {
func (s *svc) createReference(ctx context.Context, resourceID *provider.ResourceId) *rpc.Status {

log := appctx.GetLogger(ctx)

// get the metadata about the share
c, err := s.find(ctx, resourceID)
ref := &provider.Reference{ResourceId: resourceID}
c, err := s.find(ctx, ref)
if err != nil {
if _, ok := err.(errtypes.IsNotFound); ok {
return status.NewNotFound(ctx, "storage provider not found")
Expand All @@ -334,7 +335,7 @@ func (s *svc) createReference(ctx context.Context, resourceID *provider.Referenc
}

statReq := &provider.StatRequest{
Ref: resourceID,
Ref: ref,
}

statRes, err := c.Stat(ctx, statReq)
Expand Down Expand Up @@ -364,13 +365,13 @@ func (s *svc) createReference(ctx context.Context, resourceID *provider.Referenc
// It is the responsibility of the gateway to resolve these references and merge the response back
// from the main request.
// TODO(labkode): the name of the share should be the filename it points to by default.
refPath := path.Join(homeRes.Ref.Path, s.c.ShareFolder, path.Base(statRes.Info.Path))
refPath := path.Join(homeRes.Path, s.c.ShareFolder, path.Base(statRes.Info.Path))
log.Info().Msg("mount path will be:" + refPath)

createRefReq := &provider.CreateReferenceRequest{
Ref: &provider.Reference{Path: refPath},
// cs3 is the Scheme and %s/%s is the Opaque parts of a net.URL.
TargetUri: fmt.Sprintf("cs3:%s/%s", resourceID.GetStorageId(), resourceID.GetNodeId()),
TargetUri: fmt.Sprintf("cs3:%s/%s", resourceID.GetStorageId(), resourceID.GetOpaqueId()),
}

c, err = s.findByPath(ctx, refPath)
Expand Down
6 changes: 3 additions & 3 deletions internal/grpc/services/ocmcore/ocmcore.go
Original file line number Diff line number Diff line change
Expand Up @@ -116,9 +116,9 @@ func (s *service) CreateOCMCoreShare(ctx context.Context, req *ocmcore.CreateOCM
}, nil
}

resource := &provider.Reference{
rid := &provider.ResourceId{
StorageId: parts[0],
NodeId: parts[1],
OpaqueId: parts[1],
}

var resourcePermissions *provider.ResourcePermissions
Expand Down Expand Up @@ -180,7 +180,7 @@ func (s *service) CreateOCMCoreShare(ctx context.Context, req *ocmcore.CreateOCM
shareType = ocm.Share_SHARE_TYPE_REGULAR
}

share, err := s.sm.Share(ctx, resource, grant, req.Name, nil, "", req.Owner, token, shareType)
share, err := s.sm.Share(ctx, rid, grant, req.Name, nil, "", req.Owner, token, shareType)
if err != nil {
return &ocmcore.CreateOCMCoreShareResponse{
Status: status.NewInternal(ctx, err, "error creating ocm core share"),
Expand Down
Loading

0 comments on commit bf15aeb

Please sign in to comment.