Skip to content

Commit

Permalink
Merge pull request #1 from dragonchaser/ocis-3743-show-hide-share-status
Browse files Browse the repository at this point in the history
Ocis 3743 show hide share status
  • Loading branch information
dragonchaser authored Sep 18, 2023
2 parents 4a26f4f + c50bc47 commit f0ce1e2
Show file tree
Hide file tree
Showing 39 changed files with 12,903 additions and 4,219 deletions.
6 changes: 4 additions & 2 deletions .drone.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ platform:
arch: amd64

trigger:
branch:
- main
event:
exclude:
- pull_request
Expand All @@ -21,12 +23,13 @@ steps:
image: cs3org/cs3apis:latest
environment:
SSH_KEY:
from_secret: deploy_key
from_secret: deploy_gh_key
commands:
# See https://github.com/drone/drone/issues/2692
# write the ssh key to disk
- mkdir /root/.ssh
- echo -n "$SSH_KEY" > /root/.ssh/id_rsa
- shasum /root/.ssh/id_rsa
- chmod 600 /root/.ssh/id_rsa
- stat /root/.ssh/id_rsa

Expand Down Expand Up @@ -59,4 +62,3 @@ steps:
image: cs3org/cs3apis:latest
commands:
- cs3apis-build -only-build # compile, build and publish all available languages

6 changes: 5 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,17 @@ pull:

build: pull
docker run -v ${pwd}:/root/cs3apis cs3org/cs3apis cs3apis-build -build-proto
# restore ownership of the `docs` folder as docker runs as root
chown -R `ls -ld . | awk '{print $$3 ":" $$4}'` docs
python: pull
docker run -v ${pwd}:/root/cs3apis cs3org/cs3apis cs3apis-build -build-python
go: pull
docker run -v ${pwd}:/root/cs3apis cs3org/cs3apis cs3apis-build -build-go
js: pull
docker run -v ${pwd}:/root/cs3apis cs3org/cs3apis cs3apis-build -build-js
node: pull
docker run -v ${pwd}:/root/cs3apis cs3org/cs3apis cs3apis-build -build-node
clean:
rm -rf build/

all: build python go js
all: build python go js node
16 changes: 15 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,30 @@ The CS3APIS connect Storage and Applications Providers.
https://cs3org.github.io/cs3apis/

## Officialy compiled libraries
The libraries for different languages are compiled from the protobuf definitions in this repo.
When a commit to master is made the CI takes care to create a new version of the library in the following languages.
Please note that the versioning used in the libraries below differs from language to language, however they point to the
same source commit. This is due to the way the different package managers handle package versions.

* Go: https://github.com/cs3org/go-cs3apis
* Python: https://github.com/cs3org/python-cs3apis
* Javascript: https://github.com/cs3org/js-cs3apis
* Javascript: https://github.com/cs3org/js-cs3apis (to be used from Web applications - frontend)
* NodeJS: https://github.com/cs3org/node-cs3apis (to be used from NodeJS applications - backend)

## Repository packages
* Go: https://pkg.go.dev/github.com/cs3org/go-cs3apis
* Python: https://pypi.org/project/cs3apis/
* Javascript: https://www.npmjs.com/package/@cs3org/cs3apis
* NodeJS: https://www.npmjs.com/package/@cs3org/node-cs3apis


## Local compilation

You need to have Docker installed. The artifacts will be available under the build directory.

```
$ git clone https://github.com/cs3org/cs3apis
$ cd cs3apis
$ make build
$ make go # generate go code
```
Expand Down
127 changes: 127 additions & 0 deletions cs3/admin/group/v1beta1/group_api.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,127 @@
// Copyright 2018-2019 CERN
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
// In applying this license, CERN does not waive the privileges and immunities
// granted to it by virtue of its status as an Intergovernmental Organization
// or submit itself to any jurisdiction.

syntax = "proto3";

package cs3.admin.group.v1beta1;

option csharp_namespace = "Cs3.Admin.Group.V1Beta1";
option go_package = "groupv1beta1";
option java_multiple_files = true;
option java_outer_classname = "GroupApiProto";
option java_package = "com.cs3.admin.group.v1beta1";
option objc_class_prefix = "CAG";
option php_namespace = "Cs3\\Admin\\Group\\V1Beta1";

