Skip to content

Commit e3a93d3

Browse files
Hamsajjmostafa
andauthored
Update act docs to include async action redis configuration (#60)
* Update act docs to include async action redis configuration * Change wording --------- Co-authored-by: Mostafa Moradian <[email protected]>
1 parent ddb3d22 commit e3a93d3

File tree

2 files changed

+26
-15
lines changed

2 files changed

+26
-15
lines changed

using-gatewayd/Act.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ parent: Using GatewayD
99

1010
# Act
1111

12-
Act, a core component of GatewayD, is a policy engine that supports signals, policies and actions. It is used to automate the execution of business rules. The business rules are currently written as expressions in the [Expr](https://github.com/expr-lang/expr) language, with support for external policy engines to come. The expressions are evaluated against the signals received from the plugins and the corresponding actions are executed if the policy expressions evaluate to true (boolean) or any other type recognized by the action.
12+
Act, a core component of GatewayD, is a policy engine that supports signals, policies and actions. It enables a range of functionalities by automating the execution of business rules. The business rules are currently written as expressions in the [Expr](https://github.com/expr-lang/expr) language, with support for external policy engines to come. The expressions are evaluated against the signals received from the plugins (and possibly other sources). If the policy expressions evaluate to `true` (boolean) or any other type recognized by the corresponding action, then the action will be executed. Alternatively, Act can publish the result of policy evaluation to a Redis Pub/Sub queue in the [`Output`](https://github.com/gatewayd-io/gatewayd-plugin-sdk/blob/bc5513b395c6622b10db02b6608a972cef909e3d/act/io.go#L18-L24) format. This enables plugins and external systems to subscribe to the events published on that channel and run any arbitrary actions necessary based on the given parameters.
1313

1414
Previously, there were only a single signal, policy and action, called the `terminatePolicy`, which were hard-coded into the GatewayD codebase. This made it difficult to extend and customize the behavior of GatewayD. With the new Act, based on [this proposal](https://github.com/gatewayd-io/proposals/issues/5), the signals, policies and actions are pluggable and can be extended to support custom requirements. This opens up a wide range of possibilities for customizing the behavior of GatewayD to suit the needs of different use cases. For example, a policy can be written to check if the request is coming from a specific IP address, and if so, the action can be to terminate the request.
1515

@@ -86,7 +86,10 @@ The `Hook` field is a map that contains the following fields:
8686

8787
## Actions
8888

89-
The action can be run in sync or async mode, and it can return a result or an error. The actions are executed if the policy expressions evaluate to true (boolean) or any other type recognized by the action. The actions have the following fields:
89+
The action can be run in sync or async mode, and it can return a result or an error.
90+
Async actions can be configured to be published to a Redis channel instead of running in a background goroutine.
91+
To configure Act to publish async actions to a Redis channel, use `actionRedis` value of [general configuration](/using-gatewayd/plugins-configuration/general-configurations#Configuration parameters)
92+
The actions are executed, or published, if the policy expressions evaluate to true (boolean) or any other type recognized by the action. The actions have the following fields:
9093

9194
1. `name`: The name of the action, such as `terminate`, `log`, etc.
9295
2. `metadata`: The metadata associated with the action, such as the log message and log level.

0 commit comments

Comments
 (0)