Skip to content

Commit 2f1bb7e

Browse files
committed
readme prepared for publication
Signed-off-by: oEscal <pedroescaleira@hotmail.com>
1 parent 32babd2 commit 2f1bb7e

File tree

3 files changed

+20
-13
lines changed

3 files changed

+20
-13
lines changed

README.md

Lines changed: 18 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,30 @@
1-
# knative-flow-tagging
2-
Extension to the Knative queue-proxy for flow tagging
1+
# PoliFlow Enforcer
32

3+
Extension to the Knative queue-proxy for enforcing rules defined by the PoliFlow Extractor.
44

55
## Instructions
66

7-
Knative Services must have the following metadata annotation to work with this plugin:
7+
The image can be built using the `build.sh` Bash script.
8+
However, before building, it is necessary to set the `KO_DOCKER_REPO` variable to the desired container registry to which the image will be pushed to.
9+
10+
Then, the Kubernetes cluster where Knative Services protected by the Enforcer also needs some configurations.
11+
These can be automatically set by running the `patch.sh` script.
12+
Note, however, that the script will only run successfully if Knative is already installed in the cluster.
13+
Moreover, the script will also need a small modification to set the correct container registry (to the same set with `KO_DOCKER_REPO` in the `build.sh` script).
14+
15+
Regarding the Enforcer usage, Knative Services must have the following metadata annotations to work with this plugin:
816
```yaml
917
spec:
1018
template:
1119
metadata:
1220
annotations:
1321
qpoption.knative.dev/flow-activate: enable
22+
qpoption.knative.dev/flow-config-allowed_json_flows: |
23+
<extracted allowed paths>
24+
qpoption.knative.dev/flow-config-type: event
1425
```
1526
16-
Moreover, the workflow created using SonataFlow must allow the response headers to be sent as request headers in state transitions. To achieve that, the workflows must use this version of the `incubator-kie-kogito-runtimes` (not merged yet, as of 28 of July, 2025): https://github.com/apache/incubator-kie-kogito-runtimes/pull/3939.
17-
After applying this modification, the Knative functions within the workflow must also set the `returnHeaders` query parameter to `true`, like the following example:
18-
```yaml
19-
functions:
20-
- name: authorization
21-
type: custom
22-
operation: knative:services.v1.serving.knative.dev/authorization?method=POST&failOnStatusError=false&returnHeaders=true
23-
```
27+
The plugin is activated for any service that has the annotation `qpoption.knative.dev/flow-activate` set to `enable`.
28+
Then, the allowed paths extracted by the PoliFlow Enforcer must be set (in JSON) as the value ot the `qpoption.knative.dev/flow-config-allowed_json_flows` annotation.
29+
Finally, `qpoption.knative.dev/flow-config-type` is an optional annotation that can be used to set the type of protected Knative Service.
30+
It accepts the values `function` (default) and `event`, used to define BaaS services (such as databases, that are called through callbacks within the workflow).

build.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#!/bin/bash
22

3-
export KO_DOCKER_REPO='ghcr.io/atnog/knative-flow-tagging'
3+
export KO_DOCKER_REPO='ghcr.io/atnog/poliflow-enforcer'
44

55
ko build ./cmd/queue --tags=latest -B

patch.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
kubectl patch configmap config-deployment -n knative-serving \
44
--type merge \
5-
-p '{"data":{"queue-sidecar-image":"ghcr.io/atnog/knative-flow-tagging/queue:latest"}}'
5+
-p '{"data":{"queue-sidecar-image":"ghcr.io/atnog/poliflow-enforcer/queue:latest"}}'
66

77
kubectl patch configmap config-features -n knative-serving \
88
--type merge \

0 commit comments

Comments
 (0)