blob: 31d8fd0705906c10898baadf0a242e0829eb08e1 [file] [log] [blame]
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you 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.
*
*/
syntax = "proto3";
package teaclave_frontend_service_proto;
import "teaclave_common.proto";
message RegisterInputFileRequest {
string url = 1;
bytes cmac = 2;
teaclave_common_proto.FileCryptoInfo crypto_info = 3;
}
message RegisterInputFileResponse {
string data_id = 1;
}
message UpdateInputFileRequest {
string data_id = 1;
string url = 2;
}
message UpdateInputFileResponse {
string data_id = 1;
}
message RegisterOutputFileRequest {
string url = 1;
teaclave_common_proto.FileCryptoInfo crypto_info = 2;
}
message RegisterOutputFileResponse {
string data_id = 1;
}
message UpdateOutputFileRequest {
string data_id = 1;
string url = 2;
}
message UpdateOutputFileResponse {
string data_id = 1;
}
message RegisterFusionOutputRequest {
repeated string owner_list = 1;
}
message RegisterFusionOutputResponse {
string data_id = 1;
}
message RegisterInputFromOutputRequest {
string data_id = 1;
}
message RegisterInputFromOutputResponse {
string data_id = 1;
}
message GetOutputFileRequest {
string data_id = 1;
}
message GetOutputFileResponse {
repeated string owner = 1;
bytes cmac = 2;
}
message GetInputFileRequest {
string data_id = 1;
}
message GetInputFileResponse {
repeated string owner = 1;
bytes cmac = 2;
}
message FunctionInput {
string name = 1;
string description = 2;
bool optional = 3;
}
message FunctionOutput {
string name = 1;
string description = 2;
bool optional = 3;
}
message OwnerList {
string data_name = 1;
repeated string uids = 2;
}
message RegisterFunctionRequest {
string name = 1;
string description = 2;
string executor_type = 3;
bool public = 4;
bytes payload = 5;
repeated string arguments = 6;
repeated FunctionInput inputs = 10;
repeated FunctionOutput outputs = 11;
repeated string user_allowlist = 12;
}
message RegisterFunctionResponse {
string function_id = 1;
}
message UpdateFunctionRequest {
string function_id = 1;
string name = 2;
string description = 3;
string executor_type = 4;
bool public = 5;
bytes payload = 6;
repeated string arguments = 7;
repeated FunctionInput inputs = 10;
repeated FunctionOutput outputs = 11;
repeated string user_allowlist = 12;
}
message UpdateFunctionResponse {
string function_id = 1;
}
message GetFunctionRequest {
string function_id = 1;
}
message GetFunctionResponse {
string name = 1;
string description = 2;
string executor_type = 3;
string owner = 4;
bytes payload = 5;
bool public = 6;
repeated string arguments = 7;
repeated FunctionInput inputs = 10;
repeated FunctionOutput outputs = 11;
repeated string user_allowlist = 12;
}
message DeleteFunctionRequest {
string function_id = 1;
}
message DeleteFunctionResponse { }
message DisableFunctionRequest {
string function_id = 1;
}
message DisableFunctionResponse { }
message ListFunctionsRequest {
string user_id = 1;
}
message ListFunctionsResponse {
repeated string registered_functions = 1;
repeated string allowed_functions = 2;
}
message DataMap {
string data_name = 1;
string data_id = 2;
}
message CreateTaskRequest {
string function_id = 1;
string function_arguments = 2;
string executor = 3;
repeated OwnerList inputs_ownership = 10;
repeated OwnerList outputs_ownership= 11;
}
message CreateTaskResponse {
string task_id = 1;
}
message GetTaskRequest {
string task_id = 1;
}
message GetTaskResponse {
string task_id = 1;
string creator = 2;
string function_id = 3;
string function_owner = 4;
string function_arguments = 5;
repeated OwnerList inputs_ownership = 6;
repeated OwnerList outputs_ownership = 7;
repeated string participants = 8;
repeated string approved_users = 9;
repeated DataMap assigned_inputs = 10;
repeated DataMap assigned_outputs = 11;
teaclave_common_proto.TaskStatus status = 20;
teaclave_common_proto.TaskResult result = 21;
}
message AssignDataRequest {
string task_id = 1;
repeated DataMap inputs = 2;
repeated DataMap outputs = 3;
}
message AssignDataResponse { }
message ApproveTaskRequest {
string task_id = 1;
}
message ApproveTaskResponse { }
message InvokeTaskRequest {
string task_id = 1;
}
message InvokeTaskResponse { }
message CancelTaskRequest {
string task_id = 1;
}
message CancelTaskResponse { }
service TeaclaveFrontend {
rpc RegisterInputFile (RegisterInputFileRequest) returns (RegisterInputFileResponse);
rpc RegisterOutputFile (RegisterOutputFileRequest) returns (RegisterOutputFileResponse);
rpc UpdateInputFile (UpdateInputFileRequest) returns (UpdateInputFileResponse);
rpc UpdateOutputFile (UpdateOutputFileRequest) returns (UpdateOutputFileResponse);
rpc RegisterFusionOutput (RegisterFusionOutputRequest) returns (RegisterFusionOutputResponse);
rpc RegisterInputFromOutput (RegisterInputFromOutputRequest) returns (RegisterInputFromOutputResponse);
rpc GetOutputFile (GetOutputFileRequest) returns (GetOutputFileResponse);
rpc GetInputFile (GetInputFileRequest) returns (GetInputFileResponse);
rpc RegisterFunction (RegisterFunctionRequest) returns (RegisterFunctionResponse);
rpc GetFunction (GetFunctionRequest) returns (GetFunctionResponse);
rpc UpdateFunction (UpdateFunctionRequest) returns (UpdateFunctionResponse);
rpc ListFunctions (ListFunctionsRequest) returns (ListFunctionsResponse);
rpc DeleteFunction (DeleteFunctionRequest) returns (DeleteFunctionResponse);
rpc DisableFunction (DisableFunctionRequest) returns (DisableFunctionResponse);
rpc CreateTask (CreateTaskRequest) returns (CreateTaskResponse);
rpc GetTask (GetTaskRequest) returns (GetTaskResponse);
rpc AssignData (AssignDataRequest) returns (AssignDataResponse);
rpc ApproveTask (ApproveTaskRequest) returns (ApproveTaskResponse);
rpc InvokeTask (InvokeTaskRequest) returns (InvokeTaskResponse);
rpc CancelTask (CancelTaskRequest) returns (CancelTaskResponse);
}