Skip to content

Commit

Permalink
splitted created share to received share
Browse files Browse the repository at this point in the history
  • Loading branch information
gmgigi96 committed Feb 2, 2023
1 parent 4c92b80 commit 0198ed5
Show file tree
Hide file tree
Showing 5 changed files with 110 additions and 51 deletions.
15 changes: 0 additions & 15 deletions cs3/app/provider/v1beta1/provider_api.proto
Original file line number Diff line number Diff line change
Expand Up @@ -67,21 +67,6 @@ message OpenInAppRequest {
storage.provider.v1beta1.ResourceInfo resource_info = 2;
// REQUIRED.
// View mode.
enum ViewMode {
VIEW_MODE_INVALID = 0;
// The resource can be opened but not downloaded.
VIEW_MODE_VIEW_ONLY = 1;
// The resource can be downloaded.
VIEW_MODE_READ_ONLY = 2;
// The resource can be downloaded and updated. The underlying application
// MUST be a fully capable editor to support this mode.
VIEW_MODE_READ_WRITE = 3;
// The resource can be downloaded and updated, but must be shown in
// preview mode. If the underlying application does not support a preview mode,
// or if in a view-only mode users are not allowed to switch to edit mode,
// then this mode MUST fall back to READ_WRITE.
VIEW_MODE_PREVIEW = 4;
}
ViewMode view_mode = 3;
// REQUIRED.
// The access token this application provider will use when contacting
Expand Down
16 changes: 16 additions & 0 deletions cs3/app/provider/v1beta1/resources.proto
Original file line number Diff line number Diff line change
Expand Up @@ -45,3 +45,19 @@ message OpenInAppURL {
// The headers to be added to the request.
map<string, string> headers = 4;
}

enum ViewMode {
VIEW_MODE_INVALID = 0;
// The resource can be opened but not downloaded.
VIEW_MODE_VIEW_ONLY = 1;
// The resource can be downloaded.
VIEW_MODE_READ_ONLY = 2;
// The resource can be downloaded and updated. The underlying application
// MUST be a fully capable editor to support this mode.
VIEW_MODE_READ_WRITE = 3;
// The resource can be downloaded and updated, but must be shown in
// preview mode. If the underlying application does not support a preview mode,
// or if in a view-only mode users are not allowed to switch to edit mode,
// then this mode MUST fall back to READ_WRITE.
VIEW_MODE_PREVIEW = 4;
}
5 changes: 4 additions & 1 deletion cs3/ocm/core/v1beta1/ocm_core_api.proto
Original file line number Diff line number Diff line change
Expand Up @@ -86,9 +86,12 @@ message CreateOCMCoreShareRequest {
// REQUIRED.
// Recipient share type.
cs3.sharing.ocm.v1beta1.ShareType share_type = 9;
// OPTIONAL.
// The expiration time for the ocm share.
cs3.types.v1beta1.Timestamp expiration = 10;
// REQUIRED.
// The protocols which are used to establish synchronisation.
repeated cs3.sharing.ocm.v1beta1.Protocol protocols = 10;
repeated cs3.sharing.ocm.v1beta1.Protocol protocols = 11;
}

message CreateOCMCoreShareResponse {
Expand Down
9 changes: 7 additions & 2 deletions cs3/sharing/ocm/v1beta1/ocm_api.proto
Original file line number Diff line number Diff line change
Expand Up @@ -91,11 +91,16 @@ message CreateOCMShareRequest {
// The unique identifier for the shared storage resource.
storage.provider.v1beta1.ResourceId resource_id = 2;
// REQUIRED.
// The share grant for the share.
ShareGrant grant = 3;
// The grantee for the share.
storage.provider.v1beta1.Grantee grantee = 3;
// REQUIRED.
// The details of the recipient user's mesh provider.
cs3.ocm.provider.v1beta1.ProviderInfo recipient_mesh_provider = 4;
// REQUIRED.
repeated AccessMethod access_methods = 5;
// OPTIONAL.
// The expiration time for the ocm share.
cs3.types.v1beta1.Timestamp expiration = 6;
}

message CreateOCMShareResponse {
Expand Down
116 changes: 83 additions & 33 deletions cs3/sharing/ocm/v1beta1/resources.proto
Original file line number Diff line number Diff line change
Expand Up @@ -31,24 +31,24 @@ option php_namespace = "Cs3\\Sharing\\Ocm\\V1Beta1";
import "cs3/identity/user/v1beta1/resources.proto";
import "cs3/storage/provider/v1beta1/resources.proto";
import "cs3/types/v1beta1/types.proto";
import "cs3/app/provider/v1beta1/resources.proto";

// Shares are relationships between a resource owner
// (usually the authenticated user) who grants permissions to a recipient (grantee)
// on a specified resource (resource_id). UserShares represents both user and groups.
// (usually the authenticated user) who grants permissions to a recipient
// (grantee) on a specified resource (resource_id). UserShares represents both
// user and groups.
message Share {
// REQUIRED.
// Opaque unique identifier of the share.
ShareId id = 1;
// REQUIRED.
// Unique identifier of the shared resource.
storage.provider.v1beta1.ResourceId resource_id = 2;
// The unlisted token to give access to the ocm share.
string token = 2;
// REQUIRED.
// Name of the shared resource.
string name = 3;
// REQUIRED.
// Permissions for the grantee to use
// the resource.
SharePermissions permissions = 4;
storage.provider.v1beta1.ResourceId resource_id = 4;
// REQUIRED.
// The receiver of the share, like a user, group ...
storage.provider.v1beta1.Grantee grantee = 5;
Expand All @@ -70,12 +70,16 @@ message Share {
// REQUIRED.
// Last modification time of the share.
cs3.types.v1beta1.Timestamp mtime = 9;
// OPTIONAL.
// The expiration time for the ocm share.
cs3.types.v1beta1.Timestamp expiration = 10;
// REQUIRED.
// Recipient share type.
ShareType share_type = 10;
cs3.sharing.ocm.v1beta1.ShareType share_type = 11;
// REQUIRED.
// The protocols which are used to establish synchronisation.
repeated Protocol protocols = 11;
repeated AccessMethod access_methods = 12;
// OPTIONAL.
cs3.types.v1beta1.Opaque opaque = 13;
}

// The permissions for a share.
Expand All @@ -85,19 +89,49 @@ message SharePermissions {
}

// A received share is the share that a grantee will receive.
// It expands the original share by adding state to the share,
// a display name from the perspective of the grantee and a
// resource mount point in case the share will be mounted
// in a storage provider.
message ReceivedShare {
// REQUIRED.
Share share = 1;
// Opaque unique identifier of the share.
ShareId id = 1;
// REQUIRED.
// Name of the shared resource.
string name = 2;
// REQUIRED.
// The state of the share.
ShareState state = 2;
storage.provider.v1beta1.ResourceId resource_id = 3;
// REQUIRED.
// The receiver of the share, like a user, group ...
storage.provider.v1beta1.Grantee grantee = 4;
// REQUIRED.
// Uniquely identifies the owner of the share
// (the resource owner at the time of creating the share).
// In case the ownership of the underlying resource changes
// the share owner field MAY change to reflect the change of ownsership.
cs3.identity.user.v1beta1.UserId owner = 5;
// REQUIRED.
// Uniquely identifies a principal who initiates the share creation.
// A creator can create shares on behalf of the owner (because of re-sharing,
// because belonging to special groups, ...).
// Creator and owner often result in being the same principal.
cs3.identity.user.v1beta1.UserId creator = 6;
// REQUIRED.
// Creation time of the share.
cs3.types.v1beta1.Timestamp ctime = 7;
// REQUIRED.
// The mount point of the share.
storage.provider.v1beta1.Reference mount_point = 3;
// Last modification time of the share.
cs3.types.v1beta1.Timestamp mtime = 8;
// OPTIONAL.
// The expiration time for the ocm share.
cs3.types.v1beta1.Timestamp expiration = 9;
// REQUIRED.
// Recipient share type.
cs3.sharing.ocm.v1beta1.ShareType share_type = 10;
// REQUIRED.
repeated Protocol protocols = 11;
// REQUIRED.
// The state of the share.
ShareState state = 12;
// OPTIONAL.
cs3.types.v1beta1.Opaque opaque = 13;
}

// The state of the share.
Expand Down Expand Up @@ -131,11 +165,11 @@ enum ShareState {
// 4) The grantee for the share = Grantee("type" = "user", "" => "Bob")
message ShareKey {
// REQUIRED.
cs3.identity.user.v1beta1.UserId owner = 2;
cs3.identity.user.v1beta1.UserId owner = 1;
// REQUIRED.
storage.provider.v1beta1.ResourceId resource_id = 3;
storage.provider.v1beta1.ResourceId resource_id = 2;
// REQUIRED.
storage.provider.v1beta1.Grantee grantee = 4;
storage.provider.v1beta1.Grantee grantee = 3;
}

// A share id identifies uniquely a // share in the share provider namespace.
Expand All @@ -145,7 +179,7 @@ message ShareId {
// The internal id used by service implementor to
// uniquely identity the share in the internal
// implementation of the service.
string opaque_id = 2;
string opaque_id = 1;
}

// The mechanism to identify a share
Expand Down Expand Up @@ -173,15 +207,6 @@ message ShareGrant {
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.
Expand Down Expand Up @@ -224,4 +249,29 @@ message DatatxProtocol {
// 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;
}

message AccessMethod {
oneof term {
WebDAVAccessMethod webdav_options = 1;
WebappAccessMethod webapp_options = 2;
DatatxAccessMethod datatx_options = 3;
cs3.types.v1beta1.Opaque generic_options = 4;
}
}

message WebDAVAccessMethod {
storage.provider.v1beta1.ResourcePermissions permissions = 2;
}

message WebappAccessMethod { cs3.app.provider.v1beta1.ViewMode view_mode = 2; }

message DatatxAccessMethod {}

0 comments on commit 0198ed5

Please sign in to comment.