blob: db89d706e706d94b5ae52f477633bd8bb8631891 [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";
import "google/protobuf/empty.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 FunctionArgument {
string key = 1;
string default_value = 2;
bool allow_overwrite = 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 FunctionArgument arguments = 6;
repeated FunctionInput inputs = 10;
repeated FunctionOutput outputs = 11;
repeated string user_allowlist = 12;
int32 usage_quota = 13;
}
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 FunctionArgument arguments = 7;
repeated FunctionInput inputs = 10;
repeated FunctionOutput outputs = 11;
repeated string user_allowlist = 12;
int32 usage_quota = 13;
}
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 FunctionArgument arguments = 7;
repeated FunctionInput inputs = 10;
repeated FunctionOutput outputs = 11;
repeated string user_allowlist = 12;
}
message GetFunctionUsageStatsRequest {
string function_id = 1;
}
message GetFunctionUsageStatsResponse {
int32 function_quota = 1;
int32 current_usage = 2;
}
message DeleteFunctionRequest {
string function_id = 1;
}
message DisableFunctionRequest {
string function_id = 1;
}
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 ApproveTaskRequest {
string task_id = 1;
}
message InvokeTaskRequest {
string task_id = 1;
}
message CancelTaskRequest {
string task_id = 1;
}
message QueryAuditLogsRequest {
string query = 1;
uint64 limit = 2;
}
message QueryAuditLogsResponse {
repeated teaclave_common_proto.Entry logs = 1;
}
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 GetFunctionUsageStats (GetFunctionUsageStatsRequest) returns (GetFunctionUsageStatsResponse);
rpc UpdateFunction (UpdateFunctionRequest) returns (UpdateFunctionResponse);
rpc ListFunctions (ListFunctionsRequest) returns (ListFunctionsResponse);
rpc DeleteFunction (DeleteFunctionRequest) returns (google.protobuf.Empty);
rpc DisableFunction (DisableFunctionRequest) returns (google.protobuf.Empty);
rpc CreateTask (CreateTaskRequest) returns (CreateTaskResponse);
rpc GetTask (GetTaskRequest) returns (GetTaskResponse);
rpc AssignData (AssignDataRequest) returns (google.protobuf.Empty);
rpc ApproveTask (ApproveTaskRequest) returns (google.protobuf.Empty);
rpc InvokeTask (InvokeTaskRequest) returns (google.protobuf.Empty);
rpc CancelTask (CancelTaskRequest) returns (google.protobuf.Empty);
rpc QueryAuditLogs (QueryAuditLogsRequest) returns (QueryAuditLogsResponse);
}