Skip to content

Commit 0198ed5

Browse files
committed
splitted created share to received share
1 parent 4c92b80 commit 0198ed5

File tree

5 files changed

+110
-51
lines changed

5 files changed

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

cs3/ocm/core/v1beta1/ocm_core_api.proto

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,9 +86,12 @@ message CreateOCMCoreShareRequest {
8686
// REQUIRED.
8787
// Recipient share type.
8888
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;
8992
// REQUIRED.
9093
// The protocols which are used to establish synchronisation.
91-
repeated cs3.sharing.ocm.v1beta1.Protocol protocols = 10;
94+
repeated cs3.sharing.ocm.v1beta1.Protocol protocols = 11;
9295
}
9396

9497
message CreateOCMCoreShareResponse {

cs3/sharing/ocm/v1beta1/ocm_api.proto

Lines changed: 7 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 {

cs3/sharing/ocm/v1beta1/resources.proto

Lines changed: 83 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -31,24 +31,24 @@ option php_namespace = "Cs3\\Sharing\\Ocm\\V1Beta1";
3131
import "cs3/identity/user/v1beta1/resources.proto";
3232
import "cs3/storage/provider/v1beta1/resources.proto";
3333
import "cs3/types/v1beta1/types.proto";
34+
import "cs3/app/provider/v1beta1/resources.proto";
3435

3536
// Shares are relationships between a resource owner
36-
// (usually the authenticated user) who grants permissions to a recipient (grantee)
37-
// on a specified resource (resource_id). UserShares represents both user and groups.
37+
// (usually the authenticated user) who grants permissions to a recipient
38+
// (grantee) on a specified resource (resource_id). UserShares represents both
39+
// user and groups.
3840
message Share {
3941
// REQUIRED.
4042
// Opaque unique identifier of the share.
4143
ShareId id = 1;
4244
// REQUIRED.
43-
// Unique identifier of the shared resource.
44-
storage.provider.v1beta1.ResourceId resource_id = 2;
45+
// The unlisted token to give access to the ocm share.
46+
string token = 2;
4547
// REQUIRED.
4648
// Name of the shared resource.
4749
string name = 3;
4850
// REQUIRED.
49-
// Permissions for the grantee to use
50-
// the resource.
51-
SharePermissions permissions = 4;
51+
storage.provider.v1beta1.ResourceId resource_id = 4;
5252
// REQUIRED.
5353
// The receiver of the share, like a user, group ...
5454
storage.provider.v1beta1.Grantee grantee = 5;
@@ -70,12 +70,16 @@ message Share {
7070
// REQUIRED.
7171
// Last modification time of the share.
7272
cs3.types.v1beta1.Timestamp mtime = 9;
73+
// OPTIONAL.
74+
// The expiration time for the ocm share.
75+
cs3.types.v1beta1.Timestamp expiration = 10;
7376
// REQUIRED.
7477
// Recipient share type.
75-
ShareType share_type = 10;
78+
cs3.sharing.ocm.v1beta1.ShareType share_type = 11;
7679
// REQUIRED.
77-
// The protocols which are used to establish synchronisation.
78-
repeated Protocol protocols = 11;
80+
repeated AccessMethod access_methods = 12;
81+
// OPTIONAL.
82+
cs3.types.v1beta1.Opaque opaque = 13;
7983
}
8084

8185
// The permissions for a share.
@@ -85,19 +89,49 @@ message SharePermissions {
8589
}
8690

8791
// A received share is the share that a grantee will receive.
88-
// It expands the original share by adding state to the share,
89-
// a display name from the perspective of the grantee and a
90-
// resource mount point in case the share will be mounted
91-
// in a storage provider.
9292
message ReceivedShare {
9393
// REQUIRED.
94-
Share share = 1;
94+
// Opaque unique identifier of the share.
95+
ShareId id = 1;
96+
// REQUIRED.
97+
// Name of the shared resource.
98+
string name = 2;
9599
// REQUIRED.
96-
// The state of the share.
97-
ShareState state = 2;
100+
storage.provider.v1beta1.ResourceId resource_id = 3;
101+
// REQUIRED.
102+
// The receiver of the share, like a user, group ...
103+
storage.provider.v1beta1.Grantee grantee = 4;
104+
// REQUIRED.
105+
// Uniquely identifies the owner of the share
106+
// (the resource owner at the time of creating the share).
107+
// In case the ownership of the underlying resource changes
108+
// the share owner field MAY change to reflect the change of ownsership.
109+
cs3.identity.user.v1beta1.UserId owner = 5;
110+
// REQUIRED.
111+
// Uniquely identifies a principal who initiates the share creation.
112+
// A creator can create shares on behalf of the owner (because of re-sharing,
113+
// because belonging to special groups, ...).
114+
// Creator and owner often result in being the same principal.
115+
cs3.identity.user.v1beta1.UserId creator = 6;
116+
// REQUIRED.
117+
// Creation time of the share.
118+
cs3.types.v1beta1.Timestamp ctime = 7;
98119
// REQUIRED.
99-
// The mount point of the share.
100-
storage.provider.v1beta1.Reference mount_point = 3;
120+
// Last modification time of the share.
121+
cs3.types.v1beta1.Timestamp mtime = 8;
122+
// OPTIONAL.
123+
// The expiration time for the ocm share.
124+
cs3.types.v1beta1.Timestamp expiration = 9;
125+
// REQUIRED.
126+
// Recipient share type.
127+
cs3.sharing.ocm.v1beta1.ShareType share_type = 10;
128+
// REQUIRED.
129+
repeated Protocol protocols = 11;
130+
// REQUIRED.
131+
// The state of the share.
132+
ShareState state = 12;
133+
// OPTIONAL.
134+
cs3.types.v1beta1.Opaque opaque = 13;
101135
}
102136

103137
// The state of the share.
@@ -131,11 +165,11 @@ enum ShareState {
131165
// 4) The grantee for the share = Grantee("type" = "user", "" => "Bob")
132166
message ShareKey {
133167
// REQUIRED.
134-
cs3.identity.user.v1beta1.UserId owner = 2;
168+
cs3.identity.user.v1beta1.UserId owner = 1;
135169
// REQUIRED.
136-
storage.provider.v1beta1.ResourceId resource_id = 3;
170+
storage.provider.v1beta1.ResourceId resource_id = 2;
137171
// REQUIRED.
138-
storage.provider.v1beta1.Grantee grantee = 4;
172+
storage.provider.v1beta1.Grantee grantee = 3;
139173
}
140174

141175
// A share id identifies uniquely a // share in the share provider namespace.
@@ -145,7 +179,7 @@ message ShareId {
145179
// The internal id used by service implementor to
146180
// uniquely identity the share in the internal
147181
// implementation of the service.
148-
string opaque_id = 2;
182+
string opaque_id = 1;
149183
}
150184

151185
// The mechanism to identify a share
@@ -173,15 +207,6 @@ message ShareGrant {
173207
SharePermissions permissions = 2;
174208
}
175209

176-
// Defines the type of share based on its recipient.
177-
enum ShareType {
178-
// Share of type user.
179-
SHARE_TYPE_USER = 0;
180-
// Share of type group.
181-
SHARE_TYPE_GROUP = 1;
182-
}
183-
184-
185210
// The protocol which is used to establish synchronisation.
186211
message Protocol {
187212
// REQUIRED.
@@ -224,4 +249,29 @@ message DatatxProtocol {
224249
// REQUIRED.
225250
// Size in bytes of the source.
226251
uint64 size = 3;
227-
}
252+
}
253+
254+
// Defines the type of share based on its recipient.
255+
enum ShareType {
256+
// Share of type user.
257+
SHARE_TYPE_USER = 0;
258+
// Share of type group.
259+
SHARE_TYPE_GROUP = 1;
260+
}
261+
262+
message AccessMethod {
263+
oneof term {
264+
WebDAVAccessMethod webdav_options = 1;
265+
WebappAccessMethod webapp_options = 2;
266+
DatatxAccessMethod datatx_options = 3;
267+
cs3.types.v1beta1.Opaque generic_options = 4;
268+
}
269+
}
270+
271+
message WebDAVAccessMethod {
272+
storage.provider.v1beta1.ResourcePermissions permissions = 2;
273+
}
274+
275+
message WebappAccessMethod { cs3.app.provider.v1beta1.ViewMode view_mode = 2; }
276+
277+
message DatatxAccessMethod {}

0 commit comments

Comments
 (0)