From 0f3d9ed4c9129335813f9038d6891536f3f26fd8 Mon Sep 17 00:00:00 2001 From: Giuseppe Lo Presti Date: Wed, 3 Apr 2024 16:38:31 +0200 Subject: [PATCH] Enhancement: added ListExistingReceivedShares to gateway API (#228) --- cs3/gateway/v1beta1/gateway_api.proto | 31 ++++++++++++++++++++++----- cs3/gateway/v1beta1/resources.proto | 15 +++++++++++++ 2 files changed, 41 insertions(+), 5 deletions(-) diff --git a/cs3/gateway/v1beta1/gateway_api.proto b/cs3/gateway/v1beta1/gateway_api.proto index a8b0cd5..ab824fd 100644 --- a/cs3/gateway/v1beta1/gateway_api.proto +++ b/cs3/gateway/v1beta1/gateway_api.proto @@ -35,6 +35,7 @@ import "cs3/permissions/v1beta1/permissions_api.proto"; import "cs3/preferences/v1beta1/preferences_api.proto"; import "cs3/rpc/v1beta1/status.proto"; import "cs3/sharing/collaboration/v1beta1/collaboration_api.proto"; +import "cs3/sharing/collaboration/v1beta1/resources.proto"; import "cs3/sharing/link/v1beta1/link_api.proto"; import "cs3/sharing/ocm/v1beta1/ocm_api.proto"; import "cs3/storage/provider/v1beta1/provider_api.proto"; @@ -228,15 +229,18 @@ service GatewayAPI { // Gets share information for a single share. // MUST return CODE_NOT_FOUND if the share reference does not exist. rpc GetShare(cs3.sharing.collaboration.v1beta1.GetShareRequest) returns (cs3.sharing.collaboration.v1beta1.GetShareResponse); - // List the shares the authproviderenticated principal has created, + // List the shares the authenticated principal has created, // both as owner and creator. If a filter is specified, only // shares satisfying the filter MUST be returned. rpc ListShares(cs3.sharing.collaboration.v1beta1.ListSharesRequest) returns (cs3.sharing.collaboration.v1beta1.ListSharesResponse); // Updates a share. // MUST return CODE_NOT_FOUND if the share reference does not exist. rpc UpdateShare(cs3.sharing.collaboration.v1beta1.UpdateShareRequest) returns (cs3.sharing.collaboration.v1beta1.UpdateShareResponse); - // List all shares the authproviderenticated principal has received. + // List all shares the authenticated principal has received. rpc ListReceivedShares(cs3.sharing.collaboration.v1beta1.ListReceivedSharesRequest) returns (cs3.sharing.collaboration.v1beta1.ListReceivedSharesResponse); + // List all existing shares the authenticated principal has received, + // including their storage resource information. + rpc ListExistingReceivedShares(cs3.sharing.collaboration.v1beta1.ListReceivedSharesRequest) returns (ListExistingReceivedSharesResponse); // Update the received share to change the share state or the display name. // MUST return CODE_NOT_FOUND if the share reference does not exist. rpc UpdateReceivedShare(cs3.sharing.collaboration.v1beta1.UpdateReceivedShareRequest) returns (cs3.sharing.collaboration.v1beta1.UpdateReceivedShareResponse); @@ -271,7 +275,7 @@ service GatewayAPI { // Gets share information for a single share by its unlisted token. // MUST return CODE_NOT_FOUND if the share does not exist. rpc GetPublicShareByToken(cs3.sharing.link.v1beta1.GetPublicShareByTokenRequest) returns (cs3.sharing.link.v1beta1.GetPublicShareByTokenResponse); - // List the shares the authproviderenticated principal has created, + // List the shares the authenticated principal has created, // both as owner and creator. If a filter is specified, only // shares satisfying the filter MUST be returned. rpc ListPublicShares(cs3.sharing.link.v1beta1.ListPublicSharesRequest) returns (cs3.sharing.link.v1beta1.ListPublicSharesResponse); @@ -297,14 +301,14 @@ service GatewayAPI { // Gets share information for a single share by its unlisted token. // MUST return CODE_NOT_FOUND if the share does not exist. rpc GetOCMShareByToken(cs3.sharing.ocm.v1beta1.GetOCMShareByTokenRequest) returns (cs3.sharing.ocm.v1beta1.GetOCMShareByTokenResponse); - // List the shares the authproviderenticated principal has created, + // List the shares the authenticated principal has created, // both as owner and creator. If a filter is specified, only // shares satisfying the filter MUST be returned. rpc ListOCMShares(cs3.sharing.ocm.v1beta1.ListOCMSharesRequest) returns (cs3.sharing.ocm.v1beta1.ListOCMSharesResponse); // Updates a share. // MUST return CODE_NOT_FOUND if the share reference does not exist. rpc UpdateOCMShare(cs3.sharing.ocm.v1beta1.UpdateOCMShareRequest) returns (cs3.sharing.ocm.v1beta1.UpdateOCMShareResponse); - // List all shares the authproviderenticated principal has received. + // List all shares the authenticated principal has received. rpc ListReceivedOCMShares(cs3.sharing.ocm.v1beta1.ListReceivedOCMSharesRequest) returns (cs3.sharing.ocm.v1beta1.ListReceivedOCMSharesResponse); // Update the received share to change the share state or the display name. // MUST return CODE_NOT_FOUND if the share reference does not exist. @@ -534,6 +538,23 @@ message ListAuthProvidersResponse { repeated string types = 3; } +message ListExistingReceivedSharesResponse { + // REQUIRED. + // The response status. + cs3.rpc.v1beta1.Status status = 1; + // OPTIONAL. + // Opaque information. + cs3.types.v1beta1.Opaque opaque = 2; + // REQUIRED. + // The shares encapsulating both the share metadata and the storage metadata. + repeated SharedResourceInfo shares = 3; + // OPTIONAL. + // This field represents the pagination token to retrieve the next page of results. + // If the value is "", it means no further results for the request. + // see https://cloud.google.com/apis/design/design_patterns#list_pagination + string next_page_token = 4; +} + message OpenInAppRequest { // OPTIONAL. // Opaque information. diff --git a/cs3/gateway/v1beta1/resources.proto b/cs3/gateway/v1beta1/resources.proto index db94ec4..ad432f4 100644 --- a/cs3/gateway/v1beta1/resources.proto +++ b/cs3/gateway/v1beta1/resources.proto @@ -21,6 +21,7 @@ syntax = "proto3"; package cs3.gateway.v1beta1; import "cs3/storage/provider/v1beta1/resources.proto"; +import "cs3/sharing/collaboration/v1beta1/resources.proto"; import "cs3/types/v1beta1/types.proto"; option csharp_namespace = "Cs3.Gateway.V1Beta1"; @@ -75,3 +76,17 @@ message FileDownloadProtocol { // Only makes sense for downloads passing through the data gateway. string token = 4; } + +// A shared resource includes the sharing information +// and the storage-related information about a resource. +message SharedResourceInfo { + // OPTIONAL. + // Opaque information. + cs3.types.v1beta1.Opaque opaque = 1; + // REQUIRED. + // The underlying share as returned by the collaboration service. + cs3.sharing.collaboration.v1beta1.ReceivedShare share = 2; + // REQUIRED. + // The corresponding resource information as returned by the storage provider. + cs3.storage.provider.v1beta1.ResourceInfo resource_info = 3; +}