From 3264061a0af3b75207579dbb6dfa2266c4a3f406 Mon Sep 17 00:00:00 2001 From: Gianmaria Del Monte Date: Thu, 2 Feb 2023 14:36:20 +0100 Subject: [PATCH] splitted created share to received share --- cs3/app/provider/v1beta1/provider_api.proto | 15 --- cs3/app/provider/v1beta1/resources.proto | 16 +++ cs3/sharing/ocm/v1beta1/ocm_api.proto | 9 +- cs3/sharing/ocm/v1beta1/resources.proto | 116 ++++++++++++++------ 4 files changed, 106 insertions(+), 50 deletions(-) diff --git a/cs3/app/provider/v1beta1/provider_api.proto b/cs3/app/provider/v1beta1/provider_api.proto index fd5bfe18..567323ce 100644 --- a/cs3/app/provider/v1beta1/provider_api.proto +++ b/cs3/app/provider/v1beta1/provider_api.proto @@ -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 diff --git a/cs3/app/provider/v1beta1/resources.proto b/cs3/app/provider/v1beta1/resources.proto index b27901d8..7b1c1dce 100644 --- a/cs3/app/provider/v1beta1/resources.proto +++ b/cs3/app/provider/v1beta1/resources.proto @@ -45,3 +45,19 @@ message OpenInAppURL { // The headers to be added to the request. map headers = 4; } + +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; +} \ No newline at end of file diff --git a/cs3/sharing/ocm/v1beta1/ocm_api.proto b/cs3/sharing/ocm/v1beta1/ocm_api.proto index ed5592dd..06611755 100644 --- a/cs3/sharing/ocm/v1beta1/ocm_api.proto +++ b/cs3/sharing/ocm/v1beta1/ocm_api.proto @@ -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 { diff --git a/cs3/sharing/ocm/v1beta1/resources.proto b/cs3/sharing/ocm/v1beta1/resources.proto index d510f3c3..8251f594 100644 --- a/cs3/sharing/ocm/v1beta1/resources.proto +++ b/cs3/sharing/ocm/v1beta1/resources.proto @@ -31,24 +31,24 @@ option php_namespace = "Cs3\\Sharing\\Ocm\\V1Beta1"; import "cs3/identity/user/v1beta1/resources.proto"; import "cs3/storage/provider/v1beta1/resources.proto"; import "cs3/types/v1beta1/types.proto"; +import "cs3/app/provider/v1beta1/resources.proto"; // Shares are relationships between a resource owner -// (usually the authenticated user) who grants permissions to a recipient (grantee) -// on a specified resource (resource_id). UserShares represents both user and groups. +// (usually the authenticated user) who grants permissions to a recipient +// (grantee) on a specified resource (resource_id). UserShares represents both +// user and groups. message Share { // REQUIRED. // Opaque unique identifier of the share. ShareId id = 1; // REQUIRED. - // Unique identifier of the shared resource. - storage.provider.v1beta1.ResourceId resource_id = 2; + // The unlisted token to give access to the ocm share. + string token = 2; // REQUIRED. // Name of the shared resource. string name = 3; // REQUIRED. - // Permissions for the grantee to use - // the resource. - SharePermissions permissions = 4; + storage.provider.v1beta1.ResourceId resource_id = 4; // REQUIRED. // The receiver of the share, like a user, group ... storage.provider.v1beta1.Grantee grantee = 5; @@ -70,12 +70,16 @@ message Share { // REQUIRED. // Last modification time of the share. cs3.types.v1beta1.Timestamp mtime = 9; + // OPTIONAL. + // The expiration time for the ocm share. + cs3.types.v1beta1.Timestamp expiration = 10; // REQUIRED. // Recipient share type. - ShareType share_type = 10; + cs3.sharing.ocm.v1beta1.ShareType share_type = 11; // REQUIRED. - // The protocols which are used to establish synchronisation. - repeated Protocol protocols = 11; + repeated AccessMethod access_methods = 12; + // OPTIONAL. + cs3.types.v1beta1.Opaque opaque = 13; } // The permissions for a share. @@ -85,19 +89,49 @@ message SharePermissions { } // A received share is the share that a grantee will receive. -// It expands the original share by adding state to the share, -// a display name from the perspective of the grantee and a -// resource mount point in case the share will be mounted -// in a storage provider. message ReceivedShare { // REQUIRED. - Share share = 1; + // Opaque unique identifier of the share. + ShareId id = 1; + // REQUIRED. + // Name of the shared resource. + string name = 2; // REQUIRED. - // The state of the share. - ShareState state = 2; + storage.provider.v1beta1.ResourceId resource_id = 3; + // REQUIRED. + // The receiver of the share, like a user, group ... + storage.provider.v1beta1.Grantee grantee = 4; + // REQUIRED. + // Uniquely identifies the owner of the share + // (the resource owner at the time of creating the share). + // In case the ownership of the underlying resource changes + // the share owner field MAY change to reflect the change of ownsership. + cs3.identity.user.v1beta1.UserId owner = 5; + // REQUIRED. + // Uniquely identifies a principal who initiates the share creation. + // A creator can create shares on behalf of the owner (because of re-sharing, + // because belonging to special groups, ...). + // Creator and owner often result in being the same principal. + cs3.identity.user.v1beta1.UserId creator = 6; + // REQUIRED. + // Creation time of the share. + cs3.types.v1beta1.Timestamp ctime = 7; // REQUIRED. - // The mount point of the share. - storage.provider.v1beta1.Reference mount_point = 3; + // Last modification time of the share. + cs3.types.v1beta1.Timestamp mtime = 8; + // OPTIONAL. + // The expiration time for the ocm share. + cs3.types.v1beta1.Timestamp expiration = 9; + // REQUIRED. + // Recipient share type. + cs3.sharing.ocm.v1beta1.ShareType share_type = 10; + // REQUIRED. + repeated Protocol protocols = 11; + // REQUIRED. + // The state of the share. + ShareState state = 12; + // OPTIONAL. + cs3.types.v1beta1.Opaque opaque = 13; } // The state of the share. @@ -131,11 +165,11 @@ enum ShareState { // 4) The grantee for the share = Grantee("type" = "user", "" => "Bob") message ShareKey { // REQUIRED. - cs3.identity.user.v1beta1.UserId owner = 2; + cs3.identity.user.v1beta1.UserId owner = 1; // REQUIRED. - storage.provider.v1beta1.ResourceId resource_id = 3; + storage.provider.v1beta1.ResourceId resource_id = 2; // REQUIRED. - storage.provider.v1beta1.Grantee grantee = 4; + storage.provider.v1beta1.Grantee grantee = 3; } // A share id identifies uniquely a // share in the share provider namespace. @@ -145,7 +179,7 @@ message ShareId { // The internal id used by service implementor to // uniquely identity the share in the internal // implementation of the service. - string opaque_id = 2; + string opaque_id = 1; } // The mechanism to identify a share @@ -173,15 +207,6 @@ message ShareGrant { SharePermissions permissions = 2; } -// Defines the type of share based on its recipient. -enum ShareType { - // Share of type user. - SHARE_TYPE_USER = 0; - // Share of type group. - SHARE_TYPE_GROUP = 1; -} - - // The protocol which is used to establish synchronisation. message Protocol { // REQUIRED. @@ -224,4 +249,29 @@ message DatatxProtocol { // REQUIRED. // Size in bytes of the source. uint64 size = 3; -} \ No newline at end of file +} + +// Defines the type of share based on its recipient. +enum ShareType { + // Share of type user. + SHARE_TYPE_USER = 0; + // Share of type group. + SHARE_TYPE_GROUP = 1; +} + +message AccessMethod { + oneof term { + WebDAVAccessMethod webdav_options = 1; + WebappAccessMethod webapp_options = 2; + DatatxAccessMethod datatx_options = 3; + cs3.types.v1beta1.Opaque generic_options = 4; + } +} + +message WebDAVAccessMethod { + storage.provider.v1beta1.ResourcePermissions permissions = 2; +} + +message WebappAccessMethod { cs3.app.provider.v1beta1.ViewMode view_mode = 2; } + +message DatatxAccessMethod {} \ No newline at end of file