Skip to content

Commit

Permalink
Write only management API for User and Group resources (#119)
Browse files Browse the repository at this point in the history
  • Loading branch information
refs authored Apr 21, 2021
1 parent b8436e9 commit bc19782
Show file tree
Hide file tree
Showing 4 changed files with 808 additions and 1 deletion.
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;
}
Loading

0 comments on commit bc19782

Please sign in to comment.