Skip to content

Commit 2a9e199

Browse files
gmgigi96glpatcern
andauthored
Align OCM sharing APIs to new specs, add missing properties (#199)
* 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>
1 parent 441d6c6 commit 2a9e199

File tree

8 files changed

+1055
-388
lines changed

8 files changed

+1055
-388
lines changed

cs3/app/provider/v1beta1/provider_api.proto

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -67,21 +67,6 @@ message OpenInAppRequest {
6767
storage.provider.v1beta1.ResourceInfo resource_info = 2;
6868
// REQUIRED.
6969
// View mode.
70-
enum ViewMode {
71-
VIEW_MODE_INVALID = 0;
72-
// The resource can be opened but not downloaded.
73-
VIEW_MODE_VIEW_ONLY = 1;
74-
// The resource can be downloaded.
75-
VIEW_MODE_READ_ONLY = 2;
76-
// The resource can be downloaded and updated. The underlying application
77-
// MUST be a fully capable editor to support this mode.
78-
VIEW_MODE_READ_WRITE = 3;
79-
// The resource can be downloaded and updated, but must be shown in
80-
// preview mode. If the underlying application does not support a preview mode,
81-
// or if in a view-only mode users are not allowed to switch to edit mode,
82-
// then this mode MUST fall back to READ_WRITE.
83-
VIEW_MODE_PREVIEW = 4;
84-
}
8570
ViewMode view_mode = 3;
8671
// REQUIRED.
8772
// The access token this application provider will use when contacting

cs3/app/provider/v1beta1/resources.proto

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,3 +45,20 @@ message OpenInAppURL {
4545
// The headers to be added to the request.
4646
map<string, string> headers = 4;
4747
}
48+
49+
// Defines the view modes.
50+
enum ViewMode {
51+
VIEW_MODE_INVALID = 0;
52+
// The resource can be opened but not downloaded.
53+
VIEW_MODE_VIEW_ONLY = 1;
54+
// The resource can be downloaded.
55+
VIEW_MODE_READ_ONLY = 2;
56+
// The resource can be downloaded and updated. The underlying application
57+
// MUST be a fully capable editor to support this mode.
58+
VIEW_MODE_READ_WRITE = 3;
59+
// The resource can be downloaded and updated, but must be shown in
60+
// preview mode. If the underlying application does not support a preview mode,
61+
// or if in a view-only mode users are not allowed to switch to edit mode,
62+
// then this mode MUST fall back to READ_WRITE.
63+
VIEW_MODE_PREVIEW = 4;
64+
}

cs3/ocm/core/v1beta1/ocm_core_api.proto

Lines changed: 19 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,9 @@ option objc_class_prefix = "COC";
2929
option php_namespace = "Cs3\\Ocm\\Core\\V1Beta1";
3030

3131
import "cs3/identity/user/v1beta1/resources.proto";
32-
import "cs3/ocm/core/v1beta1/resources.proto";
3332
import "cs3/rpc/v1beta1/status.proto";
33+
import "cs3/sharing/ocm/v1beta1/resources.proto";
34+
import "cs3/storage/provider/v1beta1/resources.proto";
3435
import "cs3/types/v1beta1/types.proto";
3536

3637
// OCM Core API
@@ -66,19 +67,31 @@ message CreateOCMCoreShareRequest {
6667
string name = 3;
6768
// REQUIRED.
6869
// Identifier to identify the resource at the provider side. This is unique per provider.
69-
string provider_id = 4;
70+
string resource_id = 4;
7071
// REQUIRED.
71-
// Provider specific identifier of the user that wants to share the resource.
72+
// Provider specific identifier of the owner of the resource.
7273
cs3.identity.user.v1beta1.UserId owner = 5;
7374
// REQUIRED.
75+
// Provider specific identifier of the user that wants to share the resource.
76+
cs3.identity.user.v1beta1.UserId sender = 6;
77+
// REQUIRED.
7478
// Consumer specific identifier of the user or group the provider wants to share the resource with.
7579
// This is known in advance, for example using the OCM invitation flow.
7680
// Please note that the consumer service endpoint is known in advance as well, so this is no part of the request body.
7781
// TODO: this field needs to represent either a user or group in the future, not only a user.
78-
cs3.identity.user.v1beta1.UserId share_with = 6;
82+
cs3.identity.user.v1beta1.UserId share_with = 7;
83+
// REQUIRED.
84+
// Resource type.
85+
cs3.storage.provider.v1beta1.ResourceType resource_type = 8;
86+
// REQUIRED.
87+
// Recipient share type.
88+
cs3.sharing.ocm.v1beta1.ShareType share_type = 9;
89+
// OPTIONAL.
90+
// The expiration time for the ocm share.
91+
cs3.types.v1beta1.Timestamp expiration = 10;
7992
// REQUIRED.
80-
// The protocol which is used to establish synchronisation.
81-
Protocol protocol = 7;
93+
// The protocols which are used to establish synchronisation.
94+
repeated cs3.sharing.ocm.v1beta1.Protocol protocols = 11;
8295
}
8396

8497
message CreateOCMCoreShareResponse {

cs3/ocm/core/v1beta1/resources.proto

Lines changed: 0 additions & 42 deletions
This file was deleted.

cs3/sharing/ocm/v1beta1/ocm_api.proto

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,11 +91,16 @@ message CreateOCMShareRequest {
9191
// The unique identifier for the shared storage resource.
9292
storage.provider.v1beta1.ResourceId resource_id = 2;
9393
// REQUIRED.
94-
// The share grant for the share.
95-
ShareGrant grant = 3;
94+
// The grantee for the share.
95+
storage.provider.v1beta1.Grantee grantee = 3;
9696
// REQUIRED.
9797
// The details of the recipient user's mesh provider.
9898
cs3.ocm.provider.v1beta1.ProviderInfo recipient_mesh_provider = 4;
99+
// REQUIRED.
100+
repeated AccessMethod access_methods = 5;
101+
// OPTIONAL.
102+
// The expiration time for the ocm share.
103+
cs3.types.v1beta1.Timestamp expiration = 6;
99104
}
100105

101106
message CreateOCMShareResponse {
@@ -108,6 +113,9 @@ message CreateOCMShareResponse {
108113
// REQUIRED.
109114
// The created share.
110115
Share share = 3;
116+
// OPTIONAL.
117+
// Display name of the recipient of the share.
118+
string recipient_display_name = 4;
111119
}
112120

113121
message UpdateOCMShareRequest {

0 commit comments

Comments
 (0)