From 4c92b80bec0c0ee6893186d616346426a3145f41 Mon Sep 17 00:00:00 2001 From: Gianmaria Del Monte Date: Mon, 30 Jan 2023 16:10:46 +0100 Subject: [PATCH] add protocol fields to ocm share --- cs3/ocm/core/v1beta1/ocm_core_api.proto | 6 +- cs3/ocm/core/v1beta1/resources.proto | 84 ------------------------- cs3/sharing/ocm/v1beta1/resources.proto | 67 +++++++++++++++++--- 3 files changed, 61 insertions(+), 96 deletions(-) delete mode 100644 cs3/ocm/core/v1beta1/resources.proto diff --git a/cs3/ocm/core/v1beta1/ocm_core_api.proto b/cs3/ocm/core/v1beta1/ocm_core_api.proto index bb667271..7355cec6 100644 --- a/cs3/ocm/core/v1beta1/ocm_core_api.proto +++ b/cs3/ocm/core/v1beta1/ocm_core_api.proto @@ -29,10 +29,10 @@ 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/storage/provider/v1beta1/resources.proto"; import "cs3/rpc/v1beta1/status.proto"; import "cs3/types/v1beta1/types.proto"; +import "cs3/sharing/ocm/v1beta1/resources.proto"; // OCM Core API // @@ -85,10 +85,10 @@ message CreateOCMCoreShareRequest { cs3.storage.provider.v1beta1.ResourceType resource_type = 8; // REQUIRED. // Recipient share type. - ShareType share_type = 9; + cs3.sharing.ocm.v1beta1.ShareType share_type = 9; // REQUIRED. // The protocols which are used to establish synchronisation. - repeated Protocol protocols = 10; + repeated cs3.sharing.ocm.v1beta1.Protocol protocols = 10; } message CreateOCMCoreShareResponse { diff --git a/cs3/ocm/core/v1beta1/resources.proto b/cs3/ocm/core/v1beta1/resources.proto deleted file mode 100644 index fe467dee..00000000 --- a/cs3/ocm/core/v1beta1/resources.proto +++ /dev/null @@ -1,84 +0,0 @@ -// Copyright 2018-2019 CERN -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// In applying this license, CERN does not waive the privileges and immunities -// granted to it by virtue of its status as an Intergovernmental Organization -// or submit itself to any jurisdiction. - -syntax = "proto3"; - -package cs3.ocm.core.v1beta1; - -option csharp_namespace = "Cs3.Ocm.Core.V1Beta1"; -option go_package = "corev1beta1"; -option java_multiple_files = true; -option java_outer_classname = "ResourcesProto"; -option java_package = "com.cs3.ocm.core.v1beta1"; -option objc_class_prefix = "COC"; -option php_namespace = "Cs3\\Ocm\\Core\\V1Beta1"; - -import "cs3/sharing/ocm/v1beta1/resources.proto"; -import "cs3/types/v1beta1/types.proto"; - -// The protocol which is used to establish synchronisation. -message Protocol { - // REQUIRED. - oneof term { - WebDAVProtocol webdap_options = 1; - WebappProtocol webapp_options = 2; - DatatxProtocol datatx_oprions = 3; - cs3.types.v1beta1.Opaque generic_options = 4; - } -} - -// Defines the options for the WebDAV protocol. -message WebDAVProtocol { - // REQUIRED. - // Secret used to access the resource. - string shared_secret = 1; - // REQUIRED. - // Permissions of the shared resource. - cs3.sharing.ocm.v1beta1.SharePermissions permissions = 2; - // REQUIRED. - // WebDAV URI used to access the resource. - string uri = 3; -} - -// Defines the options for the Webapp protocol. -message WebappProtocol { - // REQUIRED. - // Template URI to open the resource with a remote app. - string uriTemplate = 1; -} - -// Defines the options for the Datatx protocol. -message DatatxProtocol { - // REQUIRED. - // Secret used to access the source of the data transfer. - string shared_secret = 1; - // REQUIRED. - // Source URI for the data transfer. - string source_uri = 2; - // REQUIRED. - // Size in bytes of the source. - uint64 size = 3; -} - -// 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; -} \ No newline at end of file diff --git a/cs3/sharing/ocm/v1beta1/resources.proto b/cs3/sharing/ocm/v1beta1/resources.proto index f3de64fd..d510f3c3 100644 --- a/cs3/sharing/ocm/v1beta1/resources.proto +++ b/cs3/sharing/ocm/v1beta1/resources.proto @@ -70,16 +70,12 @@ message Share { // REQUIRED. // Last modification time of the share. cs3.types.v1beta1.Timestamp mtime = 9; - // Defines the type of share based on its origin. - enum ShareType { - SHARE_TYPE_INVALID = 0; - // A regular file or folder share. - SHARE_TYPE_REGULAR = 1; - // A file or folder transfer. - SHARE_TYPE_TRANSFER = 2; - } - // Specifies the type of the share. + // REQUIRED. + // Recipient share type. ShareType share_type = 10; + // REQUIRED. + // The protocols which are used to establish synchronisation. + repeated Protocol protocols = 11; } // The permissions for a share. @@ -176,3 +172,56 @@ message ShareGrant { // The share permissions for the grant. 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. + oneof term { + WebDAVProtocol webdap_options = 1; + WebappProtocol webapp_options = 2; + DatatxProtocol datatx_oprions = 3; + cs3.types.v1beta1.Opaque generic_options = 4; + } +} + +// Defines the options for the WebDAV protocol. +message WebDAVProtocol { + // REQUIRED. + // Secret used to access the resource. + string shared_secret = 1; + // REQUIRED. + // Permissions of the shared resource. + cs3.sharing.ocm.v1beta1.SharePermissions permissions = 2; + // REQUIRED. + // WebDAV URI used to access the resource. + string uri = 3; +} + +// Defines the options for the Webapp protocol. +message WebappProtocol { + // REQUIRED. + // Template URI to open the resource with a remote app. + string uriTemplate = 1; +} + +// Defines the options for the Datatx protocol. +message DatatxProtocol { + // REQUIRED. + // Secret used to access the source of the data transfer. + string shared_secret = 1; + // REQUIRED. + // Source URI for the data transfer. + string source_uri = 2; + // REQUIRED. + // Size in bytes of the source. + uint64 size = 3; +} \ No newline at end of file