Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Document difference between OCM Shares and collaboration Shares #2148

Open
michielbdejong opened this issue Oct 11, 2021 · 6 comments
Open

Comments

@michielbdejong
Copy link
Contributor

The Opaque field in a CreateOCMShareRequest is optional but Reva's
implementation requires it.

@michielbdejong
Copy link
Contributor Author

It expects req.Opaque to be a map with:

  • "permissions" string
  • a "name" string
  • a "protocol" string that could be:
    • "datatx" for ShareType Transfer, or
    • anything else for ShareType Regular

It then sets name, req.RecipientMeshProvider, permissions, nil, "", sharetype as additional (undocumented?) arguments in the call to sm.Share.

I'll see if I can find out if any of the existing share manager implementations do anything with these arguments, if not then we should probably stop requiring them.

@michielbdejong
Copy link
Contributor Author

Hm, I'm a bit puzzled now about why this code even exists at all?

@michielbdejong
Copy link
Contributor Author

Ah wait, there is ocm.share.Manager
for handling ocm.Share shares
And it differs fromshare.Manager which handles collaboration.Share shares.

So apparently OCM isn't the only way to collaborate in ScienceMesh?

Anyway, this does probably confirm that the bug is in the CS3API message for ocm.core CreateOCMShareRequest because it was probably copied from sharing.collaboration CreateShareRequest without making the change of marking Opaque as required.

@michielbdejong
Copy link
Contributor Author

The difference between OCM shares and collaboration shares is as follows:

< // Manager is the interface that manipulates the OCM shares.
---
> // Manager is the interface that manipulates shares.
4,5c4
< 	Share(ctx context.Context, md *provider.ResourceId, g *ocm.ShareGrant, name string,
< 		pi *ocmprovider.ProviderInfo, pm string, owner *userpb.UserId, token string, st ocm.Share_ShareType) (*ocm.Share, error)
---
> 	Share(ctx context.Context, md *provider.ResourceInfo, g *collaboration.ShareGrant) (*collaboration.Share, error)
8c7
< 	GetShare(ctx context.Context, ref *ocm.ShareReference) (*ocm.Share, error)
---
> 	GetShare(ctx context.Context, ref *collaboration.ShareReference) (*collaboration.Share, error)
11c10
< 	Unshare(ctx context.Context, ref *ocm.ShareReference) error
---
> 	Unshare(ctx context.Context, ref *collaboration.ShareReference) error
14c13
< 	UpdateShare(ctx context.Context, ref *ocm.ShareReference, p *ocm.SharePermissions) (*ocm.Share, error)
---
> 	UpdateShare(ctx context.Context, ref *collaboration.ShareReference, p *collaboration.SharePermissions) (*collaboration.Share, error)
18c17
< 	ListShares(ctx context.Context, filters []*ocm.ListOCMSharesRequest_Filter) ([]*ocm.Share, error)
---
> 	ListShares(ctx context.Context, filters []*collaboration.Filter) ([]*collaboration.Share, error)
21c20
< 	ListReceivedShares(ctx context.Context) ([]*ocm.ReceivedShare, error)
---
> 	ListReceivedShares(ctx context.Context, filters []*collaboration.Filter) ([]*collaboration.ReceivedShare, error)
24c23
< 	GetReceivedShare(ctx context.Context, ref *ocm.ShareReference) (*ocm.ReceivedShare, error)
---
> 	GetReceivedShare(ctx context.Context, ref *collaboration.ShareReference) (*collaboration.ReceivedShare, error)
27c26
< 	UpdateReceivedShare(ctx context.Context, share *ocm.ReceivedShare, fieldMask *field_mask.FieldMask) (*ocm.ReceivedShare, error)
---
> 	UpdateReceivedShare(ctx context.Context, share *collaboration.ReceivedShare, fieldMask *field_mask.FieldMask) (*collaboration.ReceivedShare, error)

@michielbdejong michielbdejong changed the title CreateOCMShare fails if req.Opaque is missing Document difference between OCM Shares and collaboration Shares Oct 11, 2021
@ishank011
Copy link
Contributor

@michielbdejong thanks for reporting. I understand there are a few elements specific to our implementation. IIRC, at the time of implementing this, I did find a few missing things in the OCM API. Would you be available for a short discussion around this sometime next week? We can converge around the discrepancies and I can work towards making our implementation more robust.

@michielbdejong
Copy link
Contributor Author

It looks like cs3.sharing.ocm is implemented by pkg/ocm/share
and cs3.sharing.collaboration is implemented by pkg/share.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants