Skip to content

Commit

Permalink
Enhancement: added ListExistingReceivedShares to gateway API (#228)
Browse files Browse the repository at this point in the history
  • Loading branch information
glpatcern authored Apr 3, 2024
1 parent f575bef commit 0f3d9ed
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 5 deletions.
31 changes: 26 additions & 5 deletions cs3/gateway/v1beta1/gateway_api.proto
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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);
Expand All @@ -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.
Expand Down Expand Up @@ -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.
Expand Down
15 changes: 15 additions & 0 deletions cs3/gateway/v1beta1/resources.proto
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down Expand Up @@ -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;
}

0 comments on commit 0f3d9ed

Please sign in to comment.