import "cs3/identity/group/v1beta1/resources.proto";
import "cs3/identity/user/v1beta1/resources.proto";
import "cs3/rpc/v1beta1/status.proto";
import "cs3/types/v1beta1/types.proto";

// Provides a write only API for managing groups.
service GroupAPI {
// Create a group.
rpc CreateGroup(CreateGroupRequest) returns (CreateGroupResponse);
// Delete a group.
rpc DeleteGroup(DeleteGroupRequest) returns (DeleteGroupResponse);
// Add a user to a group.
rpc AddUserToGroup(AddUserToGroupRequest) returns (AddUserToGroupResponse);
// Remove a user from a group.
rpc RemoveUserFromGroup(RemoveUserFromGroupRequest) returns (RemoveUserFromGroupResponse);
}

message CreateGroupRequest {
// OPTIONAL.
// Opaque information. Allow to send any arbitrary data a service might use that is outside the API boundaries
cs3.types.v1beta1.Opaque opaque = 1;
// REQUIRED.
// The information of group to be created.
cs3.identity.group.v1beta1.Group group = 2;
}

message CreateGroupResponse {
// REQUIRED.
// The response status.
cs3.rpc.v1beta1.Status status = 1;
// OPTIONAL.
// Opaque information.
cs3.types.v1beta1.Opaque opaque = 2;
// REQUIRED.
// The group information.
cs3.identity.group.v1beta1.Group group = 3;
}

message DeleteGroupRequest {
// OPTIONAL.
// Opaque information. Allow to send any arbitrary data a service might use that is outside the API boundaries.
cs3.types.v1beta1.Opaque opaque = 1;
// REQUIRED.
// The group to be deleted, given their ID.
cs3.identity.group.v1beta1.GroupId group_id = 2;
}

message DeleteGroupResponse {
// REQUIRED.
// The response status.
cs3.rpc.v1beta1.Status status = 1;
// OPTIONAL.
// Opaque information.
cs3.types.v1beta1.Opaque opaque = 2;
}

message AddUserToGroupRequest {
// REQUIRED.
// ID of the user to add to the group
cs3.identity.user.v1beta1.UserId user_id = 1;
// REQUIRED.
// ID of the target group.
cs3.identity.group.v1beta1.GroupId group_id = 2;
// OPTIONAL.
// Opaque information.
cs3.types.v1beta1.Opaque opaque = 3;
}

message AddUserToGroupResponse {
// REQUIRED.
// The response status.
cs3.rpc.v1beta1.Status status = 1;
// OPTIONAL.
// Opaque information.
cs3.types.v1beta1.Opaque opaque = 2;
}

message RemoveUserFromGroupRequest {
// REQUIRED.
// ID of the user to add to the group
cs3.identity.user.v1beta1.UserId user_id = 1;
// REQUIRED.
// ID of the target group.
cs3.identity.group.v1beta1.GroupId group_id = 2;
// OPTIONAL.
// Opaque information.
cs3.types.v1beta1.Opaque opaque = 3;
}

message RemoveUserFromGroupResponse {
// REQUIRED.
// The response status.
cs3.rpc.v1beta1.Status status = 1;
// OPTIONAL.
// Opaque information.
cs3.types.v1beta1.Opaque opaque = 2;
}
80 changes: 80 additions & 0 deletions cs3/admin/user/v1beta1/user_api.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
// Copyright 2018-2019 CERN
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
// In applying this license, CERN does not waive the privileges and immunities
// granted to it by virtue of its status as an Intergovernmental Organization
// or submit itself to any jurisdiction.

syntax = "proto3";

package cs3.admin.user.v1beta1;

option csharp_namespace = "Cs3.Admin.User.V1Beta1";
option go_package = "userv1beta1";
option java_multiple_files = true;
option java_outer_classname = "UserApiProto";
option java_package = "com.cs3.admin.user.v1beta1";
option objc_class_prefix = "CAU";
option php_namespace = "Cs3\\Admin\\User\\V1Beta1";

import "cs3/identity/user/v1beta1/resources.proto";
import "cs3/rpc/v1beta1/status.proto";
import "cs3/types/v1beta1/types.proto";

// Provides a write only API for managing users.
service UserAPI {
// Create a user account.
rpc CreateUser(CreateUserRequest) returns (CreateUserResponse);
// Delete a user account.
rpc DeleteUser(DeleteUserRequest) returns (DeleteUserResponse);
}

