├── .github
└── workflows
│ ├── build-and-publish.yml
│ └── build-only.yml
├── .gitignore
├── CODEOWNERS
├── LICENSE
├── Makefile
├── README.md
├── buf.gen.yaml
├── buf.lock
├── buf.md
├── buf.yaml
├── cs3
├── admin
│ ├── group
│ │ └── v1beta1
│ │ │ └── group_api.proto
│ └── user
│ │ └── v1beta1
│ │ └── user_api.proto
├── app
│ ├── provider
│ │ └── v1beta1
│ │ │ ├── provider_api.proto
│ │ │ └── resources.proto
│ └── registry
│ │ └── v1beta1
│ │ ├── registry_api.proto
│ │ └── resources.proto
├── auth
│ ├── applications
│ │ └── v1beta1
│ │ │ ├── applications_api.proto
│ │ │ └── resources.proto
│ ├── provider
│ │ └── v1beta1
│ │ │ ├── provider_api.proto
│ │ │ └── resources.proto
│ └── registry
│ │ └── v1beta1
│ │ ├── registry_api.proto
│ │ └── resources.proto
├── gateway
│ └── v1beta1
│ │ ├── gateway_api.proto
│ │ └── resources.proto
├── identity
│ ├── group
│ │ └── v1beta1
│ │ │ ├── group_api.proto
│ │ │ └── resources.proto
│ └── user
│ │ └── v1beta1
│ │ ├── resources.proto
│ │ └── user_api.proto
├── ocm
│ ├── core
│ │ └── v1beta1
│ │ │ └── ocm_core_api.proto
│ ├── invite
│ │ └── v1beta1
│ │ │ ├── invite_api.proto
│ │ │ └── resources.proto
│ └── provider
│ │ └── v1beta1
│ │ ├── provider_api.proto
│ │ └── resources.proto
├── permissions
│ └── v1beta1
│ │ ├── permissions_api.proto
│ │ └── resources.proto
├── preferences
│ └── v1beta1
│ │ ├── preferences_api.proto
│ │ └── resources.proto
├── rpc
│ └── v1beta1
│ │ ├── code.proto
│ │ └── status.proto
├── sharing
│ ├── collaboration
│ │ └── v1beta1
│ │ │ ├── collaboration_api.proto
│ │ │ └── resources.proto
│ ├── link
│ │ └── v1beta1
│ │ │ ├── link_api.proto
│ │ │ └── resources.proto
│ └── ocm
│ │ └── v1beta1
│ │ ├── ocm_api.proto
│ │ └── resources.proto
├── storage
│ ├── provider
│ │ └── v1beta1
│ │ │ ├── provider_api.proto
│ │ │ ├── resources.proto
│ │ │ └── spaces_api.proto
│ └── registry
│ │ └── v1beta1
│ │ ├── registry_api.proto
│ │ └── resources.proto
├── tx
│ └── v1beta1
│ │ ├── resources.proto
│ │ └── tx_api.proto
└── types
│ └── v1beta1
│ └── types.proto
├── docs
└── index.html
├── go.mod
└── tools
└── check-license
└── check-license.go
/.github/workflows/build-and-publish.yml:
--------------------------------------------------------------------------------
1 | ---
2 | name: Build and Publish
3 | on:
4 | push:
5 | branches:
6 | - main
7 | jobs:
8 | build-and-publish:
9 | name: Build and publish
10 | runs-on: ubuntu-latest
11 | container: cs3org/cs3apis-build:master
12 | steps:
13 | - name: Checkout
14 | uses: actions/checkout@v4
15 | - name: setup-ssh
16 | env:
17 | SSH_KEY: ${{ secrets.ssh_key}}
18 | run: |
19 | mkdir /root/.ssh
20 | python3 -c "import os; file = open('/root/.ssh/id_rsa', 'w'); file.write(os.environ['SSH_KEY']); file.close()"
21 | shasum /root/.ssh/id_rsa
22 | chmod 400 /root/.ssh/id_rsa
23 | stat /root/.ssh/id_rsa
24 | touch /root/.ssh/known_hosts
25 | chmod 400 /root/.ssh/known_hosts
26 | ssh-keyscan -H github.com > /etc/ssh/ssh_known_hosts 2> /dev/null
27 |
28 | - name: build-and-publish
29 | run: cs3apis-build -git-ssh -push-go -push-js -push-node -push-python
30 | - name: run-mockery
31 | run: |
32 | cd build/go-cs3apis
33 | git config user.email "cs3org-bot@hugo.labkode.com"
34 | git config user.name "cs3org-bot"
35 | go install github.com/vektra/mockery/v2@v2.40.0 # Later versions are incompatible with Go 1.21
36 | mockery
37 | git add .
38 | git commit -m 'Generated mock interfaces for https://github.com/cern-eos/grpc-proto/tree/${{ github.sha }}' && git push origin main || echo "Nothing to commit"
39 | - name: setup-buf
40 | uses: bufbuild/buf-setup-action@v1
41 | - name: push-buf
42 | uses: bufbuild/buf-push-action@v1
43 | with:
44 | buf_token: ${{ secrets.BUF_TOKEN }}
45 | draft: ${{ github.ref_name != 'main'}}
--------------------------------------------------------------------------------
/.github/workflows/build-only.yml:
--------------------------------------------------------------------------------
1 | ---
2 | name: Build only
3 | on:
4 | pull_request:
5 | branches: [ "main" ]
6 | jobs:
7 | build:
8 | name: Build only
9 | runs-on: ubuntu-latest
10 | container: cs3org/cs3apis-build:master
11 | steps:
12 | - name: Checkout
13 | uses: actions/checkout@v4
14 | - name: build-and-publish
15 | run: cs3apis-build
16 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | prototool.yaml
2 | build
3 | gen
4 |
--------------------------------------------------------------------------------
/CODEOWNERS:
--------------------------------------------------------------------------------
1 | # See https://blog.github.com/2017-07-06-introducing-code-owners/
2 |
3 | * @glpatcern @diocas @jessegeens @labkode
4 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 |
2 | Apache License
3 | Version 2.0, January 2004
4 | http://www.apache.org/licenses/
5 |
6 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
7 |
8 | 1. Definitions.
9 |
10 | "License" shall mean the terms and conditions for use, reproduction,
11 | and distribution as defined by Sections 1 through 9 of this document.
12 |
13 | "Licensor" shall mean the copyright owner or entity authorized by
14 | the copyright owner that is granting the License.
15 |
16 | "Legal Entity" shall mean the union of the acting entity and all
17 | other entities that control, are controlled by, or are under common
18 | control with that entity. For the purposes of this definition,
19 | "control" means (i) the power, direct or indirect, to cause the
20 | direction or management of such entity, whether by contract or
21 | otherwise, or (ii) ownership of fifty percent (50%) or more of the
22 | outstanding shares, or (iii) beneficial ownership of such entity.
23 |
24 | "You" (or "Your") shall mean an individual or Legal Entity
25 | exercising permissions granted by this License.
26 |
27 | "Source" form shall mean the preferred form for making modifications,
28 | including but not limited to software source code, documentation
29 | source, and configuration files.
30 |
31 | "Object" form shall mean any form resulting from mechanical
32 | transformation or translation of a Source form, including but
33 | not limited to compiled object code, generated documentation,
34 | and conversions to other media types.
35 |
36 | "Work" shall mean the work of authorship, whether in Source or
37 | Object form, made available under the License, as indicated by a
38 | copyright notice that is included in or attached to the work
39 | (an example is provided in the Appendix below).
40 |
41 | "Derivative Works" shall mean any work, whether in Source or Object
42 | form, that is based on (or derived from) the Work and for which the
43 | editorial revisions, annotations, elaborations, or other modifications
44 | represent, as a whole, an original work of authorship. For the purposes
45 | of this License, Derivative Works shall not include works that remain
46 | separable from, or merely link (or bind by name) to the interfaces of,
47 | the Work and Derivative Works thereof.
48 |
49 | "Contribution" shall mean any work of authorship, including
50 | the original version of the Work and any modifications or additions
51 | to that Work or Derivative Works thereof, that is intentionally
52 | submitted to Licensor for inclusion in the Work by the copyright owner
53 | or by an individual or Legal Entity authorized to submit on behalf of
54 | the copyright owner. For the purposes of this definition, "submitted"
55 | means any form of electronic, verbal, or written communication sent
56 | to the Licensor or its representatives, including but not limited to
57 | communication on electronic mailing lists, source code control systems,
58 | and issue tracking systems that are managed by, or on behalf of, the
59 | Licensor for the purpose of discussing and improving the Work, but
60 | excluding communication that is conspicuously marked or otherwise
61 | designated in writing by the copyright owner as "Not a Contribution."
62 |
63 | "Contributor" shall mean Licensor and any individual or Legal Entity
64 | on behalf of whom a Contribution has been received by Licensor and
65 | subsequently incorporated within the Work.
66 |
67 | 2. Grant of Copyright License. Subject to the terms and conditions of
68 | this License, each Contributor hereby grants to You a perpetual,
69 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable
70 | copyright license to reproduce, prepare Derivative Works of,
71 | publicly display, publicly perform, sublicense, and distribute the
72 | Work and such Derivative Works in Source or Object form.
73 |
74 | 3. Grant of Patent License. Subject to the terms and conditions of
75 | this License, each Contributor hereby grants to You a perpetual,
76 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable
77 | (except as stated in this section) patent license to make, have made,
78 | use, offer to sell, sell, import, and otherwise transfer the Work,
79 | where such license applies only to those patent claims licensable
80 | by such Contributor that are necessarily infringed by their
81 | Contribution(s) alone or by combination of their Contribution(s)
82 | with the Work to which such Contribution(s) was submitted. If You
83 | institute patent litigation against any entity (including a
84 | cross-claim or counterclaim in a lawsuit) alleging that the Work
85 | or a Contribution incorporated within the Work constitutes direct
86 | or contributory patent infringement, then any patent licenses
87 | granted to You under this License for that Work shall terminate
88 | as of the date such litigation is filed.
89 |
90 | 4. Redistribution. You may reproduce and distribute copies of the
91 | Work or Derivative Works thereof in any medium, with or without
92 | modifications, and in Source or Object form, provided that You
93 | meet the following conditions:
94 |
95 | (a) You must give any other recipients of the Work or
96 | Derivative Works a copy of this License; and
97 |
98 | (b) You must cause any modified files to carry prominent notices
99 | stating that You changed the files; and
100 |
101 | (c) You must retain, in the Source form of any Derivative Works
102 | that You distribute, all copyright, patent, trademark, and
103 | attribution notices from the Source form of the Work,
104 | excluding those notices that do not pertain to any part of
105 | the Derivative Works; and
106 |
107 | (d) If the Work includes a "NOTICE" text file as part of its
108 | distribution, then any Derivative Works that You distribute must
109 | include a readable copy of the attribution notices contained
110 | within such NOTICE file, excluding those notices that do not
111 | pertain to any part of the Derivative Works, in at least one
112 | of the following places: within a NOTICE text file distributed
113 | as part of the Derivative Works; within the Source form or
114 | documentation, if provided along with the Derivative Works; or,
115 | within a display generated by the Derivative Works, if and
116 | wherever such third-party notices normally appear. The contents
117 | of the NOTICE file are for informational purposes only and
118 | do not modify the License. You may add Your own attribution
119 | notices within Derivative Works that You distribute, alongside
120 | or as an addendum to the NOTICE text from the Work, provided
121 | that such additional attribution notices cannot be construed
122 | as modifying the License.
123 |
124 | You may add Your own copyright statement to Your modifications and
125 | may provide additional or different license terms and conditions
126 | for use, reproduction, or distribution of Your modifications, or
127 | for any such Derivative Works as a whole, provided Your use,
128 | reproduction, and distribution of the Work otherwise complies with
129 | the conditions stated in this License.
130 |
131 | 5. Submission of Contributions. Unless You explicitly state otherwise,
132 | any Contribution intentionally submitted for inclusion in the Work
133 | by You to the Licensor shall be under the terms and conditions of
134 | this License, without any additional terms or conditions.
135 | Notwithstanding the above, nothing herein shall supersede or modify
136 | the terms of any separate license agreement you may have executed
137 | with Licensor regarding such Contributions.
138 |
139 | 6. Trademarks. This License does not grant permission to use the trade
140 | names, trademarks, service marks, or product names of the Licensor,
141 | except as required for reasonable and customary use in describing the
142 | origin of the Work and reproducing the content of the NOTICE file.
143 |
144 | 7. Disclaimer of Warranty. Unless required by applicable law or
145 | agreed to in writing, Licensor provides the Work (and each
146 | Contributor provides its Contributions) on an "AS IS" BASIS,
147 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
148 | implied, including, without limitation, any warranties or conditions
149 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
150 | PARTICULAR PURPOSE. You are solely responsible for determining the
151 | appropriateness of using or redistributing the Work and assume any
152 | risks associated with Your exercise of permissions under this License.
153 |
154 | 8. Limitation of Liability. In no event and under no legal theory,
155 | whether in tort (including negligence), contract, or otherwise,
156 | unless required by applicable law (such as deliberate and grossly
157 | negligent acts) or agreed to in writing, shall any Contributor be
158 | liable to You for damages, including any direct, indirect, special,
159 | incidental, or consequential damages of any character arising as a
160 | result of this License or out of the use or inability to use the
161 | Work (including but not limited to damages for loss of goodwill,
162 | work stoppage, computer failure or malfunction, or any and all
163 | other commercial damages or losses), even if such Contributor
164 | has been advised of the possibility of such damages.
165 |
166 | 9. Accepting Warranty or Additional Liability. While redistributing
167 | the Work or Derivative Works thereof, You may choose to offer,
168 | and charge a fee for, acceptance of support, warranty, indemnity,
169 | or other liability obligations and/or rights consistent with this
170 | License. However, in accepting such obligations, You may act only
171 | on Your own behalf and on Your sole responsibility, not on behalf
172 | of any other Contributor, and only if You agree to indemnify,
173 | defend, and hold each Contributor harmless for any liability
174 | incurred by, or claims asserted against, such Contributor by reason
175 | of your accepting any such warranty or additional liability.
176 |
177 | END OF TERMS AND CONDITIONS
178 |
179 | APPENDIX: How to apply the Apache License to your work.
180 |
181 | To apply the Apache License to your work, attach the following
182 | boilerplate notice, with the fields enclosed by brackets "[]"
183 | replaced with your own identifying information. (Don't include
184 | the brackets!) The text should be enclosed in the appropriate
185 | comment syntax for the file format. We also recommend that a
186 | file or class name and description of purpose be included on the
187 | same "printed page" as the copyright notice for easier
188 | identification within third-party archives.
189 |
190 | Copyright [yyyy] [name of copyright owner]
191 |
192 | Licensed under the Apache License, Version 2.0 (the "License");
193 | you may not use this file except in compliance with the License.
194 | You may obtain a copy of the License at
195 |
196 | http://www.apache.org/licenses/LICENSE-2.0
197 |
198 | Unless required by applicable law or agreed to in writing, software
199 | distributed under the License is distributed on an "AS IS" BASIS,
200 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
201 | See the License for the specific language governing permissions and
202 | limitations under the License.
203 |
204 |
--------------------------------------------------------------------------------
/Makefile:
--------------------------------------------------------------------------------
1 | pwd = $(shell pwd)
2 | default: gen
3 |
4 | gen:
5 | echo ${pwd}
6 | docker run -v ${pwd}:/root/cs3apis cs3org/cs3apis-build:master cs3apis-build
7 |
8 | clean:
9 | rm -rf build/
10 | all: gen clean
11 |
12 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | [](https://opensource.org/licenses/Apache-2.0) [](https://gitter.im/cs3org/cs3apis) [](https://github.com/cs3org/cs3apis/actions/workflows/build-and-publish.yml)
2 | ================
3 |
4 |
5 |
6 | The CS3APIS connect Storage and Applications Providers.
7 |
8 | ## API Documentation
9 | https://buf.build/cs3org-buf/cs3apis
10 |
11 | ## Officialy compiled libraries
12 | The libraries for different languages are compiled from the protobuf definitions in this repo.
13 | When a commit to master is made the CI takes care to create a new version of the library in the following languages.
14 | Please note that the versioning used in the libraries below differs from language to language, however they point to the
15 | same source commit. This is due to the way the different package managers handle package versions.
16 |
17 | * Go: https://github.com/cs3org/go-cs3apis
18 | * Python: https://github.com/cs3org/python-cs3apis
19 | * Javascript: https://github.com/cs3org/js-cs3apis (to be used from Web applications - frontend usage only)
20 | * NodeJS: https://github.com/cs3org/node-cs3apis (to be used from NodeJS applications - backend)
21 |
22 | ## Repository packages
23 | * Go: https://pkg.go.dev/github.com/cs3org/go-cs3apis
24 | * Python: https://pypi.org/project/cs3apis/
25 | * Javascript: https://www.npmjs.com/package/@cs3org/cs3apis
26 | * NodeJS: https://www.npmjs.com/package/@cs3org/node-cs3apis
27 |
28 |
29 | ## Local compilation
30 |
31 | You need to have Docker installed. The artifacts will be available under the build directory.
32 |
33 | ```
34 | $ git clone https://github.com/cs3org/cs3apis
35 | $ cd cs3apis
36 | $ make
37 | ```
38 | The `build` folder will be generated. It will be owned by `root`.
39 |
40 | See the Makefile to find all the available build options.
41 |
42 | ## Overview
43 |
44 | This repository contains the interface definitions of public
45 | CS3APIS that support the gRPC protocol.
46 | You can also use these definitions with open source tools to generate client
47 | libraries, documentation, and other artifacts.
48 |
49 | CS3 APIs use [Protocol Buffers](https://github.com/google/protobuf)
50 | version 3 (proto3) as their Interface Definition Language (IDL) to
51 | define the API interface and the structure of the payload messages.
52 |
53 | ## Repository Structure
54 |
55 | This repository uses a directory hierarchy that reflects the CS3
56 | feature set. In general, every API has its own root
57 | directory, and each major version of the API has its own subdirectory.
58 | The proto package names exactly match the directory: this makes it
59 | easy to locate the proto definitions and ensures that the generated
60 | client libraries have idiomatic namespaces in most programming
61 | languages.
62 |
63 | **NOTE:** The major version of an API is used to indicate breaking
64 | change to the API.
65 |
--------------------------------------------------------------------------------
/buf.gen.yaml:
--------------------------------------------------------------------------------
1 | version: v1
2 | plugins:
3 | - plugin: buf.build/protocolbuffers/go:v1.31.0
4 | out: build/go-cs3apis
5 | opt: paths=source_relative
6 |
7 | - plugin: buf.build/grpc/go:v1.3.0
8 | out: build/go-cs3apis
9 | opt: paths=source_relative,require_unimplemented_servers=false
10 |
11 | - plugin: buf.build/grpc/web:v1.5.0
12 | out: build/js-cs3apis
13 | opt: mode=grpcweb
14 |
15 | - plugin: buf.build/protocolbuffers/js:v3.21.2
16 | out: build/js-cs3apis
17 |
18 | - plugin: buf.build/grpc/python:v1.59.2
19 | out: build/python-cs3apis
20 | - plugin: buf.build/protocolbuffers/python:v25.0
21 | out: build/python-cs3apis
22 |
23 | - plugin: buf.build/grpc/node:v1.12.4
24 | out: build/node-cs3apis
25 |
26 | managed:
27 | enabled: true
28 | go_package_prefix:
29 | default: github.com/cs3org/go-cs3apis
30 |
--------------------------------------------------------------------------------
/buf.lock:
--------------------------------------------------------------------------------
1 | # Generated by buf. DO NOT EDIT.
2 | version: v1
3 | deps:
4 | - remote: buf.build
5 | owner: protocolbuffers
6 | repository: wellknowntypes
7 | commit: f17e05fe4a764a3482b8e033daec742e
8 | digest: shake256:886495c560d96bc48bef49e17e3d33430fa1f6c735b0cee40ef83161824b01c2d2f342d81ca02aadeed52aa3cf4a8273d5ab9584fbb595b71e7e44240caedb00
9 |
--------------------------------------------------------------------------------
/buf.md:
--------------------------------------------------------------------------------
1 | This is the official documention for the CS3APIs.
2 |
--------------------------------------------------------------------------------
/buf.yaml:
--------------------------------------------------------------------------------
1 | version: v1
2 | name: buf.build/cs3org-buf/cs3apis
3 | deps:
4 | - buf.build/protocolbuffers/wellknowntypes:v21.12
5 | lint:
6 | use:
7 | - DEFAULT
8 | enum_zero_value_suffix: _INVALID
9 | service_suffix: API
10 | build:
11 | excludes:
12 | - docs
13 | - tools
14 |
15 |
--------------------------------------------------------------------------------
/cs3/admin/group/v1beta1/group_api.proto:
--------------------------------------------------------------------------------
1 | // Copyright 2018-2019 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.admin.group.v1beta1;
22 |
23 | import "cs3/identity/group/v1beta1/resources.proto";
24 | import "cs3/identity/user/v1beta1/resources.proto";
25 | import "cs3/rpc/v1beta1/status.proto";
26 | import "cs3/types/v1beta1/types.proto";
27 |
28 | option csharp_namespace = "Cs3.Admin.Group.V1Beta1";
29 | option go_package = "groupv1beta1";
30 | option java_multiple_files = true;
31 | option java_outer_classname = "GroupApiProto";
32 | option java_package = "com.cs3.admin.group.v1beta1";
33 | option objc_class_prefix = "CAG";
34 | option php_namespace = "Cs3\\Admin\\Group\\V1Beta1";
35 |
36 | // Provides a write only API for managing groups.
37 | service GroupAPI {
38 | // Create a group.
39 | rpc CreateGroup(CreateGroupRequest) returns (CreateGroupResponse);
40 | // Delete a group.
41 | rpc DeleteGroup(DeleteGroupRequest) returns (DeleteGroupResponse);
42 | // Add a user to a group.
43 | rpc AddUserToGroup(AddUserToGroupRequest) returns (AddUserToGroupResponse);
44 | // Remove a user from a group.
45 | rpc RemoveUserFromGroup(RemoveUserFromGroupRequest) returns (RemoveUserFromGroupResponse);
46 | }
47 |
48 | message CreateGroupRequest {
49 | // OPTIONAL.
50 | // Opaque information. Allow to send any arbitrary data a service might use that is outside the API boundaries
51 | cs3.types.v1beta1.Opaque opaque = 1;
52 | // REQUIRED.
53 | // The information of group to be created.
54 | cs3.identity.group.v1beta1.Group group = 2;
55 | }
56 |
57 | message CreateGroupResponse {
58 | // REQUIRED.
59 | // The response status.
60 | cs3.rpc.v1beta1.Status status = 1;
61 | // OPTIONAL.
62 | // Opaque information.
63 | cs3.types.v1beta1.Opaque opaque = 2;
64 | // REQUIRED.
65 | // The group information.
66 | cs3.identity.group.v1beta1.Group group = 3;
67 | }
68 |
69 | message DeleteGroupRequest {
70 | // OPTIONAL.
71 | // Opaque information. Allow to send any arbitrary data a service might use that is outside the API boundaries.
72 | cs3.types.v1beta1.Opaque opaque = 1;
73 | // REQUIRED.
74 | // The group to be deleted, given their ID.
75 | cs3.identity.group.v1beta1.GroupId group_id = 2;
76 | }
77 |
78 | message DeleteGroupResponse {
79 | // REQUIRED.
80 | // The response status.
81 | cs3.rpc.v1beta1.Status status = 1;
82 | // OPTIONAL.
83 | // Opaque information.
84 | cs3.types.v1beta1.Opaque opaque = 2;
85 | }
86 |
87 | message AddUserToGroupRequest {
88 | // REQUIRED.
89 | // ID of the user to add to the group
90 | cs3.identity.user.v1beta1.UserId user_id = 1;
91 | // REQUIRED.
92 | // ID of the target group.
93 | cs3.identity.group.v1beta1.GroupId group_id = 2;
94 | // OPTIONAL.
95 | // Opaque information.
96 | cs3.types.v1beta1.Opaque opaque = 3;
97 | }
98 |
99 | message AddUserToGroupResponse {
100 | // REQUIRED.
101 | // The response status.
102 | cs3.rpc.v1beta1.Status status = 1;
103 | // OPTIONAL.
104 | // Opaque information.
105 | cs3.types.v1beta1.Opaque opaque = 2;
106 | }
107 |
108 | message RemoveUserFromGroupRequest {
109 | // REQUIRED.
110 | // ID of the user to add to the group
111 | cs3.identity.user.v1beta1.UserId user_id = 1;
112 | // REQUIRED.
113 | // ID of the target group.
114 | cs3.identity.group.v1beta1.GroupId group_id = 2;
115 | // OPTIONAL.
116 | // Opaque information.
117 | cs3.types.v1beta1.Opaque opaque = 3;
118 | }
119 |
120 | message RemoveUserFromGroupResponse {
121 | // REQUIRED.
122 | // The response status.
123 | cs3.rpc.v1beta1.Status status = 1;
124 | // OPTIONAL.
125 | // Opaque information.
126 | cs3.types.v1beta1.Opaque opaque = 2;
127 | }
128 |
--------------------------------------------------------------------------------
/cs3/admin/user/v1beta1/user_api.proto:
--------------------------------------------------------------------------------
1 | // Copyright 2018-2019 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.admin.user.v1beta1;
22 |
23 | import "cs3/identity/user/v1beta1/resources.proto";
24 | import "cs3/rpc/v1beta1/status.proto";
25 | import "cs3/types/v1beta1/types.proto";
26 |
27 | option csharp_namespace = "Cs3.Admin.User.V1Beta1";
28 | option go_package = "userv1beta1";
29 | option java_multiple_files = true;
30 | option java_outer_classname = "UserApiProto";
31 | option java_package = "com.cs3.admin.user.v1beta1";
32 | option objc_class_prefix = "CAU";
33 | option php_namespace = "Cs3\\Admin\\User\\V1Beta1";
34 |
35 | // Provides a write only API for managing users.
36 | service UserAPI {
37 | // Create a user account.
38 | rpc CreateUser(CreateUserRequest) returns (CreateUserResponse);
39 | // Delete a user account.
40 | rpc DeleteUser(DeleteUserRequest) returns (DeleteUserResponse);
41 | }
42 |
43 | message CreateUserRequest {
44 | // OPTIONAL.
45 | // Opaque information. Allow to send any arbitrary data a service might use that is outside the API boundaries
46 | cs3.types.v1beta1.Opaque opaque = 1;
47 | // REQUIRED.
48 | // The information of user to be created.
49 | cs3.identity.user.v1beta1.User user = 2;
50 | }
51 |
52 | message CreateUserResponse {
53 | // REQUIRED.
54 | // The response status.
55 | cs3.rpc.v1beta1.Status status = 1;
56 | // OPTIONAL.
57 | // Opaque information.
58 | cs3.types.v1beta1.Opaque opaque = 2;
59 | // REQUIRED.
60 | // The user information.
61 | cs3.identity.user.v1beta1.User user = 3;
62 | }
63 |
64 | message DeleteUserRequest {
65 | // OPTIONAL.
66 | // Opaque information. Allow to send any arbitrary data a service might use that is outside the API boundaries
67 | cs3.types.v1beta1.Opaque opaque = 1;
68 | // REQUIRED.
69 | // The user to be deleted, given their ID.
70 | cs3.identity.user.v1beta1.UserId user_id = 2;
71 | }
72 |
73 | message DeleteUserResponse {
74 | // REQUIRED.
75 | // The response status.
76 | cs3.rpc.v1beta1.Status status = 1;
77 | // OPTIONAL.
78 | // Opaque information.
79 | cs3.types.v1beta1.Opaque opaque = 2;
80 | }
81 |
--------------------------------------------------------------------------------
/cs3/app/provider/v1beta1/provider_api.proto:
--------------------------------------------------------------------------------
1 | // Copyright 2018-2019 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.app.provider.v1beta1;
22 |
23 | import "cs3/app/provider/v1beta1/resources.proto";
24 | import "cs3/rpc/v1beta1/status.proto";
25 | import "cs3/storage/provider/v1beta1/resources.proto";
26 | import "cs3/types/v1beta1/types.proto";
27 |
28 | option csharp_namespace = "Cs3.App.Provider.V1Beta1";
29 | option go_package = "providerv1beta1";
30 | option java_multiple_files = true;
31 | option java_outer_classname = "ProviderApiProto";
32 | option java_package = "com.cs3.app.provider.v1beta1";
33 | option objc_class_prefix = "CAP";
34 | option php_namespace = "Cs3\\App\\Provider\\V1Beta1";
35 |
36 | //import "cs3/appprovider/v1beta1/resources.proto";
37 |
38 | // App Provider API
39 | //
40 | // The App Provider API is responsible for creating URLs that
41 | // will render a viewer or editor for the given resource, typically via WOPI protocol.
42 | // For example, a Collabora or HackMD editor.
43 | //
44 | // The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL
45 | // NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and
46 | // "OPTIONAL" in this document are to be interpreted as described in
47 | // RFC 2119.
48 | //
49 | // The following are global requirements that apply to all methods:
50 | // Any method MUST return CODE_OK on a succesful operation.
51 | // Any method MAY return NOT_IMPLEMENTED.
52 | // Any method MAY return INTERNAL.
53 | // Any method MAY return UNKNOWN.
54 | // Any method MAY return UNAUTHENTICATED.
55 | service ProviderAPI {
56 | // Returns the App URL and all necessary info to open a resource in an online editor.
57 | // MUST return CODE_NOT_FOUND if the resource does not exist.
58 | rpc OpenInApp(OpenInAppRequest) returns (OpenInAppResponse);
59 | }
60 |
61 | message OpenInAppRequest {
62 | // OPTIONAL.
63 | // Opaque information.
64 | cs3.types.v1beta1.Opaque opaque = 1;
65 | // REQUIRED.
66 | // The resourceInfo to be opened. The gateway grpc message has a ref instead.
67 | storage.provider.v1beta1.ResourceInfo resource_info = 2;
68 | // REQUIRED.
69 | // View mode.
70 | ViewMode view_mode = 3;
71 | // REQUIRED.
72 | // The access token this application provider will use when contacting
73 | // the storage provider to read and write.
74 | // Service implementors MUST make sure that the access token only grants
75 | // access to the requested resource.
76 | // Service implementors should use a ResourceId rather than a filepath to grant access, as
77 | // ResourceIds MUST NOT change when a resource is renamed.
78 | // The access token MUST be short-lived.
79 | // TODO(labkode): investigate token derivation techniques.
80 | string access_token = 4;
81 | }
82 |
83 | message OpenInAppResponse {
84 | // REQUIRED.
85 | // The response status.
86 | cs3.rpc.v1beta1.Status status = 1;
87 | // OPTIONAL.
88 | // Opaque information.
89 | cs3.types.v1beta1.Opaque opaque = 2;
90 | // REQUIRED.
91 | // The url that user agents will render to clients.
92 | // Usually the rendering happens by using HTML iframes or in separate browser tabs.
93 | OpenInAppURL app_url = 3;
94 | }
95 |
--------------------------------------------------------------------------------
/cs3/app/provider/v1beta1/resources.proto:
--------------------------------------------------------------------------------
1 | // Copyright 2018-2019 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.app.provider.v1beta1;
22 |
23 | option csharp_namespace = "Cs3.App.Provider.V1Beta1";
24 | option go_package = "providerv1beta1";
25 | option java_multiple_files = true;
26 | option java_outer_classname = "ResourcesProto";
27 | option java_package = "com.cs3.app.provider.v1beta1";
28 | option objc_class_prefix = "CAP";
29 | option php_namespace = "Cs3\\App\\Provider\\V1Beta1";
30 |
31 | // Represents the information for the app URL to be called by the clients.
32 | message OpenInAppURL {
33 | // REQUIRED.
34 | // The URL that clients will perform requests to.
35 | string app_url = 1;
36 | // REQUIRED.
37 | // The method for the request to be made.
38 | // Only GET and POST are supported.
39 | string method = 2;
40 | // OPTIONAL.
41 | // The form parameters which have to be passed along with the request.
42 | // These are sent only if the method is 'POST'.
43 | map form_parameters = 3;
44 | // OPTIONAL.
45 | // The headers to be added to the request.
46 | map headers = 4;
47 | // REQUIRED.
48 | // Whether the target for the app URL is an iframe or a new page.
49 | Target target = 5;
50 | }
51 |
52 | // Defines the view modes.
53 | enum ViewMode {
54 | VIEW_MODE_INVALID = 0;
55 | // The resource can be opened but not downloaded.
56 | VIEW_MODE_VIEW_ONLY = 1;
57 | // The resource can be downloaded.
58 | VIEW_MODE_READ_ONLY = 2;
59 | // The resource can be downloaded and updated. The underlying application
60 | // MUST be a fully capable editor to support this mode.
61 | VIEW_MODE_READ_WRITE = 3;
62 | // The resource can be downloaded and updated, but must be shown in
63 | // preview mode. If the underlying application does not support a preview mode,
64 | // or if in a view-only mode users are not allowed to switch to edit mode,
65 | // then this mode MUST fall back to READ_WRITE.
66 | VIEW_MODE_PREVIEW = 4;
67 | }
68 |
69 | // Defines the valid targets for an app URL.
70 | enum Target {
71 | TARGET_INVALID = 0;
72 | // The app URL is to be opened within an iframe
73 | TARGET_IFRAME = 1;
74 | // The app URL is to be opened on a new blank page
75 | TARGET_BLANK = 2;
76 | }
77 |
--------------------------------------------------------------------------------
/cs3/app/registry/v1beta1/registry_api.proto:
--------------------------------------------------------------------------------
1 | // Copyright 2018-2019 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.app.registry.v1beta1;
22 |
23 | import "cs3/app/registry/v1beta1/resources.proto";
24 | import "cs3/rpc/v1beta1/status.proto";
25 | import "cs3/storage/provider/v1beta1/resources.proto";
26 | import "cs3/types/v1beta1/types.proto";
27 |
28 | option csharp_namespace = "Cs3.App.Registry.V1Beta1";
29 | option go_package = "registryv1beta1";
30 | option java_multiple_files = true;
31 | option java_outer_classname = "RegistryApiProto";
32 | option java_package = "com.cs3.app.registry.v1beta1";
33 | option objc_class_prefix = "CAR";
34 | option php_namespace = "Cs3\\App\\Registry\\V1Beta1";
35 |
36 | // App Registry API
37 | //
38 | // The App Registry API is meant to as registry that
39 | // contains mappings between mime types and app providers.
40 | //
41 | // The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL
42 | // NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and
43 | // "OPTIONAL" in this document are to be interpreted as described in
44 | // RFC 2119.
45 | //
46 | // The following are global requirements that apply to all methods:
47 | // Any method MUST return CODE_OK on a succesful operation.
48 | // Any method MAY return NOT_IMPLEMENTED.
49 | // Any method MAY return INTERNAL.
50 | // Any method MAY return UNKNOWN.
51 | // Any method MAY return UNAUTHENTICATED.
52 | service RegistryAPI {
53 | // Returns the app providers that are capable of handling this resource info.
54 | // MUST return CODE_NOT_FOUND if no providers are available.
55 | rpc GetAppProviders(GetAppProvidersRequest) returns (GetAppProvidersResponse);
56 | // Registers a new app provider to the registry.
57 | rpc AddAppProvider(AddAppProviderRequest) returns (AddAppProviderResponse);
58 | // Returns a list of the available app providers known by this registry.
59 | rpc ListAppProviders(ListAppProvidersRequest) returns (ListAppProvidersResponse);
60 | // Returns a list of the supported mime types along with the apps which they can be opened with.
61 | rpc ListSupportedMimeTypes(ListSupportedMimeTypesRequest) returns (ListSupportedMimeTypesResponse);
62 | // Returns the default app provider which serves a specified mime type.
63 | rpc GetDefaultAppProviderForMimeType(GetDefaultAppProviderForMimeTypeRequest) returns (GetDefaultAppProviderForMimeTypeResponse);
64 | // Sets the default app provider for a specified mime type.
65 | rpc SetDefaultAppProviderForMimeType(SetDefaultAppProviderForMimeTypeRequest) returns (SetDefaultAppProviderForMimeTypeResponse);
66 | }
67 |
68 | message GetAppProvidersRequest {
69 | // OPTIONAL.
70 | // Opaque information.
71 | cs3.types.v1beta1.Opaque opaque = 1;
72 | // REQUIRED.
73 | // The resource information.
74 | storage.provider.v1beta1.ResourceInfo resource_info = 2;
75 | }
76 |
77 | message GetAppProvidersResponse {
78 | // REQUIRED.
79 | // The response status.
80 | cs3.rpc.v1beta1.Status status = 1;
81 | // OPTIONAL.
82 | // Opaque information.
83 | cs3.types.v1beta1.Opaque opaque = 2;
84 | // REQUIRED.
85 | // The app providers available for the given resource info.
86 | repeated ProviderInfo providers = 3;
87 | }
88 |
89 | message AddAppProviderRequest {
90 | // OPTIONAL.
91 | // Opaque information.
92 | cs3.types.v1beta1.Opaque opaque = 1;
93 | // REQUIRED.
94 | // The app provider to be registered.
95 | ProviderInfo provider = 2;
96 | }
97 |
98 | message AddAppProviderResponse {
99 | // REQUIRED.
100 | // The response status.
101 | cs3.rpc.v1beta1.Status status = 1;
102 | // OPTIONAL.
103 | // Opaque information.
104 | cs3.types.v1beta1.Opaque opaque = 2;
105 | }
106 |
107 | message ListAppProvidersRequest {
108 | // OPTIONAL.
109 | // Opaque information.
110 | cs3.types.v1beta1.Opaque opaque = 1;
111 | }
112 |
113 | message ListAppProvidersResponse {
114 | // REQUIRED.
115 | // The response status.
116 | cs3.rpc.v1beta1.Status status = 1;
117 | // OPTIONAL.
118 | // Opaque information.
119 | cs3.types.v1beta1.Opaque opaque = 2;
120 | // REQUIRED.
121 | // The list of app providers this registry knows about.
122 | repeated ProviderInfo providers = 3;
123 | }
124 |
125 | message ListSupportedMimeTypesRequest {
126 | // OPTIONAL.
127 | // Opaque information.
128 | cs3.types.v1beta1.Opaque opaque = 1;
129 | }
130 |
131 | message ListSupportedMimeTypesResponse {
132 | // REQUIRED.
133 | // The response status.
134 | cs3.rpc.v1beta1.Status status = 1;
135 | // OPTIONAL.
136 | // Opaque information.
137 | cs3.types.v1beta1.Opaque opaque = 2;
138 | // REQUIRED.
139 | // The list of supported mime types and their properties.
140 | repeated MimeTypeInfo mime_types = 3;
141 | }
142 |
143 | message GetDefaultAppProviderForMimeTypeRequest {
144 | // OPTIONAL.
145 | // Opaque information.
146 | cs3.types.v1beta1.Opaque opaque = 1;
147 | // REQUIRED.
148 | // The mimetype for which the default app has to be returned.
149 | string mime_type = 2;
150 | }
151 |
152 | message GetDefaultAppProviderForMimeTypeResponse {
153 | // REQUIRED.
154 | // The response status.
155 | cs3.rpc.v1beta1.Status status = 1;
156 | // OPTIONAL.
157 | // Opaque information.
158 | cs3.types.v1beta1.Opaque opaque = 2;
159 | // REQUIRED.
160 | // The default app provider for the specified mime type.
161 | ProviderInfo provider = 3;
162 | }
163 |
164 | message SetDefaultAppProviderForMimeTypeRequest {
165 | // OPTIONAL.
166 | // Opaque information.
167 | cs3.types.v1beta1.Opaque opaque = 1;
168 | // REQUIRED.
169 | // The mimetype for which the default app has to be returned.
170 | string mime_type = 2;
171 | // REQUIRED.
172 | // The app provider to be marked as default for the specified mime type.
173 | ProviderInfo provider = 3;
174 | }
175 |
176 | message SetDefaultAppProviderForMimeTypeResponse {
177 | // REQUIRED.
178 | // The response status.
179 | cs3.rpc.v1beta1.Status status = 1;
180 | // OPTIONAL.
181 | // Opaque information.
182 | cs3.types.v1beta1.Opaque opaque = 2;
183 | }
184 |
--------------------------------------------------------------------------------
/cs3/app/registry/v1beta1/resources.proto:
--------------------------------------------------------------------------------
1 | // Copyright 2018-2019 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.app.registry.v1beta1;
22 |
23 | import "cs3/types/v1beta1/types.proto";
24 |
25 | option csharp_namespace = "Cs3.App.Registry.V1Beta1";
26 | option go_package = "registryv1beta1";
27 | option java_multiple_files = true;
28 | option java_outer_classname = "ResourcesProto";
29 | option java_package = "com.cs3.app.registry.v1beta1";
30 | option objc_class_prefix = "CAR";
31 | option php_namespace = "Cs3\\App\\Registry\\V1Beta1";
32 |
33 | // Represents the information of the app provider.
34 | message ProviderInfo {
35 | // OPTIONAL.
36 | // Opaque information.
37 | cs3.types.v1beta1.Opaque opaque = 1;
38 | // REQUIRED.
39 | // The mimetypes handled by this provider.
40 | repeated string mime_types = 2;
41 | // REQUIRED.
42 | // The address where the app provider can be reached.
43 | // For example, localhost:1099.
44 | string address = 3;
45 | // REQUIRED.
46 | // The capability of the underlying app.
47 | enum Capability {
48 | CAPABILITY_INVALID = 0;
49 | // The app is a simple viewer.
50 | CAPABILITY_VIEWER = 1;
51 | // The app is a full editor.
52 | CAPABILITY_EDITOR = 2;
53 | }
54 | Capability capability = 4;
55 | // OPTIONAL.
56 | // A human-readable name of the underlying app.
57 | string name = 5;
58 | // OPTIONAL.
59 | // Information to describe the functionalities
60 | // offered by the underlying app. Meant to be read
61 | // by humans.
62 | string description = 6;
63 | // OPTIONAL.
64 | // A URI to a static asset which represents the app icon.
65 | string icon = 7;
66 | // OPTIONAL.
67 | // Whether the app can be opened only on desktop
68 | bool desktop_only = 8;
69 | // OPTIONAL.
70 | // The action to be displayed to the user on the context menu.
71 | // By default this is "Open with".
72 | string action = 9;
73 | // REQUIRED.
74 | // The product name of the underlying app, to be used to handle
75 | // product-specific differences.
76 | // For example: Collabora, OnlyOffice, Microsoft365 or MicrosoftOfficeOnline
77 | string product_name = 10;
78 | }
79 |
80 | // Represents a mime type and its corresponding file extension.
81 | message MimeTypeInfo {
82 | // OPTIONAL.
83 | // Opaque information.
84 | cs3.types.v1beta1.Opaque opaque = 1;
85 | // REQUIRED.
86 | // The mime type.
87 | string mime_type = 2;
88 | // REQUIRED.
89 | // The file extension mapped to this mime type.
90 | string ext = 3;
91 | // REQUIRED.
92 | // The list of app providers which can open this mime type
93 | repeated ProviderInfo app_providers = 4;
94 | // OPTIONAL.
95 | // The friendly name of this mime type.
96 | string name = 5;
97 | // OPTIONAL.
98 | // Human-readable information to describe the mime type.
99 | string description = 6;
100 | // OPTIONAL.
101 | // A URI to a static asset which represents the mime type icon.
102 | string icon = 7;
103 | // OPTIONAL.
104 | // Whether the mime type is eligible for file creation in the web UI.
105 | // Defaults to false, i.e. files with this mime type can be opened
106 | // but not directly created from the web UI.
107 | bool allow_creation = 8;
108 | // OPTIONAL.
109 | // name of the default application to open this mime type
110 | string default_application = 9;
111 | }
112 |
--------------------------------------------------------------------------------
/cs3/auth/applications/v1beta1/applications_api.proto:
--------------------------------------------------------------------------------
1 | // Copyright 2018-2019 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.auth.applications.v1beta1;
22 |
23 | import "cs3/auth/applications/v1beta1/resources.proto";
24 | import "cs3/auth/provider/v1beta1/resources.proto";
25 | import "cs3/identity/user/v1beta1/resources.proto";
26 | import "cs3/rpc/v1beta1/status.proto";
27 | import "cs3/types/v1beta1/types.proto";
28 |
29 | option csharp_namespace = "Cs3.Auth.Applications.V1Beta1";
30 | option go_package = "applicationsv1beta1";
31 | option java_multiple_files = true;
32 | option java_outer_classname = "ApplicationsApiProto";
33 | option java_package = "com.cs3.auth.applications.v1beta1";
34 | option objc_class_prefix = "CAA";
35 | option php_namespace = "Cs3\\Auth\\Applications\\V1Beta1";
36 |
37 | // Auth Applications API
38 | //
39 | // The Auth Applications API is meant to generate and manage authentication
40 | // tokens with specified scopes to be used in third-party applications on behalf
41 | // of the user.
42 | //
43 | // The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL
44 | // NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and
45 | // "OPTIONAL" in this document are to be interpreted as described in
46 | // RFC 2119.
47 | //
48 | // The following are global requirements that apply to all methods:
49 | // Any method MUST return CODE_OK on a succesful operation.
50 | // Any method MAY return NOT_IMPLEMENTED.
51 | // Any method MAY return INTERNAL.
52 | // Any method MAY return UNKNOWN.
53 | // Any method MAY return UNAUTHENTICATED.
54 | service ApplicationsAPI {
55 | // GenerateAppPassword creates a password with specified scope to be used by
56 | // third-party applications.
57 | rpc GenerateAppPassword(GenerateAppPasswordRequest) returns (GenerateAppPasswordResponse);
58 | // ListAppPasswords lists the application passwords created by a user.
59 | rpc ListAppPasswords(ListAppPasswordsRequest) returns (ListAppPasswordsResponse);
60 | // InvalidateAppPassword invalidates a generated password.
61 | rpc InvalidateAppPassword(InvalidateAppPasswordRequest) returns (InvalidateAppPasswordResponse);
62 | // GetAppPassword retrieves the password information by the combination of username and password.
63 | rpc GetAppPassword(GetAppPasswordRequest) returns (GetAppPasswordResponse);
64 | }
65 |
66 | message GenerateAppPasswordRequest {
67 | // OPTIONAL.
68 | // Opaque information.
69 | cs3.types.v1beta1.Opaque opaque = 1;
70 | // OPTIONAL.
71 | // The scope of the token to be issued.
72 | // This would be a list of resources with corresponding role-based access scope.
73 | map token_scope = 2;
74 | // OPTIONAL.
75 | // A label to be associated with the password.
76 | string label = 3;
77 | // OPTIONAL.
78 | // The time when the token will expire.
79 | cs3.types.v1beta1.Timestamp expiration = 4;
80 | }
81 |
82 | message GenerateAppPasswordResponse {
83 | // REQUIRED.
84 | // The response status.
85 | cs3.rpc.v1beta1.Status status = 1;
86 | // OPTIONAL.
87 | // Opaque information.
88 | cs3.types.v1beta1.Opaque opaque = 2;
89 | // REQUIRED.
90 | // The generated access password.
91 | AppPassword app_password = 3;
92 | }
93 |
94 | message ListAppPasswordsRequest {
95 | // OPTIONAL.
96 | // Opaque information.
97 | cs3.types.v1beta1.Opaque opaque = 1;
98 | }
99 |
100 | message ListAppPasswordsResponse {
101 | // REQUIRED.
102 | // The response status.
103 | cs3.rpc.v1beta1.Status status = 1;
104 | // OPTIONAL.
105 | // Opaque information.
106 | cs3.types.v1beta1.Opaque opaque = 2;
107 | // REQUIRED.
108 | // The generated access password.
109 | repeated AppPassword app_passwords = 3;
110 | }
111 |
112 | message InvalidateAppPasswordRequest {
113 | // OPTIONAL.
114 | // Opaque information.
115 | cs3.types.v1beta1.Opaque opaque = 1;
116 | // REQUIRED.
117 | // The password which has to be invalidated.
118 | string password = 2;
119 | }
120 |
121 | message InvalidateAppPasswordResponse {
122 | // REQUIRED.
123 | // The response status.
124 | cs3.rpc.v1beta1.Status status = 1;
125 | // OPTIONAL.
126 | // Opaque information.
127 | cs3.types.v1beta1.Opaque opaque = 2;
128 | }
129 |
130 | message GetAppPasswordRequest {
131 | // OPTIONAL.
132 | // Opaque information.
133 | cs3.types.v1beta1.Opaque opaque = 1;
134 | // REQUIRED.
135 | // The user who created the app password.
136 | cs3.identity.user.v1beta1.UserId user = 2;
137 | // REQUIRED.
138 | // The password which has to be retrieved.
139 | string password = 3;
140 | }
141 |
142 | message GetAppPasswordResponse {
143 | // REQUIRED.
144 | // The response status.
145 | cs3.rpc.v1beta1.Status status = 1;
146 | // OPTIONAL.
147 | // Opaque information.
148 | cs3.types.v1beta1.Opaque opaque = 2;
149 | // REQUIRED.
150 | // The generated access password.
151 | AppPassword app_password = 3;
152 | }
153 |
--------------------------------------------------------------------------------
/cs3/auth/applications/v1beta1/resources.proto:
--------------------------------------------------------------------------------
1 | // Copyright 2018-2019 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.auth.applications.v1beta1;
22 |
23 | import "cs3/auth/provider/v1beta1/resources.proto";
24 | import "cs3/identity/user/v1beta1/resources.proto";
25 | import "cs3/types/v1beta1/types.proto";
26 |
27 | option csharp_namespace = "Cs3.Auth.Applications.V1Beta1";
28 | option go_package = "applicationsv1beta1";
29 | option java_multiple_files = true;
30 | option java_outer_classname = "ResourcesProto";
31 | option java_package = "com.cs3.auth.applications.v1beta1";
32 | option objc_class_prefix = "CAA";
33 | option php_namespace = "Cs3\\Auth\\Applications\\V1Beta1";
34 |
35 | // AppPassword stores information about secondary passwords generated by users
36 | // to be used with third-party applications.
37 | message AppPassword {
38 | // REQUIRED.
39 | // The generated access password.
40 | string password = 1;
41 | // OPTIONAL.
42 | // The scope of the token to be issued.
43 | // This would be a list of resources with corresponding role-based access scope.
44 | map token_scope = 2;
45 | // OPTIONAL.
46 | // A label to be associated with the password.
47 | string label = 3;
48 | // REQUIRED.
49 | // The user who created the password.
50 | cs3.identity.user.v1beta1.UserId user = 4;
51 | // OPTIONAL.
52 | // The time when the token will expire.
53 | cs3.types.v1beta1.Timestamp expiration = 5;
54 | // REQUIRED.
55 | // The creation time of the password.
56 | cs3.types.v1beta1.Timestamp ctime = 6;
57 | // REQUIRED.
58 | // The last time the password was used.
59 | cs3.types.v1beta1.Timestamp utime = 7;
60 | }
61 |
--------------------------------------------------------------------------------
/cs3/auth/provider/v1beta1/provider_api.proto:
--------------------------------------------------------------------------------
1 | // Copyright 2018-2019 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.auth.provider.v1beta1;
22 |
23 | import "cs3/auth/provider/v1beta1/resources.proto";
24 | import "cs3/identity/user/v1beta1/resources.proto";
25 | import "cs3/rpc/v1beta1/status.proto";
26 | import "cs3/types/v1beta1/types.proto";
27 |
28 | option csharp_namespace = "Cs3.Auth.Provider.V1Beta1";
29 | option go_package = "providerv1beta1";
30 | option java_multiple_files = true;
31 | option java_outer_classname = "ProviderApiProto";
32 | option java_package = "com.cs3.auth.provider.v1beta1";
33 | option objc_class_prefix = "CAP";
34 | option php_namespace = "Cs3\\Auth\\Provider\\V1Beta1";
35 |
36 | // Auth Provider API
37 | //
38 | // The Auth Provider API is meant to authenticate a client.
39 | //
40 | // The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL
41 | // NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and
42 | // "OPTIONAL" in this document are to be interpreted as described in
43 | // RFC 2119.
44 | //
45 | // The following are global requirements that apply to all methods:
46 | // Any method MUST return CODE_OK on a succesful operation.
47 | // Any method MAY return NOT_IMPLEMENTED.
48 | // Any method MAY return INTERNAL.
49 | // Any method MAY return UNKNOWN.
50 | // Any method MAY return UNAUTHENTICATED.
51 | service ProviderAPI {
52 | // Authenticate authenticates a client.
53 | rpc Authenticate(AuthenticateRequest) returns (AuthenticateResponse);
54 | }
55 |
56 | message AuthenticateRequest {
57 | // OPTIONAL.
58 | // Opaque information.
59 | cs3.types.v1beta1.Opaque opaque = 1;
60 | // OPTIONAL.
61 | // The id of the client.
62 | // For basic authentication with username and password
63 | // both client_id and client_secret are expected to be filled.
64 | // However, for example, for OIDC only a token is necessary.
65 | string client_id = 2;
66 | // OPTIONAL.
67 | // The secret of the client.
68 | string client_secret = 3;
69 | }
70 |
71 | message AuthenticateResponse {
72 | // REQUIRED.
73 | // The response status.
74 | cs3.rpc.v1beta1.Status status = 1;
75 | // REQUIRED.
76 | // The authenticated user.
77 | cs3.identity.user.v1beta1.User user = 2;
78 | // REQUIRED.
79 | // The scope of the token to be issued.
80 | // This would be a list of resources with corresponding role-based access scope.
81 | map token_scope = 3;
82 | }
83 |
--------------------------------------------------------------------------------
/cs3/auth/provider/v1beta1/resources.proto:
--------------------------------------------------------------------------------
1 | // Copyright 2018-2019 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.auth.provider.v1beta1;
22 |
23 | import "cs3/types/v1beta1/types.proto";
24 |
25 | option csharp_namespace = "Cs3.Auth.Provider.V1Beta1";
26 | option go_package = "providerv1beta1";
27 | option java_multiple_files = true;
28 | option java_outer_classname = "ResourcesProto";
29 | option java_package = "com.cs3.auth.provider.v1beta1";
30 | option objc_class_prefix = "CAP";
31 | option php_namespace = "Cs3\\Auth\\Provider\\V1Beta1";
32 |
33 | // Scope defines role-based permissions for various resources.
34 | message Scope {
35 | // REQUIRED.
36 | // The resource embedded in the request of a particular method. It depends on
37 | // the method, hence is left as opaque.
38 | cs3.types.v1beta1.OpaqueEntry resource = 1;
39 | // REQUIRED.
40 | // The role associated with the resource.
41 | Role role = 2;
42 | }
43 |
44 | // The role associated with the scope.
45 | enum Role {
46 | // Used for invalid roles
47 | ROLE_INVALID = 0;
48 | // Grants owner permissions on a resource
49 | ROLE_OWNER = 1;
50 | // Provides backwards compatibility
51 | ROLE_LEGACY = 2;
52 | // Grants non-editor role on a resource
53 | ROLE_VIEWER = 3;
54 | // Grants editor permission on a resource, including folders
55 | ROLE_EDITOR = 4;
56 | // Grants editor permission on a single file
57 | ROLE_FILE_EDITOR = 5;
58 | // Grants co-owner permissions on a resource
59 | ROLE_COOWNER = 6;
60 | // Role with only write permission can use InitiateFileUpload, nothing else
61 | ROLE_UPLOADER = 7;
62 | }
63 |
--------------------------------------------------------------------------------
/cs3/auth/registry/v1beta1/registry_api.proto:
--------------------------------------------------------------------------------
1 | // Copyright 2018-2019 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.auth.registry.v1beta1;
22 |
23 | import "cs3/auth/registry/v1beta1/resources.proto";
24 | import "cs3/rpc/v1beta1/status.proto";
25 | import "cs3/types/v1beta1/types.proto";
26 |
27 | option csharp_namespace = "Cs3.Auth.Registry.V1Beta1";
28 | option go_package = "registryv1beta1";
29 | option java_multiple_files = true;
30 | option java_outer_classname = "RegistryApiProto";
31 | option java_package = "com.cs3.auth.registry.v1beta1";
32 | option objc_class_prefix = "CAR";
33 | option php_namespace = "Cs3\\Auth\\Registry\\V1Beta1";
34 |
35 | // Auth Registry API
36 | //
37 | // The Auth Registry API is meant to as registry to obtain
38 | // information of available auth providers.
39 | // For example, to use OIDC or Kerberos for authentication.
40 | //
41 | // The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL
42 | // NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and
43 | // "OPTIONAL" in this document are to be interpreted as described in
44 | // RFC 2119.
45 | //
46 | // The following are global requirements that apply to all methods:
47 | // Any method MUST return CODE_OK on a succesful operation.
48 | // Any method MAY return NOT_IMPLEMENTED.
49 | // Any method MAY return INTERNAL.
50 | // Any method MAY return UNKNOWN.
51 | // Any method MAY return UNAUTHENTICATED.
52 | service RegistryAPI {
53 | // Returns the auth provider that is reponsible for the given
54 | // resource reference.
55 | // MUST return CODE_NOT_FOUND if the reference does not exist.
56 | rpc GetAuthProviders(GetAuthProvidersRequest) returns (GetAuthProvidersResponse);
57 | // Returns a list of the available auth providers known by this registry.
58 | rpc ListAuthProviders(ListAuthProvidersRequest) returns (ListAuthProvidersResponse);
59 | }
60 |
61 | message GetAuthProvidersRequest {
62 | // OPTIONAL.
63 | // Opaque information.
64 | cs3.types.v1beta1.Opaque opaque = 1;
65 | // REQUIRED.
66 | // The type of authentication provider.
67 | string type = 2;
68 | }
69 |
70 | message GetAuthProvidersResponse {
71 | // REQUIRED.
72 | // The response status.
73 | cs3.rpc.v1beta1.Status status = 1;
74 | // OPTIONAL.
75 | // Opaque information.
76 | cs3.types.v1beta1.Opaque opaque = 2;
77 | // REQUIRED.
78 | // The auth providers handling the requested auth call.
79 | repeated ProviderInfo providers = 3;
80 | }
81 |
82 | message ListAuthProvidersRequest {
83 | // OPTIONAL.
84 | // Opaque information.
85 | cs3.types.v1beta1.Opaque opaque = 1;
86 | // TODO(labkode): maybe add some filter?
87 | }
88 |
89 | message ListAuthProvidersResponse {
90 | // REQUIRED.
91 | // The response status.
92 | cs3.rpc.v1beta1.Status status = 1;
93 | // OPTIONAL.
94 | // Opaque information.
95 | cs3.types.v1beta1.Opaque opaque = 2;
96 | // REQUIRED.
97 | // The list of auth providers this registry knows about.
98 | repeated ProviderInfo providers = 3;
99 | }
100 |
--------------------------------------------------------------------------------
/cs3/auth/registry/v1beta1/resources.proto:
--------------------------------------------------------------------------------
1 | // Copyright 2018-2019 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.auth.registry.v1beta1;
22 |
23 | import "cs3/types/v1beta1/types.proto";
24 |
25 | option csharp_namespace = "Cs3.Auth.Registry.V1Beta1";
26 | option go_package = "registryv1beta1";
27 | option java_multiple_files = true;
28 | option java_outer_classname = "ResourcesProto";
29 | option java_package = "com.cs3.auth.registry.v1beta1";
30 | option objc_class_prefix = "CAR";
31 | option php_namespace = "Cs3\\Auth\\Registry\\V1Beta1";
32 |
33 | // ProviderInfo provides the information about an authentication provider.
34 | message ProviderInfo {
35 | // OPTIONAL.
36 | // Opaque information (containing storage-specific information).
37 | // For example, additional metadata attached to the resource.
38 | cs3.types.v1beta1.Opaque opaque = 1;
39 | // REQUIRED.
40 | // The storage provider id that will become part of the
41 | // resource id.
42 | // For example, if the provider_id is "home", resources obtained
43 | // from this storage provider will have a resource id like "home:1234".
44 | string provider_type = 2;
45 | // REQUIRED.
46 | // The address where the storage provider can be reached.
47 | // For example, tcp://localhost:1099.
48 | string address = 4;
49 | // OPTIONAL.
50 | // Information to describe the functionalities
51 | // offered by the storage provider. Meant to be read
52 | // by humans.
53 | string description = 5;
54 | }
55 |
--------------------------------------------------------------------------------
/cs3/gateway/v1beta1/resources.proto:
--------------------------------------------------------------------------------
1 | // Copyright 2018-2019 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.gateway.v1beta1;
22 |
23 | import "cs3/storage/provider/v1beta1/resources.proto";
24 | import "cs3/sharing/collaboration/v1beta1/resources.proto";
25 | import "cs3/sharing/link/v1beta1/resources.proto";
26 | import "cs3/types/v1beta1/types.proto";
27 |
28 | option csharp_namespace = "Cs3.Gateway.V1Beta1";
29 | option go_package = "gatewayv1beta1";
30 | option java_multiple_files = true;
31 | option java_outer_classname = "ResourcesProto";
32 | option java_package = "com.cs3.gateway.v1beta1";
33 | option objc_class_prefix = "CGX";
34 | option php_namespace = "Cs3\\Gateway\\V1Beta1";
35 |
36 | // A file upload protocol object stores information about
37 | // uploading resources using a specific protocol.
38 | message FileUploadProtocol {
39 | // OPTIONAL.
40 | // Opaque information.
41 | cs3.types.v1beta1.Opaque opaque = 1;
42 | // REQUIRED.
43 | // The protocol to be followed.
44 | string protocol = 2;
45 | // REQUIRED.
46 | // The endpoint where to upload the data.
47 | // The value MUST be a Uniform Resource Identifier (URI)
48 | // as specified in RFC 3986.
49 | string upload_endpoint = 3;
50 | // REQUIRED.
51 | // List of available checksums
52 | // the client can use when sending
53 | // the file.
54 | repeated cs3.storage.provider.v1beta1.ResourceChecksumPriority available_checksums = 4;
55 | // OPTIONAL.
56 | // A token that MUST be validated by the data gateway for the upload.
57 | // Only makes sense for uploads passing through the data gateway.
58 | string token = 5;
59 | }
60 |
61 | // A file download protocol object stores information about
62 | // downloading resources using a specific protocol.
63 | message FileDownloadProtocol {
64 | // OPTIONAL.
65 | // Opaque information.
66 | cs3.types.v1beta1.Opaque opaque = 1;
67 | // REQUIRED.
68 | // The protocol to be followed.
69 | string protocol = 2;
70 | // REQUIRED.
71 | // The endpoint where to download the data.
72 | // The value MUST be a Uniform Resource Identifier (URI)
73 | // as specified in RFC 3986.
74 | string download_endpoint = 3;
75 | // OPTIONAL.
76 | // A token that MUST be validated by the data gateway for the download.
77 | // Only makes sense for downloads passing through the data gateway.
78 | string token = 4;
79 | }
80 |
81 | // ShareResourceInfo includes the sharing information
82 | // and the storage-related information about a share resource.
83 | message ShareResourceInfo {
84 | // OPTIONAL.
85 | // Opaque information.
86 | cs3.types.v1beta1.Opaque opaque = 1;
87 | // REQUIRED.
88 | // The underlying share as returned by the collaboration service.
89 | cs3.sharing.collaboration.v1beta1.Share share = 2;
90 | // REQUIRED.
91 | // The corresponding resource information as returned by the storage provider.
92 | cs3.storage.provider.v1beta1.ResourceInfo resource_info = 3;
93 | }
94 |
95 | // ReceivedShareResourceInfo includes the sharing information
96 | // and the storage-related information about a received share resource.
97 | message ReceivedShareResourceInfo {
98 | // OPTIONAL.
99 | // Opaque information.
100 | cs3.types.v1beta1.Opaque opaque = 1;
101 | // REQUIRED.
102 | // The underlying share as returned by the collaboration service.
103 | cs3.sharing.collaboration.v1beta1.ReceivedShare received_share = 2;
104 | // REQUIRED.
105 | // The corresponding resource information as returned by the storage provider.
106 | cs3.storage.provider.v1beta1.ResourceInfo resource_info = 3;
107 | }
108 |
109 | // PublicShareResourceInfo includes the sharing information
110 | // and the storage-related information about a public share resource.
111 | message PublicShareResourceInfo {
112 | // OPTIONAL.
113 | // Opaque information.
114 | cs3.types.v1beta1.Opaque opaque = 1;
115 | // REQUIRED.
116 | // The underlying share as returned by the collaboration service.
117 | cs3.sharing.link.v1beta1.PublicShare public_share = 2;
118 | // REQUIRED.
119 | // The corresponding resource information as returned by the storage provider.
120 | cs3.storage.provider.v1beta1.ResourceInfo resource_info = 3;
121 | }
122 |
--------------------------------------------------------------------------------
/cs3/identity/group/v1beta1/group_api.proto:
--------------------------------------------------------------------------------
1 | // Copyright 2018-2019 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.identity.group.v1beta1;
22 |
23 | import "cs3/identity/group/v1beta1/resources.proto";
24 | import "cs3/identity/user/v1beta1/resources.proto";
25 | import "cs3/rpc/v1beta1/status.proto";
26 | import "cs3/types/v1beta1/types.proto";
27 |
28 | option csharp_namespace = "Cs3.Identity.Group.V1Beta1";
29 | option go_package = "groupv1beta1";
30 | option java_multiple_files = true;
31 | option java_outer_classname = "GroupApiProto";
32 | option java_package = "com.cs3.identity.group.v1beta1";
33 | option objc_class_prefix = "CIG";
34 | option php_namespace = "Cs3\\Identity\\Group\\V1Beta1";
35 |
36 | // GroupProvider API.
37 | //
38 | // The GroupProvider API is responsible for providing methods to retrieve
39 | // information about groups and their interactions with users.
40 | //
41 | // The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL
42 | // NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and
43 | // "OPTIONAL" in this document are to be interpreted as described in
44 | // RFC 2119.
45 | //
46 | // The following are global requirements that apply to all methods:
47 | // Any method MUST return CODE_OK on a successful operation.
48 | // Any method MAY return NOT_IMPLEMENTED.
49 | // Any method MAY return INTERNAL.
50 | // Any method MAY return UNKNOWN.
51 | // Any method MAY return UNAUTHENTICATED.
52 |
53 | // Provides an API for managing groups.
54 | service GroupAPI {
55 | // Gets the information about a group by the group id.
56 | rpc GetGroup(GetGroupRequest) returns (GetGroupResponse);
57 | // Gets the information about a group based on a specified claim.
58 | rpc GetGroupByClaim(GetGroupByClaimRequest) returns (GetGroupByClaimResponse);
59 | // Gets the members of a group.
60 | rpc GetMembers(GetMembersRequest) returns (GetMembersResponse);
61 | // Tells if the group has certain member.
62 | rpc HasMember(HasMemberRequest) returns (HasMemberResponse);
63 | // Finds groups whose names match the specified filter.
64 | rpc FindGroups(FindGroupsRequest) returns (FindGroupsResponse);
65 | }
66 |
67 | message GetGroupRequest {
68 | // OPTIONAL.
69 | // Opaque information.
70 | cs3.types.v1beta1.Opaque opaque = 1;
71 | // REQUIRED.
72 | // The id of the group.
73 | cs3.identity.group.v1beta1.GroupId group_id = 2;
74 | // OPTIONAL.
75 | // Whether to skip fetching members along with the group object.
76 | bool skip_fetching_members = 3;
77 | }
78 |
79 | message GetGroupResponse {
80 | // REQUIRED.
81 | // The response status.
82 | cs3.rpc.v1beta1.Status status = 1;
83 | // OPTIONAL.
84 | // Opaque information.
85 | cs3.types.v1beta1.Opaque opaque = 2;
86 | // REQUIRED.
87 | // The group information.
88 | Group group = 3;
89 | }
90 |
91 | message GetGroupByClaimRequest {
92 | // OPTIONAL.
93 | // Opaque information.
94 | cs3.types.v1beta1.Opaque opaque = 1;
95 | // REQUIRED.
96 | // The claim on the basis of which groups will be filtered.
97 | string claim = 2;
98 | // REQUIRED.
99 | // The value of the claim to find the specific group.
100 | string value = 3;
101 | // OPTIONAL.
102 | // Whether to skip fetching members along with the group object.
103 | bool skip_fetching_members = 4;
104 | }
105 |
106 | message GetGroupByClaimResponse {
107 | // REQUIRED.
108 | // The response status.
109 | cs3.rpc.v1beta1.Status status = 1;
110 | // OPTIONAL.
111 | // Opaque information.
112 | cs3.types.v1beta1.Opaque opaque = 2;
113 | // REQUIRED.
114 | // The group information.
115 | Group group = 3;
116 | }
117 |
118 | message GetMembersRequest {
119 | // OPTIONAL.
120 | // Opaque information.
121 | cs3.types.v1beta1.Opaque opaque = 1;
122 | // REQUIRED.
123 | // The id of the group.
124 | cs3.identity.group.v1beta1.GroupId group_id = 2;
125 | }
126 |
127 | message GetMembersResponse {
128 | // REQUIRED.
129 | // The response status.
130 | cs3.rpc.v1beta1.Status status = 1;
131 | // OPTIONAL.
132 | // Opaque information.
133 | cs3.types.v1beta1.Opaque opaque = 2;
134 | // REQUIRED.
135 | // The members of the group.
136 | repeated cs3.identity.user.v1beta1.UserId members = 3;
137 | }
138 |
139 | message HasMemberRequest {
140 | // OPTIONAL.
141 | // Opaque information.
142 | cs3.types.v1beta1.Opaque opaque = 1;
143 | // REQUIRED.
144 | // The id of the group.
145 | cs3.identity.group.v1beta1.GroupId group_id = 2;
146 | // REQUIRED.
147 | // The id of the user to check.
148 | cs3.identity.user.v1beta1.UserId user_id = 3;
149 | }
150 |
151 | message HasMemberResponse {
152 | // REQUIRED.
153 | // The response status.
154 | cs3.rpc.v1beta1.Status status = 1;
155 | // OPTIONAL.
156 | // Opaque information.
157 | cs3.types.v1beta1.Opaque opaque = 2;
158 | // REQUIRED.
159 | // Tells if the user belongs to the group.
160 | bool ok = 3;
161 | }
162 |
163 | message FindGroupsRequest {
164 | // OPTIONAL.
165 | // Opaque information.
166 | cs3.types.v1beta1.Opaque opaque = 1;
167 | // REQUIRED.
168 | // The filter to apply.
169 | string filter = 2;
170 | // OPTIONAL.
171 | // Whether to skip fetching members along with the group object.
172 | bool skip_fetching_members = 3;
173 | }
174 |
175 | message FindGroupsResponse {
176 | // REQUIRED.
177 | // The response status.
178 | cs3.rpc.v1beta1.Status status = 1;
179 | // OPTIONAL.
180 | // Opaque information.
181 | cs3.types.v1beta1.Opaque opaque = 2;
182 | // REQUIRED.
183 | // The groups matching the specified filter.
184 | repeated Group groups = 3;
185 | }
186 |
--------------------------------------------------------------------------------
/cs3/identity/group/v1beta1/resources.proto:
--------------------------------------------------------------------------------
1 | // Copyright 2018-2019 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.identity.group.v1beta1;
22 |
23 | import "cs3/identity/user/v1beta1/resources.proto";
24 | import "cs3/types/v1beta1/types.proto";
25 |
26 | option csharp_namespace = "Cs3.Identity.Group.V1Beta1";
27 | option go_package = "groupv1beta1";
28 | option java_multiple_files = true;
29 | option java_outer_classname = "ResourcesProto";
30 | option java_package = "com.cs3.identity.group.v1beta1";
31 | option objc_class_prefix = "CIG";
32 | option php_namespace = "Cs3\\Identity\\Group\\V1Beta1";
33 |
34 | // A GroupId represents a group.
35 | message GroupId {
36 | // REQUIRED.
37 | // The identity provider for the group.
38 | string idp = 1;
39 | // REQUIRED.
40 | // the unique identifier for the group in the scope of
41 | // the identity provider.
42 | string opaque_id = 2;
43 | }
44 |
45 | // Represents a group of the system.
46 | message Group {
47 | GroupId id = 1;
48 | string group_name = 2;
49 | int64 gid_number = 3;
50 | string mail = 4;
51 | bool mail_verified = 5;
52 | string display_name = 6;
53 | repeated cs3.identity.user.v1beta1.UserId members = 7;
54 | cs3.types.v1beta1.Opaque opaque = 8;
55 | }
56 |
--------------------------------------------------------------------------------
/cs3/identity/user/v1beta1/resources.proto:
--------------------------------------------------------------------------------
1 | // Copyright 2018-2019 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.identity.user.v1beta1;
22 |
23 | import "cs3/types/v1beta1/types.proto";
24 |
25 | option csharp_namespace = "Cs3.Identity.User.V1Beta1";
26 | option go_package = "userv1beta1";
27 | option java_multiple_files = true;
28 | option java_outer_classname = "ResourcesProto";
29 | option java_package = "com.cs3.identity.user.v1beta1";
30 | option objc_class_prefix = "CIU";
31 | option php_namespace = "Cs3\\Identity\\User\\V1Beta1";
32 |
33 | // A UserId represents a unique identifier of a user.
34 | message UserId {
35 | // REQUIRED.
36 | // The identity provider for the user.
37 | string idp = 1;
38 | // REQUIRED.
39 | // the unique identifier for the user in the scope of
40 | // the identity provider.
41 | string opaque_id = 2;
42 | // REQUIRED.
43 | // The type of user.
44 | UserType type = 3;
45 | }
46 |
47 | // Represents a user of the system.
48 | message User {
49 | // REQUIRED.
50 | // The unique identifier of this user.
51 | UserId id = 1;
52 | // REQUIRED.
53 | // A human-friendly unique identifier of this user.
54 | string username = 2;
55 | // OPTIONAL.
56 | // The e-mail address of this user.
57 | string mail = 3;
58 | // OPTIONAL.
59 | // Whether the e-mail address was verified by the IDP.
60 | bool mail_verified = 4;
61 | // OPTIONAL.
62 | // A human-friendly display name for this user, e.g. "Family and First Name"
63 | string display_name = 5;
64 | // OPTIONAL.
65 | // A list of groups this user belongs to.
66 | repeated string groups = 6;
67 | // OPTIONAL.
68 | // Opaque information.
69 | cs3.types.v1beta1.Opaque opaque = 7;
70 | // OPTIONAL.
71 | // The user id of this user in the Unix world.
72 | int64 uid_number = 8;
73 | // OPTIONAL.
74 | // The group id of this user in the Unix world.
75 | int64 gid_number = 9;
76 | }
77 |
78 | // The type of user.
79 | enum UserType {
80 | // The user is invalid, for example, is missing primary attributes.
81 | USER_TYPE_INVALID = 0;
82 | // A primary user.
83 | USER_TYPE_PRIMARY = 1;
84 | // A secondary user for cases with multiple identities.
85 | USER_TYPE_SECONDARY = 2;
86 | // A user catering to specific services.
87 | USER_TYPE_SERVICE = 3;
88 | // A user to be used by specific applications.
89 | USER_TYPE_APPLICATION = 4;
90 | // A guest user not affiliated to the IDP.
91 | USER_TYPE_GUEST = 5;
92 | // A federated user provided by external IDPs.
93 | USER_TYPE_FEDERATED = 6;
94 | // A lightweight user account without access to various major functionalities.
95 | USER_TYPE_LIGHTWEIGHT = 7;
96 | // A space owner to allow access for public link or content indexing.
97 | USER_TYPE_SPACE_OWNER = 8;
98 | }
99 |
--------------------------------------------------------------------------------
/cs3/identity/user/v1beta1/user_api.proto:
--------------------------------------------------------------------------------
1 | // Copyright 2018-2019 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.identity.user.v1beta1;
22 |
23 | import "cs3/identity/user/v1beta1/resources.proto";
24 | import "cs3/rpc/v1beta1/status.proto";
25 | import "cs3/types/v1beta1/types.proto";
26 |
27 | option csharp_namespace = "Cs3.Identity.User.V1Beta1";
28 | option go_package = "userv1beta1";
29 | option java_multiple_files = true;
30 | option java_outer_classname = "UserApiProto";
31 | option java_package = "com.cs3.identity.user.v1beta1";
32 | option objc_class_prefix = "CIU";
33 | option php_namespace = "Cs3\\Identity\\User\\V1Beta1";
34 |
35 | // UserProvider API.
36 | //
37 | // The UserProvider API is responsible for providing
38 | // methods to retrieve information about the users.
39 | //
40 | // The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL
41 | // NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and
42 | // "OPTIONAL" in this document are to be interpreted as described in
43 | // RFC 2119.
44 | //
45 | // The following are global requirements that apply to all methods:
46 | // Any method MUST return CODE_OK on a successful operation.
47 | // Any method MAY return NOT_IMPLEMENTED.
48 | // Any method MAY return INTERNAL.
49 | // Any method MAY return UNKNOWN.
50 | // Any method MAY return UNAUTHENTICATED.
51 |
52 | // Provides an API for managing users.
53 | service UserAPI {
54 | // Gets the information about a user by the user id.
55 | rpc GetUser(GetUserRequest) returns (GetUserResponse);
56 | // Gets the information about a user based on a specified claim.
57 | rpc GetUserByClaim(GetUserByClaimRequest) returns (GetUserByClaimResponse);
58 | // Gets the groups of a user.
59 | rpc GetUserGroups(GetUserGroupsRequest) returns (GetUserGroupsResponse);
60 | // Finds users by any attribute of the user.
61 | // TODO(labkode): to define the filters that make more sense.
62 | rpc FindUsers(FindUsersRequest) returns (FindUsersResponse);
63 | }
64 |
65 | message GetUserRequest {
66 | // OPTIONAL.
67 | // Opaque information.
68 | cs3.types.v1beta1.Opaque opaque = 1;
69 | // REQUIRED.
70 | // The id of the user.
71 | cs3.identity.user.v1beta1.UserId user_id = 2;
72 | // OPTIONAL.
73 | // Whether to skip fetching user groups along with the user object.
74 | bool skip_fetching_user_groups = 3;
75 | }
76 |
77 | message GetUserResponse {
78 | // REQUIRED.
79 | // The response status.
80 | cs3.rpc.v1beta1.Status status = 1;
81 | // OPTIONAL.
82 | // Opaque information.
83 | cs3.types.v1beta1.Opaque opaque = 2;
84 | // REQUIRED.
85 | // The user information.
86 | User user = 3;
87 | }
88 |
89 | message GetUserByClaimRequest {
90 | // OPTIONAL.
91 | // Opaque information.
92 | cs3.types.v1beta1.Opaque opaque = 1;
93 | // REQUIRED.
94 | // The claim on the basis of which users will be filtered.
95 | string claim = 2;
96 | // REQUIRED.
97 | // The value of the claim to find the specific user.
98 | string value = 3;
99 | // OPTIONAL.
100 | // Whether to skip fetching user groups along with the user object.
101 | bool skip_fetching_user_groups = 4;
102 | }
103 |
104 | message GetUserByClaimResponse {
105 | // REQUIRED.
106 | // The response status.
107 | cs3.rpc.v1beta1.Status status = 1;
108 | // OPTIONAL.
109 | // Opaque information.
110 | cs3.types.v1beta1.Opaque opaque = 2;
111 | // REQUIRED.
112 | // The user information.
113 | User user = 3;
114 | }
115 |
116 | message GetUserGroupsRequest {
117 | // OPTIONAL.
118 | // Opaque information.
119 | cs3.types.v1beta1.Opaque opaque = 1;
120 | // REQUIRED.
121 | // The id of the user.
122 | cs3.identity.user.v1beta1.UserId user_id = 2;
123 | }
124 |
125 | message GetUserGroupsResponse {
126 | // REQUIRED.
127 | // The response status.
128 | cs3.rpc.v1beta1.Status status = 1;
129 | // OPTIONAL.
130 | // Opaque information.
131 | cs3.types.v1beta1.Opaque opaque = 2;
132 | // REQUIRED.
133 | // The groups for the user.
134 | repeated string groups = 3;
135 | }
136 |
137 | message FindUsersRequest {
138 | // OPTIONAL.
139 | // Opaque information.
140 | cs3.types.v1beta1.Opaque opaque = 1;
141 | // REQUIRED. TODO(labkode): create proper filters for most common searches.
142 | // The filter to apply.
143 | string filter = 2;
144 | // OPTIONAL.
145 | // Whether to skip fetching user groups along with the user object.
146 | bool skip_fetching_user_groups = 3;
147 | }
148 |
149 | message FindUsersResponse {
150 | // REQUIRED.
151 | // The response status.
152 | cs3.rpc.v1beta1.Status status = 1;
153 | // OPTIONAL.
154 | // Opaque information.
155 | cs3.types.v1beta1.Opaque opaque = 2;
156 | // REQUIRED.
157 | // The users matching the specified filter.
158 | repeated User users = 3;
159 | }
160 |
--------------------------------------------------------------------------------
/cs3/ocm/core/v1beta1/ocm_core_api.proto:
--------------------------------------------------------------------------------
1 | // Copyright 2018-2019 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.core.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.Core.V1Beta1";
30 | option go_package = "corev1beta1";
31 | option java_multiple_files = true;
32 | option java_outer_classname = "OcmCoreApiProto";
33 | option java_package = "com.cs3.ocm.core.v1beta1";
34 | option objc_class_prefix = "COC";
35 | option php_namespace = "Cs3\\Ocm\\Core\\V1Beta1";
36 |
37 | // OCM Core API
38 | //
39 | // the OCM Core API is the mapping for the local system of the OCM protocol,
40 | // including multi-protocol shares. Implementations are expected to expose
41 | // the `/ocm` endpoints according to the OCM API, and in response to those
42 | // endpoints implement the following API.
43 | //
44 | // The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL
45 | // NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and
46 | // "OPTIONAL" in this document are to be interpreted as described in
47 | // RFC 2119.
48 | //
49 | // The following are global requirements that apply to all methods:
50 | // Any method MUST return CODE_OK on a succesful operation.
51 | // Any method MAY return NOT_IMPLEMENTED.
52 | // Any method MAY return INTERNAL.
53 | // Any method MAY return UNKNOWN.
54 | // Any method MAY return UNAUTHENTICATED.
55 | service OcmCoreAPI {
56 | // Creates a new OCM share, in response to a call from remote to:
57 | // https://cs3org.github.io/OCM-API/docs.html?branch=v1.2.0&repo=OCM-API&user=cs3org#/paths/~1shares/post
58 | rpc CreateOCMCoreShare(CreateOCMCoreShareRequest) returns (CreateOCMCoreShareResponse);
59 | // Updates an OCM share, in response to a notification from the remote system to:
60 | // https://cs3org.github.io/OCM-API/docs.html?branch=v1.2.0&repo=OCM-API&user=cs3org#/paths/~1notifications/post
61 | rpc UpdateOCMCoreShare(UpdateOCMCoreShareRequest) returns (UpdateOCMCoreShareResponse);
62 | // Deletes an OCM share, in response to a notification from the remote system to:
63 | // https://cs3org.github.io/OCM-API/docs.html?branch=v1.2.0&repo=OCM-API&user=cs3org#/paths/~1notifications/post
64 | rpc DeleteOCMCoreShare(DeleteOCMCoreShareRequest) returns (DeleteOCMCoreShareResponse);
65 | }
66 |
67 | message CreateOCMCoreShareRequest {
68 | // OPTIONAL.
69 | // Opaque information.
70 | cs3.types.v1beta1.Opaque opaque = 1;
71 | // OPTIONAL.
72 | // Description for the share.
73 | string description = 2;
74 | // REQUIRED.
75 | // Name of the resource (file or folder).
76 | string name = 3;
77 | // REQUIRED.
78 | // Identifier to identify the resource at the provider side. This is unique per provider.
79 | string resource_id = 4;
80 | // REQUIRED.
81 | // Provider specific identifier of the owner of the resource.
82 | cs3.identity.user.v1beta1.UserId owner = 5;
83 | // REQUIRED.
84 | // Provider specific identifier of the user that wants to share the resource.
85 | cs3.identity.user.v1beta1.UserId sender = 6;
86 | // REQUIRED.
87 | // Consumer specific identifier of the user or group the provider wants to share the resource with.
88 | // This is known in advance, for example using the OCM invitation flow.
89 | // Please note that the consumer service endpoint is known in advance as well, so this is no part of the request body.
90 | // TODO: this field needs to represent either a user or group in the future, not only a user.
91 | cs3.identity.user.v1beta1.UserId share_with = 7;
92 | // REQUIRED.
93 | // Resource type.
94 | cs3.storage.provider.v1beta1.ResourceType resource_type = 8;
95 | // REQUIRED.
96 | // Recipient share type.
97 | cs3.sharing.ocm.v1beta1.ShareType share_type = 9;
98 | // OPTIONAL.
99 | // The expiration time for the OCM share.
100 | cs3.types.v1beta1.Timestamp expiration = 10;
101 | // REQUIRED.
102 | // The protocols which are used to establish synchronisation,
103 | // with their access rights.
104 | // See also cs3/sharing/ocm/v1beta1/resources.proto for how to map
105 | // this to the OCM share payload.
106 | repeated cs3.sharing.ocm.v1beta1.Protocol protocols = 11;
107 | // OPTIONAL.
108 | // A nonce to be exchanged for a (potentially short-lived) bearer token.
109 | string code = 12;
110 | }
111 |
112 | message CreateOCMCoreShareResponse {
113 | // REQUIRED.
114 | // The response status.
115 | cs3.rpc.v1beta1.Status status = 1;
116 | // OPTIONAL.
117 | // Opaque information.
118 | cs3.types.v1beta1.Opaque opaque = 2;
119 | // REQUIRED.
120 | // Unique ID to identify the share at the consumer side.
121 | string id = 3;
122 | // REQUIRED.
123 | cs3.types.v1beta1.Timestamp created = 4;
124 | }
125 |
126 | message UpdateOCMCoreShareRequest {
127 | // OPTIONAL.
128 | // Opaque information.
129 | cs3.types.v1beta1.Opaque opaque = 1;
130 | // REQUIRED.
131 | // Unique ID to identify the share at the consumer side.
132 | string ocm_share_id = 2;
133 | // OPTIONAL.
134 | // Description for the share.
135 | string description = 3;
136 | // OPTIONAL.
137 | // Recipient share type.
138 | cs3.sharing.ocm.v1beta1.ShareType share_type = 5;
139 | // OPTIONAL.
140 | // The expiration time for the OCM share.
141 | cs3.types.v1beta1.Timestamp expiration = 6;
142 | // OPTIONAL.
143 | // The protocols which are used to establish synchronisation,
144 | // with their access rights.
145 | repeated cs3.sharing.ocm.v1beta1.Protocol protocols = 7;
146 | }
147 |
148 | message UpdateOCMCoreShareResponse {
149 | // REQUIRED.
150 | // The response status.
151 | cs3.rpc.v1beta1.Status status = 1;
152 | // OPTIONAL.
153 | // Opaque information.
154 | cs3.types.v1beta1.Opaque opaque = 2;
155 | }
156 |
157 | message DeleteOCMCoreShareRequest {
158 | // REQUIRED.
159 | // Unique ID to identify the share at the consumer side.
160 | string id = 1;
161 | // OPTIONAL.
162 | // Opaque information.
163 | cs3.types.v1beta1.Opaque opaque = 2;
164 | }
165 |
166 | message DeleteOCMCoreShareResponse {
167 | // REQUIRED.
168 | // The response status.
169 | cs3.rpc.v1beta1.Status status = 1;
170 | // OPTIONAL.
171 | // Opaque information.
172 | cs3.types.v1beta1.Opaque opaque = 2;
173 | }
174 |
--------------------------------------------------------------------------------
/cs3/ocm/invite/v1beta1/invite_api.proto:
--------------------------------------------------------------------------------
1 | // Copyright 2018-2019 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.invite.v1beta1;
22 |
23 | import "cs3/identity/user/v1beta1/resources.proto";
24 | import "cs3/ocm/invite/v1beta1/resources.proto";
25 | import "cs3/ocm/provider/v1beta1/resources.proto";
26 | import "cs3/rpc/v1beta1/status.proto";
27 | import "cs3/types/v1beta1/types.proto";
28 |
29 | option csharp_namespace = "Cs3.Ocm.Invite.V1Beta1";
30 | option go_package = "invitev1beta1";
31 | option java_multiple_files = true;
32 | option java_outer_classname = "InviteApiProto";
33 | option java_package = "com.cs3.ocm.invite.v1beta1";
34 | option objc_class_prefix = "COI";
35 | option php_namespace = "Cs3\\Ocm\\Invite\\V1Beta1";
36 |
37 | // Invite API
38 | //
39 | // The Invite API is meant to invite users and groups belonging to other
40 | // sync'n'share systems, so that collaboration of resources can be enabled.
41 | //
42 | // The following APIs match the OCM v1.1 spec for the /invite-accepted endpoint.
43 | //
44 | // The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL
45 | // NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and
46 | // "OPTIONAL" in this document are to be interpreted as described in
47 | // RFC 2119.
48 | //
49 | // The following are global requirements that apply to all methods:
50 | // Any method MUST return CODE_OK on a succesful operation.
51 | // Any method MAY return NOT_IMPLEMENTED.
52 | // Any method MAY return INTERNAL.
53 | // Any method MAY return UNKNOWN.
54 | // Any method MAY return UNAUTHENTICATED.
55 | service InviteAPI {
56 | // Generates a new token for the user with a validity of 24 hours.
57 | rpc GenerateInviteToken(GenerateInviteTokenRequest) returns (GenerateInviteTokenResponse);
58 | // Lists the valid tokens generated by the user.
59 | rpc ListInviteTokens(ListInviteTokensRequest) returns (ListInviteTokensResponse);
60 | // Forwards a received invite to the remote sync'n'share system provider. The remote
61 | // system SHALL get an `invite-accepted` call as follows:
62 | // https://cs3org.github.io/OCM-API/docs.html?branch=v1.2.0&repo=OCM-API&user=cs3org#/paths/~1invite-accepted/post
63 | // MUST return CODE_NOT_FOUND if the token does not exist.
64 | // MUST return CODE_INVALID_ARGUMENT if the token expired.
65 | // MUST return CODE_ALREADY_EXISTS if the user already accepted an invite.
66 | // MUST return CODE_PERMISSION_DENIED if the remote service is not trusted to accept invitations.
67 | rpc ForwardInvite(ForwardInviteRequest) returns (ForwardInviteResponse);
68 | // Completes an invitation acceptance.
69 | // MUST return CODE_NOT_FOUND if the token does not exist.
70 | // MUST return CODE_INVALID_ARGUMENT if the token expired.
71 | // MUST return CODE_ALREADY_EXISTS if the user already accepted an invite.
72 | rpc AcceptInvite(AcceptInviteRequest) returns (AcceptInviteResponse);
73 | // Retrieves details about a remote user who has accepted an invite to share.
74 | // MUST return CODE_NOT_FOUND if the user does not exist.
75 | rpc GetAcceptedUser(GetAcceptedUserRequest) returns (GetAcceptedUserResponse);
76 | // Finds users who accepted invite tokens by their attributes.
77 | rpc FindAcceptedUsers(FindAcceptedUsersRequest) returns (FindAcceptedUsersResponse);
78 | // Delete a previously accepted remote user, that is unfriend that user.
79 | // MUST return CODE_NOT_FOUND if the user does not exist.
80 | rpc DeleteAcceptedUser(DeleteAcceptedUserRequest) returns (DeleteAcceptedUserResponse);
81 | }
82 |
83 | message GenerateInviteTokenRequest {
84 | // OPTIONAL.
85 | // Opaque information.
86 | cs3.types.v1beta1.Opaque opaque = 1;
87 | // OPTIONAL.
88 | // The description of the token.
89 | string description = 2;
90 | }
91 |
92 | message GenerateInviteTokenResponse {
93 | // REQUIRED.
94 | // The response status.
95 | cs3.rpc.v1beta1.Status status = 1;
96 | // OPTIONAL.
97 | // Opaque information.
98 | cs3.types.v1beta1.Opaque opaque = 2;
99 | // REQUIRED.
100 | // The generated token.
101 | InviteToken invite_token = 3;
102 | }
103 |
104 | message ListInviteTokensRequest {}
105 |
106 | message ListInviteTokensResponse {
107 | // REQUIRED.
108 | // The response status.
109 | cs3.rpc.v1beta1.Status status = 1;
110 | // REQUIRED.
111 | // The list of valid tokens.
112 | repeated InviteToken invite_tokens = 2;
113 | }
114 |
115 | message ForwardInviteRequest {
116 | // OPTIONAL.
117 | // Opaque information.
118 | cs3.types.v1beta1.Opaque opaque = 1;
119 | // REQUIRED.
120 | // The token to authenticate with.
121 | InviteToken invite_token = 2;
122 | // REQUIRED.
123 | // The details of the sync'n'share system provider of the user who sent the invite.
124 | cs3.ocm.provider.v1beta1.ProviderInfo origin_system_provider = 3;
125 | }
126 |
127 | message ForwardInviteResponse {
128 | // REQUIRED.
129 | // The response status.
130 | cs3.rpc.v1beta1.Status status = 1;
131 | // OPTIONAL.
132 | // Opaque information.
133 | cs3.types.v1beta1.Opaque opaque = 2;
134 | // REQUIRED.
135 | // The initiator's user id of the workflow.
136 | cs3.identity.user.v1beta1.UserId user_id = 3;
137 | // REQUIRED.
138 | // The initiator's email of the workflow.
139 | string email = 4;
140 | // REQUIRED.
141 | // The initiator's display name of the workflow.
142 | string display_name = 5;
143 | }
144 |
145 | message AcceptInviteRequest {
146 | // OPTIONAL.
147 | // Opaque information.
148 | cs3.types.v1beta1.Opaque opaque = 1;
149 | // REQUIRED.
150 | // The token to authenticate with.
151 | InviteToken invite_token = 2;
152 | // REQUIRED.
153 | // The user who accepted the invite.
154 | cs3.identity.user.v1beta1.User remote_user = 3;
155 | }
156 |
157 | message AcceptInviteResponse {
158 | // REQUIRED.
159 | // The response status.
160 | cs3.rpc.v1beta1.Status status = 1;
161 | // OPTIONAL.
162 | // Opaque information.
163 | cs3.types.v1beta1.Opaque opaque = 2;
164 | // REQUIRED.
165 | // The initiator's user id of the workflow.
166 | cs3.identity.user.v1beta1.UserId user_id = 3;
167 | // REQUIRED.
168 | // The initiator's email of the workflow.
169 | string email = 4;
170 | // REQUIRED.
171 | // The initiator's display name of the workflow.
172 | string display_name = 5;
173 | }
174 |
175 | message GetAcceptedUserRequest {
176 | // OPTIONAL.
177 | // Opaque information.
178 | cs3.types.v1beta1.Opaque opaque = 1;
179 | // REQUIRED.
180 | // The id of the user.
181 | cs3.identity.user.v1beta1.UserId remote_user_id = 2;
182 | }
183 |
184 | message GetAcceptedUserResponse {
185 | // REQUIRED.
186 | // The response status.
187 | cs3.rpc.v1beta1.Status status = 1;
188 | // OPTIONAL.
189 | // Opaque information.
190 | cs3.types.v1beta1.Opaque opaque = 2;
191 | // REQUIRED.
192 | // The user information.
193 | cs3.identity.user.v1beta1.User remote_user = 3;
194 | }
195 |
196 | message FindAcceptedUsersRequest {
197 | // OPTIONAL.
198 | // Opaque information.
199 | cs3.types.v1beta1.Opaque opaque = 1;
200 | // REQUIRED.
201 | // The filter to apply.
202 | string filter = 2;
203 | }
204 |
205 | message FindAcceptedUsersResponse {
206 | // REQUIRED.
207 | // The response status.
208 | cs3.rpc.v1beta1.Status status = 1;
209 | // OPTIONAL.
210 | // Opaque information.
211 | cs3.types.v1beta1.Opaque opaque = 2;
212 | // REQUIRED.
213 | // The accepted users matching the specified filter.
214 | repeated cs3.identity.user.v1beta1.User accepted_users = 3;
215 | }
216 |
217 | message DeleteAcceptedUserRequest {
218 | // OPTIONAL.
219 | // Opaque information.
220 | cs3.types.v1beta1.Opaque opaque = 1;
221 | // REQUIRED.
222 | // The id of the user.
223 | cs3.identity.user.v1beta1.UserId remote_user_id = 2;
224 | }
225 |
226 | message DeleteAcceptedUserResponse {
227 | // REQUIRED.
228 | // The response status.
229 | cs3.rpc.v1beta1.Status status = 1;
230 | // OPTIONAL.
231 | // Opaque information.
232 | cs3.types.v1beta1.Opaque opaque = 2;
233 | }
234 |
--------------------------------------------------------------------------------
/cs3/ocm/invite/v1beta1/resources.proto:
--------------------------------------------------------------------------------
1 | // Copyright 2018-2019 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.invite.v1beta1;
22 |
23 | import "cs3/identity/user/v1beta1/resources.proto";
24 | import "cs3/types/v1beta1/types.proto";
25 |
26 | option csharp_namespace = "Cs3.Ocm.Invite.V1Beta1";
27 | option go_package = "invitev1beta1";
28 | option java_multiple_files = true;
29 | option java_outer_classname = "ResourcesProto";
30 | option java_package = "com.cs3.ocm.invite.v1beta1";
31 | option objc_class_prefix = "COI";
32 | option php_namespace = "Cs3\\Ocm\\Invite\\V1Beta1";
33 |
34 | // InviteToken is used to invite users and groups from other sync'n'share
35 | // systems to collaborate on resources.
36 | message InviteToken {
37 | // REQUIRED.
38 | // Unique ID associated with an InviteToken.
39 | string token = 1;
40 | // REQUIRED.
41 | // The user who created the token.
42 | cs3.identity.user.v1beta1.UserId user_id = 2;
43 | // OPTIONAL.
44 | // The time when the token will expire.
45 | cs3.types.v1beta1.Timestamp expiration = 3;
46 | // OPTIONAL.
47 | // User-defined description to be forwarded to the invitees.
48 | string description = 4;
49 | }
50 |
--------------------------------------------------------------------------------
/cs3/ocm/provider/v1beta1/provider_api.proto:
--------------------------------------------------------------------------------
1 | // Copyright 2018-2019 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.provider.v1beta1;
22 |
23 | import "cs3/ocm/provider/v1beta1/resources.proto";
24 | import "cs3/rpc/v1beta1/status.proto";
25 | import "cs3/types/v1beta1/types.proto";
26 |
27 | option csharp_namespace = "Cs3.Ocm.Provider.V1Beta1";
28 | option go_package = "providerv1beta1";
29 | option java_multiple_files = true;
30 | option java_outer_classname = "ProviderApiProto";
31 | option java_package = "com.cs3.ocm.provider.v1beta1";
32 | option objc_class_prefix = "COP";
33 | option php_namespace = "Cs3\\Ocm\\Provider\\V1Beta1";
34 |
35 | // OCM Auth Provider API
36 | //
37 | // The Auth Provider API is meant to authenticate a sync'n'share provider regsistered in the mesh.
38 | //
39 | // The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL
40 | // NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and
41 | // "OPTIONAL" in this document are to be interpreted as described in
42 | // RFC 2119.
43 | //
44 | // The following are global requirements that apply to all methods:
45 | // Any method MUST return CODE_OK on a succesful operation.
46 | // Any method MAY return NOT_IMPLEMENTED.
47 | // Any method MAY return INTERNAL.
48 | // Any method MAY return UNKNOWN.
49 | // Any method MAY return UNAUTHENTICATED.
50 | service ProviderAPI {
51 | // Check if a given system provider is registered in the mesh or not.
52 | // MUST return CODE_UNAUTHENTICATED if the system is not registered
53 | rpc IsProviderAllowed(IsProviderAllowedRequest) returns (IsProviderAllowedResponse);
54 | // Get the information of the provider identified by a specific domain.
55 | // MUST return CODE_NOT_FOUND if the sync'n'share system provider does not exist.
56 | rpc GetInfoByDomain(GetInfoByDomainRequest) returns (GetInfoByDomainResponse);
57 | // Get the information of all the providers registered in the mesh.
58 | rpc ListAllProviders(ListAllProvidersRequest) returns (ListAllProvidersResponse);
59 | }
60 |
61 | message IsProviderAllowedRequest {
62 | // OPTIONAL.
63 | // Opaque information.
64 | cs3.types.v1beta1.Opaque opaque = 1;
65 | // REQUIRED.
66 | // The provider that we need to check against the list of verified mesh providers.
67 | ProviderInfo provider = 2;
68 | }
69 |
70 | message IsProviderAllowedResponse {
71 | // REQUIRED.
72 | // The response status.
73 | cs3.rpc.v1beta1.Status status = 1;
74 | // OPTIONAL.
75 | // Opaque information.
76 | cs3.types.v1beta1.Opaque opaque = 2;
77 | }
78 |
79 | message GetInfoByDomainRequest {
80 | // OPTIONAL.
81 | // Opaque information.
82 | cs3.types.v1beta1.Opaque opaque = 1;
83 | // REQUIRED.
84 | // The domain of the system provider.
85 | string domain = 2;
86 | }
87 |
88 | message GetInfoByDomainResponse {
89 | // REQUIRED.
90 | // The response status.
91 | cs3.rpc.v1beta1.Status status = 1;
92 | // OPTIONAL.
93 | // Opaque information.
94 | cs3.types.v1beta1.Opaque opaque = 2;
95 | // REQUIRED.
96 | // The info of the provider
97 | ProviderInfo provider_info = 3;
98 | }
99 |
100 | message ListAllProvidersRequest {
101 | // OPTIONAL.
102 | // Opaque information.
103 | cs3.types.v1beta1.Opaque opaque = 1;
104 | }
105 |
106 | message ListAllProvidersResponse {
107 | // REQUIRED.
108 | // The response status.
109 | cs3.rpc.v1beta1.Status status = 1;
110 | // OPTIONAL.
111 | // Opaque information.
112 | cs3.types.v1beta1.Opaque opaque = 2;
113 | // REQUIRED.
114 | // The share.
115 | repeated ProviderInfo providers = 3;
116 | }
117 |
--------------------------------------------------------------------------------
/cs3/ocm/provider/v1beta1/resources.proto:
--------------------------------------------------------------------------------
1 | // Copyright 2018-2019 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.provider.v1beta1;
22 |
23 | option csharp_namespace = "Cs3.Ocm.Provider.V1Beta1";
24 | option go_package = "providerv1beta1";
25 | option java_multiple_files = true;
26 | option java_outer_classname = "ResourcesProto";
27 | option java_package = "com.cs3.ocm.provider.v1beta1";
28 | option objc_class_prefix = "COP";
29 | option php_namespace = "Cs3\\Ocm\\Provider\\V1Beta1";
30 |
31 | // Identifier for various types of services offered by sync'n'share system providers.
32 | message ServiceType {
33 | // REQUIRED
34 | // The name of the service type.
35 | string name = 1;
36 | // REQUIRED
37 | // The description of the service type.
38 | string description = 2;
39 | }
40 |
41 | // The endpoints exposed by particular services.
42 | message ServiceEndpoint {
43 | // REQUIRED.
44 | // The type of service.
45 | ServiceType type = 1;
46 | // REQUIRED.
47 | // The name of the service.
48 | string name = 2;
49 | // REQUIRED.
50 | // The path at which the service is hosted.
51 | string path = 3;
52 | // OPTIONAL.
53 | // Whether the service is monitored.
54 | bool is_monitored = 4;
55 | // OPTIONAL.
56 | // Additional properties about the service.
57 | map properties = 5;
58 | }
59 |
60 | // The services offered by sync'n'share system providers.
61 | message Service {
62 | // REQUIRED.
63 | // The URL at which the service is hosted.
64 | string host = 1;
65 | // REQUIRED.
66 | // The primary endpoint of the service.
67 | ServiceEndpoint endpoint = 2;
68 | // REQUIRED.
69 | // The API version of the provided service.
70 | string api_version = 3;
71 | // OPTIONAL.
72 | // Additional endpoints at which the service is exposed.
73 | repeated ServiceEndpoint additional_endpoints = 4;
74 | }
75 |
76 | // Details of the sync'n'share system provider.
77 | message ProviderInfo {
78 | // REQUIRED.
79 | // The name of the provider.
80 | string name = 1;
81 | // REQUIRED.
82 | // The full name of the provider.
83 | string full_name = 2;
84 | // OPTIONAL.
85 | // A description of the provider.
86 | string description = 3;
87 | // OPTIONAL.
88 | // The organization to which the provider belongs.
89 | string organization = 4;
90 | // REQUIRED.
91 | // The domain of the sync'n'share provider.
92 | string domain = 5;
93 | // OPTIONAL.
94 | // The homepage of the provider.
95 | string homepage = 6;
96 | // OPTIONAL.
97 | // The email at which the provider can be reached.
98 | string email = 7;
99 | // REQUIRED.
100 | // The list of services provided by the provider.
101 | repeated Service services = 8;
102 | // OPTIONAL.
103 | // Additional properties about the service.
104 | map properties = 9;
105 | }
106 |
--------------------------------------------------------------------------------
/cs3/permissions/v1beta1/permissions_api.proto:
--------------------------------------------------------------------------------
1 | // Copyright 2018-2021 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.permissions.v1beta1;
22 |
23 | import "cs3/permissions/v1beta1/resources.proto";
24 | import "cs3/rpc/v1beta1/status.proto";
25 | import "cs3/storage/provider/v1beta1/resources.proto";
26 |
27 | option csharp_namespace = "Cs3.Permissions.V1Beta1";
28 | option go_package = "permissionsv1beta1";
29 | option java_multiple_files = true;
30 | option java_outer_classname = "PermissionsApiProto";
31 | option java_package = "com.cs3.permissions.v1beta1";
32 | option objc_class_prefix = "CPX";
33 | option php_namespace = "Cs3\\Permissions\\V1Beta1";
34 |
35 | // PermissionsAPI defines a service for permissions.
36 | service PermissionsAPI {
37 | // CheckPermission defines a method to check permission/role.
38 | rpc CheckPermission(CheckPermissionRequest) returns (CheckPermissionResponse);
39 | }
40 |
41 | // CheckPermissionsRequest is used to check if a user has a certain permission.
42 | message CheckPermissionRequest {
43 | //REQUIRED.
44 | // The permission to check.
45 | string permission = 1;
46 | // REQUIRED.
47 | // The subject holding the permission.
48 | cs3.permissions.v1beta1.SubjectReference subject_ref = 2;
49 | // OPTIONAL.
50 | // The target resource of the permission.
51 | cs3.storage.provider.v1beta1.Reference ref = 3;
52 | }
53 |
54 | // CheckPermissionsResponse ...
55 | message CheckPermissionResponse {
56 | // REQUIRED.
57 | // The response status.
58 | cs3.rpc.v1beta1.Status status = 1;
59 | }
60 |
--------------------------------------------------------------------------------
/cs3/permissions/v1beta1/resources.proto:
--------------------------------------------------------------------------------
1 | // Copyright 2018-2021 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.permissions.v1beta1;
22 |
23 | import "cs3/identity/group/v1beta1/resources.proto";
24 | import "cs3/identity/user/v1beta1/resources.proto";
25 |
26 | option csharp_namespace = "Cs3.Permissions.V1Beta1";
27 | option go_package = "permissionsv1beta1";
28 | option java_multiple_files = true;
29 | option java_outer_classname = "ResourcesProto";
30 | option java_package = "com.cs3.permissions.v1beta1";
31 | option objc_class_prefix = "CPX";
32 | option php_namespace = "Cs3\\Permissions\\V1Beta1";
33 |
34 | // SubjectReference references either a user or a group by id.
35 | message SubjectReference {
36 | oneof spec {
37 | cs3.identity.user.v1beta1.UserId user_id = 1;
38 | cs3.identity.group.v1beta1.GroupId group_id = 2;
39 | }
40 | }
41 |
--------------------------------------------------------------------------------
/cs3/preferences/v1beta1/preferences_api.proto:
--------------------------------------------------------------------------------
1 | // Copyright 2018-2019 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.preferences.v1beta1;
22 |
23 | import "cs3/preferences/v1beta1/resources.proto";
24 | import "cs3/rpc/v1beta1/status.proto";
25 |
26 | option csharp_namespace = "Cs3.Preferences.V1Beta1";
27 | option go_package = "preferencesv1beta1";
28 | option java_multiple_files = true;
29 | option java_outer_classname = "PreferencesApiProto";
30 | option java_package = "com.cs3.preferences.v1beta1";
31 | option objc_class_prefix = "CPX";
32 | option php_namespace = "Cs3\\Preferences\\V1Beta1";
33 |
34 | // Preferences API.
35 | //
36 | // The Preferences API is responsible for creating
37 | // a key-value map according to user preferences.
38 | //
39 | // The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL
40 | // NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and
41 | // "OPTIONAL" in this document are to be interpreted as described in
42 | // RFC 2119.
43 | //
44 | // The following are global requirements that apply to all methods:
45 | // Any method MUST return CODE_OK on a succesful operation.
46 | // Any method MAY return NOT_IMPLEMENTED.
47 | // Any method MAY return INTERNAL.
48 | // Any method MAY return UNKNOWN.
49 | // Any method MAY return UNAUTHENTICATED.
50 | service PreferencesAPI {
51 | // Maps the key-value pair.
52 | rpc SetKey(SetKeyRequest) returns (SetKeyResponse);
53 | // Returns the value associated with the
54 | // requested key.
55 | rpc GetKey(GetKeyRequest) returns (GetKeyResponse);
56 | }
57 |
58 | message SetKeyRequest {
59 | // REQUIRED.
60 | PreferenceKey key = 1;
61 | // REQUIRED.
62 | // The value associated with the key.
63 | string val = 2;
64 | }
65 |
66 | message SetKeyResponse {
67 | // REQUIRED.
68 | // The response status.
69 | cs3.rpc.v1beta1.Status status = 1;
70 | }
71 |
72 | message GetKeyRequest {
73 | // REQUIRED.
74 | PreferenceKey key = 1;
75 | }
76 |
77 | message GetKeyResponse {
78 | // REQUIRED.
79 | // The response status.
80 | cs3.rpc.v1beta1.Status status = 1;
81 | // REQUIRED.
82 | // The value associated with the key.
83 | string val = 2;
84 | }
85 |
--------------------------------------------------------------------------------
/cs3/preferences/v1beta1/resources.proto:
--------------------------------------------------------------------------------
1 | // Copyright 2018-2019 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.preferences.v1beta1;
22 |
23 | option csharp_namespace = "Cs3.Preferences.V1Beta1";
24 | option go_package = "preferencesv1beta1";
25 | option java_multiple_files = true;
26 | option java_outer_classname = "ResourcesProto";
27 | option java_package = "com.cs3.preferences.v1beta1";
28 | option objc_class_prefix = "CPX";
29 | option php_namespace = "Cs3\\Preferences\\V1Beta1";
30 |
31 | // Represents a key object consisting of a namespace and a string key.
32 | message PreferenceKey {
33 | // REQUIRED.
34 | // The namespace to which the key belongs.
35 | string namespace = 1;
36 | // REQUIRED.
37 | string key = 2;
38 | }
39 |
--------------------------------------------------------------------------------
/cs3/rpc/v1beta1/code.proto:
--------------------------------------------------------------------------------
1 | // Copyright 2018-2019 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.rpc.v1beta1;
22 |
23 | option csharp_namespace = "Cs3.Rpc.V1Beta1";
24 | option go_package = "rpcv1beta1";
25 | option java_multiple_files = true;
26 | option java_outer_classname = "CodeProto";
27 | option java_package = "com.cs3.rpc.v1beta1";
28 | option objc_class_prefix = "CRX";
29 | option php_namespace = "Cs3\\Rpc\\V1Beta1";
30 |
31 | // These are the canonical error codes used by CS3 APIs.
32 | //
33 | // Adapted from Google APIs:
34 | // https://github.com/googleapis/googleapis/
35 | //
36 | // Sometimes multiple error codes may apply. Services should return
37 | // the most specific error code that applies. For example, prefer
38 | // `OUT_OF_RANGE` over `FAILED_PRECONDITION` if both codes apply.
39 | // Similarly prefer `NOT_FOUND` or `ALREADY_EXISTS` over `FAILED_PRECONDITION`.
40 | enum Code {
41 | // A programmer would not intentionally set the code to CODE_INVALID.
42 | // This code exists to force service implementors to set
43 | // a specific code for the API call and to not rely on defaults.
44 | //
45 | // HTTP Mapping: 500 Internal Server Error
46 | CODE_INVALID = 0;
47 | // Not an error; returned on success
48 | //
49 | // HTTP Mapping: 200 OK
50 | CODE_OK = 1;
51 | // The operation was cancelled, typically by the caller.
52 | //
53 | // HTTP Mapping: 499 Client Closed Request
54 | CODE_CANCELLED = 2;
55 | // Unknown error. For example, this error may be returned when
56 | // a `Status` value received from another address space belongs to
57 | // an error space that is not known in this address space. Also
58 | // errors raised by APIs that do not return enough error information
59 | // may be converted to this error.
60 | //
61 | // HTTP Mapping: 500 Internal Server Error
62 | CODE_UNKNOWN = 3;
63 | // The client specified an invalid argument. Note that this differs
64 | // from `FAILED_PRECONDITION`. `INVALID_ARGUMENT` indicates arguments
65 | // that are problematic regardless of the state of the system
66 | // (e.g., a malformed file name).
67 | //
68 | // HTTP Mapping: 400 Bad Request
69 | CODE_INVALID_ARGUMENT = 4;
70 | // The deadline expired before the operation could complete. For operations
71 | // that change the state of the system, this error may be returned
72 | // even if the operation has completed successfully. For example, a
73 | // successful response from a server could have been delayed long
74 | // enough for the deadline to expire.
75 | //
76 | // HTTP Mapping: 504 Gateway Timeout
77 | CODE_DEADLINE_EXCEEDED = 5;
78 | // Some requested entity (e.g., file or directory) was not found.
79 | //
80 | // Note to server developers: if a request is denied for an entire class
81 | // of users, such as gradual feature rollout or undocumented whitelist,
82 | // `NOT_FOUND` may be used. If a request is denied for some users within
83 | // a class of users, such as user-based access control, `PERMISSION_DENIED`
84 | // must be used.
85 | //
86 | // HTTP Mapping: 404 Not Found
87 | CODE_NOT_FOUND = 6;
88 | // The entity that a client attempted to create (e.g., file or directory)
89 | // already exists.
90 | //
91 | // HTTP Mapping: 409 Conflict
92 | CODE_ALREADY_EXISTS = 7;
93 | // The caller does not have permission to execute the specified
94 | // operation. `PERMISSION_DENIED` must not be used for rejections
95 | // caused by exhausting some resource (use `RESOURCE_EXHAUSTED`
96 | // instead for those errors). `PERMISSION_DENIED` must not be
97 | // used if the caller can not be identified (use `UNAUTHENTICATED`
98 | // instead for those errors). This error code does not imply the
99 | // request is valid or the requested entity exists or satisfies
100 | // other pre-conditions.
101 | //
102 | // HTTP Mapping: 403 Forbidden
103 | CODE_PERMISSION_DENIED = 8;
104 | // The request does not have valid authentication credentials for the
105 | // operation.
106 | //
107 | // HTTP Mapping: 401 Unauthorized
108 | CODE_UNAUTHENTICATED = 9;
109 | // Some resource has been exhausted, perhaps a per-user quota, or
110 | // perhaps the entire file system is out of space.
111 | //
112 | // HTTP Mapping: 429 Too Many Requests
113 | CODE_RESOURCE_EXHAUSTED = 10;
114 | // The operation was rejected because the system is not in a state
115 | // required for the operation's execution. For example, the directory
116 | // to be deleted is non-empty, an rmdir operation is applied to
117 | // a non-directory, etc.
118 | //
119 | // Service implementors can use the following guidelines to decide
120 | // between `FAILED_PRECONDITION`, `ABORTED`, and `UNAVAILABLE`:
121 | // (a) Use `UNAVAILABLE` if the client can retry just the failing call.
122 | // (b) Use `ABORTED` if the client should retry at a higher level
123 | // (e.g., when a client-specified test-and-set fails, indicating the
124 | // client should restart a read-modify-write sequence).
125 | // (c) Use `FAILED_PRECONDITION` if the client should not retry until
126 | // the system state has been explicitly fixed. E.g., if an "rmdir"
127 | // fails because the directory is non-empty, `FAILED_PRECONDITION`
128 | // should be returned since the client should not retry unless
129 | // the files are deleted from the directory.
130 | //
131 | // HTTP Mapping: 400 Bad Request
132 | CODE_FAILED_PRECONDITION = 11;
133 | // The operation was aborted, typically due to a concurrency issue such as
134 | // a sequencer check failure or transaction abort.
135 | //
136 | // See the guidelines above for deciding between `FAILED_PRECONDITION`,
137 | // `ABORTED`, and `UNAVAILABLE`.
138 | //
139 | // HTTP Mapping: 409 Conflict
140 | CODE_ABORTED = 12;
141 | // The operation was attempted past the valid range. E.g., seeking or
142 | // reading past end-of-file.
143 | //
144 | // Unlike `INVALID_ARGUMENT`, this error indicates a problem that may
145 | // be fixed if the system state changes. For example, a 32-bit file
146 | // system will generate `INVALID_ARGUMENT` if asked to read at an
147 | // offset that is not in the range [0,2^32-1], but it will generate
148 | // `OUT_OF_RANGE` if asked to read from an offset past the current
149 | // file size.
150 | //
151 | // There is a fair bit of overlap between `FAILED_PRECONDITION` and
152 | // `OUT_OF_RANGE`. We recommend using `OUT_OF_RANGE` (the more specific
153 | // error) when it applies so that callers who are iterating through
154 | // a space can easily look for an `OUT_OF_RANGE` error to detect when
155 | // they are done.
156 | //
157 | // HTTP Mapping: 400 Bad Request
158 | CODE_OUT_OF_RANGE = 13;
159 | // The operation is not implemented or is not supported/enabled in this
160 | // service.
161 | //
162 | // HTTP Mapping: 501 Not Implemented
163 | CODE_UNIMPLEMENTED = 14;
164 | // Internal errors. This means that some invariants expected by the
165 | // underlying system have been broken. This error code is reserved
166 | // for serious errors.
167 | //
168 | // HTTP Mapping: 500 Internal Server Error
169 | CODE_INTERNAL = 15;
170 | // The service is currently unavailable. This is most likely a
171 | // transient condition, which can be corrected by retrying with
172 | // a backoff.
173 | //
174 | // See the guidelines above for deciding between `FAILED_PRECONDITION`,
175 | // `ABORTED`, and `UNAVAILABLE`.
176 | //
177 | // HTTP Mapping: 503 Service Unavailable
178 | CODE_UNAVAILABLE = 16;
179 | // Unrecoverable data loss or corruption.
180 | //
181 | // HTTP Mapping: 500 Internal Server Error
182 | CODE_DATA_LOSS = 17;
183 | // Redirects the operation to another location.
184 | // Used in a Status reponse with a reference to the target URI.
185 | CODE_REDIRECTION = 18;
186 | // The operation could not be performed because there is not enough
187 | // storage available. This can be because of lack of real storage
188 | // space or because of the exceeding of a quota associated to a
189 | // storage.
190 | //
191 | // HTTP Mapping: 507 Insufficient Storage
192 | CODE_INSUFFICIENT_STORAGE = 19;
193 | // The ability to lock a resource is specific to some WebDAV servers.
194 | // The HTTP 423 Locked error response code indicates that either
195 | // the resources tentatively targeted by is locked, meaning it can't be accessed.
196 | //
197 | // HTTP Mapping: 423 Locked
198 | CODE_LOCKED = 20;
199 | // The server returns the response status code to indicate that it has received
200 | // the request but is not going to process it because an asynchronous job
201 | // that has been started is still being processed and the result can not yet be provided.
202 | //
203 | // HTTP Mapping: 425 Too Early
204 | CODE_TOO_EARLY = 21;
205 | }
206 |
--------------------------------------------------------------------------------
/cs3/rpc/v1beta1/status.proto:
--------------------------------------------------------------------------------
1 | // Copyright 2018-2019 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.rpc.v1beta1;
22 |
23 | import "cs3/rpc/v1beta1/code.proto";
24 | import "cs3/types/v1beta1/types.proto";
25 |
26 | option csharp_namespace = "Cs3.Rpc.V1Beta1";
27 | option go_package = "rpcv1beta1";
28 | option java_multiple_files = true;
29 | option java_outer_classname = "StatusProto";
30 | option java_package = "com.cs3.rpc.v1beta1";
31 | option objc_class_prefix = "CRX";
32 | option php_namespace = "Cs3\\Rpc\\V1Beta1";
33 |
34 | // The `Status` message contains two pieces of data: error code and error message.
35 | // The error code should be an enum value of [cs3.rpc.code].
36 | // The error message should be a developer-facing English
37 | // message that helps developers *understand* and *resolve* the error.
38 | message Status {
39 | // REQUIRED.
40 | // The status code, which should be an enum value of [cs3.rpc.code][cs3.rpc.code].
41 | Code code = 1;
42 | // OPTIONAL.
43 | // A developer-facing error message, which should be in English. Any
44 | // user-facing error message should be localized and sent in the
45 | string message = 2;
46 | // OPTIONAL.
47 | // A trace added to the response for helping support to identify client problems.
48 | string trace = 3;
49 | // OPTIONAL.
50 | // A target URI as per RFC3986 to redirect requests to another location.
51 | // A Status message with CODE_REDIRECT MUST always set the target_uri.
52 | // https://golang.org/pkg/net/url/#URL provides a quick view of the format.
53 | string target_uri = 4;
54 | // OPTIONAL.
55 | // InnerError represents an encoded error.
56 | // This makes it possible to transport error types
57 | // and match them on the client side by type.
58 | // The InnerError pattern originates from graph.
59 | cs3.types.v1beta1.OpaqueEntry InnerError = 5;
60 | }
61 |
--------------------------------------------------------------------------------
/cs3/sharing/collaboration/v1beta1/collaboration_api.proto:
--------------------------------------------------------------------------------
1 | // Copyright 2018-2019 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.sharing.collaboration.v1beta1;
22 |
23 | import "cs3/rpc/v1beta1/status.proto";
24 | import "cs3/sharing/collaboration/v1beta1/resources.proto";
25 | import "cs3/storage/provider/v1beta1/resources.proto";
26 | import "cs3/types/v1beta1/types.proto";
27 | import "google/protobuf/field_mask.proto";
28 |
29 | option csharp_namespace = "Cs3.Sharing.Collaboration.V1Beta1";
30 | option go_package = "collaborationv1beta1";
31 | option java_multiple_files = true;
32 | option java_outer_classname = "CollaborationApiProto";
33 | option java_package = "com.cs3.sharing.collaboration.v1beta1";
34 | option objc_class_prefix = "CSC";
35 | option php_namespace = "Cs3\\Sharing\\Collaboration\\V1Beta1";
36 |
37 | // User Share Provider API
38 | //
39 | // The User Share Provider API is meant to manipulate share
40 | // resources for a specific share type (user, group, ocm, ...)
41 | // from the perspective of the creator or the share and
42 | // from the perspective of the receiver of the share.
43 | //
44 | // The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL
45 | // NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and
46 | // "OPTIONAL" in this document are to be interpreted as described in
47 | // RFC 2119.
48 | //
49 | // The following are global requirements that apply to all methods:
50 | // Any method MUST return CODE_OK on a succesful operation.
51 | // Any method MAY return NOT_IMPLEMENTED.
52 | // Any method MAY return INTERNAL.
53 | // Any method MAY return UNKNOWN.
54 | // Any method MAY return UNAUTHENTICATED.
55 | service CollaborationAPI {
56 | // Creates a new share.
57 | // MUST return CODE_NOT_FOUND if the resource reference does not exist.
58 | // MUST return CODE_LOCKED if the resource reference already locked.
59 | // MUST return CODE_ALREADY_EXISTS if the share already exists for the 4-tuple consisting of
60 | // (owner, shared_resource, grantee).
61 | // New shares MUST be created in the state SHARE_STATE_PENDING.
62 | rpc CreateShare(CreateShareRequest) returns (CreateShareResponse);
63 | // Removes a share.
64 | // MUST return CODE_NOT_FOUND if the share reference does not exist.
65 | rpc RemoveShare(RemoveShareRequest) returns (RemoveShareResponse);
66 | // Gets share information for a single share.
67 | // MUST return CODE_NOT_FOUND if the share reference does not exist.
68 | rpc GetShare(GetShareRequest) returns (GetShareResponse);
69 | // List the shares the authenticated principal has created,
70 | // both as owner and creator. If a filter is specified, only
71 | // shares satisfying the filter MUST be returned.
72 | rpc ListShares(ListSharesRequest) returns (ListSharesResponse);
73 | // Updates a share.
74 | // MUST return CODE_NOT_FOUND if the share reference does not exist.
75 | rpc UpdateShare(UpdateShareRequest) returns (UpdateShareResponse);
76 | // List all shares the authenticated principal has received.
77 | rpc ListReceivedShares(ListReceivedSharesRequest) returns (ListReceivedSharesResponse);
78 | // Update the received share to change the share state or the display name.
79 | // MUST return CODE_NOT_FOUND if the share reference does not exist.
80 | rpc UpdateReceivedShare(UpdateReceivedShareRequest) returns (UpdateReceivedShareResponse);
81 | // Get the information for the given received share reference.
82 | // MUST return CODE_NOT_FOUND if the received share reference does not exist.
83 | rpc GetReceivedShare(GetReceivedShareRequest) returns (GetReceivedShareResponse);
84 | }
85 |
86 | message CreateShareRequest {
87 | // OPTIONAL.
88 | // Opaque information.
89 | cs3.types.v1beta1.Opaque opaque = 1;
90 | // REQUIRED.
91 | // The information of the resource to be shared.
92 | storage.provider.v1beta1.ResourceInfo resource_info = 2;
93 | // REQUIRED.
94 | // The share grant for the share.
95 | ShareGrant grant = 3;
96 | }
97 |
98 | message CreateShareResponse {
99 | // REQUIRED.
100 | // The response status.
101 | cs3.rpc.v1beta1.Status status = 1;
102 | // OPTIONAL.
103 | // Opaque information.
104 | cs3.types.v1beta1.Opaque opaque = 2;
105 | // REQUIRED.
106 | // The created share.
107 | Share share = 3;
108 | }
109 |
110 | message UpdateShareRequest {
111 | // OPTIONAL.
112 | // Opaque information.
113 | cs3.types.v1beta1.Opaque opaque = 1;
114 | // REQUIRED.
115 | // Deprecated use the share and update_mask attribute.
116 | ShareReference ref = 2;
117 | // REQUIRED.
118 | message UpdateField {
119 | // One of the update fields MUST be specified.
120 | oneof field {
121 | // Update the permissions.
122 | SharePermissions permissions = 2;
123 | // Update the display name.
124 | string display_name = 3;
125 | }
126 | }
127 | // REQUIRED.
128 | // Deprecated use the share and update_mask attribute.
129 | UpdateField field = 3;
130 | // The update mask applies to the resource. For the `FieldMask` definition,
131 | // see https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#fieldmask
132 | google.protobuf.FieldMask update_mask = 4;
133 | // REQUIRED.
134 | // The share containing the new data
135 | Share share = 5;
136 | }
137 |
138 | message UpdateShareResponse {
139 | // REQUIRED.
140 | // The response status.
141 | cs3.rpc.v1beta1.Status status = 1;
142 | // OPTIONAL.
143 | // Opaque information.
144 | cs3.types.v1beta1.Opaque opaque = 2;
145 | // REQUIRED.
146 | // The updated share.
147 | Share share = 3;
148 | }
149 |
150 | message ListSharesRequest {
151 | // OPTIONAL.
152 | // Opaque information.
153 | cs3.types.v1beta1.Opaque opaque = 1;
154 | // OPTIONAL.
155 | // The list of filters to apply if any.
156 | repeated Filter filters = 2;
157 | // OPTIONAL.
158 | // Clients use this field to specify the maximum number of results to be returned by the server.
159 | // The server may further constrain the maximum number of results returned in a single page.
160 | // If the page_size is 0, the server will decide the number of results to be returned.
161 | // see https://cloud.google.com/apis/design/design_patterns#list_pagination
162 | int32 page_size = 3;
163 | // OPTIONAL.
164 | // The client uses this field to request a specific page of the list results.
165 | string page_token = 4;
166 | }
167 |
168 | message ListSharesResponse {
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 | // REQUIRED.
176 | // The list of shares.
177 | repeated Share shares = 3;
178 | // OPTIONAL.
179 | // This field represents the pagination token to retrieve the next page of results.
180 | // If the value is "", it means no further results for the request.
181 | // see https://cloud.google.com/apis/design/design_patterns#list_pagination
182 | string next_page_token = 4;
183 | }
184 |
185 | message RemoveShareRequest {
186 | // OPTIONAL.
187 | // Opaque information.
188 | cs3.types.v1beta1.Opaque opaque = 1;
189 | // REQUIRED.
190 | // The reference to which the action should be performed.
191 | ShareReference ref = 2;
192 | }
193 |
194 | message RemoveShareResponse {
195 | // REQUIRED.
196 | // The response status.
197 | cs3.rpc.v1beta1.Status status = 1;
198 | // OPTIONAL.
199 | // Opaque information.
200 | cs3.types.v1beta1.Opaque opaque = 2;
201 | }
202 |
203 | message GetShareRequest {
204 | // OPTIONAL.
205 | // Opaque information.
206 | cs3.types.v1beta1.Opaque opaque = 1;
207 | // REQUIRED.
208 | // The reference to which the action should be performed.
209 | ShareReference ref = 2;
210 | }
211 |
212 | message GetShareResponse {
213 | // REQUIRED.
214 | // The response status.
215 | cs3.rpc.v1beta1.Status status = 1;
216 | // OPTIONAL.
217 | // Opaque information.
218 | cs3.types.v1beta1.Opaque opaque = 2;
219 | // REQUIRED.
220 | // The share.
221 | Share share = 3;
222 | }
223 |
224 | message ListReceivedSharesRequest {
225 | // OPTIONAL.
226 | // Opaque information.
227 | cs3.types.v1beta1.Opaque opaque = 1;
228 | // OPTIONAL.
229 | // The list of filters to apply if any.
230 | repeated Filter filters = 3;
231 | // OPTIONAL.
232 | // Clients use this field to specify the maximum number of results to be returned by the server.
233 | // The server may further constrain the maximum number of results returned in a single page.
234 | // If the page_size is 0, the server will decide the number of results to be returned.
235 | // see https://cloud.google.com/apis/design/design_patterns#list_pagination
236 | int32 page_size = 4;
237 | // OPTIONAL.
238 | // The client uses this field to request a specific page of the list results.
239 | string page_token = 5;
240 | }
241 |
242 | message ListReceivedSharesResponse {
243 | // REQUIRED.
244 | // The response status.
245 | cs3.rpc.v1beta1.Status status = 1;
246 | // OPTIONAL.
247 | // Opaque information.
248 | cs3.types.v1beta1.Opaque opaque = 2;
249 | // REQUIRED.
250 | // The list of received shares.
251 | repeated ReceivedShare shares = 3;
252 | // OPTIONAL.
253 | // This field represents the pagination token to retrieve the next page of results.
254 | // If the value is "", it means no further results for the request.
255 | // see https://cloud.google.com/apis/design/design_patterns#list_pagination
256 | string next_page_token = 4;
257 | }
258 |
259 | // TODO(labkode): clean up display_name ? we'll use storage links for that.
260 | message UpdateReceivedShareRequest {
261 | // OPTIONAL.
262 | // Opaque information.
263 | cs3.types.v1beta1.Opaque opaque = 1;
264 | // REQUIRED.
265 | // The received share to update.
266 | ReceivedShare share = 2;
267 | // The update mask applies to the resource. For the `FieldMask` definition,
268 | // see https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#fieldmask
269 | google.protobuf.FieldMask update_mask = 3;
270 | }
271 |
272 | message UpdateReceivedShareResponse {
273 | // REQUIRED.
274 | // The response status.
275 | cs3.rpc.v1beta1.Status status = 1;
276 | // OPTIONAL.
277 | // Opaque information.
278 | cs3.types.v1beta1.Opaque opaque = 2;
279 | // REQUIRED.
280 | // The updated share.
281 | ReceivedShare share = 3;
282 | }
283 |
284 | message GetReceivedShareRequest {
285 | // OPTIONAL.
286 | // Opaque information.
287 | cs3.types.v1beta1.Opaque opaque = 1;
288 | // REQUIRED.
289 | // The reference of the received share.
290 | ShareReference ref = 2;
291 | }
292 |
293 | message GetReceivedShareResponse {
294 | // REQUIRED.
295 | // The response status.
296 | cs3.rpc.v1beta1.Status status = 1;
297 | // OPTIONAL.
298 | // Opaque information.
299 | cs3.types.v1beta1.Opaque opaque = 2;
300 | // REQUIRED.
301 | // The share.
302 | ReceivedShare share = 3;
303 | }
304 |
--------------------------------------------------------------------------------
/cs3/sharing/collaboration/v1beta1/resources.proto:
--------------------------------------------------------------------------------
1 | // Copyright 2018-2019 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.sharing.collaboration.v1beta1;
22 |
23 | import "cs3/identity/user/v1beta1/resources.proto";
24 | import "cs3/storage/provider/v1beta1/resources.proto";
25 | import "cs3/types/v1beta1/types.proto";
26 |
27 | option csharp_namespace = "Cs3.Sharing.Collaboration.V1Beta1";
28 | option go_package = "collaborationv1beta1";
29 | option java_multiple_files = true;
30 | option java_outer_classname = "ResourcesProto";
31 | option java_package = "com.cs3.sharing.collaboration.v1beta1";
32 | option objc_class_prefix = "CSC";
33 | option php_namespace = "Cs3\\Sharing\\Collaboration\\V1Beta1";
34 |
35 | // Shares are relationships between a resource owner
36 | // (usually the authenticated user) who grants permissions to a recipient (grantee)
37 | // on a specified resource (resource_id). UserShares represents both user and groups.
38 | message Share {
39 | // REQUIRED.
40 | // Opaque unique identifier of the share.
41 | ShareId id = 1;
42 | // REQUIRED.
43 | // Unique identifier of the shared resource.
44 | storage.provider.v1beta1.ResourceId resource_id = 2;
45 | // REQUIRED.
46 | // Permissions for the grantee to use
47 | // the resource.
48 | SharePermissions permissions = 3;
49 | // REQUIRED.
50 | // The receiver of the share, like a user, group ...
51 | storage.provider.v1beta1.Grantee grantee = 4;
52 | // REQUIRED.
53 | // Uniquely identifies the owner of the share
54 | // (the resource owner at the time of creating the share).
55 | // In case the ownership of the underlying resource changes
56 | // the share owner field MAY change to reflect the change of ownsership.
57 | cs3.identity.user.v1beta1.UserId owner = 5;
58 | // REQUIRED.
59 | // Uniquely identifies a principal who initiates the share creation.
60 | // A creator can create shares on behalf of the owner (because of re-sharing,
61 | // because belonging to special groups, ...).
62 | // Creator and owner often result in being the same principal.
63 | cs3.identity.user.v1beta1.UserId creator = 6;
64 | // REQUIRED.
65 | // Creation time of the share.
66 | cs3.types.v1beta1.Timestamp ctime = 7;
67 | // REQUIRED.
68 | // Last modification time of the share.
69 | cs3.types.v1beta1.Timestamp mtime = 8;
70 | // OPTIONAL.
71 | // The expiration time of the share.
72 | cs3.types.v1beta1.Timestamp expiration = 9;
73 | // OPTIONAL.
74 | // A user-defined description for the share.
75 | string description = 10;
76 | }
77 |
78 | // The permissions for a share.
79 | message SharePermissions {
80 | storage.provider.v1beta1.ResourcePermissions permissions = 1;
81 | // TODO(labkode): additional permissions for shares like re-sharing and denying
82 | }
83 |
84 | // A received share is the share that a grantee will receive.
85 | // It expands the original share by adding state to the share,
86 | // a display name from the perspective of the grantee and a
87 | // resource mount point in case the share will be mounted
88 | // in a storage provider.
89 | message ReceivedShare {
90 | // REQUIRED.
91 | Share share = 1;
92 | // REQUIRED.
93 | // The state of the share.
94 | ShareState state = 2;
95 | // REQUIRED.
96 | // The mount point of the share.
97 | storage.provider.v1beta1.Reference mount_point = 3;
98 | // OPTIONAL.
99 | // Flag to hide the share, defaults to false.
100 | bool hidden = 4;
101 | // OPTIONAL.
102 | // An alternate identifier to allow a recipient to rename the share.
103 | // If missing, use the original folder name.
104 | string alias = 5;
105 | }
106 |
107 | // The state of the share.
108 | enum ShareState {
109 | // The share is no longer valid, for example, the share expired.
110 | SHARE_STATE_INVALID = 0;
111 | // New shares MUST be created in the SHARE_STATE_PENDING state.
112 | // This state means the share is pending to be accepted or rejected
113 | // by the recipient of the share.
114 | SHARE_STATE_PENDING = 1;
115 | // The recipient of the share has accepted the share.
116 | SHARE_STATE_ACCEPTED = 2;
117 | // The recipient of the share has rejected the share.
118 | // Do not means the share is removed, the recipient MAY
119 | // change the state to accepted or pending.
120 | SHARE_STATE_REJECTED = 3;
121 | }
122 |
123 | // Uniquely identifies a share in the share provider.
124 | // A share MUST be uniquely identify by four (4) elements:
125 | // 1) The share provider id
126 | // 2) The owner of the share
127 | // 3) The resource id
128 | // 4) The grantee for the share
129 | // This 4-tuple MUST be unique.
130 | // For example, owner Alice shares the resource /home/docs with id
131 | // home:1234 to an user named Bob. The 4-tuple will consist of
132 | // 1) The share provider id = "user"
133 | // 2) The owner of the share = "Alice"
134 | // 3) The resource id = "home:1234"
135 | // 4) The grantee for the share = Grantee("type" = "user", "" => "Bob")
136 | message ShareKey {
137 | // REQUIRED.
138 | cs3.identity.user.v1beta1.UserId owner = 2;
139 | // REQUIRED.
140 | storage.provider.v1beta1.ResourceId resource_id = 3;
141 | // REQUIRED.
142 | storage.provider.v1beta1.Grantee grantee = 4;
143 | }
144 |
145 | // A share id identifies uniquely a // share in the share provider namespace.
146 | // A ShareId MUST be unique inside the share provider.
147 | message ShareId {
148 | // REQUIRED.
149 | // The internal id used by service implementor to
150 | // uniquely Collaboration the share in the internal
151 | // implementation of the service.
152 | string opaque_id = 2;
153 | }
154 |
155 | // The mechanism to identify a share
156 | // in the share provider namespace.
157 | message ShareReference {
158 | // REQUIRED.
159 | // One of the specifications MUST be specified.
160 | oneof spec {
161 | // The id of the share.
162 | ShareId id = 1;
163 | // The combination of fields that
164 | // make the share unique.
165 | ShareKey key = 2;
166 | }
167 | }
168 |
169 | // A share grant specifies the share permissions
170 | // for a grantee.
171 | message ShareGrant {
172 | // REQUIRED.
173 | // The grantee of the grant.
174 | storage.provider.v1beta1.Grantee grantee = 1;
175 | // REQUIRED.
176 | // The share permissions for the grant.
177 | SharePermissions permissions = 2;
178 | // OPTIONAL
179 | // Expiration of the grant.
180 | cs3.types.v1beta1.Timestamp expiration = 3;
181 | }
182 |
183 | // Represents a filter to apply to the request.
184 | message Filter {
185 | // The filter to apply.
186 | enum Type {
187 | TYPE_INVALID = 0;
188 | TYPE_NO = 1;
189 | TYPE_RESOURCE_ID = 2;
190 | TYPE_OWNER = 3;
191 | TYPE_CREATOR = 4;
192 | TYPE_GRANTEE_TYPE = 5;
193 | TYPE_EXCLUDE_DENIALS = 6;
194 | TYPE_SPACE_ID = 7;
195 | TYPE_STATE = 8;
196 | }
197 | // REQUIRED.
198 | Type type = 2;
199 | oneof term {
200 | storage.provider.v1beta1.ResourceId resource_id = 3;
201 | cs3.identity.user.v1beta1.UserId owner = 4;
202 | cs3.identity.user.v1beta1.UserId creator = 5;
203 | storage.provider.v1beta1.GranteeType grantee_type = 6;
204 | string space_id = 7;
205 | ShareState state = 8;
206 | }
207 | }
208 |
--------------------------------------------------------------------------------
/cs3/sharing/link/v1beta1/link_api.proto:
--------------------------------------------------------------------------------
1 | // Copyright 2018-2023 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.sharing.link.v1beta1;
22 |
23 | import "cs3/identity/user/v1beta1/resources.proto";
24 | import "cs3/rpc/v1beta1/status.proto";
25 | import "cs3/sharing/link/v1beta1/resources.proto";
26 | import "cs3/storage/provider/v1beta1/resources.proto";
27 | import "cs3/types/v1beta1/types.proto";
28 |
29 | option csharp_namespace = "Cs3.Sharing.Link.V1Beta1";
30 | option go_package = "linkv1beta1";
31 | option java_multiple_files = true;
32 | option java_outer_classname = "LinkApiProto";
33 | option java_package = "com.cs3.sharing.link.v1beta1";
34 | option objc_class_prefix = "CSL";
35 | option php_namespace = "Cs3\\Sharing\\Link\\V1Beta1";
36 |
37 | // PublicShare Provider API
38 | //
39 | // The Public Share Provider API is meant to manipulate public shares
40 | // also called public links.
41 | //
42 | // Access to public shares can be limitted by a password. The share
43 | // provider must store this password in a secure manner e.g. hashed
44 | // with the bcrypt algorithm.
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 LinkAPI {
58 | // Creates a new share.
59 | // MUST return CODE_NOT_FOUND if the resource reference does not exist.
60 | // MUST return CODE_ALREADY_EXISTS if the share already exists for the 4-tuple consisting of
61 | // (owner, shared_resource, grantee).
62 | // New shares MUST be created in the state SHARE_STATE_PENDING.
63 | rpc CreatePublicShare(CreatePublicShareRequest) returns (CreatePublicShareResponse);
64 | // Removes a share.
65 | // MUST return CODE_NOT_FOUND if the share reference does not exist.
66 | rpc RemovePublicShare(RemovePublicShareRequest) returns (RemovePublicShareResponse);
67 | // Gets share information for a single share.
68 | // MUST return CODE_NOT_FOUND if the share reference does not exist.
69 | rpc GetPublicShare(GetPublicShareRequest) returns (GetPublicShareResponse);
70 | // Gets share information for a single share by its unlisted token.
71 | // MUST return CODE_NOT_FOUND if the share does not exist.
72 | rpc GetPublicShareByToken(GetPublicShareByTokenRequest) returns (GetPublicShareByTokenResponse);
73 | // List the shares the authenticated principal has created,
74 | // both as owner and creator. If a filter is specified, only
75 | // shares satisfying the filter MUST be returned.
76 | rpc ListPublicShares(ListPublicSharesRequest) returns (ListPublicSharesResponse);
77 | // Updates a share.
78 | // MUST return CODE_NOT_FOUND if the share reference does not exist.
79 | rpc UpdatePublicShare(UpdatePublicShareRequest) returns (UpdatePublicShareResponse);
80 | }
81 |
82 | message CreatePublicShareRequest {
83 | // OPTIONAL.
84 | // Opaque information.
85 | cs3.types.v1beta1.Opaque opaque = 1;
86 | // REQUIRED.
87 | // The unique identifier for the shared storage resource.
88 | storage.provider.v1beta1.ResourceInfo resource_info = 2;
89 | // REQUIRED.
90 | // The restrictions to apply to the share.
91 | Grant grant = 3;
92 | // OPTIONAL
93 | // The description to add to the share.
94 | string description = 4;
95 | // OPTIONAL
96 | // Indicates a share used for internal usage,
97 | // not exposed by a ListPublicShares.
98 | bool internal = 5;
99 | // OPTIONAL
100 | // Whether to notify the owner of a share when a file is uploaded to it.
101 | bool notify_uploads = 6;
102 | // OPTIONAL
103 | // Comma-separated list of extra email addresses to notify when a file is
104 | // uploaded to the share.
105 | string notify_uploads_extra_recipients = 7;
106 | }
107 |
108 | message CreatePublicShareResponse {
109 | // REQUIRED.
110 | // The response status.
111 | cs3.rpc.v1beta1.Status status = 1;
112 | // OPTIONAL.
113 | // Opaque information.
114 | cs3.types.v1beta1.Opaque opaque = 2;
115 | // REQUIRED.
116 | // The created share.
117 | PublicShare share = 3;
118 | }
119 |
120 | message UpdatePublicShareRequest {
121 | // OPTIONAL.
122 | // Opaque information.
123 | cs3.types.v1beta1.Opaque opaque = 1;
124 | // REQUIRED.
125 |
126 | // REQUIRED.
127 | // The reference to the public share.
128 | PublicShareReference ref = 2;
129 | // Available fields to update.
130 |
131 | // REQUIRED.
132 | message Update {
133 | // REQUIRED.
134 | enum Type {
135 | TYPE_INVALID = 0;
136 | TYPE_PERMISSIONS = 1;
137 | TYPE_PASSWORD = 2;
138 | TYPE_EXPIRATION = 3;
139 | TYPE_DISPLAYNAME = 4;
140 | TYPE_DESCRIPTION = 5;
141 | TYPE_NOTIFYUPLOADS = 6;
142 | TYPE_NOTIFYUPLOADSEXTRARECIPIENTS = 7;
143 | }
144 | // REQUIRED.
145 | // Defines the field to update.
146 | Type type = 3;
147 | // REQUIRED.
148 | // Contains the field that will be updated.
149 | Grant grant = 4;
150 | // OPTIONAL
151 | // Defines the public link display name.
152 | string display_name = 5;
153 | // OPTIONAL
154 | // Defines the public link description.
155 | string description = 6;
156 | // OPTIONAL
157 | // Whether to notify the owner of a share when a file is uploaded to it.
158 | bool notify_uploads = 7;
159 | // OPTIONAL
160 | // Comma-separated list of extra email addresses to notify when a file is
161 | // uploaded to the share.
162 | string notify_uploads_extra_recipients = 8;
163 | }
164 | Update update = 3;
165 | }
166 |
167 | message UpdatePublicShareResponse {
168 | // REQUIRED.
169 | // The response status.
170 | cs3.rpc.v1beta1.Status status = 1;
171 | // OPTIONAL.
172 | // Opaque information.
173 | cs3.types.v1beta1.Opaque opaque = 2;
174 | // REQUIRED.
175 | // The updated public share.
176 | PublicShare share = 3;
177 | }
178 |
179 | message ListPublicSharesRequest {
180 | // OPTIONAL.
181 | // Opaque information.
182 | cs3.types.v1beta1.Opaque opaque = 1;
183 | // REQUIRED.
184 | // represents a filter to apply to the request.
185 | message Filter {
186 | // REQUIRED.
187 | enum Type {
188 | TYPE_INVALID = 0;
189 | TYPE_RESOURCE_ID = 1;
190 | TYPE_OWNER = 2;
191 | TYPE_CREATOR = 3;
192 | }
193 | Type type = 2;
194 | oneof term {
195 | storage.provider.v1beta1.ResourceId resource_id = 3;
196 | cs3.identity.user.v1beta1.UserId owner = 4;
197 | cs3.identity.user.v1beta1.UserId creator = 5;
198 | }
199 | }
200 | // OPTIONAL.
201 | // The list of filters to apply if any.
202 | repeated Filter filters = 2;
203 | // OPTIONAL.
204 | // If a signature should be included in the share.
205 | bool sign = 3;
206 | // OPTIONAL.
207 | // Clients use this field to specify the maximum number of results to be returned by the server.
208 | // The server may further constrain the maximum number of results returned in a single page.
209 | // If the page_size is 0, the server will decide the number of results to be returned.
210 | // see https://cloud.google.com/apis/design/design_patterns#list_pagination
211 | int32 page_size = 4;
212 | // OPTIONAL.
213 | // The client uses this field to request a specific page of the list results.
214 | string page_token = 5;
215 | }
216 |
217 | message ListPublicSharesResponse {
218 | // REQUIRED.
219 | // The response status.
220 | cs3.rpc.v1beta1.Status status = 1;
221 | // OPTIONAL.
222 | // Opaque information.
223 | cs3.types.v1beta1.Opaque opaque = 2;
224 | // REQUIRED.
225 | // The list of shares.
226 | repeated PublicShare share = 3;
227 | // OPTIONAL.
228 | // This field represents the pagination token to retrieve the next page of results.
229 | // If the value is "", it means no further results for the request.
230 | // see https://cloud.google.com/apis/design/design_patterns#list_pagination
231 | string next_page_token = 4;
232 | }
233 |
234 | message RemovePublicShareRequest {
235 | // OPTIONAL.
236 | // Opaque information.
237 | cs3.types.v1beta1.Opaque opaque = 1;
238 | // REQUIRED.
239 | // The reference to which the action should be performed.
240 | PublicShareReference ref = 2;
241 | }
242 |
243 | message RemovePublicShareResponse {
244 | // REQUIRED.
245 | // The response status.
246 | cs3.rpc.v1beta1.Status status = 1;
247 | // OPTIONAL.
248 | // Opaque information.
249 | cs3.types.v1beta1.Opaque opaque = 2;
250 | }
251 |
252 | message GetPublicShareRequest {
253 | // OPTIONAL.
254 | // Opaque information.
255 | cs3.types.v1beta1.Opaque opaque = 1;
256 | // REQUIRED.
257 | // The reference to which the action should be performed.
258 | PublicShareReference ref = 2;
259 | // OPTIONAL.
260 | // If a signature should be included in the share.
261 | bool sign = 3;
262 | }
263 |
264 | message GetPublicShareResponse {
265 | // REQUIRED.
266 | // The response status.
267 | cs3.rpc.v1beta1.Status status = 1;
268 | // OPTIONAL.
269 | // Opaque information.
270 | cs3.types.v1beta1.Opaque opaque = 2;
271 | // REQUIRED.
272 | // The share.
273 | PublicShare share = 3;
274 | }
275 |
276 | message GetPublicShareByTokenRequest {
277 | // OPTIONAL.
278 | // Opaque information.
279 | cs3.types.v1beta1.Opaque opaque = 1;
280 | // REQUIRED.
281 | // The unlisted token to identify the public share.
282 | string token = 2;
283 | // OPTIONAL.
284 | // The public link can require authentication.
285 | PublicShareAuthentication authentication = 3;
286 | // OPTIONAL.
287 | // If a signature should be included in the share.
288 | bool sign = 4;
289 | }
290 |
291 | message GetPublicShareByTokenResponse {
292 | // REQUIRED.
293 | // The response status.
294 | cs3.rpc.v1beta1.Status status = 1;
295 | // OPTIONAL.
296 | // Opaque information.
297 | cs3.types.v1beta1.Opaque opaque = 2;
298 | // REQUIRED.
299 | // The share.
300 | PublicShare share = 3;
301 | // OPTIONAL.
302 | // The share password hash.
303 | string password_hash = 4 [deprecated = true];
304 | }
305 |
--------------------------------------------------------------------------------
/cs3/sharing/link/v1beta1/resources.proto:
--------------------------------------------------------------------------------
1 | // Copyright 2018-2023 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.sharing.link.v1beta1;
22 |
23 | import "cs3/identity/user/v1beta1/resources.proto";
24 | import "cs3/storage/provider/v1beta1/resources.proto";
25 | import "cs3/types/v1beta1/types.proto";
26 |
27 | option csharp_namespace = "Cs3.Sharing.Link.V1Beta1";
28 | option go_package = "linkv1beta1";
29 | option java_multiple_files = true;
30 | option java_outer_classname = "ResourcesProto";
31 | option java_package = "com.cs3.sharing.link.v1beta1";
32 | option objc_class_prefix = "CSL";
33 | option php_namespace = "Cs3\\Sharing\\Link\\V1Beta1";
34 |
35 |
36 | // Public share are relationships between a resource owner
37 | // (usually the authenticated user) who grants permissions to a recipient (grantee)
38 | // on a specified resource (resource_id). UserShares represents both user and groups.
39 | // TODO(labkode): do we need to have resource_type stored on the share?
40 | // This is not needed if when getting the shares a stat operation is launched against the
41 | // the storage provider.
42 | message PublicShare {
43 | // REQUIRED.
44 | // Opaque unique identifier of the share.
45 | PublicShareId id = 1;
46 | // REQUIRED.
47 | // The unlisted token to give public access
48 | // to the public share.
49 | string token = 2;
50 | // REQUIRED.
51 | // Unique identifier of the shared resource.
52 | storage.provider.v1beta1.ResourceId resource_id = 3;
53 | // REQUIRED.
54 | // Permissions for the grantee to use
55 | // the resource.
56 | PublicSharePermissions permissions = 4;
57 | // REQUIRED.
58 | // Uniquely identifies the owner of the share
59 | // (the resource owner at the time of creating the share).
60 | // In case the ownership of the underlying resource changes
61 | // the share owner field MAY change to reflect the change of ownsership.
62 | cs3.identity.user.v1beta1.UserId owner = 5;
63 | // REQUIRED.
64 | // Uniquely identifies a principal who initiates the share creation.
65 | // A creator can create shares on behalf of the owner (because of re-sharing,
66 | // because belonging to special groups, ...).
67 | // Creator and owner often result in being the same principal.
68 | cs3.identity.user.v1beta1.UserId creator = 6;
69 | // REQUIRED.
70 | // Creation time of the share.
71 | cs3.types.v1beta1.Timestamp ctime = 7;
72 | // REQUIRED.
73 | // Last modification time of the share.
74 | cs3.types.v1beta1.Timestamp mtime = 8;
75 | // REQUIRED.
76 | // Determines if the public share is password protected or not.
77 | bool password_protected = 9;
78 | // OPTIONAL.
79 | // The expiration time for the public share.
80 | cs3.types.v1beta1.Timestamp expiration = 10;
81 | // OPTIONAL.
82 | // Display name for the shared resource (such as file, directory basename or any
83 | // user defined name).
84 | // The display name MAY be different than the actual resource basename.
85 | // This field is only useful for informational purposes, like for example,
86 | // setting the window title in a public share HTML page.
87 | string display_name = 11;
88 | // OPTIONAL.
89 | // A time constrained token with which
90 | // GetPublicSharebyToken requests can be
91 | // authenticated.
92 | ShareSignature signature = 12;
93 | // OPTIONAL
94 | // A bool value indicating if the link is the quicklink
95 | // the server will enforce a maximum of 1 quicklink per resource
96 | bool quicklink = 13;
97 | // OPTIONAL
98 | // Description of the share.
99 | string description = 14;
100 | // OPTIONAL
101 | // Whether to notify the owner of a share when a file is uploaded to it.
102 | bool notify_uploads = 15;
103 | // OPTIONAL
104 | // Comma-separated list of extra email addresses to notify when a file is
105 | // uploaded to the share.
106 | string notify_uploads_extra_recipients = 16;
107 | }
108 |
109 | // The permissions for a share.
110 | message PublicSharePermissions {
111 | storage.provider.v1beta1.ResourcePermissions permissions = 1;
112 | // TODO(labkode): additional permissions for shares like re-sharing
113 | }
114 |
115 | // A share id identifies uniquely a // share in the share provider namespace.
116 | // A ShareId MUST be unique inside the share provider.
117 | message PublicShareId {
118 | // REQUIRED.
119 | // The internal id used by service implementor to
120 | // uniquely identity the share in the internal
121 | // implementation of the service.
122 | string opaque_id = 2;
123 | }
124 |
125 | // The mechanism to identify a share
126 | // in the share provider namespace.
127 | message PublicShareReference {
128 | // REQUIRED.
129 | // One of the specifications MUST be specified.
130 | oneof spec {
131 | // The id of the share.
132 | PublicShareId id = 1;
133 | // The token to identify the public share.
134 | string token = 2;
135 | }
136 | }
137 |
138 | // The mechanism to authenticate a request to
139 | // GetPublicShareByToken.
140 | message PublicShareAuthentication {
141 | oneof spec {
142 | // The password of the share.
143 | string password = 1;
144 | // The signature issued by GetPublicShareByToken.
145 | ShareSignature signature = 2;
146 | }
147 | }
148 |
149 | // A time constrained token which can be used to
150 | // authenticate link share requests.
151 | message ShareSignature {
152 | // REQUIRED.
153 | // The signature value.
154 | string signature = 1;
155 | // REQUIRED.
156 | // The time until the signature becomes invalid.
157 | cs3.types.v1beta1.Timestamp signature_expiration = 2;
158 | }
159 |
160 | // Defines the restrictions for the public share.
161 | message Grant {
162 | // REQUIRED.
163 | // The permissions for the share.
164 | PublicSharePermissions permissions = 1;
165 | // OPTIONAL.
166 | // A password to protect the access to the public share.
167 | string password = 2;
168 | // OPTIONAL.
169 | // An expiration date to protect the access to the public share.
170 | cs3.types.v1beta1.Timestamp expiration = 3;
171 | }
172 |
--------------------------------------------------------------------------------
/cs3/sharing/ocm/v1beta1/ocm_api.proto:
--------------------------------------------------------------------------------
1 | // Copyright 2018-2019 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.sharing.ocm.v1beta1;
22 |
23 | import "cs3/identity/user/v1beta1/resources.proto";
24 | import "cs3/ocm/provider/v1beta1/resources.proto";
25 | import "cs3/rpc/v1beta1/status.proto";
26 | import "cs3/sharing/ocm/v1beta1/resources.proto";
27 | import "cs3/storage/provider/v1beta1/resources.proto";
28 | import "cs3/types/v1beta1/types.proto";
29 | import "google/protobuf/field_mask.proto";
30 |
31 | option csharp_namespace = "Cs3.Sharing.Ocm.V1Beta1";
32 | option go_package = "ocmv1beta1";
33 | option java_multiple_files = true;
34 | option java_outer_classname = "OcmApiProto";
35 | option java_package = "com.cs3.sharing.ocm.v1beta1";
36 | option objc_class_prefix = "CSO";
37 | option php_namespace = "Cs3\\Sharing\\Ocm\\V1Beta1";
38 |
39 | // OCM Share Provider API
40 | //
41 | // The OCM Share Provider API is meant to manipulate share
42 | // resources from the perspective of the creator or the share and
43 | // from the perspective of the receiver of the share.
44 | //
45 | // The following APIs match the OCM v1.1 spec including multi-protocol shares.
46 | //
47 | // The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL
48 | // NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and
49 | // "OPTIONAL" in this document are to be interpreted as described in
50 | // RFC 2119.
51 | //
52 | // The following are global requirements that apply to all methods:
53 | // Any method MUST return CODE_OK on a succesful operation.
54 | // Any method MAY return NOT_IMPLEMENTED.
55 | // Any method MAY return INTERNAL.
56 | // Any method MAY return UNKNOWN.
57 | // Any method MAY return UNAUTHENTICATED.
58 | service OcmAPI {
59 | // Creates a new ocm share.
60 | // MUST return CODE_NOT_FOUND if the resource reference does not exist.
61 | // MUST return CODE_ALREADY_EXISTS if the share already exists for the 4-tuple consisting of
62 | // (owner, shared_resource, grantee).
63 | // New shares MUST be created in the state SHARE_STATE_PENDING, and MUST be sent
64 | // to the remote system using the OCM API at:
65 | // https://cs3org.github.io/OCM-API/docs.html?branch=v1.1.0&repo=OCM-API&user=cs3org#/paths/~1shares/post
66 | rpc CreateOCMShare(CreateOCMShareRequest) returns (CreateOCMShareResponse);
67 | // Removes a share.
68 | // MUST return CODE_NOT_FOUND if the share reference does not exist.
69 | // This action SHALL be notified to the remote system
70 | // using the OCM API at:
71 | // https://cs3org.github.io/OCM-API/docs.html?branch=v1.1.0&repo=OCM-API&user=cs3org#/paths/~1notifications/post
72 | rpc RemoveOCMShare(RemoveOCMShareRequest) returns (RemoveOCMShareResponse);
73 | // Gets share information for a single share.
74 | // MUST return CODE_NOT_FOUND if the share reference does not exist.
75 | rpc GetOCMShare(GetOCMShareRequest) returns (GetOCMShareResponse);
76 | // Gets share information for a single share by its unlisted token.
77 | // MUST return CODE_NOT_FOUND if the share does not exist.
78 | rpc GetOCMShareByToken(GetOCMShareByTokenRequest) returns (GetOCMShareByTokenResponse);
79 | // List the shares the authenticated principal has created,
80 | // both as owner and creator. If a filter is specified, only
81 | // shares satisfying the filter MUST be returned.
82 | rpc ListOCMShares(ListOCMSharesRequest) returns (ListOCMSharesResponse);
83 | // Updates a share.
84 | // MUST return CODE_NOT_FOUND if the share reference does not exist.
85 | // This action SHALL be notified to the remote system
86 | // using the OCM API at:
87 | // https://cs3org.github.io/OCM-API/docs.html?branch=v1.1.0&repo=OCM-API&user=cs3org#/paths/~1notifications/post
88 | rpc UpdateOCMShare(UpdateOCMShareRequest) returns (UpdateOCMShareResponse);
89 | // List all shares the authenticated principal has received.
90 | rpc ListReceivedOCMShares(ListReceivedOCMSharesRequest) returns (ListReceivedOCMSharesResponse);
91 | // Update the received share to change the share state or the display name.
92 | // MUST return CODE_NOT_FOUND if the share reference does not exist.
93 | rpc UpdateReceivedOCMShare(UpdateReceivedOCMShareRequest) returns (UpdateReceivedOCMShareResponse);
94 | // Get the information for the given received share reference.
95 | // MUST return CODE_NOT_FOUND if the received share reference does not exist.
96 | rpc GetReceivedOCMShare(GetReceivedOCMShareRequest) returns (GetReceivedOCMShareResponse);
97 | }
98 |
99 | message CreateOCMShareRequest {
100 | // OPTIONAL.
101 | // Opaque information.
102 | cs3.types.v1beta1.Opaque opaque = 1;
103 | // REQUIRED.
104 | // The unique identifier for the shared storage resource.
105 | storage.provider.v1beta1.ResourceId resource_id = 2;
106 | // REQUIRED.
107 | // The grantee for the share.
108 | storage.provider.v1beta1.Grantee grantee = 3;
109 | // REQUIRED.
110 | // The details of the recipient user's mesh provider.
111 | cs3.ocm.provider.v1beta1.ProviderInfo recipient_mesh_provider = 4;
112 | // REQUIRED.
113 | repeated AccessMethod access_methods = 5;
114 | // OPTIONAL.
115 | // The expiration time for the ocm share.
116 | cs3.types.v1beta1.Timestamp expiration = 6;
117 | }
118 |
119 | message CreateOCMShareResponse {
120 | // REQUIRED.
121 | // The response status.
122 | cs3.rpc.v1beta1.Status status = 1;
123 | // OPTIONAL.
124 | // Opaque information.
125 | cs3.types.v1beta1.Opaque opaque = 2;
126 | // REQUIRED.
127 | // The created share.
128 | Share share = 3;
129 | // OPTIONAL.
130 | // Display name of the recipient of the share.
131 | string recipient_display_name = 4;
132 | }
133 |
134 | message UpdateOCMShareRequest {
135 | // OPTIONAL.
136 | // Opaque information.
137 | cs3.types.v1beta1.Opaque opaque = 1;
138 | // REQUIRED.
139 | ShareReference ref = 2;
140 | // REQUIRED.
141 | message UpdateField {
142 | // One of the update fields MUST be specified.
143 | oneof field {
144 | // Update the expiration.
145 | cs3.types.v1beta1.Timestamp expiration = 1;
146 | // Update access methods.
147 | AccessMethod access_methods = 2;
148 | }
149 | }
150 | repeated UpdateField field = 3;
151 | }
152 |
153 | message UpdateOCMShareResponse {
154 | // REQUIRED.
155 | // The response status.
156 | cs3.rpc.v1beta1.Status status = 1;
157 | // OPTIONAL.
158 | // Opaque information.
159 | cs3.types.v1beta1.Opaque opaque = 2;
160 | }
161 |
162 | message ListOCMSharesRequest {
163 | // OPTIONAL.
164 | // Opaque information.
165 | cs3.types.v1beta1.Opaque opaque = 1;
166 | // REQUIRED.
167 | // represents a filter to apply to the request.
168 | message Filter {
169 | // REQUIRED.
170 | // The filter to apply.
171 | enum Type {
172 | TYPE_INVALID = 0;
173 | TYPE_NO = 1;
174 | TYPE_RESOURCE_ID = 2;
175 | TYPE_OWNER = 3;
176 | TYPE_CREATOR = 4;
177 | TYPE_OWNER_PROVIDER = 5;
178 | TYPE_CREATOR_PROVIDER = 6;
179 | }
180 | // REQUIRED.
181 | Type type = 2;
182 | oneof term {
183 | storage.provider.v1beta1.ResourceId resource_id = 3;
184 | cs3.identity.user.v1beta1.UserId owner = 4;
185 | cs3.identity.user.v1beta1.UserId creator = 5;
186 | }
187 | }
188 | // OPTIONAL.
189 | // The list of filters to apply if any.
190 | repeated Filter filters = 2;
191 | // OPTIONAL.
192 | // Clients use this field to specify the maximum number of results to be returned by the server.
193 | // The server may further constrain the maximum number of results returned in a single page.
194 | // If the page_size is 0, the server will decide the number of results to be returned.
195 | // see https://cloud.google.com/apis/design/design_patterns#list_pagination
196 | int32 page_size = 3;
197 | // OPTIONAL.
198 | // The client uses this field to request a specific page of the list results.
199 | string page_token = 4;
200 | }
201 |
202 | message ListOCMSharesResponse {
203 | // REQUIRED.
204 | // The response status.
205 | cs3.rpc.v1beta1.Status status = 1;
206 | // OPTIONAL.
207 | // Opaque information.
208 | cs3.types.v1beta1.Opaque opaque = 2;
209 | // REQUIRED.
210 | // The list of shares.
211 | repeated Share shares = 3;
212 | // OPTIONAL.
213 | // This field represents the pagination token to retrieve the next page of results.
214 | // If the value is "", it means no further results for the request.
215 | // see https://cloud.google.com/apis/design/design_patterns#list_pagination
216 | string next_page_token = 4;
217 | }
218 |
219 | message RemoveOCMShareRequest {
220 | // OPTIONAL.
221 | // Opaque information.
222 | cs3.types.v1beta1.Opaque opaque = 1;
223 | // REQUIRED.
224 | // The reference to which the action should be performed.
225 | ShareReference ref = 2;
226 | }
227 |
228 | message RemoveOCMShareResponse {
229 | // REQUIRED.
230 | // The response status.
231 | cs3.rpc.v1beta1.Status status = 1;
232 | // OPTIONAL.
233 | // Opaque information.
234 | cs3.types.v1beta1.Opaque opaque = 2;
235 | }
236 |
237 | message GetOCMShareRequest {
238 | // OPTIONAL.
239 | // Opaque information.
240 | cs3.types.v1beta1.Opaque opaque = 1;
241 | // REQUIRED.
242 | // The reference to which the action should be performed.
243 | ShareReference ref = 2;
244 | }
245 |
246 | message GetOCMShareResponse {
247 | // REQUIRED.
248 | // The response status.
249 | cs3.rpc.v1beta1.Status status = 1;
250 | // OPTIONAL.
251 | // Opaque information.
252 | cs3.types.v1beta1.Opaque opaque = 2;
253 | // REQUIRED.
254 | // The share.
255 | Share share = 3;
256 | }
257 |
258 | message GetOCMShareByTokenRequest {
259 | // REQUIRED.
260 | // The unlisted token to identify the public share.
261 | string token = 1;
262 | }
263 |
264 | message GetOCMShareByTokenResponse {
265 | // REQUIRED.
266 | // The response status.
267 | cs3.rpc.v1beta1.Status status = 1;
268 | // REQUIRED.
269 | // The share.
270 | Share share = 2;
271 | }
272 |
273 | message ListReceivedOCMSharesRequest {
274 | // OPTIONAL.
275 | // Opaque information.
276 | cs3.types.v1beta1.Opaque opaque = 1;
277 | // OPTIONAL.
278 | // Clients use this field to specify the maximum number of results to be returned by the server.
279 | // The server may further constrain the maximum number of results returned in a single page.
280 | // If the page_size is 0, the server will decide the number of results to be returned.
281 | // see https://cloud.google.com/apis/design/design_patterns#list_pagination
282 | int32 page_size = 2;
283 | // OPTIONAL.
284 | // The client uses this field to request a specific page of the list results.
285 | string page_token = 3;
286 | }
287 |
288 | message ListReceivedOCMSharesResponse {
289 | // REQUIRED.
290 | // The response status.
291 | cs3.rpc.v1beta1.Status status = 1;
292 | // OPTIONAL.
293 | // Opaque information.
294 | cs3.types.v1beta1.Opaque opaque = 2;
295 | // REQUIRED.
296 | // The list of received shares.
297 | repeated ReceivedShare shares = 3;
298 | // OPTIONAL.
299 | // This field represents the pagination token to retrieve the next page of results.
300 | // If the value is "", it means no further results for the request.
301 | // see https://cloud.google.com/apis/design/design_patterns#list_pagination
302 | string next_page_token = 4;
303 | }
304 |
305 | // TODO(labkode): clean up display_name ? we'll use storage links for that.
306 | message UpdateReceivedOCMShareRequest {
307 | // OPTIONAL.
308 | // Opaque information.
309 | cs3.types.v1beta1.Opaque opaque = 1;
310 | // REQUIRED.
311 | // The received share to update.
312 | ReceivedShare share = 2;
313 | // The update mask applies to the resource. For the `FieldMask` definition,
314 | // see https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#fieldmask
315 | google.protobuf.FieldMask update_mask = 3;
316 | }
317 |
318 | message UpdateReceivedOCMShareResponse {
319 | // REQUIRED.
320 | // The response status.
321 | cs3.rpc.v1beta1.Status status = 1;
322 | // OPTIONAL.
323 | // Opaque information.
324 | cs3.types.v1beta1.Opaque opaque = 2;
325 | }
326 |
327 | message GetReceivedOCMShareRequest {
328 | // OPTIONAL.
329 | // Opaque information.
330 | cs3.types.v1beta1.Opaque opaque = 1;
331 | // REQUIRED.
332 | // The reference of the received share.
333 | ShareReference ref = 2;
334 | }
335 |
336 | message GetReceivedOCMShareResponse {
337 | // REQUIRED.
338 | // The response status.
339 | cs3.rpc.v1beta1.Status status = 1;
340 | // OPTIONAL.
341 | // Opaque information.
342 | cs3.types.v1beta1.Opaque opaque = 2;
343 | // REQUIRED.
344 | // The share.
345 | ReceivedShare share = 3;
346 | }
347 |
--------------------------------------------------------------------------------
/cs3/sharing/ocm/v1beta1/resources.proto:
--------------------------------------------------------------------------------
1 | // Copyright 2018-2019 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.sharing.ocm.v1beta1;
22 |
23 | import "cs3/app/provider/v1beta1/resources.proto";
24 | import "cs3/identity/user/v1beta1/resources.proto";
25 | import "cs3/storage/provider/v1beta1/resources.proto";
26 | import "cs3/types/v1beta1/types.proto";
27 |
28 | option csharp_namespace = "Cs3.Sharing.Ocm.V1Beta1";
29 | option go_package = "ocmv1beta1";
30 | option java_multiple_files = true;
31 | option java_outer_classname = "ResourcesProto";
32 | option java_package = "com.cs3.sharing.ocm.v1beta1";
33 | option objc_class_prefix = "CSO";
34 | option php_namespace = "Cs3\\Sharing\\Ocm\\V1Beta1";
35 |
36 | // OCM Shares are shares created by a local owner (usually the authenticated user),
37 | // who grants permissions to a remote recipient (grantee) on a specified (local) resource (resource_id).
38 | // UserShares represents both user and groups.
39 | message Share {
40 | // REQUIRED.
41 | // Opaque unique identifier of the share.
42 | ShareId id = 1;
43 | // REQUIRED.
44 | // Unique identifier of the shared resource.
45 | storage.provider.v1beta1.ResourceId resource_id = 2;
46 | // REQUIRED.
47 | // Name of the shared resource.
48 | string name = 3;
49 | // REQUIRED.
50 | // The unlisted token to give access to the ocm share.
51 | string token = 4;
52 | // REQUIRED.
53 | // The receiver of the share, like a user, group ...
54 | storage.provider.v1beta1.Grantee grantee = 5;
55 | // REQUIRED.
56 | // Uniquely identifies the owner of the share
57 | // (the resource owner at the time of creating the share).
58 | // In case the ownership of the underlying resource changes
59 | // the share owner field MAY change to reflect the change of ownsership.
60 | cs3.identity.user.v1beta1.UserId owner = 6;
61 | // REQUIRED.
62 | // Uniquely identifies a principal who initiates the share creation.
63 | // A creator can create shares on behalf of the owner (because of re-sharing,
64 | // because belonging to special groups, ...).
65 | // Creator and owner often result in being the same principal.
66 | cs3.identity.user.v1beta1.UserId creator = 7;
67 | // REQUIRED.
68 | // Creation time of the share.
69 | cs3.types.v1beta1.Timestamp ctime = 8;
70 | // REQUIRED.
71 | // Last modification time of the share.
72 | cs3.types.v1beta1.Timestamp mtime = 9;
73 | // OPTIONAL.
74 | // The expiration time for the OCM share.
75 | cs3.types.v1beta1.Timestamp expiration = 10;
76 | // REQUIRED.
77 | // Recipient share type.
78 | cs3.sharing.ocm.v1beta1.ShareType share_type = 11;
79 | // REQUIRED.
80 | // Access methods represent how remote users would access the local resource.
81 | repeated AccessMethod access_methods = 12;
82 | // OPTIONAL.
83 | // A nonce to be exchanged for a (potentially short-lived) bearer token.
84 | string code = 13;
85 | // OPTIONAL.
86 | cs3.types.v1beta1.Opaque opaque = 14;
87 | }
88 |
89 | // The permissions for a share.
90 | message SharePermissions {
91 | storage.provider.v1beta1.ResourcePermissions permissions = 1;
92 | bool reshare = 2;
93 | }
94 |
95 | // A received share represents a share offered by a remote user to a local grantee.
96 | message ReceivedShare {
97 | // REQUIRED.
98 | // Opaque unique identifier of the share.
99 | ShareId id = 1;
100 | // REQUIRED.
101 | // Name of the shared resource.
102 | string name = 2;
103 | // REQUIRED.
104 | // Identifier to identify the shared resource at the provider side.
105 | // This is unique per provider such that if the same resource is shared twice, this will not be repeated.
106 | // This correspond to the `providerId` in the OCM API specs.
107 | string remote_share_id = 3;
108 | // REQUIRED.
109 | // The receiver of the share, like a user, group ...
110 | storage.provider.v1beta1.Grantee grantee = 4;
111 | // REQUIRED.
112 | // Uniquely identifies the owner of the share
113 | // (the resource owner at the time of creating the share).
114 | // In case the ownership of the underlying resource changes
115 | // the share owner field MAY change to reflect the change of ownsership.
116 | cs3.identity.user.v1beta1.UserId owner = 5;
117 | // REQUIRED.
118 | // Uniquely identifies a principal who initiates the share creation.
119 | // A creator can create shares on behalf of the owner (because of re-sharing,
120 | // because belonging to special groups, ...).
121 | // Creator and owner often result in being the same principal.
122 | cs3.identity.user.v1beta1.UserId creator = 6;
123 | // REQUIRED.
124 | // Creation time of the share.
125 | cs3.types.v1beta1.Timestamp ctime = 7;
126 | // REQUIRED.
127 | // Last modification time of the share.
128 | cs3.types.v1beta1.Timestamp mtime = 8;
129 | // OPTIONAL.
130 | // The expiration time for the ocm share.
131 | cs3.types.v1beta1.Timestamp expiration = 9;
132 | // REQUIRED.
133 | // Recipient share type.
134 | cs3.sharing.ocm.v1beta1.ShareType share_type = 10;
135 | // REQUIRED.
136 | // List of protocols offered for this share.
137 | // In the OCM specifications, this corresponds to the `protocol`
138 | // property, to maintain backwards compatibility with OCM v1 where
139 | // only a single protocol was implemented. Furthermore,
140 | // `protocol.name` MAY be set to `multi` and `protocol.options`
141 | // MAY be left empty in the OCM share payload, in order to use
142 | // the `protocol.webdav` and similar properties.
143 | repeated Protocol protocols = 11;
144 | // REQUIRED.
145 | // The state of the share.
146 | ShareState state = 12;
147 | // OPTIONAL.
148 | cs3.types.v1beta1.Opaque opaque = 13;
149 | // REQUIRED.
150 | // Resource type.
151 | cs3.storage.provider.v1beta1.ResourceType resource_type = 14;
152 | // OPTIONAL.
153 | // A nonce to be exchanged for a (potentially short-lived) bearer token.
154 | string code = 15;
155 | }
156 |
157 | // The state of the share.
158 | enum ShareState {
159 | // The share is no longer valid, for example, the share expired.
160 | SHARE_STATE_INVALID = 0;
161 | // New shares MUST be created in the SHARE_STATE_PENDING state.
162 | // This state means the share is pending to be accepted or rejected
163 | // by the recipient of the share.
164 | SHARE_STATE_PENDING = 1;
165 | // The recipient of the share has accepted the share.
166 | SHARE_STATE_ACCEPTED = 2;
167 | // The recipient of the share has rejected the share.
168 | // Do not means the share is removed, the recipient MAY
169 | // change the state to accepted or pending.
170 | SHARE_STATE_REJECTED = 3;
171 | }
172 |
173 | // Uniquely identifies a share in the share provider.
174 | // A share MUST be uniquely identify by four (4) elements:
175 | // 1) The share provider id
176 | // 2) The owner of the share
177 | // 3) The resource id
178 | // 4) The grantee for the share
179 | // This 4-tuple MUST be unique.
180 | // For example, owner Alice shares the resource /home/docs with id
181 | // home:1234 to an user named Bob. The 4-tuple will consist of
182 | // 1) The share provider id = "user"
183 | // 2) The owner of the share = "Alice"
184 | // 3) The resource id = "home:1234"
185 | // 4) The grantee for the share = Grantee("type" = "user", "" => "Bob")
186 | message ShareKey {
187 | // REQUIRED.
188 | cs3.identity.user.v1beta1.UserId owner = 1;
189 | // REQUIRED.
190 | storage.provider.v1beta1.ResourceId resource_id = 2;
191 | // REQUIRED.
192 | storage.provider.v1beta1.Grantee grantee = 3;
193 | }
194 |
195 | // A share id identifies uniquely a share in the share provider namespace.
196 | // A ShareId MUST be unique inside the share provider.
197 | message ShareId {
198 | // REQUIRED.
199 | // The internal id used by service implementor to
200 | // uniquely identify the share in the internal
201 | // implementation of the service.
202 | // In the OCM specifications, this corresponds to the `providerId`.
203 | string opaque_id = 1;
204 | }
205 |
206 | // The mechanism to identify a share
207 | // in the share provider namespace.
208 | message ShareReference {
209 | // REQUIRED.
210 | // One of the specifications MUST be specified.
211 | oneof spec {
212 | // The id of the share.
213 | ShareId id = 1;
214 | // The combination of fields that
215 | // make the share unique.
216 | ShareKey key = 2;
217 | // The token of the share.
218 | string token = 3;
219 | }
220 | }
221 |
222 | // A share grant specifies the share permissions
223 | // for a grantee.
224 | message ShareGrant {
225 | // REQUIRED.
226 | // The grantee of the grant.
227 | storage.provider.v1beta1.Grantee grantee = 1;
228 | // REQUIRED.
229 | // The share permissions for the grant.
230 | SharePermissions permissions = 2;
231 | }
232 |
233 | // The protocol which is used to give access to a remote OCM user.
234 | message Protocol {
235 | // REQUIRED.
236 | // One of the protocols MUST be specified.
237 | oneof term {
238 | // Options for WebDAV protocol.
239 | WebDAVProtocol webdav_options = 1;
240 | // Options for Webapp protocol.
241 | WebappProtocol webapp_options = 2;
242 | // Options for transfer protocol.
243 | TransferProtocol transfer_options = 3;
244 | // Options for a generic protocol.
245 | // Used to implement future protocols
246 | // in the OCM specs.
247 | cs3.types.v1beta1.Opaque generic_options = 4;
248 | }
249 | }
250 |
251 | // Defines the options for the WebDAV protocol.
252 | message WebDAVProtocol {
253 | // REQUIRED.
254 | // Secret used to access the resource.
255 | string shared_secret = 1;
256 | // REQUIRED.
257 | // Permissions of the shared resource.
258 | cs3.sharing.ocm.v1beta1.SharePermissions permissions = 2;
259 | // REQUIRED.
260 | // Path-only URI used to access the resource.
261 | string uri = 3;
262 | // OPTIONAL.
263 | // The requirements for the share.
264 | repeated string requirements = 4;
265 | }
266 |
267 | // Defines the options for the Webapp protocol.
268 | message WebappProtocol {
269 | // REQUIRED.
270 | // Path-only URI to open the resource with a remote app.
271 | string uri = 1;
272 | // REQUIRED.
273 | // View mode for the remote app.
274 | cs3.app.provider.v1beta1.ViewMode view_mode = 2;
275 | // OPTIONAL.
276 | // Secret used to access the resource.
277 | string shared_secret = 3;
278 | }
279 |
280 | // Defines the options for the Transfer protocol.
281 | message TransferProtocol {
282 | // REQUIRED.
283 | // Secret used to access the source of the data transfer.
284 | string shared_secret = 1;
285 | // REQUIRED.
286 | // Source URI for the data transfer.
287 | string source_uri = 2;
288 | // REQUIRED.
289 | // Size in bytes of the source.
290 | uint64 size = 3;
291 | }
292 |
293 | // Defines the type of share based on its recipient.
294 | enum ShareType {
295 | SHARE_TYPE_INVALID = 0;
296 | // Share of type user.
297 | SHARE_TYPE_USER = 1;
298 | // Share of type group.
299 | SHARE_TYPE_GROUP = 2;
300 | }
301 |
302 | // Defines how the recipient accesses an incoming remote OCM share.
303 | message AccessMethod {
304 | // REQUIRED.
305 | // One of the access method MUST be specified.
306 | oneof term {
307 | // Options for the WebDAV access method.
308 | WebDAVAccessMethod webdav_options = 1;
309 | // Options for the Webapp access method.
310 | WebappAccessMethod webapp_options = 2;
311 | // Options for the Transfer access method.
312 | TransferAccessMethod transfer_options = 3;
313 | // Options for a generic transfer method.
314 | // Used to implement future access methods.
315 | cs3.types.v1beta1.Opaque generic_options = 4;
316 | }
317 | }
318 |
319 | // Defines the options for the WebDAV access method.
320 | message WebDAVAccessMethod {
321 | // REQUIRED.
322 | // The permissions for the share.
323 | storage.provider.v1beta1.ResourcePermissions permissions = 1;
324 | // OPTIONAL.
325 | // The requirements for the share.
326 | repeated string requirements = 2;
327 | }
328 |
329 | // Defines the options for the Webapp access method.
330 | message WebappAccessMethod {
331 | // REQUIRED.
332 | // The view mode for the share.
333 | cs3.app.provider.v1beta1.ViewMode view_mode = 1;
334 | }
335 |
336 | // Defines the options for the Transfer access method.
337 | message TransferAccessMethod {
338 | // REQUIRED.
339 | // The destination path of the data transfer.
340 | storage.provider.v1beta1.Reference destination = 1;
341 | }
342 |
--------------------------------------------------------------------------------
/cs3/storage/provider/v1beta1/spaces_api.proto:
--------------------------------------------------------------------------------
1 | // Copyright 2018-2019 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.storage.provider.v1beta1;
22 |
23 | option csharp_namespace = "Cs3.Storage.Provider.V1Beta1";
24 | option go_package = "providerv1beta1";
25 | option java_multiple_files = true;
26 | option java_outer_classname = "SpacesApiProto";
27 | option java_package = "com.cs3.storage.provider.v1beta1";
28 | option objc_class_prefix = "CSP";
29 | option php_namespace = "Cs3\\Storage\\Provider\\V1Beta1";
30 |
31 | import "cs3/identity/user/v1beta1/resources.proto";
32 | import "cs3/rpc/v1beta1/status.proto";
33 | import "cs3/storage/provider/v1beta1/resources.proto";
34 | import "cs3/types/v1beta1/types.proto";
35 | import "google/protobuf/field_mask.proto";
36 |
37 | // Spaces API
38 | //
39 | // The Spaces API is meant to manipulate spaces in the service.
40 | //
41 | // The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL
42 | // NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and
43 | // "OPTIONAL" in this document are to be interpreted as described in
44 | // RFC 2119.
45 | //
46 | // The following are global requirements that apply to all methods:
47 | // Any method MUST return CODE_OK on a succesful operation.
48 | // Any method MAY return NOT_IMPLEMENTED.
49 | // Any method MAY return INTERNAL.
50 | // Any method MAY return UNKNOWN.
51 | // Any method MAY return UNAUTHENTICATED.
52 | service SpacesAPI {
53 | // Creates a storage space.
54 | rpc CreateStorageSpace(CreateStorageSpaceRequest) returns (CreateStorageSpaceResponse);
55 | // Lists storage spaces.
56 | rpc ListStorageSpaces(ListStorageSpacesRequest) returns (ListStorageSpacesResponse);
57 | // Updates a storage space.
58 | rpc UpdateStorageSpace(UpdateStorageSpaceRequest) returns (UpdateStorageSpaceResponse);
59 | // Deletes a storage space.
60 | rpc DeleteStorageSpace(DeleteStorageSpaceRequest) returns (DeleteStorageSpaceResponse);
61 | }
62 |
63 |
64 | message CreateStorageSpaceRequest {
65 | // OPTIONAL.
66 | cs3.types.v1beta1.Opaque opaque = 1;
67 | // REQUIRED.
68 | cs3.identity.user.v1beta1.User owner = 2;
69 | // OPTIONAL.
70 | // Could be 'home', 'share', 'project', 'space'...
71 | string type = 3;
72 | // OPTIONAL.
73 | // User readable name of the storage space.
74 | string name = 4;
75 | // OPTIONAL.
76 | Quota quota = 5;
77 | }
78 |
79 | message CreateStorageSpaceResponse {
80 | // OPTIONAL.
81 | // Opaque information.
82 | cs3.types.v1beta1.Opaque opaque = 1;
83 | // REQUIRED.
84 | // The response status.
85 | cs3.rpc.v1beta1.Status status = 2;
86 | // REQUIRED.
87 | // The created storage space.
88 | StorageSpace storage_space = 3;
89 | }
90 |
91 | message ListStorageSpacesRequest {
92 | // OPTIONAL.
93 | // Opaque information.
94 | cs3.types.v1beta1.Opaque opaque = 1;
95 | // Represents a filter to apply to the request.
96 | message Filter {
97 | // The filter to apply.
98 | enum Type {
99 | TYPE_INVALID = 0;
100 | TYPE_NO = 1;
101 | TYPE_ID = 2;
102 | TYPE_OWNER = 3;
103 | TYPE_SPACE_TYPE = 4;
104 | TYPE_PATH = 5;
105 | TYPE_USER = 6;
106 | }
107 | // REQUIRED.
108 | Type type = 1;
109 | oneof term {
110 | StorageSpaceId id = 2;
111 | cs3.identity.user.v1beta1.UserId owner = 3;
112 | string space_type = 4;
113 | string path = 5;
114 | cs3.identity.user.v1beta1.UserId user = 6;
115 | }
116 | }
117 | // OPTIONAL.
118 | // The list of filters to apply if any.
119 | repeated Filter filters = 2;
120 | // OPTIONAL.
121 | // The field mask applies to the resource. For the `FieldMask` definition,
122 | // see https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#fieldmask
123 | google.protobuf.FieldMask field_mask = 3;
124 | // OPTIONAL.
125 | // Clients use this field to specify the maximum number of results to be returned by the server.
126 | // The server may further constrain the maximum number of results returned in a single page.
127 | // If the page_size is 0, the server will decide the number of results to be returned.
128 | // see https://cloud.google.com/apis/design/design_patterns#list_pagination
129 | int32 page_size = 4;
130 | // OPTIONAL.
131 | // The client uses this field to request a specific page of the list results.
132 | string page_token = 5;
133 | }
134 |
135 | message ListStorageSpacesResponse {
136 | // OPTIONAL.
137 | // Opaque information.
138 | cs3.types.v1beta1.Opaque opaque = 1;
139 | // REQUIRED.
140 | // The response status.
141 | cs3.rpc.v1beta1.Status status = 2;
142 | // REQUIRED.
143 | repeated StorageSpace storage_spaces = 3;
144 | // OPTIONAL.
145 | // This field represents the pagination token to retrieve the next page of results.
146 | // If the value is "", it means no further results for the request.
147 | // see https://cloud.google.com/apis/design/design_patterns#list_pagination
148 | string next_page_token = 4;
149 | }
150 |
151 | message UpdateStorageSpaceRequest {
152 | // OPTIONAL.
153 | // Opaque information.
154 | cs3.types.v1beta1.Opaque opaque = 1;
155 | // REQUIRED.
156 | StorageSpace storage_space = 2;
157 | }
158 |
159 | message UpdateStorageSpaceResponse {
160 | // OPTIONAL.
161 | // Opaque information.
162 | cs3.types.v1beta1.Opaque opaque = 1;
163 | // REQUIRED.
164 | // The response status.
165 | cs3.rpc.v1beta1.Status status = 2;
166 | // REQUIRED.
167 | // The updated storage space.
168 | StorageSpace storage_space = 3;
169 | }
170 |
171 | message DeleteStorageSpaceRequest {
172 | // OPTIONAL.
173 | // Opaque information.
174 | cs3.types.v1beta1.Opaque opaque = 1;
175 | // REQUIRED.
176 | StorageSpaceId id = 2;
177 | }
178 |
179 | message DeleteStorageSpaceResponse {
180 | // OPTIONAL.
181 | // Opaque information.
182 | cs3.types.v1beta1.Opaque opaque = 1;
183 | // REQUIRED.
184 | // The response status.
185 | cs3.rpc.v1beta1.Status status = 2;
186 | }
187 |
--------------------------------------------------------------------------------
/cs3/storage/registry/v1beta1/registry_api.proto:
--------------------------------------------------------------------------------
1 | // Copyright 2018-2019 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.storage.registry.v1beta1;
22 |
23 | import "cs3/rpc/v1beta1/status.proto";
24 | import "cs3/storage/provider/v1beta1/resources.proto";
25 | import "cs3/storage/registry/v1beta1/resources.proto";
26 | import "cs3/types/v1beta1/types.proto";
27 |
28 | option csharp_namespace = "Cs3.Storage.Registry.V1Beta1";
29 | option go_package = "registryv1beta1";
30 | option java_multiple_files = true;
31 | option java_outer_classname = "RegistryApiProto";
32 | option java_package = "com.cs3.storage.registry.v1beta1";
33 | option objc_class_prefix = "CSR";
34 | option php_namespace = "Cs3\\Storage\\Registry\\V1Beta1";
35 |
36 | // Storage Registry API
37 | //
38 | // The Storage Registry API is meant to as registry to obtain
39 | // information of available storage providers.
40 | //
41 | // The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL
42 | // NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and
43 | // "OPTIONAL" in this document are to be interpreted as described in
44 | // RFC 2119.
45 | //
46 | // The following are global requirements that apply to all methods:
47 | // Any method MUST return CODE_OK on a succesful operation.
48 | // Any method MAY return NOT_IMPLEMENTED.
49 | // Any method MAY return INTERNAL.
50 | // Any method MAY return UNKNOWN.
51 | // Any method MAY return UNAUTHENTICATED.
52 | service RegistryAPI {
53 | // Returns the storage provider that is reponsible for the given
54 | // resource reference.
55 | // MUST return CODE_NOT_FOUND if the reference does not exist.
56 | rpc GetStorageProviders(GetStorageProvidersRequest) returns (GetStorageProvidersResponse);
57 | // Returns a list of the available storage providers known by this registry.
58 | rpc ListStorageProviders(ListStorageProvidersRequest) returns (ListStorageProvidersResponse);
59 | // Gets the user home storage provider.
60 | rpc GetHome(GetHomeRequest) returns (GetHomeResponse);
61 | // TODO(labkode): missing methods for adding and removing a storage provider
62 | // with different visibility levels (system-wide, user-wide, group-wide)...
63 | }
64 |
65 | message GetHomeRequest {
66 | // OPTIONAL.
67 | // Opaque information.
68 | cs3.types.v1beta1.Opaque opaque = 1;
69 | }
70 |
71 | message GetHomeResponse {
72 | // REQUIRED.
73 | // The response status.
74 | cs3.rpc.v1beta1.Status status = 1;
75 | // OPTIONAL.
76 | // Opaque information.
77 | cs3.types.v1beta1.Opaque opaque = 2;
78 | // REQUIRED.
79 | // The storage provider for the user home.
80 | cs3.storage.registry.v1beta1.ProviderInfo provider = 3;
81 | }
82 |
83 | message GetStorageProvidersRequest {
84 | // OPTIONAL.
85 | // Opaque information.
86 | cs3.types.v1beta1.Opaque opaque = 1;
87 | // REQUIRED.
88 | // The reference for the resource.
89 | cs3.storage.provider.v1beta1.Reference ref = 2;
90 | }
91 |
92 | message GetStorageProvidersResponse {
93 | // REQUIRED.
94 | // The response status.
95 | cs3.rpc.v1beta1.Status status = 1;
96 | // OPTIONAL.
97 | // Opaque information.
98 | cs3.types.v1beta1.Opaque opaque = 2;
99 | // REQUIRED.
100 | // The storage providers handling the requested storage resource.
101 | repeated cs3.storage.registry.v1beta1.ProviderInfo providers = 3;
102 | }
103 |
104 | message ListStorageProvidersRequest {
105 | // OPTIONAL.
106 | // Opaque information.
107 | cs3.types.v1beta1.Opaque opaque = 1;
108 | // TODO(labkode): maybe add some filter?
109 | }
110 |
111 | message ListStorageProvidersResponse {
112 | // REQUIRED.
113 | // The response status.
114 | cs3.rpc.v1beta1.Status status = 1;
115 | // OPTIONAL.
116 | // Opaque information.
117 | cs3.types.v1beta1.Opaque opaque = 2;
118 | // REQUIRED.
119 | // The list of storage providers this registry knows about.
120 | repeated cs3.storage.registry.v1beta1.ProviderInfo providers = 3;
121 | }
122 |
--------------------------------------------------------------------------------
/cs3/storage/registry/v1beta1/resources.proto:
--------------------------------------------------------------------------------
1 | // Copyright 2018-2019 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.storage.registry.v1beta1;
22 |
23 | import "cs3/types/v1beta1/types.proto";
24 |
25 | option csharp_namespace = "Cs3.Storage.Registry.V1Beta1";
26 | option go_package = "registryv1beta1";
27 | option java_multiple_files = true;
28 | option java_outer_classname = "ResourcesProto";
29 | option java_package = "com.cs3.storage.registry.v1beta1";
30 | option objc_class_prefix = "CSR";
31 | option php_namespace = "Cs3\\Storage\\Registry\\V1Beta1";
32 |
33 | // The information for the storage provider.
34 | message ProviderInfo {
35 | // OPTIONAL.
36 | // Opaque information (containing storage-specific information).
37 | // For example, additional metadata attached to the resource.
38 | cs3.types.v1beta1.Opaque opaque = 1;
39 | // REQUIRED.
40 | // The storage provider id that will become part of the
41 | // resource id.
42 | // For example, if the provider_id is "home", resources obtained
43 | // from this storage provider will have a resource id like "home:1234".
44 | string provider_id = 2;
45 | // REQUIRED.
46 | // The public path prefix this storage provider handles.
47 | // In Unix literature, the mount path.
48 | // For example, if the provider_path is "/home", resources obtained
49 | // from this storage provier will have a resource path lik "/home/docs".
50 | string provider_path = 3;
51 | // REQUIRED.
52 | // The address where the storage provider can be reached.
53 | // For example, tcp://localhost:1099.
54 | string address = 4;
55 | // OPTIONAL.
56 | // Information to describe the functionalities
57 | // offered by the storage provider. Meant to be read
58 | // by humans.
59 | string description = 5;
60 | // REQUIRED.
61 | // Represents the list of features available
62 | // on this storage provider. If the feature is not supported,
63 | // the related service methods MUST return CODE_UNIMPLEMENTED.
64 | message Features {
65 | bool recycle = 1;
66 | bool file_versions = 2;
67 | }
68 | // REQUIRED.
69 | // List of available methods.
70 | Features features = 6;
71 | }
72 |
--------------------------------------------------------------------------------
/cs3/tx/v1beta1/resources.proto:
--------------------------------------------------------------------------------
1 | // Copyright 2018-2019 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.tx.v1beta1;
22 |
23 | import "cs3/identity/user/v1beta1/resources.proto";
24 | import "cs3/sharing/ocm/v1beta1/resources.proto";
25 | import "cs3/storage/provider/v1beta1/resources.proto";
26 | import "cs3/types/v1beta1/types.proto";
27 |
28 | option csharp_namespace = "Cs3.Tx.V1Beta1";
29 | option go_package = "txv1beta1";
30 | option java_multiple_files = true;
31 | option java_outer_classname = "ResourcesProto";
32 | option java_package = "com.cs3.tx.v1beta1";
33 | option objc_class_prefix = "CTX";
34 | option php_namespace = "Cs3\\Tx\\V1Beta1";
35 |
36 | // TxId uniquely identifies a transfer in the transfer provider namespace.
37 | message TxId {
38 | // REQUIRED.
39 | // The internal transfer id used by the service implementor
40 | // to uniquely identity the transfer in the internal
41 | // implementation of the service.
42 | string opaque_id = 1;
43 | }
44 |
45 | // TxInfo represents information about a transfer.
46 | message TxInfo {
47 | // REQUIRED.
48 | // The transfer identifier.
49 | TxId id = 1;
50 | // REQUIRED.
51 | // The transfer status. Eg.: STATUS_TRANSFER_FAILED.
52 | // Note: the description field may provide additional information on the transfer status.
53 | Status status = 2;
54 | // REQUIRED.
55 | // The destination (receiver of the transfer)
56 | cs3.storage.provider.v1beta1.Grantee grantee = 3;
57 | // REQUIRED.
58 | // Uniquely identifies a principal who initiates the transfer creation.
59 | cs3.identity.user.v1beta1.UserId creator = 4;
60 | // REQUIRED.
61 | // Creation time of the transfer.
62 | cs3.types.v1beta1.Timestamp ctime = 5;
63 | // OPTIONAL.
64 | // Information to describe the transfer status.
65 | // Eg. may contain information about a transfer failure.
66 | // Meant to be human-readable.
67 | string description = 6;
68 | // REQUIRED.
69 | // Opaque unique identifier of the share on which the transfer is based.
70 | cs3.sharing.ocm.v1beta1.ShareId share_id = 7;
71 | }
72 |
73 | // Status represents transfer status.
74 | enum Status {
75 | STATUS_INVALID = 0;
76 | // The destination could not be found.
77 | STATUS_DESTINATION_NOT_FOUND = 1;
78 | // A new data transfer
79 | STATUS_TRANSFER_NEW = 2;
80 | // The data transfer is awaiting acceptance from the destination
81 | STATUS_TRANSFER_AWAITING_ACCEPTANCE = 3;
82 | // The data transfer is accepted by the destination.
83 | STATUS_TRANSFER_ACCEPTED = 4;
84 | // The data transfer has started and not yet completed.
85 | STATUS_TRANSFER_IN_PROGRESS = 5;
86 | // The data transfer has completed.
87 | STATUS_TRANSFER_COMPLETE = 6;
88 | // The data transfer has failed.
89 | STATUS_TRANSFER_FAILED = 7;
90 | // The data transfer had been cancelled.
91 | STATUS_TRANSFER_CANCELLED = 8;
92 | // The request for cancelling the data transfer has failed.
93 | STATUS_TRANSFER_CANCEL_FAILED = 9;
94 | // The transfer has expired somewhere down the line.
95 | STATUS_TRANSFER_EXPIRED = 10;
96 | }
97 |
--------------------------------------------------------------------------------
/cs3/tx/v1beta1/tx_api.proto:
--------------------------------------------------------------------------------
1 | // Copyright 2018-2019 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.tx.v1beta1;
22 |
23 | import "cs3/rpc/v1beta1/status.proto";
24 | import "cs3/sharing/ocm/v1beta1/resources.proto";
25 | import "cs3/tx/v1beta1/resources.proto";
26 | import "cs3/types/v1beta1/types.proto";
27 |
28 | option csharp_namespace = "Cs3.Tx.V1Beta1";
29 | option go_package = "txv1beta1";
30 | option java_multiple_files = true;
31 | option java_outer_classname = "TxApiProto";
32 | option java_package = "com.cs3.tx.v1beta1";
33 | option objc_class_prefix = "CTX";
34 | option php_namespace = "Cs3\\Tx\\V1Beta1";
35 |
36 | // Tx API
37 | //
38 | // The Tx API provides data transfer capabilities.
39 | //
40 | // The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL
41 | // NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and
42 | // "OPTIONAL" in this document are to be interpreted as described in
43 | // RFC 2119.
44 | //
45 | // The following are global requirements that apply to all methods:
46 | // Any method MUST return CODE_OK on a succesful operation.
47 | // Any method MAY return NOT_IMPLEMENTED.
48 | // Any method MAY return INTERNAL.
49 | // Any method MAY return UNKNOWN.
50 | // Any method MAY return UNAUTHENTICATED.
51 | service TxAPI {
52 | // Requests creation of a transfer.
53 | // Returns a CreateTransferResponse.
54 | rpc CreateTransfer(CreateTransferRequest) returns (CreateTransferResponse);
55 | // Requests a transfer status.
56 | rpc GetTransferStatus(GetTransferStatusRequest) returns (GetTransferStatusResponse);
57 | // Requests to cancel a transfer.
58 | rpc CancelTransfer(CancelTransferRequest) returns (CancelTransferResponse);
59 | // Requests a list of transfers received by the authenticated principle.
60 | // If a filter is specified, only transfers satisfying the filter MUST be returned.
61 | rpc ListTransfers(ListTransfersRequest) returns (ListTransfersResponse);
62 | // Requests retrying a transfer.
63 | rpc RetryTransfer(RetryTransferRequest) returns (RetryTransferResponse);
64 | }
65 |
66 | message CreateTransferRequest {
67 | // REQUIRED.
68 | // The source target URI. Should include at the minimum all the info needed to access the source.
69 | // https://golang.org/pkg/net/url/#URL provides a quick view of the format.
70 | string src_target_uri = 1;
71 | // REQUIRED.
72 | // The destination target URI. Should include at the minimum all the info needed to access the destination.
73 | // https://golang.org/pkg/net/url/#URL provides a quick view of the format.
74 | string dest_target_uri = 2;
75 | // REQUIRED.
76 | // The share Id of the share this transfer is based on.
77 | cs3.sharing.ocm.v1beta1.ShareId share_id = 3;
78 | // OPTIONAL.
79 | // Opaque information.
80 | cs3.types.v1beta1.Opaque opaque = 4;
81 | }
82 |
83 | message CreateTransferResponse {
84 | // REQUIRED.
85 | // The response status.
86 | cs3.rpc.v1beta1.Status status = 1;
87 | // REQUIRED.
88 | // TxInfo, includes transfer id, status, description.
89 | TxInfo tx_info = 2;
90 | // OPTIONAL.
91 | // Opaque information.
92 | cs3.types.v1beta1.Opaque opaque = 3;
93 | }
94 |
95 | message GetTransferStatusRequest {
96 | // REQUIRED.
97 | // The transfer identifier.
98 | TxId tx_id = 1;
99 | // OPTIONAL.
100 | // Opaque information.
101 | cs3.types.v1beta1.Opaque opaque = 2;
102 | }
103 |
104 | message GetTransferStatusResponse {
105 | // REQUIRED.
106 | // The response status.
107 | cs3.rpc.v1beta1.Status status = 1;
108 | // REQUIRED.
109 | // TxInfo, includes ao. transfer id, status, description.
110 | TxInfo tx_info = 2;
111 | // OPTIONAL.
112 | // Opaque information.
113 | cs3.types.v1beta1.Opaque opaque = 3;
114 | }
115 |
116 | message CancelTransferRequest {
117 | // REQUIRED.
118 | // The transfer identifier.
119 | TxId tx_id = 1;
120 | // OPTIONAL.
121 | // Opaque information.
122 | cs3.types.v1beta1.Opaque opaque = 2;
123 | }
124 |
125 | message CancelTransferResponse {
126 | // REQUIRED.
127 | // The response status.
128 | cs3.rpc.v1beta1.Status status = 1;
129 | // REQUIRED.
130 | // TxInfo, includes ao. transfer id, status, description.
131 | TxInfo tx_info = 2;
132 | // OPTIONAL.
133 | // Opaque information.
134 | cs3.types.v1beta1.Opaque opaque = 3;
135 | }
136 |
137 | message ListTransfersRequest {
138 | // OPTIONAL.
139 | // Opaque information.
140 | cs3.types.v1beta1.Opaque opaque = 1;
141 | // REQUIRED.
142 | // Represents a filter to apply to the request.
143 | message Filter {
144 | // The filter type.
145 | enum Type {
146 | TYPE_INVALID = 0;
147 | TYPE_STATUS = 1;
148 | TYPE_SHARE_ID = 2;
149 | TYPE_TX_ID = 3;
150 | }
151 | // REQUIRED.
152 | Type type = 1;
153 | // REQUIRED.
154 | oneof term {
155 | Status status = 2;
156 | cs3.sharing.ocm.v1beta1.ShareId share_id = 3;
157 | TxId tx_id = 4;
158 | }
159 | }
160 | // OPTIONAL.
161 | // The list of filters to apply if any.
162 | repeated Filter filters = 2;
163 | }
164 |
165 | message ListTransfersResponse {
166 | // REQUIRED.
167 | // The response status.
168 | cs3.rpc.v1beta1.Status status = 1;
169 | // REQUIRED.
170 | // List of TxInfo types representing transfers.
171 | repeated TxInfo transfers = 2;
172 | // OPTIONAL.
173 | // Opaque information.
174 | cs3.types.v1beta1.Opaque opaque = 3;
175 | }
176 |
177 | message RetryTransferRequest {
178 | // REQUIRED.
179 | // The transfer identifier.
180 | TxId tx_id = 1;
181 | // OPTIONAL.
182 | // Opaque information.
183 | cs3.types.v1beta1.Opaque opaque = 2;
184 | }
185 |
186 | message RetryTransferResponse {
187 | // REQUIRED.
188 | // The response status.
189 | cs3.rpc.v1beta1.Status status = 1;
190 | // REQUIRED.
191 | // TxInfo, includes ao. transfer id, status, description.
192 | TxInfo tx_info = 2;
193 | // OPTIONAL.
194 | // Opaque information.
195 | cs3.types.v1beta1.Opaque opaque = 3;
196 | }
197 |
--------------------------------------------------------------------------------
/cs3/types/v1beta1/types.proto:
--------------------------------------------------------------------------------
1 | // Copyright 2018-2019 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.types.v1beta1;
22 |
23 | option csharp_namespace = "Cs3.Types.V1Beta1";
24 | option go_package = "typesv1beta1";
25 | option java_multiple_files = true;
26 | option java_outer_classname = "TypesProto";
27 | option java_package = "com.cs3.types.v1beta1";
28 | option objc_class_prefix = "CTX";
29 | option php_namespace = "Cs3\\Types\\V1Beta1";
30 |
31 | // Opaque represents opaque information
32 | // in a form on a map.
33 | // For example, a local filesystem can
34 | // use this message to include filesystem
35 | // extended attributes.
36 | message Opaque {
37 | // REQUIRED.
38 | map map = 1;
39 | }
40 |
41 | // OpaqueEntry represents the encoded
42 | // opaque value.
43 | message OpaqueEntry {
44 | // REQUIRED.
45 | // The decoder to use: json, xml, toml, ...
46 | // TODO(labkode): make encoder a fixed set using a enum type?
47 | string decoder = 1;
48 | // REQUIRED.
49 | // The encoded value.
50 | bytes value = 2;
51 | }
52 |
53 | // Adapted from Google google/protobuf/timestamp.proto.
54 | // A Timestamp represents a point in time independent of any time zone or local
55 | // calendar, encoded as a count of seconds and fractions of seconds at
56 | // nanosecond resolution. The count is relative to an epoch at UTC midnight on
57 | // January 1, 1970, in the proleptic Gregorian calendar which extends the
58 | // Gregorian calendar backwards to year one.
59 | //
60 | // The range MUST be from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z.
61 | // Restricting to this range ensures the conversion from and to [RFC
62 | // 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings.
63 | message Timestamp {
64 | // Represents seconds of UTC time since Unix epoch
65 | // 1970-01-01T00:00:00Z. Must be from 0001-01-01T00:00:00Z to
66 | // 9999-12-31T23:59:59Z inclusive.
67 | uint64 seconds = 1;
68 | // Non-negative fractions of a second at nanosecond resolution. Negative
69 | // second values with fractions must still have non-negative nanos values
70 | // that count forward in time.
71 | // Value MUST be from 0 to 999,999,999
72 | // inclusive.
73 | uint32 nanos = 2;
74 | }
75 |
--------------------------------------------------------------------------------
/go.mod:
--------------------------------------------------------------------------------
1 | module github.com/cs3org/go-cs3apis
2 |
3 | go 1.21.2
4 |
--------------------------------------------------------------------------------
/tools/check-license/check-license.go:
--------------------------------------------------------------------------------
1 | // Copyright 2018-2019 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 | package main
20 |
21 | import (
22 | "bytes"
23 | "flag"
24 | "fmt"
25 | "io/ioutil"
26 | "os"
27 | "path/filepath"
28 | "regexp"
29 | )
30 |
31 | var fix = flag.Bool("fix", false, "add header if not present")
32 |
33 | var licenseText = `// Copyright 2018-2019 CERN
34 | //
35 | // Licensed under the Apache License, Version 2.0 (the "License");
36 | // you may not use this file except in compliance with the License.
37 | // You may obtain a copy of the License at
38 | //
39 | // http://www.apache.org/licenses/LICENSE-2.0
40 | //
41 | // Unless required by applicable law or agreed to in writing, software
42 | // distributed under the License is distributed on an "AS IS" BASIS,
43 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
44 | // See the License for the specific language governing permissions and
45 | // limitations under the License.
46 | //
47 | // In applying this license, CERN does not waive the privileges and immunities
48 | // granted to it by virtue of its status as an Intergovernmental Organization
49 | // or submit itself to any jurisdiction.
50 |
51 | `
52 |
53 | var license = regexp.MustCompile(licenseText)
54 |
55 | const prefix = "// Copyright "
56 |
57 | var skip = map[string]bool{}
58 |
59 | func main() {
60 | flag.Parse()
61 | err := filepath.Walk("cs3", func(path string, fi os.FileInfo, err error) error {
62 | if skip[path] {
63 | return nil
64 | }
65 |
66 | if err != nil {
67 | return err
68 | }
69 |
70 | if filepath.Ext(path) != ".proto" {
71 | return nil
72 | }
73 |
74 | src, err := ioutil.ReadFile(path)
75 | if err != nil {
76 | return nil
77 | }
78 |
79 | // Check if license is at the top of the file.
80 | if !bytes.HasPrefix(src, []byte(prefix)) {
81 | err := fmt.Errorf("%v: license header not present or not at the top, to fix run: go run tools/check-license/check-license.go -fix", path)
82 | if *fix == true {
83 | newSrc := licenseText + string(src)
84 | ioutil.WriteFile(path, []byte(newSrc), 644)
85 | src = []byte(newSrc)
86 | } else {
87 | return err
88 | }
89 | }
90 | return nil
91 | })
92 | if err != nil {
93 | fmt.Println(err)
94 | os.Exit(1)
95 | }
96 | os.Exit(0)
97 | }
98 |
--------------------------------------------------------------------------------