165 lines
5.5 KiB
Protocol Buffer
165 lines
5.5 KiB
Protocol Buffer
syntax = "proto3";
|
|
|
|
package zitadel.action.v2;
|
|
|
|
import "google/api/annotations.proto";
|
|
import "google/api/field_behavior.proto";
|
|
import "google/protobuf/duration.proto";
|
|
import "google/protobuf/struct.proto";
|
|
import "protoc-gen-openapiv2/options/annotations.proto";
|
|
import "validate/validate.proto";
|
|
import "zitadel/protoc_gen_zitadel/v2/options.proto";
|
|
|
|
import "google/protobuf/timestamp.proto";
|
|
|
|
option go_package = "github.com/zitadel/zitadel/pkg/grpc/action/v2;action";
|
|
|
|
message Execution {
|
|
// The condition under which the execution is triggered.
|
|
Condition condition = 1;
|
|
|
|
// The timestamp of the execution creation.
|
|
google.protobuf.Timestamp creation_date = 2 [
|
|
(grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = {
|
|
example: "\"2024-12-18T07:50:47.492Z\"";
|
|
}
|
|
];
|
|
|
|
// The timestamp of the last change to the execution.
|
|
google.protobuf.Timestamp change_date = 3 [
|
|
(grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = {
|
|
example: "\"2025-01-23T10:34:18.051Z\"";
|
|
}
|
|
];
|
|
|
|
// Ordered list of targets called during the execution.
|
|
// The order of the targets in this list defines the order of execution.
|
|
// If one of the targets fails, depending on the target's type and settings,
|
|
// the execution might be interrupted and the following targets will not be called.
|
|
repeated string targets = 4;
|
|
}
|
|
|
|
message Condition {
|
|
// Condition-types under which conditions the execution should happen, only one possible.
|
|
oneof condition_type {
|
|
option (validate.required) = true;
|
|
|
|
// Condition-type to execute if a request on the defined API point happens.
|
|
RequestExecution request = 1;
|
|
|
|
// Condition-type to execute on response if a request on the defined API point happens.
|
|
ResponseExecution response = 2;
|
|
|
|
// Condition-type to execute if function is used, replaces actions v1.
|
|
FunctionExecution function = 3;
|
|
|
|
// Condition-type to execute if an event is created in the system.
|
|
EventExecution event = 4;
|
|
}
|
|
}
|
|
|
|
message RequestExecution {
|
|
// Condition for the request execution. Only one is possible.
|
|
oneof condition{
|
|
option (validate.required) = true;
|
|
|
|
// Define a GRPC-method as condition.
|
|
// When a request to this method happens, the execution is triggered.
|
|
string method = 1 [
|
|
(validate.rules).string = {min_len: 1, max_len: 1000},
|
|
(grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = {
|
|
min_length: 1,
|
|
max_length: 1000,
|
|
example: "\"/zitadel.session.v2.SessionService/ListSessions\"";
|
|
}
|
|
];
|
|
|
|
// Define a GRPC-service as condition.
|
|
// When a request to any method of this service happens, the execution is triggered.
|
|
string service = 2 [
|
|
(validate.rules).string = {min_len: 1, max_len: 1000},
|
|
(grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = {
|
|
min_length: 1,
|
|
max_length: 1000,
|
|
example: "\"zitadel.session.v2.SessionService\"";
|
|
}
|
|
];
|
|
|
|
// Define all calls as condition.
|
|
// When a call to any available service happens, the execution is triggered.
|
|
bool all = 3 [(validate.rules).bool = {const: true}];
|
|
}
|
|
}
|
|
|
|
message ResponseExecution {
|
|
// Condition for the response execution. Only one is possible.
|
|
oneof condition{
|
|
option (validate.required) = true;
|
|
|
|
// Define a GRPC-method as condition.
|
|
// Before a response is returned to the client from this method, the execution is triggered.
|
|
string method = 1 [
|
|
(validate.rules).string = {min_len: 1, max_len: 1000},
|
|
(grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = {
|
|
min_length: 1,
|
|
max_length: 1000,
|
|
example: "\"/zitadel.session.v2.SessionService/ListSessions\"";
|
|
}
|
|
];
|
|
|
|
// Define a GRPC-service as condition.
|
|
// Before a response is returned to the client from any method of this service, the execution is triggered.
|
|
string service = 2 [
|
|
(validate.rules).string = {min_len: 1, max_len: 1000},
|
|
(grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = {
|
|
min_length: 1,
|
|
max_length: 1000,
|
|
example: "\"zitadel.session.v2.SessionService\"";
|
|
}
|
|
];
|
|
|
|
// Define all calls as condition.
|
|
// Before a response is returned to the client from any available service,
|
|
// the execution is triggered.
|
|
bool all = 3 [(validate.rules).bool = {const: true}];
|
|
}
|
|
}
|
|
|
|
// Executed on the specified function
|
|
message FunctionExecution {
|
|
string name = 1 [(validate.rules).string = {min_len: 1, max_len: 1000}];
|
|
}
|
|
|
|
message EventExecution {
|
|
// Condition for the event execution. Only one is possible.
|
|
oneof condition{
|
|
option (validate.required) = true;
|
|
|
|
// Define a specific event as condition.
|
|
// After this event is created, the execution is triggered.
|
|
string event = 1 [
|
|
(validate.rules).string = {min_len: 1, max_len: 1000},
|
|
(grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = {
|
|
min_length: 1,
|
|
max_length: 1000,
|
|
example: "\"user.human.added\"";
|
|
}
|
|
];
|
|
|
|
// Define an event group as condition.
|
|
// After any event under this group is created, the execution is triggered.
|
|
string group = 2 [
|
|
(validate.rules).string = {min_len: 1, max_len: 1000},
|
|
(grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = {
|
|
min_length: 1,
|
|
max_length: 1000,
|
|
example: "\"user.human\"";
|
|
}
|
|
];
|
|
|
|
// Define all events as condition.
|
|
// After any event is created, the execution is triggered.
|
|
bool all = 3 [(validate.rules).bool = {const: true}];
|
|
}
|
|
}
|