codemp-proto/proto/session.proto

47 lines
1.4 KiB
Protocol Buffer

syntax = "proto2";
package session;
import "common.proto";
// Manages user workspaces and refreshes tokens.
service Session {
// Handle a workspace access request and return a workspace token.
rpc AccessWorkspace (WorkspaceRequest) returns (common.Token);
// Create a workspace.
rpc CreateWorkspace (WorkspaceRequest) returns (common.Empty);
// Delete a workspace.
rpc DeleteWorkspace (WorkspaceRequest) returns (common.Empty);
// List all workspaces the user has been invited to.
rpc FetchInvitedWorkspaces (common.Empty) returns (WorkspacesInvitedList);
//List all workspaces the user owns
rpc FetchOwnedWorkspaces (common.Empty) returns (WorkspacesOwnedList);
// Handle a workspace invite request.
rpc InviteToWorkspace (InviteRequest) returns (common.Empty);
}
// A message representing a request for specific workspace.
message WorkspaceRequest {
// The workspace's id
required string workspace = 1;
}
// A message representing a list of workspaces.
message WorkspacesInvitedList {
// A vector of workspaces the user is invited to.
repeated string invited = 1;
}
// A message representing a list of workspaces.
message WorkspacesOwnedList {
// A vector of workspaces owned by the user.
repeated string owned = 1;
}
// A message representing an invitation to a workspace.
message InviteRequest {
// The user the invitation is for.
required string user = 1;
// the workspace's id the invitation is for
required string workspace = 2;
}