2024-08-21 21:38:36 +02:00
|
|
|
syntax = "proto2";
|
|
|
|
|
|
|
|
package session;
|
|
|
|
|
|
|
|
import "common.proto";
|
|
|
|
|
2024-09-05 00:08:07 +02:00
|
|
|
// Manages user workspaces and refreshes tokens.
|
2024-08-21 21:38:36 +02:00
|
|
|
service Session {
|
2024-09-05 00:08:07 +02:00
|
|
|
// Handle a workspace access request and return a workspace token.
|
2024-08-21 21:38:36 +02:00
|
|
|
rpc AccessWorkspace (WorkspaceRequest) returns (common.Token);
|
2024-09-05 00:08:07 +02:00
|
|
|
// Create a workspace.
|
2024-08-21 21:38:36 +02:00
|
|
|
rpc CreateWorkspace (WorkspaceRequest) returns (common.Empty);
|
2024-09-05 00:08:07 +02:00
|
|
|
// Delete a workspace.
|
2024-08-21 21:38:36 +02:00
|
|
|
rpc DeleteWorkspace (WorkspaceRequest) returns (common.Empty);
|
2024-09-05 00:08:07 +02:00
|
|
|
// List all available workspaces.
|
2024-08-21 21:38:36 +02:00
|
|
|
rpc ListWorkspaces (common.Empty) returns (WorkspaceList);
|
2024-09-05 00:08:07 +02:00
|
|
|
// Handle a workspace invite request.
|
2024-08-21 21:38:36 +02:00
|
|
|
rpc InviteToWorkspace (InviteRequest) returns (common.Empty);
|
|
|
|
}
|
|
|
|
|
2024-09-05 00:08:07 +02:00
|
|
|
// A message representing a request for specific workspace.
|
2024-08-21 21:38:36 +02:00
|
|
|
message WorkspaceRequest {
|
2024-12-08 15:56:06 +01:00
|
|
|
// The workspace's id
|
2024-08-21 21:38:36 +02:00
|
|
|
required string workspace = 1;
|
|
|
|
}
|
|
|
|
|
2024-09-05 00:08:07 +02:00
|
|
|
// A message representing a list of workspaces.
|
2024-08-21 21:38:36 +02:00
|
|
|
message WorkspaceList {
|
2024-09-05 00:08:07 +02:00
|
|
|
// A vector of workspaces owned by the user.
|
2024-08-21 21:38:36 +02:00
|
|
|
repeated string owned = 1;
|
2024-09-05 00:08:07 +02:00
|
|
|
// A vector of workspaces the user is invited to.
|
2024-08-21 21:38:36 +02:00
|
|
|
repeated string invited = 2;
|
|
|
|
}
|
|
|
|
|
2024-09-05 00:08:07 +02:00
|
|
|
// A message representing an invitation to a workspace.
|
2024-08-21 21:38:36 +02:00
|
|
|
message InviteRequest {
|
2024-09-05 00:08:07 +02:00
|
|
|
// The user the invitation is for.
|
2024-08-21 21:38:36 +02:00
|
|
|
required string user = 1;
|
2024-12-08 15:56:06 +01:00
|
|
|
// the workspace's id the invitation is for
|
2024-08-21 21:38:36 +02:00
|
|
|
required string workspace = 2;
|
|
|
|
}
|