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

Align OCM sharing APIs to new specs, add missing properties #199

Merged
merged 12 commits into from
Feb 14, 2023

Conversation

gmgigi96
Copy link
Member

@gmgigi96 gmgigi96 commented Jan 26, 2023

This PR updates the OCM implementation according to the changes introduced in the OCM APIs cs3org/OCM-API#54 and cs3org/OCM-API#57.

Since the metadata associated with an OCM share is different between local and remote provider (and the information every site has to store), there is now a clear distinction between the object Share (the one created locally) and the ReceivedShare (the one received from the remote site).

More in details, these are the changes including the breaking changes:

  • OCMCoreShareRequest (remote share):

    • Added a list of protocols with all their properties (webdav, webapp and transfer), instead of a single protocol [breaking change]
    • provider_id is renamed to resource_id [breaking change]
    • Added sender [breaking change]
    • Added resource_type, and share_type (previously missing but part of OCM. Behavior remains the same)
    • Added an optional expiration time
  • OCMShareRequest (local share sent to a remote grantee):

    • Removed grant (included permissions and grantee), replaced with just grantee [breaking change]
    • Added a required list of access methods that match the protocols above [breaking change], and removed permissions as that's incorporated in the access_methods
    • Added required token, free string [breaking change]. So far we reused the user's token with full power (insecure!), this is the scoped token for the resource with configurable expiration.
    • Added recipient's share_type (previously missing but part of OCM. Behavior remains the same)
    • Removed misleading share_type to tell apart Datatx (i.e. transfer) shares from others [breaking change], as this is now captured by the list of protocols / access methods directly.
    • Added an optional expiration time
  • ReceivedShare (internal structure to represent a share received from a remote granter)

    • Added more metadata including the protocols to match the OCMCoreShareRequest [breaking change]

@gmgigi96 gmgigi96 force-pushed the ocm_specs branch 2 times, most recently from 3264061 to 0198ed5 Compare February 2, 2023 13:43
@glpatcern glpatcern marked this pull request as ready for review February 3, 2023 10:43
@glpatcern glpatcern changed the title [WIP] Rework of ocm Align OCM sharing APIs to new specs, add missing properties Feb 3, 2023
@glpatcern glpatcern marked this pull request as draft February 3, 2023 11:01
Copy link
Member

@glpatcern glpatcern left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To not forget the things to check/fix:

  • Datatx -> Transfer to please the protobuf linter
  • In CreateNewShareRequest, keep the recipientDisplayName in the return
  • Missing INVALID values in some enums

cs3/sharing/ocm/v1beta1/resources.proto Outdated Show resolved Hide resolved
@gmgigi96
Copy link
Member Author

gmgigi96 commented Feb 6, 2023

@glpatcern done, can you take a look?

@gmgigi96 gmgigi96 marked this pull request as ready for review February 6, 2023 10:53
Copy link
Member

@glpatcern glpatcern left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good!

@glpatcern glpatcern merged commit 2a9e199 into cs3org:main Feb 14, 2023
dragonchaser pushed a commit to dragonchaser/cs3apis that referenced this pull request Sep 1, 2023
* rework of ocm in cs3apis

* defined ocm protocols

* add opaque to protocols

* add protocol fields to ocm share

* splitted created share to received share

* updated proto.lock

* updated proto.lock

* fixes for review

* revert position of resource_id field in share message

* update proto.lock

* updated docs

---------

Co-authored-by: Giuseppe Lo Presti <giuseppe.lopresti@cern.ch>
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

Successfully merging this pull request may close these issues.

3 participants