diff --git a/cs3/app/provider/v1beta1/provider_api.proto b/cs3/app/provider/v1beta1/provider_api.proto index fd5bfe18..567323ce 100644 --- a/cs3/app/provider/v1beta1/provider_api.proto +++ b/cs3/app/provider/v1beta1/provider_api.proto @@ -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 diff --git a/cs3/app/provider/v1beta1/resources.proto b/cs3/app/provider/v1beta1/resources.proto index b27901d8..59f69665 100644 --- a/cs3/app/provider/v1beta1/resources.proto +++ b/cs3/app/provider/v1beta1/resources.proto @@ -45,3 +45,20 @@ message OpenInAppURL { // The headers to be added to the request. map headers = 4; } + +// Defines the view modes. +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; +} diff --git a/cs3/ocm/core/v1beta1/ocm_core_api.proto b/cs3/ocm/core/v1beta1/ocm_core_api.proto index d004f89c..2f04a406 100644 --- a/cs3/ocm/core/v1beta1/ocm_core_api.proto +++ b/cs3/ocm/core/v1beta1/ocm_core_api.proto @@ -29,8 +29,9 @@ option objc_class_prefix = "COC"; option php_namespace = "Cs3\\Ocm\\Core\\V1Beta1"; import "cs3/identity/user/v1beta1/resources.proto"; -import "cs3/ocm/core/v1beta1/resources.proto"; import "cs3/rpc/v1beta1/status.proto"; +import "cs3/sharing/ocm/v1beta1/resources.proto"; +import "cs3/storage/provider/v1beta1/resources.proto"; import "cs3/types/v1beta1/types.proto"; // OCM Core API @@ -66,19 +67,31 @@ message CreateOCMCoreShareRequest { string name = 3; // REQUIRED. // Identifier to identify the resource at the provider side. This is unique per provider. - string provider_id = 4; + string resource_id = 4; // REQUIRED. - // Provider specific identifier of the user that wants to share the resource. + // Provider specific identifier of the owner of the resource. cs3.identity.user.v1beta1.UserId owner = 5; // REQUIRED. + // Provider specific identifier of the user that wants to share the resource. + cs3.identity.user.v1beta1.UserId sender = 6; + // REQUIRED. // Consumer specific identifier of the user or group the provider wants to share the resource with. // This is known in advance, for example using the OCM invitation flow. // Please note that the consumer service endpoint is known in advance as well, so this is no part of the request body. // TODO: this field needs to represent either a user or group in the future, not only a user. - cs3.identity.user.v1beta1.UserId share_with = 6; + cs3.identity.user.v1beta1.UserId share_with = 7; + // REQUIRED. + // Resource type. + cs3.storage.provider.v1beta1.ResourceType resource_type = 8; + // 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 protocol which is used to establish synchronisation. - Protocol protocol = 7; + // The protocols which are used to establish synchronisation. + repeated cs3.sharing.ocm.v1beta1.Protocol protocols = 11; } message CreateOCMCoreShareResponse { diff --git a/cs3/ocm/core/v1beta1/resources.proto b/cs3/ocm/core/v1beta1/resources.proto deleted file mode 100644 index 22ae893c..00000000 --- a/cs3/ocm/core/v1beta1/resources.proto +++ /dev/null @@ -1,42 +0,0 @@ -// 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.ocm.core.v1beta1; - -option csharp_namespace = "Cs3.Ocm.Core.V1Beta1"; -option go_package = "corev1beta1"; -option java_multiple_files = true; -option java_outer_classname = "ResourcesProto"; -option java_package = "com.cs3.ocm.core.v1beta1"; -option objc_class_prefix = "COC"; -option php_namespace = "Cs3\\Ocm\\Core\\V1Beta1"; - -import "cs3/types/v1beta1/types.proto"; - -// The protocol which is used to establish synchronisation. -message Protocol { - // REQUIRED. - // The name of the protocol to use. - string name = 1; - // REQUIRED. - // JSON object with protocol specific options, - // e.g. uri, access_token, password, permissions etc. - cs3.types.v1beta1.Opaque opaque = 2; -} diff --git a/cs3/sharing/ocm/v1beta1/ocm_api.proto b/cs3/sharing/ocm/v1beta1/ocm_api.proto index ed5592dd..d6d3d7ea 100644 --- a/cs3/sharing/ocm/v1beta1/ocm_api.proto +++ b/cs3/sharing/ocm/v1beta1/ocm_api.proto @@ -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 { @@ -108,6 +113,9 @@ message CreateOCMShareResponse { // REQUIRED. // The created share. Share share = 3; + // OPTIONAL. + // Display name of the recipient of the share. + string recipient_display_name = 4; } message UpdateOCMShareRequest { diff --git a/cs3/sharing/ocm/v1beta1/resources.proto b/cs3/sharing/ocm/v1beta1/resources.proto index f3de64fd..d2bd23fd 100644 --- a/cs3/sharing/ocm/v1beta1/resources.proto +++ b/cs3/sharing/ocm/v1beta1/resources.proto @@ -28,13 +28,15 @@ option java_package = "com.cs3.sharing.ocm.v1beta1"; option objc_class_prefix = "CSO"; option php_namespace = "Cs3\\Sharing\\Ocm\\V1Beta1"; +import "cs3/app/provider/v1beta1/resources.proto"; import "cs3/identity/user/v1beta1/resources.proto"; import "cs3/storage/provider/v1beta1/resources.proto"; import "cs3/types/v1beta1/types.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. @@ -46,9 +48,8 @@ message Share { // Name of the shared resource. string name = 3; // REQUIRED. - // Permissions for the grantee to use - // the resource. - SharePermissions permissions = 4; + // The unlisted token to give access to the ocm share. + string token = 4; // REQUIRED. // The receiver of the share, like a user, group ... storage.provider.v1beta1.Grantee grantee = 5; @@ -70,16 +71,16 @@ message Share { // REQUIRED. // Last modification time of the share. cs3.types.v1beta1.Timestamp mtime = 9; - // Defines the type of share based on its origin. - enum ShareType { - SHARE_TYPE_INVALID = 0; - // A regular file or folder share. - SHARE_TYPE_REGULAR = 1; - // A file or folder transfer. - SHARE_TYPE_TRANSFER = 2; - } - // Specifies the type of the share. - ShareType share_type = 10; + // OPTIONAL. + // The expiration time for the ocm share. + cs3.types.v1beta1.Timestamp expiration = 10; + // REQUIRED. + // Recipient share type. + cs3.sharing.ocm.v1beta1.ShareType share_type = 11; + // REQUIRED. + repeated AccessMethod access_methods = 12; + // OPTIONAL. + cs3.types.v1beta1.Opaque opaque = 13; } // The permissions for a share. @@ -89,19 +90,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. - // The mount point of the share. - storage.provider.v1beta1.Reference mount_point = 3; + // 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. + // 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. @@ -135,11 +166,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. @@ -149,7 +180,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 @@ -176,3 +207,97 @@ message ShareGrant { // The share permissions for the grant. SharePermissions permissions = 2; } + +// The protocol which is used to establish synchronisation. +message Protocol { + // REQUIRED. + // One of the protocols MUST be specified. + oneof term { + // Options for WebDAV protocol. + WebDAVProtocol webdav_options = 1; + // Options for Webapp protocol. + WebappProtocol webapp_options = 2; + // Options for transfer protocol. + TransferProtocol transfer_options = 3; + // Options for a generic protocol. + // Used to implement future protocols + // in the OCM specs. + cs3.types.v1beta1.Opaque generic_options = 4; + } +} + +// Defines the options for the WebDAV protocol. +message WebDAVProtocol { + // REQUIRED. + // Secret used to access the resource. + string shared_secret = 1; + // REQUIRED. + // Permissions of the shared resource. + cs3.sharing.ocm.v1beta1.SharePermissions permissions = 2; + // REQUIRED. + // WebDAV URI used to access the resource. + string uri = 3; +} + +// Defines the options for the Webapp protocol. +message WebappProtocol { + // REQUIRED. + // Template URI to open the resource with a remote app. + string uri_template = 1; +} + +// Defines the options for the Transfer protocol. +message TransferProtocol { + // REQUIRED. + // Secret used to access the source of the data transfer. + string shared_secret = 1; + // REQUIRED. + // Source URI for the data transfer. + string source_uri = 2; + // REQUIRED. + // Size in bytes of the source. + uint64 size = 3; +} + +// Defines the type of share based on its recipient. +enum ShareType { + SHARE_TYPE_INVALID = 0; + // Share of type user. + SHARE_TYPE_USER = 1; + // Share of type group. + SHARE_TYPE_GROUP = 2; +} + +// Defines how the recipient accesses the share. +message AccessMethod { + // REQUIRED. + // One of the access method MUST be specified. + oneof term { + // Options for the WebDAV access method. + WebDAVAccessMethod webdav_options = 1; + // Options for the Webapp access method. + WebappAccessMethod webapp_options = 2; + // Options for the Transfer access method. + TransferAccessMethod transfer_options = 3; + // Options for a generic transfer method. + // Used to implement future access methods. + cs3.types.v1beta1.Opaque generic_options = 4; + } +} + +// Defines the options for the WebDAV access method. +message WebDAVAccessMethod { + // REQUIRED. + // The permissions for the share. + storage.provider.v1beta1.ResourcePermissions permissions = 2; +} + +// Defines the options for the Webapp access method. +message WebappAccessMethod { + // REQUIRED. + // The view mode for the share. + cs3.app.provider.v1beta1.ViewMode view_mode = 2; +} + +// Defines the options for the Transfer access method. +message TransferAccessMethod {} diff --git a/docs/index.html b/docs/index.html index 05402826..c058a20b 100644 --- a/docs/index.html +++ b/docs/index.html @@ -566,10 +566,6 @@

Table of Contents

-
  • - EOpenInAppRequest.ViewMode -
  • -
  • @@ -597,6 +593,10 @@

    Table of Contents

  • +
  • + EViewMode +
  • + @@ -1018,21 +1018,6 @@

    Table of Contents

    -
  • - cs3/ocm/core/v1beta1/resources.proto - -
  • - -
  • cs3/ocm/invite/v1beta1/invite_api.proto