Skip to content

Commit

Permalink
Enable support for multiple data transfer protocols (#96)
Browse files Browse the repository at this point in the history
  • Loading branch information
ishank011 authored Nov 18, 2020
1 parent a6cf2aa commit 8591720
Show file tree
Hide file tree
Showing 6 changed files with 1,055 additions and 192 deletions.
29 changes: 5 additions & 24 deletions cs3/gateway/v1beta1/gateway_api.proto
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down Expand Up @@ -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 {
Expand All @@ -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 {
Expand Down
78 changes: 78 additions & 0 deletions cs3/gateway/v1beta1/resources.proto
Original file line number Diff line number Diff line change
@@ -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;
}
23 changes: 4 additions & 19 deletions cs3/storage/provider/v1beta1/provider_api.proto
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -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 {
Expand Down
43 changes: 43 additions & 0 deletions cs3/storage/provider/v1beta1/resources.proto
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Loading

0 comments on commit 8591720

Please sign in to comment.