|
| 1 | +// Copyright 2018-2025 CERN |
| 2 | +// |
| 3 | +// Licensed under the Apache License, Version 2.0 (the "License"); |
| 4 | +// you may not use this file except in compliance with the License. |
| 5 | +// You may obtain a copy of the License at |
| 6 | +// |
| 7 | +// http://www.apache.org/licenses/LICENSE-2.0 |
| 8 | +// |
| 9 | +// Unless required by applicable law or agreed to in writing, software |
| 10 | +// distributed under the License is distributed on an "AS IS" BASIS, |
| 11 | +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 12 | +// See the License for the specific language governing permissions and |
| 13 | +// limitations under the License. |
| 14 | +// |
| 15 | +// In applying this license, CERN does not waive the privileges and immunities |
| 16 | +// granted to it by virtue of its status as an Intergovernmental Organization |
| 17 | +// or submit itself to any jurisdiction. |
| 18 | + |
| 19 | +syntax = "proto3"; |
| 20 | + |
| 21 | +package cs3.ocm.incoming.v1beta1; |
| 22 | + |
| 23 | +import "cs3/identity/user/v1beta1/resources.proto"; |
| 24 | +import "cs3/rpc/v1beta1/status.proto"; |
| 25 | +import "cs3/sharing/ocm/v1beta1/resources.proto"; |
| 26 | +import "cs3/storage/provider/v1beta1/resources.proto"; |
| 27 | +import "cs3/types/v1beta1/types.proto"; |
| 28 | + |
| 29 | +option csharp_namespace = "Cs3.Ocm.Incoming.V1Beta1"; |
| 30 | +option go_package = "incomingv1beta1"; |
| 31 | +option java_multiple_files = true; |
| 32 | +option java_outer_classname = "OcmIncomingApiProto"; |
| 33 | +option java_package = "com.cs3.ocm.incoming.v1beta1"; |
| 34 | +option objc_class_prefix = "COI"; |
| 35 | +option php_namespace = "Cs3\\Ocm\\Incoming\\V1Beta1"; |
| 36 | + |
| 37 | +// OCM Incoming API |
| 38 | +// |
| 39 | +// The OCM Incoming API is used to persist in the local system the incoming remote |
| 40 | +// shares that are sent via the Open Cloud Mesh (OCM) sharing protocol. |
| 41 | +// Implementations are expected to expose the `/ocm` endpoints according to the |
| 42 | +// OCM API, and in response to those endpoints call the following API. |
| 43 | +// Support for multi-protocol shares is included, if the remote sender supplies |
| 44 | +// a multi-protocol share. |
| 45 | +// |
| 46 | +// The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL |
| 47 | +// NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and |
| 48 | +// "OPTIONAL" in this document are to be interpreted as described in |
| 49 | +// RFC 2119. |
| 50 | +// |
| 51 | +// The following are global requirements that apply to all methods: |
| 52 | +// Any method MUST return CODE_OK on a succesful operation. |
| 53 | +// Any method MAY return NOT_IMPLEMENTED. |
| 54 | +// Any method MAY return INTERNAL. |
| 55 | +// Any method MAY return UNKNOWN. |
| 56 | +// Any method MAY return UNAUTHENTICATED. |
| 57 | +service OcmIncomingAPI { |
| 58 | + // Creates a new OCM share in response to a call from remote to `/ocm/shares`. See: |
| 59 | + // https://cs3org.github.io/OCM-API/docs.html?branch=v1.2.0&repo=OCM-API&user=cs3org#/paths/~1shares/post |
| 60 | + rpc CreateOCMIncomingShare(CreateOCMIncomingShareRequest) returns (CreateOCMIncomingShareResponse); |
| 61 | + // Updates an OCM share in response to a notification from remote to `/ocm/notifications`. See: |
| 62 | + // https://cs3org.github.io/OCM-API/docs.html?branch=v1.2.0&repo=OCM-API&user=cs3org#/paths/~1notifications/post |
| 63 | + rpc UpdateOCMIncomingShare(UpdateOCMIncomingShareRequest) returns (UpdateOCMIncomingShareResponse); |
| 64 | + // Deletes an OCM share in response to a notification from remote to `/ocm/notifications`. See: |
| 65 | + // https://cs3org.github.io/OCM-API/docs.html?branch=v1.2.0&repo=OCM-API&user=cs3org#/paths/~1notifications/post |
| 66 | + rpc DeleteOCMIncomingShare(DeleteOCMIncomingShareRequest) returns (DeleteOCMIncomingShareResponse); |
| 67 | +} |
| 68 | + |
| 69 | +message CreateOCMIncomingShareRequest { |
| 70 | + // OPTIONAL. |
| 71 | + // Opaque information. |
| 72 | + cs3.types.v1beta1.Opaque opaque = 1; |
| 73 | + // OPTIONAL. |
| 74 | + // Description for the share. |
| 75 | + string description = 2; |
| 76 | + // REQUIRED. |
| 77 | + // Name of the resource (file or folder). |
| 78 | + string name = 3; |
| 79 | + // REQUIRED. |
| 80 | + // Identifier to identify the resource at the provider side. This is unique per provider. |
| 81 | + string resource_id = 4; |
| 82 | + // REQUIRED. |
| 83 | + // Provider specific identifier of the owner of the resource. |
| 84 | + cs3.identity.user.v1beta1.UserId owner = 5; |
| 85 | + // REQUIRED. |
| 86 | + // Provider specific identifier of the user that wants to share the resource. |
| 87 | + cs3.identity.user.v1beta1.UserId sender = 6; |
| 88 | + // REQUIRED. |
| 89 | + // Consumer specific identifier of the user or group the provider wants to share the resource with. |
| 90 | + // This is known in advance, for example using the OCM invitation flow. |
| 91 | + // Please note that the consumer service endpoint is known in advance as well, so this is no part of the request body. |
| 92 | + // TODO: this field needs to represent either a user or group in the future, not only a user. |
| 93 | + cs3.identity.user.v1beta1.UserId share_with = 7; |
| 94 | + // REQUIRED. |
| 95 | + // Resource type. |
| 96 | + cs3.storage.provider.v1beta1.ResourceType resource_type = 8; |
| 97 | + // REQUIRED. |
| 98 | + // Recipient share type. |
| 99 | + cs3.sharing.ocm.v1beta1.ShareType share_type = 9; |
| 100 | + // OPTIONAL. |
| 101 | + // The expiration time for the OCM share. |
| 102 | + cs3.types.v1beta1.Timestamp expiration = 10; |
| 103 | + // REQUIRED. |
| 104 | + // The protocols which are used to establish synchronisation, |
| 105 | + // with their access rights. |
| 106 | + // See also cs3/sharing/ocm/v1beta1/resources.proto for how to map |
| 107 | + // this to the OCM share payload. |
| 108 | + repeated cs3.sharing.ocm.v1beta1.Protocol protocols = 11; |
| 109 | + // OPTIONAL. |
| 110 | + // A nonce to be exchanged for a (potentially short-lived) bearer token. |
| 111 | + string code = 12; |
| 112 | +} |
| 113 | + |
| 114 | +message CreateOCMIncomingShareResponse { |
| 115 | + // REQUIRED. |
| 116 | + // The response status. |
| 117 | + cs3.rpc.v1beta1.Status status = 1; |
| 118 | + // OPTIONAL. |
| 119 | + // Opaque information. |
| 120 | + cs3.types.v1beta1.Opaque opaque = 2; |
| 121 | + // REQUIRED. |
| 122 | + // Unique ID to identify the share at the consumer side. |
| 123 | + string id = 3; |
| 124 | + // REQUIRED. |
| 125 | + cs3.types.v1beta1.Timestamp created = 4; |
| 126 | +} |
| 127 | + |
| 128 | +message UpdateOCMIncomingShareRequest { |
| 129 | + // OPTIONAL. |
| 130 | + // Opaque information. |
| 131 | + cs3.types.v1beta1.Opaque opaque = 1; |
| 132 | + // REQUIRED. |
| 133 | + // Unique ID to identify the share at the consumer side. |
| 134 | + string ocm_share_id = 2; |
| 135 | + // OPTIONAL. |
| 136 | + // Description for the share. |
| 137 | + string description = 3; |
| 138 | + // OPTIONAL. |
| 139 | + // Recipient share type. |
| 140 | + cs3.sharing.ocm.v1beta1.ShareType share_type = 5; |
| 141 | + // OPTIONAL. |
| 142 | + // The expiration time for the OCM share. |
| 143 | + cs3.types.v1beta1.Timestamp expiration = 6; |
| 144 | + // OPTIONAL. |
| 145 | + // The protocols which are used to establish synchronisation, |
| 146 | + // with their access rights. |
| 147 | + repeated cs3.sharing.ocm.v1beta1.Protocol protocols = 7; |
| 148 | +} |
| 149 | + |
| 150 | +message UpdateOCMIncomingShareResponse { |
| 151 | + // REQUIRED. |
| 152 | + // The response status. |
| 153 | + cs3.rpc.v1beta1.Status status = 1; |
| 154 | + // OPTIONAL. |
| 155 | + // Opaque information. |
| 156 | + cs3.types.v1beta1.Opaque opaque = 2; |
| 157 | +} |
| 158 | + |
| 159 | +message DeleteOCMIncomingShareRequest { |
| 160 | + // REQUIRED. |
| 161 | + // Unique ID to identify the share at the consumer side. |
| 162 | + string id = 1; |
| 163 | + // OPTIONAL. |
| 164 | + // Opaque information. |
| 165 | + cs3.types.v1beta1.Opaque opaque = 2; |
| 166 | +} |
| 167 | + |
| 168 | +message DeleteOCMIncomingShareResponse { |
| 169 | + // REQUIRED. |
| 170 | + // The response status. |
| 171 | + cs3.rpc.v1beta1.Status status = 1; |
| 172 | + // OPTIONAL. |
| 173 | + // Opaque information. |
| 174 | + cs3.types.v1beta1.Opaque opaque = 2; |
| 175 | +} |
0 commit comments