From 7e9019f5fd85ecdb1eabb7a5b54ce8647272dc70 Mon Sep 17 00:00:00 2001 From: Joscha Schmiedt <joscha@schmiedt.dev> Date: Tue, 18 Mar 2025 20:21:26 +0100 Subject: [PATCH] Add auth_token to ExecuteScriptRequest and remove ideas for later releases --- .../caosdb/scripting/v1alpha1/scripting.proto | 34 +++++++------------ 1 file changed, 13 insertions(+), 21 deletions(-) diff --git a/proto/caosdb/scripting/v1alpha1/scripting.proto b/proto/caosdb/scripting/v1alpha1/scripting.proto index 8b3d85f..2028e04 100644 --- a/proto/caosdb/scripting/v1alpha1/scripting.proto +++ b/proto/caosdb/scripting/v1alpha1/scripting.proto @@ -21,6 +21,8 @@ syntax = "proto3"; package caosdb.scripting.v1alpha1; +import "google/protobuf/timestamp.proto"; + option java_multiple_files = true; option java_package = "org.caosdb.api.scripting.v1alpha1"; @@ -40,10 +42,12 @@ message ExecuteScriptRequest { repeated string positional_arguments = 3; // The named arguments for the script repeated NamedArgument named_arguments = 4; - // The files to be used by the script (will be uploaded to the server) + // The files to be used by the script (will be uploaded to the server, not implemented yet) repeated string script_files = 5; - // IDEA: Whether the script should be executed asynchronously - bool run_async = 6; + // The authentication token for the script execution. Will be generated by server if empty. + string auth_token = 6; + // Whether the script should be executed asynchronously (not implemented yet) + bool run_async = 7; } enum ScriptExecutionResult { @@ -90,27 +94,15 @@ message ExecuteScriptResponse { string stdout = 5; // The standard error of the script string stderr = 6; - // IDEA: The user who executed the script - string executing_user = 7; - // IDEA: The date and time when the script was started - string execution_start_datetime = 8; - // IDEA: The date and time when the script was finished - string execution_end_datetime = 9; - // IDEA: The duration of the script execution - string execution_duration = 10; - // IDEA: Return a list of files created by the script. These files will be available for download. - // The files will be deleted after a certain time? How should the server know about - // about these? - repeated string created_files = 11; + // The start time of the script execution + google.protobuf.Timestamp start_time = 7; + // The end time of the script execution (empty if the script is still running) + google.protobuf.Timestamp end_time = 8; + // The duration of the script execution in milliseconds (zero if the script is still running) + int64 duration_ms = 9; } service ServerSideScriptingService { // Executes a script on the server side rpc ExecuteScript(ExecuteScriptRequest) returns (ExecuteScriptResponse) {} - // IDEA: Get the status of a script execution - rpc GetScriptExecutionStatus(ScriptExecutionId) returns (ExecuteScriptResponse) {} - // IDEA: Delete temp files (only for admins?) - // rpc DeleteTempFiles(DeleteTempFilesRequest) returns (DeleteTempFilesResponse) {} - // IDEA: Wait for a script execution to finish - // rpc WaitForScriptExecution(ScriptExecutionId, TimeoutDuration) returns (ExecuteScriptResponse) {} } -- GitLab