message CreateUserRequest {
// OPTIONAL.
// Opaque information. Allow to send any arbitrary data a service might use that is outside the API boundaries
cs3.types.v1beta1.Opaque opaque = 1;
// REQUIRED.
// The information of user to be created.
cs3.identity.user.v1beta1.User user = 2;
}

message CreateUserResponse {
// REQUIRED.
// The response status.
cs3.rpc.v1beta1.Status status = 1;
// OPTIONAL.
// Opaque information.
cs3.types.v1beta1.Opaque opaque = 2;
// REQUIRED.
// The user information.
cs3.identity.user.v1beta1.User user = 3;
}

message DeleteUserRequest {
// OPTIONAL.
// Opaque information. Allow to send any arbitrary data a service might use that is outside the API boundaries
cs3.types.v1beta1.Opaque opaque = 1;
// REQUIRED.
// The user to be deleted, given their ID.
cs3.identity.user.v1beta1.UserId user_id = 2;
}

message DeleteUserResponse {
// REQUIRED.
// The response status.
cs3.rpc.v1beta1.Status status = 1;
// OPTIONAL.
// Opaque information.
cs3.types.v1beta1.Opaque opaque = 2;
}
25 changes: 16 additions & 9 deletions cs3/app/provider/v1beta1/provider_api.proto
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ option java_package = "com.cs3.app.provider.v1beta1";
option objc_class_prefix = "CAP";
option php_namespace = "Cs3\\App\\Provider\\V1Beta1";

import "cs3/app/provider/v1beta1/resources.proto";
import "cs3/rpc/v1beta1/status.proto";
import "cs3/storage/provider/v1beta1/resources.proto";
import "cs3/types/v1beta1/types.proto";
Expand All @@ -52,12 +53,12 @@ import "cs3/types/v1beta1/types.proto";
// Any method MAY return UNKNOWN.
// Any method MAY return UNAUTHENTICATED.
service ProviderAPI {
// Returns the App provider URL
// Returns the App URL and all necessary info to open a resource in an online editor.
// MUST return CODE_NOT_FOUND if the resource does not exist.
rpc OpenFileInAppProvider(OpenFileInAppProviderRequest) returns (OpenFileInAppProviderResponse);
rpc OpenInApp(OpenInAppRequest) returns (OpenInAppResponse);
}

message OpenFileInAppProviderRequest {
message OpenInAppRequest {
// OPTIONAL.
// Opaque information.
cs3.types.v1beta1.Opaque opaque = 1;
Expand All @@ -68,27 +69,33 @@ message OpenFileInAppProviderRequest {
// View mode.
enum ViewMode {
VIEW_MODE_INVALID = 0;
// The file can be opened but not downloaded.
// The resource can be opened but not downloaded.
VIEW_MODE_VIEW_ONLY = 1;
// The file can be downloaded.
// The resource can be downloaded.
VIEW_MODE_READ_ONLY = 2;
// The file can be downloaded and updated.
// The resource can be downloaded and updated. The underlying application
// MUST be a fully capable editor to support this mode.
VIEW_MODE_READ_WRITE = 3;
// The resource can be downloaded and updated, but must be shown in
// preview mode. If the underlying application does not support a preview mode,
// or if in a view-only mode users are not allowed to switch to edit mode,
// then this mode MUST fall back to READ_WRITE.
VIEW_MODE_PREVIEW = 4;
}
ViewMode view_mode = 3;
// REQUIRED.
// The access token this application provider will use when contacting
// the storage provider to read and write.
// Service implementors MUST make sure that the access token only grants
// access to the requested resource.
// Service implementors should use a ResourceId rather than a filename to grant access, as
// Service implementors should use a ResourceId rather than a filepath to grant access, as
// ResourceIds MUST NOT change when a resource is renamed.
// The access token MUST be short-lived.
// TODO(labkode): investigate token derivation techniques.
string access_token = 4;
}

message OpenFileInAppProviderResponse {
message OpenInAppResponse {
// REQUIRED.
// The response status.
cs3.rpc.v1beta1.Status status = 1;
Expand All @@ -98,5 +105,5 @@ message OpenFileInAppProviderResponse {
// REQUIRED.
// The url that user agents will render to clients.
// Usually the rendering happens by using HTML iframes or in separate browser tabs.
string app_provider_url = 3;
OpenInAppURL app_url = 3;
}
Loading

0 comments on commit f0ce1e2

Please sign in to comment.