Skip to content

Commit

Permalink
Align OCM sharing APIs to new specs, add missing properties (cs3org#199)
Browse files Browse the repository at this point in the history
* 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>
  • Loading branch information
2 people authored and dragonchaser committed Sep 1, 2023
1 parent a927825 commit ae6420d
Show file tree
Hide file tree
Showing 8 changed files with 1,055 additions and 388 deletions.
15 changes: 0 additions & 15 deletions cs3/app/provider/v1beta1/provider_api.proto
Original file line number Diff line number Diff line change
Expand Up @@ -67,21 +67,6 @@ message OpenInAppRequest {
storage.provider.v1beta1.ResourceInfo resource_info = 2;
// REQUIRED.
// View mode.
enum ViewMode {
VIEW_MODE_INVALID = 0;
// The resource can be opened but not downloaded.
VIEW_MODE_VIEW_ONLY = 1;
// The resource can be downloaded.
VIEW_MODE_READ_ONLY = 2;
// The resource can be downloaded and updated. The underlying application
// MUST be a fully capable editor to support this mode.
VIEW_MODE_READ_WRITE = 3;
// The resource can be downloaded and updated, but must be shown in
// preview mode. If the underlying application does not support a preview mode,
// or if in a view-only mode users are not allowed to switch to edit mode,
// then this mode MUST fall back to READ_WRITE.
VIEW_MODE_PREVIEW = 4;
}
ViewMode view_mode = 3;
// REQUIRED.
// The access token this application provider will use when contacting
Expand Down
17 changes: 17 additions & 0 deletions cs3/app/provider/v1beta1/resources.proto
Original file line number Diff line number Diff line change
Expand Up @@ -45,3 +45,20 @@ message OpenInAppURL {
// The headers to be added to the request.
map<string, string> headers = 4;
}

// Defines the view modes.
enum ViewMode {
VIEW_MODE_INVALID = 0;
// The resource can be opened but not downloaded.
VIEW_MODE_VIEW_ONLY = 1;
// The resource can be downloaded.
VIEW_MODE_READ_ONLY = 2;
// The resource can be downloaded and updated. The underlying application
// MUST be a fully capable editor to support this mode.
VIEW_MODE_READ_WRITE = 3;
// The resource can be downloaded and updated, but must be shown in
// preview mode. If the underlying application does not support a preview mode,
// or if in a view-only mode users are not allowed to switch to edit mode,
// then this mode MUST fall back to READ_WRITE.
VIEW_MODE_PREVIEW = 4;
}
25 changes: 19 additions & 6 deletions cs3/ocm/core/v1beta1/ocm_core_api.proto
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,9 @@ option objc_class_prefix = "COC";
option php_namespace = "Cs3\\Ocm\\Core\\V1Beta1";

import "cs3/identity/user/v1beta1/resources.proto";
import "cs3/ocm/core/v1beta1/resources.proto";
import "cs3/rpc/v1beta1/status.proto";
import "cs3/sharing/ocm/v1beta1/resources.proto";
import "cs3/storage/provider/v1beta1/resources.proto";
import "cs3/types/v1beta1/types.proto";

// OCM Core API
Expand Down Expand Up @@ -66,19 +67,31 @@ message CreateOCMCoreShareRequest {
string name = 3;
// REQUIRED.
// Identifier to identify the resource at the provider side. This is unique per provider.
string provider_id = 4;
string resource_id = 4;
// REQUIRED.
// Provider specific identifier of the user that wants to share the resource.
// Provider specific identifier of the owner of the resource.
cs3.identity.user.v1beta1.UserId owner = 5;
// REQUIRED.
// Provider specific identifier of the user that wants to share the resource.
cs3.identity.user.v1beta1.UserId sender = 6;
// REQUIRED.
// Consumer specific identifier of the user or group the provider wants to share the resource with.
// This is known in advance, for example using the OCM invitation flow.
// Please note that the consumer service endpoint is known in advance as well, so this is no part of the request body.
// TODO: this field needs to represent either a user or group in the future, not only a user.
cs3.identity.user.v1beta1.UserId share_with = 6;
cs3.identity.user.v1beta1.UserId share_with = 7;
// REQUIRED.
// Resource type.
cs3.storage.provider.v1beta1.ResourceType resource_type = 8;
// REQUIRED.
// Recipient share type.
cs3.sharing.ocm.v1beta1.ShareType share_type = 9;
// OPTIONAL.
// The expiration time for the ocm share.
cs3.types.v1beta1.Timestamp expiration = 10;
// REQUIRED.
// The protocol which is used to establish synchronisation.
Protocol protocol = 7;
// The protocols which are used to establish synchronisation.
repeated cs3.sharing.ocm.v1beta1.Protocol protocols = 11;
}

message CreateOCMCoreShareResponse {
Expand Down
42 changes: 0 additions & 42 deletions cs3/ocm/core/v1beta1/resources.proto

This file was deleted.

12 changes: 10 additions & 2 deletions cs3/sharing/ocm/v1beta1/ocm_api.proto
Original file line number Diff line number Diff line change
Expand Up @@ -91,11 +91,16 @@ message CreateOCMShareRequest {
// The unique identifier for the shared storage resource.
storage.provider.v1beta1.ResourceId resource_id = 2;
// REQUIRED.
// The share grant for the share.
ShareGrant grant = 3;
// The grantee for the share.
storage.provider.v1beta1.Grantee grantee = 3;
// REQUIRED.
// The details of the recipient user's mesh provider.
cs3.ocm.provider.v1beta1.ProviderInfo recipient_mesh_provider = 4;
// REQUIRED.
repeated AccessMethod access_methods = 5;
// OPTIONAL.
// The expiration time for the ocm share.
cs3.types.v1beta1.Timestamp expiration = 6;
}

message CreateOCMShareResponse {
Expand All @@ -108,6 +113,9 @@ message CreateOCMShareResponse {
// REQUIRED.
// The created share.
Share share = 3;
// OPTIONAL.
// Display name of the recipient of the share.
string recipient_display_name = 4;
}

message UpdateOCMShareRequest {
Expand Down
Loading

0 comments on commit ae6420d

Please sign in to comment.