1180 lines
38 KiB
Protocol Buffer
1180 lines
38 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 "zitadel/action/v2/target.proto";
|
|
import "zitadel/action/v2/execution.proto";
|
|
import "zitadel/action/v2/query.proto";
|
|
import "google/protobuf/timestamp.proto";
|
|
import "zitadel/filter/v2/filter.proto";
|
|
|
|
option go_package = "github.com/zitadel/zitadel/pkg/grpc/action/v2;action";
|
|
|
|
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_swagger) = {
|
|
info: {
|
|
title: "Action Service";
|
|
version: "2.0";
|
|
description: "This API is intended to manage custom executions (previously known as actions) in a Zitadel instance.";
|
|
contact:{
|
|
name: "ZITADEL"
|
|
url: "https://zitadel.com"
|
|
email: "hi@zitadel.com"
|
|
}
|
|
license: {
|
|
name: "Apache 2.0",
|
|
url: "https://github.com/zitadel/zitadel/blob/main/LICENSING.md";
|
|
};
|
|
};
|
|
schemes: HTTPS;
|
|
schemes: HTTP;
|
|
|
|
consumes: "application/json";
|
|
consumes: "application/grpc";
|
|
|
|
produces: "application/json";
|
|
produces: "application/grpc";
|
|
|
|
consumes: "application/grpc-web+proto";
|
|
produces: "application/grpc-web+proto";
|
|
|
|
host: "$CUSTOM_DOMAIN";
|
|
base_path: "/";
|
|
|
|
external_docs: {
|
|
description: "Detailed information about ZITADEL",
|
|
url: "https://zitadel.com/docs"
|
|
}
|
|
security_definitions: {
|
|
security: {
|
|
key: "OAuth2";
|
|
value: {
|
|
type: TYPE_OAUTH2;
|
|
flow: FLOW_ACCESS_CODE;
|
|
authorization_url: "$CUSTOM_DOMAIN/oauth/v2/authorize";
|
|
token_url: "$CUSTOM_DOMAIN/oauth/v2/token";
|
|
scopes: {
|
|
scope: {
|
|
key: "openid";
|
|
value: "openid";
|
|
}
|
|
scope: {
|
|
key: "urn:zitadel:iam:org:project:id:zitadel:aud";
|
|
value: "urn:zitadel:iam:org:project:id:zitadel:aud";
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
security: {
|
|
security_requirement: {
|
|
key: "OAuth2";
|
|
value: {
|
|
scope: "openid";
|
|
scope: "urn:zitadel:iam:org:project:id:zitadel:aud";
|
|
}
|
|
}
|
|
}
|
|
responses: {
|
|
key: "403";
|
|
value: {
|
|
description: "Returned when the user does not have permission to access the resource.";
|
|
schema: {
|
|
json_schema: {
|
|
ref: "#/definitions/rpcStatus";
|
|
}
|
|
}
|
|
}
|
|
}
|
|
responses: {
|
|
key: "404";
|
|
value: {
|
|
description: "Returned when the resource does not exist.";
|
|
schema: {
|
|
json_schema: {
|
|
ref: "#/definitions/rpcStatus";
|
|
}
|
|
}
|
|
}
|
|
}
|
|
};
|
|
|
|
// Service to manage custom executions.
|
|
// The service provides methods to create, update, delete and list targets and executions.
|
|
service ActionService {
|
|
|
|
// Create Target
|
|
//
|
|
// Create a new target to your endpoint, which can be used in executions.
|
|
//
|
|
// Required permission:
|
|
// - `action.target.write`
|
|
rpc CreateTarget (CreateTargetRequest) returns (CreateTargetResponse) {
|
|
option (google.api.http) = {
|
|
post: "/v2/actions/targets"
|
|
body: "*"
|
|
};
|
|
|
|
option (zitadel.protoc_gen_zitadel.v2.options) = {
|
|
auth_option: {
|
|
permission: "action.target.write"
|
|
}
|
|
};
|
|
|
|
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {
|
|
responses: {
|
|
key: "200";
|
|
value: {
|
|
description: "Target created successfully";
|
|
};
|
|
};
|
|
responses: {
|
|
key: "409"
|
|
value: {
|
|
description: "The target to create already exists.";
|
|
}
|
|
};
|
|
responses: {
|
|
key: "400"
|
|
value: {
|
|
description: "The feature flag `actions` is not enabled.";
|
|
}
|
|
};
|
|
};
|
|
}
|
|
|
|
// Update Target
|
|
//
|
|
// Update an existing target.
|
|
// To generate a new signing key set the optional expirationSigningKey.
|
|
//
|
|
// Required permission:
|
|
// - `action.target.write`
|
|
rpc UpdateTarget (UpdateTargetRequest) returns (UpdateTargetResponse) {
|
|
option (google.api.http) = {
|
|
post: "/v2/actions/targets/{id}"
|
|
body: "*"
|
|
};
|
|
|
|
option (zitadel.protoc_gen_zitadel.v2.options) = {
|
|
auth_option: {
|
|
permission: "action.target.write"
|
|
}
|
|
};
|
|
|
|
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {
|
|
responses: {
|
|
key: "200";
|
|
value: {
|
|
description: "Target successfully updated or left unchanged";
|
|
};
|
|
};
|
|
responses: {
|
|
key: "404"
|
|
value: {
|
|
description: "The target to update does not exist.";
|
|
}
|
|
};
|
|
responses: {
|
|
key: "400"
|
|
value: {
|
|
description: "The feature flag `actions` is not enabled.";
|
|
}
|
|
};
|
|
};
|
|
}
|
|
|
|
// Delete Target
|
|
//
|
|
// Delete an existing target. This will remove it from any configured execution as well.
|
|
// In case the target is not found, the request will return a successful response as
|
|
// the desired state is already achieved.
|
|
//
|
|
// Required permission:
|
|
// - `action.target.delete`
|
|
rpc DeleteTarget (DeleteTargetRequest) returns (DeleteTargetResponse) {
|
|
option (google.api.http) = {
|
|
delete: "/v2/actions/targets/{id}"
|
|
};
|
|
|
|
option (zitadel.protoc_gen_zitadel.v2.options) = {
|
|
auth_option: {
|
|
permission: "action.target.delete"
|
|
}
|
|
};
|
|
|
|
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {
|
|
responses: {
|
|
key: "200";
|
|
value: {
|
|
description: "Target deleted successfully";
|
|
};
|
|
};
|
|
responses: {
|
|
key: "400"
|
|
value: {
|
|
description: "The feature flag `actions` is not enabled.";
|
|
}
|
|
};
|
|
};
|
|
}
|
|
|
|
// Get Target
|
|
//
|
|
// Returns the target identified by the requested ID.
|
|
//
|
|
// Required permission:
|
|
// - `action.target.read`
|
|
rpc GetTarget (GetTargetRequest) returns (GetTargetResponse) {
|
|
option (google.api.http) = {
|
|
get: "/v2/actions/targets/{id}"
|
|
};
|
|
|
|
option (zitadel.protoc_gen_zitadel.v2.options) = {
|
|
auth_option: {
|
|
permission: "action.target.read"
|
|
}
|
|
};
|
|
|
|
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {
|
|
responses: {
|
|
key: "200"
|
|
value: {
|
|
description: "Target retrieved successfully";
|
|
}
|
|
};
|
|
responses: {
|
|
key: "404"
|
|
value: {
|
|
description: "The target to update does not exist.";
|
|
}
|
|
};
|
|
responses: {
|
|
key: "400"
|
|
value: {
|
|
description: "The feature flag `actions` is not enabled.";
|
|
}
|
|
};
|
|
};
|
|
}
|
|
|
|
// List targets
|
|
//
|
|
// List all matching targets. By default all targets of the instance are returned.
|
|
// Make sure to include a limit and sorting for pagination.
|
|
//
|
|
// Required permission:
|
|
// - `action.target.read`
|
|
rpc ListTargets (ListTargetsRequest) returns (ListTargetsResponse) {
|
|
option (google.api.http) = {
|
|
post: "/v2/actions/targets/search",
|
|
body: "*"
|
|
};
|
|
|
|
option (zitadel.protoc_gen_zitadel.v2.options) = {
|
|
auth_option: {
|
|
permission: "action.target.read"
|
|
}
|
|
};
|
|
|
|
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {
|
|
responses: {
|
|
key: "200";
|
|
value: {
|
|
description: "A list of all targets matching the query";
|
|
};
|
|
};
|
|
responses: {
|
|
key: "400";
|
|
value: {
|
|
description: "invalid list query";
|
|
};
|
|
};
|
|
responses: {
|
|
key: "400"
|
|
value: {
|
|
description: "The feature flag `actions` is not enabled.";
|
|
}
|
|
};
|
|
};
|
|
}
|
|
|
|
// Add Public Key
|
|
//
|
|
// Adds a public key to the target for payload encryption.
|
|
// The public key is used to encrypt the payload sent to the target when the payload type is set to `PAYLOAD_TYPE_JWE`.
|
|
// The public key must be in PEM format and be either an RSA or an EC key.
|
|
// On a successful addition, a key ID is returned which can not only be used to manage the key (activate, remove),
|
|
// but also will be used as the `kid` header in the JWE token sent to the target to indicate which key was used for encryption.
|
|
// Note that newly added keys are inactive by default. You must activate the key to use it for payload encryption.
|
|
// Providing an optional expiration date allows you to set a validity period for the key.
|
|
// After the expiration date, the key will be automatically deactivated and no longer used for payload encryption.
|
|
// Be sure to activate a new key before the current active key expires to avoid interruptions in your target executions.
|
|
// You can have multiple inactive keys for rotation purposes, but only one active key at a time.
|
|
//
|
|
// Required permission:
|
|
// - `action.target.write`
|
|
rpc AddPublicKey (AddPublicKeyRequest) returns (AddPublicKeyResponse) {
|
|
option (google.api.http) = {
|
|
post: "/v2/actions/targets/{target_id}/publickeys"
|
|
body: "*"
|
|
};
|
|
|
|
option (zitadel.protoc_gen_zitadel.v2.options) = {
|
|
auth_option: {
|
|
permission: "action.target.write"
|
|
}
|
|
};
|
|
|
|
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {
|
|
responses: {
|
|
key: "200";
|
|
value: {
|
|
description: "Public key added successfully";
|
|
};
|
|
};
|
|
};
|
|
}
|
|
|
|
// Activate Public Key
|
|
//
|
|
// Activates the public key for payload encryption.
|
|
// The public key is used to encrypt the payload sent to the target when the payload type is set to `PAYLOAD_TYPE_JWE`.
|
|
// Activating a new key will deactivate the current active key. Only one key can be active at a time.
|
|
// The active key is indicated in the `kid` header in the JWE token sent to the target.
|
|
// Activating a key that is already active is a no-op.
|
|
//
|
|
// Required permission:
|
|
// - `action.target.write`
|
|
rpc ActivatePublicKey (ActivatePublicKeyRequest) returns (ActivatePublicKeyResponse) {
|
|
option (google.api.http) = {
|
|
post: "/v2/actions/targets/{target_id}/publickeys/{key_id}/activate"
|
|
};
|
|
option (zitadel.protoc_gen_zitadel.v2.options) = {
|
|
auth_option: {
|
|
permission: "action.target.write"
|
|
}
|
|
};
|
|
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {
|
|
responses: {
|
|
key: "200";
|
|
value: {
|
|
description: "Public key activated successfully";
|
|
};
|
|
};
|
|
responses: {
|
|
key: "404"
|
|
value: {
|
|
description: "The key to activate does not exist.";
|
|
}
|
|
};
|
|
};
|
|
}
|
|
|
|
// Deactivate Public Key
|
|
//
|
|
// Deactivates the public key for payload encryption.
|
|
// The public key will no longer be used to encrypt payloads sent to the target.
|
|
// Be aware that deactivating the active key will leave the target without an active key.
|
|
// Subsequent calls to the target with payload type `PAYLOAD_TYPE_JWE` will fail until a new key is activated.
|
|
// This endpoint can be used in break glass scenarios to quickly disable a compromised key.
|
|
// Deactivating a key that is already inactive is a no-op.
|
|
//
|
|
// Required permission:
|
|
// - `action.target.write`
|
|
rpc DeactivatePublicKey (DeactivatePublicKeyRequest) returns (DeactivatePublicKeyResponse) {
|
|
option (google.api.http) = {
|
|
post: "/v2/actions/targets/{target_id}/publickeys/{key_id}/deactivate"
|
|
};
|
|
option (zitadel.protoc_gen_zitadel.v2.options) = {
|
|
auth_option: {
|
|
permission: "action.target.write"
|
|
}
|
|
};
|
|
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {
|
|
responses: {
|
|
key: "200";
|
|
value: {
|
|
description: "Public key deactivated successfully";
|
|
};
|
|
};
|
|
responses: {
|
|
key: "404"
|
|
value: {
|
|
description: "The key to deactivate does not exist.";
|
|
}
|
|
};
|
|
};
|
|
}
|
|
|
|
|
|
// Remove Public Key
|
|
//
|
|
// Removes the public key from the target. This is a permanent action and can not be undone.
|
|
// Note that you can only remove inactive keys. Attempting to remove an active key will result in an error.
|
|
// For break glass scenarios, deactivate the key first and then remove it.
|
|
// Removing a non-existing key is a no-op.
|
|
//
|
|
// Required permission:
|
|
// - `action.target.write`
|
|
rpc RemovePublicKey (RemovePublicKeyRequest) returns (RemovePublicKeyResponse) {
|
|
option (google.api.http) = {
|
|
delete: "/v2/actions/targets/{target_id}/publickeys/{key_id}"
|
|
};
|
|
|
|
option (zitadel.protoc_gen_zitadel.v2.options) = {
|
|
auth_option: {
|
|
permission: "action.target.write"
|
|
}
|
|
};
|
|
|
|
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {
|
|
responses: {
|
|
key: "200";
|
|
value: {
|
|
description: "Public key removed successfully";
|
|
};
|
|
};
|
|
};
|
|
}
|
|
|
|
// List Public Keys
|
|
//
|
|
// Lists all public keys of a target.
|
|
// The response includes which key is active and the key's expiration dates.
|
|
// This allows you to manage key rotations and ensure that your target always has an active key for payload encryption.
|
|
//
|
|
// Required permission:
|
|
// - `action.target.read`
|
|
rpc ListPublicKeys (ListPublicKeysRequest) returns (ListPublicKeysResponse) {
|
|
option (google.api.http) = {
|
|
post: "/v2/actions/targets/{target_id}/publickeys/search"
|
|
body: "*"
|
|
};
|
|
|
|
option (zitadel.protoc_gen_zitadel.v2.options) = {
|
|
auth_option: {
|
|
permission: "action.target.read"
|
|
}
|
|
};
|
|
|
|
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {
|
|
responses: {
|
|
key: "200";
|
|
value: {
|
|
description: "List of public keys retrieved successfully";
|
|
};
|
|
};
|
|
};
|
|
}
|
|
|
|
// Set Execution
|
|
//
|
|
// Sets an execution to call a target or include the targets of another execution.
|
|
// Setting an empty list of targets will remove all targets from the execution, making it a noop.
|
|
//
|
|
// Required permission:
|
|
// - `action.execution.write`
|
|
rpc SetExecution (SetExecutionRequest) returns (SetExecutionResponse) {
|
|
option (google.api.http) = {
|
|
put: "/v2/actions/executions"
|
|
body: "*"
|
|
};
|
|
|
|
option (zitadel.protoc_gen_zitadel.v2.options) = {
|
|
auth_option: {
|
|
permission: "action.execution.write"
|
|
}
|
|
};
|
|
|
|
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {
|
|
responses: {
|
|
key: "200";
|
|
value: {
|
|
description: "Execution successfully updated or left unchanged";
|
|
};
|
|
};
|
|
responses: {
|
|
key: "400"
|
|
value: {
|
|
description: "Condition to set execution does not exist or the feature flag `actions` is not enabled.";
|
|
}
|
|
};
|
|
};
|
|
}
|
|
|
|
// List Executions
|
|
//
|
|
// List all matching executions. By default all executions of the instance are returned that have at least one execution target.
|
|
// Make sure to include a limit and sorting for pagination.
|
|
//
|
|
// Required permission:
|
|
// - `action.execution.read`
|
|
rpc ListExecutions (ListExecutionsRequest) returns (ListExecutionsResponse) {
|
|
option (google.api.http) = {
|
|
post: "/v2/actions/executions/search"
|
|
body: "*"
|
|
};
|
|
|
|
option (zitadel.protoc_gen_zitadel.v2.options) = {
|
|
auth_option: {
|
|
permission: "action.execution.read"
|
|
}
|
|
};
|
|
|
|
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {
|
|
responses: {
|
|
key: "200";
|
|
value: {
|
|
description: "A list of all non noop executions matching the query";
|
|
};
|
|
};
|
|
responses: {
|
|
key: "400";
|
|
value: {
|
|
description: "Invalid list query or the feature flag `actions` is not enabled.";
|
|
};
|
|
};
|
|
};
|
|
}
|
|
|
|
// List Execution Functions
|
|
//
|
|
// List all available functions which can be used as condition for executions.
|
|
rpc ListExecutionFunctions (ListExecutionFunctionsRequest) returns (ListExecutionFunctionsResponse) {
|
|
option (google.api.http) = {
|
|
get: "/v2/actions/executions/functions"
|
|
};
|
|
|
|
option (zitadel.protoc_gen_zitadel.v2.options) = {
|
|
auth_option: {
|
|
permission: "authenticated"
|
|
}
|
|
};
|
|
|
|
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {
|
|
responses: {
|
|
key: "200";
|
|
value: {
|
|
description: "List all functions successfully";
|
|
};
|
|
};
|
|
};
|
|
}
|
|
|
|
// List Execution Methods
|
|
//
|
|
// List all available methods which can be used as condition for executions.
|
|
rpc ListExecutionMethods (ListExecutionMethodsRequest) returns (ListExecutionMethodsResponse) {
|
|
option (google.api.http) = {
|
|
get: "/v2/actions/executions/methods"
|
|
};
|
|
|
|
option (zitadel.protoc_gen_zitadel.v2.options) = {
|
|
auth_option: {
|
|
permission: "authenticated"
|
|
}
|
|
};
|
|
|
|
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {
|
|
responses: {
|
|
key: "200";
|
|
value: {
|
|
description: "List all methods successfully";
|
|
};
|
|
};
|
|
};
|
|
}
|
|
|
|
// List Execution Services
|
|
//
|
|
// List all available services which can be used as condition for executions.
|
|
rpc ListExecutionServices (ListExecutionServicesRequest) returns (ListExecutionServicesResponse) {
|
|
option (google.api.http) = {
|
|
get: "/v2/actions/executions/services"
|
|
};
|
|
|
|
option (zitadel.protoc_gen_zitadel.v2.options) = {
|
|
auth_option: {
|
|
permission: "authenticated"
|
|
}
|
|
};
|
|
|
|
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {
|
|
responses: {
|
|
key: "200";
|
|
value: {
|
|
description: "List all services successfully";
|
|
};
|
|
};
|
|
};
|
|
}
|
|
}
|
|
|
|
message CreateTargetRequest {
|
|
string name = 1 [
|
|
(validate.rules).string = {min_len: 1, max_len: 1000},
|
|
(google.api.field_behavior) = REQUIRED,
|
|
(grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = {
|
|
example: "\"ip_allow_list\"";
|
|
min_length: 1
|
|
max_length: 1000
|
|
}
|
|
];
|
|
|
|
// Defines the target type and how the response of the target is treated.
|
|
oneof target_type {
|
|
option (validate.required) = true;
|
|
|
|
// The HTTP call to this target will be a POST request.
|
|
// The response of the target will only be checked for the status code.
|
|
// The returned body will be ignored.
|
|
// In case of an error status code (non 2xx) and interrupt_on_error is set to true,
|
|
// the execution will be aborted and no further targets will be called.
|
|
RESTWebhook rest_webhook = 2;
|
|
|
|
// The HTTP call to this target will be a POST request.
|
|
// The response of the target will be checked for the status code and the body.
|
|
// In case of an error status code (non 2xx) and interrupt_on_error is set to true,
|
|
// the execution will be aborted and no further targets will be called.
|
|
// In case of a successful status code (2xx) the body will be parsed and mapped.
|
|
// This allows to modify the payload of request and response executions.
|
|
RESTCall rest_call = 3;
|
|
|
|
// The HTTP call to this target will be a POST request.
|
|
// The call is sent asynchronously and Zitadel does not wait for the response.
|
|
// The response of the target is ignored, no status or body is checked.
|
|
// This is typically used for executions of type "events".
|
|
RESTAsync rest_async = 4;
|
|
}
|
|
|
|
// Timeout defines the duration until Zitadel cancels the execution.
|
|
// If the target doesn't respond before this timeout expires, then the connection is closed and the action fails.
|
|
// Depending on the target type and possible setting on `interrupt_on_error` following targets will not be called.
|
|
// In case of a `rest_async` target only this specific target will fail, without any influence on other targets of the same execution.
|
|
// The maximum timeout is 270 seconds or 4.5 minutes.
|
|
google.protobuf.Duration timeout = 5 [
|
|
(validate.rules).duration = {gte: {}, lte: {seconds: 270}},
|
|
(grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = {
|
|
example: "\"10s\"";
|
|
}
|
|
];
|
|
|
|
// The URL of the endpoint to call.
|
|
string endpoint = 6 [
|
|
(validate.rules).string = {min_len: 1, max_len: 2048},
|
|
(google.api.field_behavior) = REQUIRED,
|
|
(grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = {
|
|
example: "\"https://example.com/hooks/ip_check\""
|
|
min_length: 1
|
|
max_length: 2048
|
|
}
|
|
];
|
|
|
|
// Payload type defines how the payload is formatted and secured.
|
|
// The default is `PAYLOAD_TYPE_JSON`, which sends the payload as JSON in the body of the request.
|
|
// For integrity and authenticity a signature is included in the header `X-ZITADEL-Signature`.
|
|
// You can also choose to send the payload as a JWT (`PAYLOAD_TYPE_JWT`), which sends
|
|
// the payload as a signed JWT in the body of the request. This allows the receiver to verify
|
|
// the authenticity and integrity of the payload using the signing key.
|
|
// If you need encryption as well, you can choose `PAYLOAD_TYPE_JWE`, which sends the payload
|
|
// as an encrypted JWT in the body of the request. You can provide your own public key for encryption.
|
|
PayloadType payload_type = 7 [
|
|
(grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = {
|
|
default: "\"PAYLOAD_TYPE_JSON\""
|
|
}
|
|
];
|
|
|
|
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_schema) = {
|
|
example: "{\"name\": \"ip_allow_list\",\"restWebhook\":{\"interruptOnError\":true},\"timeout\":\"10s\",\"endpoint\":\"https://example.com/hooks/ip_check\"}";
|
|
};
|
|
}
|
|
|
|
message CreateTargetResponse {
|
|
// The unique identifier of the newly created target.
|
|
string id = 1 [
|
|
(grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = {
|
|
example: "\"69629012906488334\"";
|
|
}
|
|
];
|
|
|
|
// The timestamp of the target creation.
|
|
google.protobuf.Timestamp creation_date = 2 [
|
|
(grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = {
|
|
example: "\"2024-12-18T07:50:47.492Z\"";
|
|
}
|
|
];
|
|
|
|
// Key used to sign and check payload sent to the target.
|
|
// The key can be used to verify the integrity and authenticity of the request
|
|
// on the receiver side. The key should be treated as a secret and only known to Zitadel and the receiver.
|
|
// The signature is included in the request header `X-ZITADEL-Signature`
|
|
// and calculated over the raw body of the request using HMAC with SHA256.
|
|
string signing_key = 3 [
|
|
(grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = {
|
|
example: "\"98KmsU67\""
|
|
}
|
|
];
|
|
}
|
|
|
|
message UpdateTargetRequest {
|
|
// The unique identifier of the target to update.
|
|
string id = 1 [
|
|
(validate.rules).string = {min_len: 1, max_len: 200},
|
|
(google.api.field_behavior) = REQUIRED,
|
|
(grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = {
|
|
min_length: 1,
|
|
max_length: 200,
|
|
example: "\"69629026806489455\"";
|
|
}
|
|
];
|
|
|
|
// Optionally, update the name of the target.
|
|
// If not set, the name will not be changed.
|
|
optional string name = 2 [
|
|
(validate.rules).string = {min_len: 1, max_len: 1000},
|
|
(grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = {
|
|
example: "\"ip_allow_list\""
|
|
min_length: 1
|
|
max_length: 1000
|
|
}
|
|
];
|
|
|
|
// Defines the target type and how the response of the target is treated.
|
|
oneof target_type {
|
|
|
|
// The HTTP call to this target will be a POST request.
|
|
// The response of the target will only be checked for the status code.
|
|
// The returned body will be ignored.
|
|
// In case of an error status code (non 2xx) and interrupt_on_error is set to true,
|
|
// the execution will be aborted and no further targets will be called.
|
|
RESTWebhook rest_webhook = 3;
|
|
|
|
// The HTTP call to this target will be a POST request.
|
|
// The response of the target will be checked for the status code and the body.
|
|
// In case of an error status code (non 2xx) and interrupt_on_error is set to true,
|
|
// the execution will be aborted and no further targets will be called.
|
|
// In case of a successful status code (2xx) the body will be parsed and mapped.
|
|
// This allows to modify the payload of request and response executions.
|
|
RESTCall rest_call = 4;
|
|
|
|
// The HTTP call to this target will be a POST request.
|
|
// The call is sent asynchronously and Zitadel does not wait for the response.
|
|
// The response of the target is ignored, no status or body is checked.
|
|
// This is typically used for executions of type "events".
|
|
RESTAsync rest_async = 5;
|
|
}
|
|
|
|
// Timeout defines the duration until Zitadel cancels the execution.
|
|
// If the target doesn't respond before this timeout expires, then the connection is closed and the action fails.
|
|
// Depending on the target type and possible setting on `interrupt_on_error` following targets will not be called.
|
|
// In case of a `rest_async` target only this specific target will fail, without any influence on other targets of the same execution.
|
|
// The maximum timeout is 270 seconds or 4.5 minutes.
|
|
// If not set, the timeout will not be changed.
|
|
optional google.protobuf.Duration timeout = 6 [
|
|
(validate.rules).duration = {gte: {}, lte: {seconds: 270}},
|
|
(grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = {
|
|
example: "\"10s\"";
|
|
}
|
|
];
|
|
|
|
// The new URL of the endpoint to call.
|
|
// If not set, the endpoint will not be changed.
|
|
optional string endpoint = 7 [
|
|
(validate.rules).string = {min_len: 1, max_len: 2048},
|
|
(grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = {
|
|
example: "\"https://example.com/hooks/ip_check\""
|
|
min_length: 1
|
|
max_length: 2048
|
|
}
|
|
];
|
|
|
|
// Regenerate the key used for signing and checking the payload sent to the target.
|
|
// Set the graceful period for the existing key. During that time, the previous
|
|
// signing key and the new one will be used to sign the request to allow you a smooth
|
|
// transition onf your API.
|
|
//
|
|
// Note that we currently only allow an immediate rotation ("0s") and will support
|
|
// longer expirations in the future.
|
|
optional google.protobuf.Duration expiration_signing_key = 8 [
|
|
(validate.rules).duration = {const: {seconds: 0, nanos: 0}},
|
|
(grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = {
|
|
example: "\"0s\""
|
|
minimum: 0
|
|
maximum: 0
|
|
}
|
|
];
|
|
|
|
// Payload type defines how the payload is formatted and secured.
|
|
// The default is `PAYLOAD_TYPE_JSON`, which sends the payload as JSON in the body of the request.
|
|
// For integrity and authenticity a signature is included in the header `X-ZITADEL-Signature`.
|
|
// You can also choose to send the payload as a JWT (`PAYLOAD_TYPE_JWT`), which sends
|
|
// the payload as a signed JWT in the body of the request. This allows the receiver to verify
|
|
// the authenticity and integrity of the payload using the signing key.
|
|
// If you need encryption as well, you can choose `PAYLOAD_TYPE_JWE`, which sends the payload
|
|
// as an encrypted JWT in the body of the request. You can provide your own public key for encryption.
|
|
// If unspecified, the payload type will not be changed.
|
|
PayloadType payload_type = 9 [
|
|
(grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = {
|
|
default: "\"PAYLOAD_TYPE_JSON\""
|
|
}
|
|
];
|
|
|
|
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_schema) = {
|
|
example: "{\"name\": \"ip_allow_list\",\"restCall\":{\"interruptOnError\":true},\"timeout\":\"10s\",\"endpoint\":\"https://example.com/hooks/ip_check\",\"expirationSigningKey\":\"0s\"}";
|
|
};
|
|
}
|
|
|
|
message UpdateTargetResponse {
|
|
// The timestamp of the change of the target.
|
|
google.protobuf.Timestamp change_date = 1 [
|
|
(grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = {
|
|
example: "\"2025-01-23T10:34:18.051Z\"";
|
|
}
|
|
];
|
|
|
|
// Key used to sign and check payload sent to the target.
|
|
// The key can be used to verify the integrity and authenticity of the request
|
|
// on the receiver side. The key should be treated as a secret and only known to Zitadel and the receiver.
|
|
// The signature is included in the request header `X-ZITADEL-Signature`
|
|
// and calculated over the raw body of the request using HMAC with SHA256.
|
|
// The key is only returned if expirationSigningKey was set in the request.
|
|
optional string signing_key = 2 [
|
|
(grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = {
|
|
example: "\"98KmsU67\""
|
|
}
|
|
];
|
|
}
|
|
|
|
message DeleteTargetRequest {
|
|
// The unique identifier of the target to delete.
|
|
string id = 1 [
|
|
(validate.rules).string = {min_len: 1, max_len: 200},
|
|
(google.api.field_behavior) = REQUIRED,
|
|
(grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = {
|
|
min_length: 1,
|
|
max_length: 200,
|
|
example: "\"69629026806489455\"";
|
|
}
|
|
];
|
|
}
|
|
|
|
message DeleteTargetResponse {
|
|
// The timestamp of the deletion of the target.
|
|
// Note that the deletion date is only guaranteed to be set if the deletion was successful during the request.
|
|
// In case the deletion occurred in a previous request, the deletion date might be empty.
|
|
google.protobuf.Timestamp deletion_date = 3 [
|
|
(grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = {
|
|
example: "\"2025-01-23T10:34:18.051Z\"";
|
|
}
|
|
];
|
|
}
|
|
|
|
message GetTargetRequest {
|
|
// The unique identifier of the target to retrieve.
|
|
string id = 1 [
|
|
(validate.rules).string = {min_len: 1, max_len: 200},
|
|
(google.api.field_behavior) = REQUIRED,
|
|
(grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = {
|
|
min_length: 1,
|
|
max_length: 200,
|
|
example: "\"69629026806489455\"";
|
|
}
|
|
];
|
|
}
|
|
|
|
message GetTargetResponse {
|
|
Target target = 1;
|
|
}
|
|
|
|
message ListTargetsRequest {
|
|
// List limitations and ordering.
|
|
optional zitadel.filter.v2.PaginationRequest pagination = 1;
|
|
|
|
// The field the result is sorted by. The default is the creation date. Beware that if you change this, your result pagination might be inconsistent.
|
|
optional TargetFieldName sorting_column = 2 [
|
|
(grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = {
|
|
default: "\"TARGET_FIELD_NAME_CREATION_DATE\""
|
|
}
|
|
];
|
|
|
|
// Define the criteria to query for.
|
|
repeated TargetSearchFilter filters = 3;
|
|
|
|
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_schema) = {
|
|
example: "{\"pagination\":{\"offset\":0,\"limit\":0,\"asc\":true},\"sortingColumn\":\"TARGET_FIELD_NAME_CREATION_DATE\",\"filters\":[{\"targetNameFilter\":{\"targetName\":\"ip_allow_list\",\"method\":\"TEXT_FILTER_METHOD_EQUALS\"}},{\"inTargetIdsFilter\":{\"targetIds\":[\"69629023906488334\",\"69622366012355662\"]}}]}";
|
|
};
|
|
}
|
|
|
|
message ListTargetsResponse {
|
|
reserved 'result';
|
|
|
|
zitadel.filter.v2.PaginationResponse pagination = 1;
|
|
|
|
// List of all targets matching the query.
|
|
repeated Target targets = 2;
|
|
}
|
|
|
|
message AddPublicKeyRequest {
|
|
// The unique identifier of the target to add the public key to.
|
|
string target_id = 1 [
|
|
(validate.rules).string = {min_len: 1, max_len: 200},
|
|
(google.api.field_behavior) = REQUIRED,
|
|
(grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = {
|
|
min_length: 1,
|
|
max_length: 200,
|
|
example: "\"69629026806489455\"";
|
|
}
|
|
];
|
|
|
|
// The public key in PEM format. It must be either an RSA or an EC public key.
|
|
bytes public_key = 2 [
|
|
(validate.rules).bytes = {min_len: 1, max_len: 8192},
|
|
(google.api.field_behavior) = REQUIRED,
|
|
(grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = {
|
|
example: "\"LS0tLS1CRUdJTiBQVUJMSUMgS0VZLS0tLS1cbk1JSUJJakFOQmdrcWhraUc5dzBCQVFzRkFEQV...\"";
|
|
}
|
|
];
|
|
|
|
// Optional expiration date of the public key.
|
|
// After the expiration date, the key will be automatically deactivated and no longer used for payload encryption.
|
|
// Be sure to activate a new key before the current active key expires to avoid interruptions.
|
|
// If not set, the key will not expire.
|
|
optional google.protobuf.Timestamp expiration_date = 3 [
|
|
(grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = {
|
|
example: "\"2025-12-18T07:50:47.492Z\"";
|
|
}
|
|
];
|
|
}
|
|
|
|
message AddPublicKeyResponse {
|
|
// The KeyID is the unique identifier of the newly added public key.
|
|
// The ID is also used a `kid` in the JWT header for payload encryption.
|
|
// This allows the target to identify the correct key to use for decryption.
|
|
string key_id = 1 [
|
|
(grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = {
|
|
example: "\"69629032906489576\"";
|
|
}
|
|
];
|
|
|
|
// CreationDate represents the timestamp of the public key addition.
|
|
google.protobuf.Timestamp creation_date = 2 [
|
|
(grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = {
|
|
example: "\"2024-12-18T07:50:47.492Z\"";
|
|
}
|
|
];
|
|
}
|
|
|
|
message ActivatePublicKeyRequest {
|
|
// TargetID is the unique identifier of the target to activate the public key for.
|
|
string target_id = 1 [
|
|
(validate.rules).string = {min_len: 1, max_len: 200},
|
|
(google.api.field_behavior) = REQUIRED,
|
|
(grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = {
|
|
min_length: 1,
|
|
max_length: 200,
|
|
example: "\"69629026806489455\"";
|
|
}
|
|
];
|
|
|
|
// KeyID is the unique identifier of the public key to activate.
|
|
string key_id = 2 [
|
|
(validate.rules).string = {min_len: 1, max_len: 200},
|
|
(google.api.field_behavior) = REQUIRED,
|
|
(grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = {
|
|
min_length: 1,
|
|
max_length: 200,
|
|
example: "\"69629032906489576\"";
|
|
}
|
|
];
|
|
}
|
|
|
|
message ActivatePublicKeyResponse {
|
|
// ChangeDate is the timestamp of the public key's activation.
|
|
google.protobuf.Timestamp change_date = 1 [
|
|
(grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = {
|
|
example: "\"2024-12-18T07:50:47.492Z\"";
|
|
}
|
|
];
|
|
}
|
|
|
|
message DeactivatePublicKeyRequest {
|
|
// TargetID is the unique identifier of the target to deactivate the public key for.
|
|
string target_id = 1 [
|
|
(validate.rules).string = {min_len: 1, max_len: 200},
|
|
(google.api.field_behavior) = REQUIRED,
|
|
(grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = {
|
|
min_length: 1,
|
|
max_length: 200,
|
|
example: "\"69629026806489455\"";
|
|
}
|
|
];
|
|
|
|
// KeyID is the unique identifier of the public key to deactivate.
|
|
string key_id = 2 [
|
|
(validate.rules).string = {min_len: 1, max_len: 200},
|
|
(google.api.field_behavior) = REQUIRED,
|
|
(grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = {
|
|
min_length: 1,
|
|
max_length: 200,
|
|
example: "\"69629032906489576\"";
|
|
}
|
|
];
|
|
}
|
|
|
|
message DeactivatePublicKeyResponse {
|
|
// ChangeDate is the timestamp of the public key's deactivation.
|
|
google.protobuf.Timestamp change_date = 1 [
|
|
(grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = {
|
|
example: "\"2024-12-18T07:50:47.492Z\"";
|
|
}
|
|
];
|
|
}
|
|
|
|
message RemovePublicKeyRequest {
|
|
// TargetID is the unique identifier of the target to remove the public key from.
|
|
string target_id = 1 [
|
|
(validate.rules).string = {min_len: 1, max_len: 200},
|
|
(google.api.field_behavior) = REQUIRED,
|
|
(grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = {
|
|
min_length: 1,
|
|
max_length: 200,
|
|
example: "\"69629026806489455\"";
|
|
}
|
|
];
|
|
|
|
// KeyID is the unique identifier of the public key to remove.
|
|
string key_id = 2 [
|
|
(validate.rules).string = {min_len: 1, max_len: 200},
|
|
(google.api.field_behavior) = REQUIRED,
|
|
(grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = {
|
|
min_length: 1,
|
|
max_length: 200,
|
|
example: "\"69629032906489576\"";
|
|
}
|
|
];
|
|
}
|
|
|
|
message RemovePublicKeyResponse {
|
|
// DeletionDate is the timestamp of the public key removal.
|
|
google.protobuf.Timestamp deletion_date = 1 [
|
|
(grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = {
|
|
example: "\"2024-12-18T07:50:47.492Z\"";
|
|
}
|
|
];
|
|
}
|
|
|
|
message ListPublicKeysRequest {
|
|
// TargetID is the unique identifier of the target to list the public keys for.
|
|
string target_id = 1 [
|
|
(validate.rules).string = {min_len: 1, max_len: 200},
|
|
(google.api.field_behavior) = REQUIRED,
|
|
(grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = {
|
|
min_length: 1,
|
|
max_length: 200,
|
|
example: "\"69629026806489455\"";
|
|
}
|
|
];
|
|
|
|
// List limitations and ordering.
|
|
optional zitadel.filter.v2.PaginationRequest pagination = 2;
|
|
|
|
// The field the result is sorted by. The default is the creation date.
|
|
// Beware that if you change this, your result pagination might be inconsistent.
|
|
PublicKeyFieldName sorting_column = 3 [
|
|
(grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = {
|
|
default: "\"EXECUTION_FIELD_NAME_CREATION_DATE\""
|
|
}
|
|
];
|
|
|
|
// Define the criteria to query for.
|
|
repeated PublicKeySearchFilter filters = 4;
|
|
}
|
|
|
|
message ListPublicKeysResponse {
|
|
// List limitations and ordering.
|
|
zitadel.filter.v2.PaginationResponse pagination = 1;
|
|
|
|
// List of all public keys for the target.
|
|
repeated PublicKey public_keys = 2;
|
|
}
|
|
|
|
message SetExecutionRequest {
|
|
// Condition defining when the execution should be used.
|
|
Condition condition = 1;
|
|
|
|
// Ordered list of targets called during the execution.
|
|
repeated string targets = 2;
|
|
|
|
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_schema) = {
|
|
example: "{\"condition\":{\"request\":{\"method\":\"zitadel.session.v2.SessionService/ListSessions\"}},\"targets\":[{\"target\":\"69629026806489455\"}]}";
|
|
};
|
|
}
|
|
|
|
message SetExecutionResponse {
|
|
// The timestamp of the execution set.
|
|
google.protobuf.Timestamp set_date = 1 [
|
|
(grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = {
|
|
example: "\"2024-12-18T07:50:47.492Z\"";
|
|
}
|
|
];
|
|
}
|
|
|
|
message ListExecutionsRequest {
|
|
// List limitations and ordering.
|
|
optional zitadel.filter.v2.PaginationRequest pagination = 1;
|
|
|
|
// The field the result is sorted by. The default is the creation date.
|
|
// Beware that if you change this, your result pagination might be inconsistent.
|
|
optional ExecutionFieldName sorting_column = 2 [
|
|
(grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = {
|
|
default: "\"EXECUTION_FIELD_NAME_CREATION_DATE\""
|
|
}
|
|
];
|
|
|
|
// Define the criteria to query for.
|
|
repeated ExecutionSearchFilter filters = 3;
|
|
|
|
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_schema) = {
|
|
example: "{\"pagination\":{\"offset\":0,\"limit\":0,\"asc\":true},\"sortingColumn\":\"EXECUTION_FIELD_NAME_ID\",\"filters\":[{\"targetFilter\":{\"targetId\":\"69629023906488334\"}}]}";
|
|
};
|
|
}
|
|
|
|
message ListExecutionsResponse {
|
|
reserved 'result';
|
|
|
|
zitadel.filter.v2.PaginationResponse pagination = 1;
|
|
|
|
// List of all executions matching the query.
|
|
repeated Execution executions = 2;
|
|
}
|
|
|
|
message ListExecutionFunctionsRequest{}
|
|
|
|
message ListExecutionFunctionsResponse{
|
|
// All available functions to use in conditions.
|
|
repeated string functions = 1;
|
|
}
|
|
|
|
message ListExecutionMethodsRequest{}
|
|
|
|
message ListExecutionMethodsResponse{
|
|
// All available methods to use in conditions.
|
|
repeated string methods = 1;
|
|
}
|
|
|
|
message ListExecutionServicesRequest{}
|
|
|
|
message ListExecutionServicesResponse{
|
|
// All available services to use in conditions.
|
|
repeated string services = 1;
|
|
}
|