From 8591720809ba698e7e45d7c2c0601bd961234d10 Mon Sep 17 00:00:00 2001 From: Ishank Arora Date: Wed, 18 Nov 2020 10:07:11 +0100 Subject: [PATCH] Enable support for multiple data transfer protocols (#96) --- cs3/gateway/v1beta1/gateway_api.proto | 29 +- cs3/gateway/v1beta1/resources.proto | 78 ++ .../provider/v1beta1/provider_api.proto | 23 +- cs3/storage/provider/v1beta1/resources.proto | 43 ++ docs/index.html | 365 ++++++--- proto.lock | 709 ++++++++++++++++-- 6 files changed, 1055 insertions(+), 192 deletions(-) create mode 100644 cs3/gateway/v1beta1/resources.proto diff --git a/cs3/gateway/v1beta1/gateway_api.proto b/cs3/gateway/v1beta1/gateway_api.proto index 96f0944f..e7ecba18 100644 --- a/cs3/gateway/v1beta1/gateway_api.proto +++ b/cs3/gateway/v1beta1/gateway_api.proto @@ -31,6 +31,7 @@ option php_namespace = "Cs3\\Gateway\\V1Beta1"; import "cs3/app/provider/v1beta1/provider_api.proto"; import "cs3/app/registry/v1beta1/registry_api.proto"; import "cs3/auth/registry/v1beta1/registry_api.proto"; +import "cs3/gateway/v1beta1/resources.proto"; import "cs3/identity/user/v1beta1/resources.proto"; import "cs3/identity/user/v1beta1/user_api.proto"; import "cs3/ocm/core/v1beta1/ocm_core_api.proto"; @@ -455,17 +456,8 @@ message InitiateFileDownloadResponse { // Opaque information. cs3.types.v1beta1.Opaque opaque = 2; // REQUIRED. - // The endpoint where to downooad the data. - // The value MUST be a Uniform Resource Identifier (URI) - // as specified in RFC 3986. - string download_endpoint = 3; - // REQUIRED. - // Tells to the gateway if the client should be exposed directly to the download_endpoint. - bool expose = 5; - // OPTIONAL. - // A token that MUST be validated by the data gateway for the upload. - // Only makes sense for uploads passing through the data gateway. - string token = 6; + // The protocols through which data can be downloaded. + repeated FileDownloadProtocol protocols = 3; } message InitiateFileUploadResponse { @@ -476,19 +468,8 @@ message InitiateFileUploadResponse { // Opaque information. cs3.types.v1beta1.Opaque opaque = 2; // REQUIRED. - // The endpoint where to upload the data. - // The value MUST be a Uniform Resource Identifier (URI) - // as specified in RFC 3986. - string upload_endpoint = 3; - // REQUIRED. - // List of available checksums - // the client can use when sending - // the file. - repeated cs3.storage.provider.v1beta1.ResourceChecksumPriority available_checksums = 4; - // OPTIONAL. - // A token that MUST be validated by the data gateway for the upload. - // Only makes sense for uploads passing through the data gateway. - string token = 5; + // The protocols through which data can be uploaded. + repeated FileUploadProtocol protocols = 3; } message ListAuthProvidersResponse { diff --git a/cs3/gateway/v1beta1/resources.proto b/cs3/gateway/v1beta1/resources.proto new file mode 100644 index 00000000..a10ed69e --- /dev/null +++ b/cs3/gateway/v1beta1/resources.proto @@ -0,0 +1,78 @@ +// 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.gateway.v1beta1; + +option csharp_namespace = "Cs3.Gateway.V1Beta1"; +option go_package = "gatewayv1beta1"; +option java_multiple_files = true; +option java_outer_classname = "ResourcesProto"; +option java_package = "com.cs3.gateway.v1beta1"; +option objc_class_prefix = "CGX"; +option php_namespace = "Cs3\\Gateway\\V1Beta1"; + +import "cs3/rpc/v1beta1/status.proto"; +import "cs3/storage/provider/v1beta1/resources.proto"; +import "cs3/types/v1beta1/types.proto"; + +// A file upload protocol object stores information about +// uploading resources using a specific protocol. +message FileUploadProtocol { + // OPTIONAL. + // Opaque information. + cs3.types.v1beta1.Opaque opaque = 1; + // REQUIRED. + // The protocol to be followed. + string protocol = 2; + // REQUIRED. + // The endpoint where to upload the data. + // The value MUST be a Uniform Resource Identifier (URI) + // as specified in RFC 3986. + string upload_endpoint = 3; + // REQUIRED. + // List of available checksums + // the client can use when sending + // the file. + repeated cs3.storage.provider.v1beta1.ResourceChecksumPriority available_checksums = 4; + // OPTIONAL. + // A token that MUST be validated by the data gateway for the upload. + // Only makes sense for uploads passing through the data gateway. + string token = 5; +} + +// A file download protocol object stores information about +// downloading resources using a specific protocol. +message FileDownloadProtocol { + // OPTIONAL. + // Opaque information. + cs3.types.v1beta1.Opaque opaque = 1; + // REQUIRED. + // The protocol to be followed. + string protocol = 2; + // REQUIRED. + // The endpoint where to download the data. + // The value MUST be a Uniform Resource Identifier (URI) + // as specified in RFC 3986. + string download_endpoint = 3; + // OPTIONAL. + // A token that MUST be validated by the data gateway for the download. + // Only makes sense for downloads passing through the data gateway. + string token = 4; +} diff --git a/cs3/storage/provider/v1beta1/provider_api.proto b/cs3/storage/provider/v1beta1/provider_api.proto index 28c64a60..f07b8b57 100644 --- a/cs3/storage/provider/v1beta1/provider_api.proto +++ b/cs3/storage/provider/v1beta1/provider_api.proto @@ -281,18 +281,8 @@ message InitiateFileUploadResponse { // Opaque information. cs3.types.v1beta1.Opaque opaque = 2; // REQUIRED. - // The endpoint where to upload the data. - // The value MUST be a Uniform Resource Identifier (URI) - // as specified in RFC 3986. - string upload_endpoint = 3; - // REQUIRED. - // List of available checksums - // the client can use when sending - // the file. - repeated ResourceChecksumPriority available_checksums = 4; - // REQUIRED. - // Tells to the gateway if the client should be exposed directly to the upload_endpoint. - bool expose = 5; + // The protocols through which data can be uploaded. + repeated FileUploadProtocol protocols = 3; } message InitiateFileDownloadRequest { @@ -312,13 +302,8 @@ message InitiateFileDownloadResponse { // Opaque information. cs3.types.v1beta1.Opaque opaque = 2; // REQUIRED. - // The endpoint where to downooad the data. - // The value MUST be a Uniform Resource Identifier (URI) - // as specified in RFC 3986. - string download_endpoint = 3; - // REQUIRED. - // Tells to the gateway if the client should be exposed directly to the download_endpoint. - bool expose = 5; + // The protocols through which data can be downloaded. + repeated FileDownloadProtocol protocols = 3; } message ListGrantsRequest { diff --git a/cs3/storage/provider/v1beta1/resources.proto b/cs3/storage/provider/v1beta1/resources.proto index 75f8cbee..8b8cf0cf 100644 --- a/cs3/storage/provider/v1beta1/resources.proto +++ b/cs3/storage/provider/v1beta1/resources.proto @@ -312,3 +312,46 @@ message RecycleItem { // in Unix Epoch timestamp in seconds. cs3.types.v1beta1.Timestamp deletion_time = 6; } + +// A file upload protocol object stores information about +// uploading resources using a specific protocol. +message FileUploadProtocol { + // OPTIONAL. + // Opaque information. + cs3.types.v1beta1.Opaque opaque = 1; + // REQUIRED. + // The protocol to be followed. + string protocol = 2; + // REQUIRED. + // The endpoint where to upload the data. + // The value MUST be a Uniform Resource Identifier (URI) + // as specified in RFC 3986. + string upload_endpoint = 3; + // REQUIRED. + // List of available checksums + // the client can use when sending + // the file. + repeated ResourceChecksumPriority available_checksums = 4; + // REQUIRED. + // Tells to the gateway if the client should be exposed directly to the upload_endpoint. + bool expose = 5; +} + +// A file download protocol object stores information about +// downloading resources using a specific protocol. +message FileDownloadProtocol { + // OPTIONAL. + // Opaque information. + cs3.types.v1beta1.Opaque opaque = 1; + // REQUIRED. + // The protocol to be followed. + string protocol = 2; + // REQUIRED. + // The endpoint where to download the data. + // The value MUST be a Uniform Resource Identifier (URI) + // as specified in RFC 3986. + string download_endpoint = 3; + // REQUIRED. + // Tells to the gateway if the client should be exposed directly to the download_endpoint. + bool expose = 4; +} diff --git a/docs/index.html b/docs/index.html index 83bc8f85..8efda4c5 100644 --- a/docs/index.html +++ b/docs/index.html @@ -241,6 +241,25 @@

Table of Contents

+
  • + cs3/gateway/v1beta1/resources.proto + +
  • + +
  • cs3/preferences/v1beta1/preferences_api.proto