Skip to content

Commit 1ddcfbe

Browse files
committed
Add allowedCallbackHosts parameter for queue-worker
Allow users to restrict which hosts receive async function callbacks via a list of glob URLs. Defaults to ["*"] for backwards compatibility (allow all). Set to an empty list to deny all. Signed-off-by: Han Verstraete (OpenFaaS Ltd) <han@openfaas.com>
1 parent 2bf4e7b commit 1ddcfbe

6 files changed

Lines changed: 9 additions & 0 deletions

File tree

chart/openfaas/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -582,6 +582,7 @@ See [values.yaml](./values.yaml) for detailed configuration.
582582
| `jetstreamQueueWorker.logs.debug` | Log debug messages | `false` |
583583
| `jetstreamQueueWorker.logs.format` | Set the log format, supports `console` or `json` | `console` |
584584
| `jetstreamQueueWorker.adaptiveConcurrency` | Enable adaptive concurrency limiting for functions. This setting only takes effect when `jetstreamQueueWorker.mode` is set to `function`. | `true` |
585+
| `jetstreamQueueWorker.allowedCallbackHosts` | List of glob patterns for hosts allowed to receive async callbacks. Defaults to `["*"]` (allow all). Set to empty list `[]` to deny all | `["*"]` |
585586
| `nats.channel` | The name of the NATS Streaming channel or NATS JetStream stream to use for asynchronous function invocations | `faas-request` |
586587
| `nats.external.clusterName` | The name of the externally-managed NATS Streaming server | `""` |
587588
| `nats.external.enabled` | Whether to use an externally-managed NATS Streaming server | `false` |

chart/openfaas/templates/queueworker-dep.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,8 @@ spec:
113113
value: "{{ .Values.queueWorkerPro.httpRetryCodes }}"
114114
- name: backoff
115115
value: "{{ .Values.queueWorkerPro.backoff }}"
116+
- name: "allowed_callback_hosts"
117+
value: "{{ join \",\" .Values.jetstreamQueueWorker.allowedCallbackHosts }}"
116118

117119
{{- if .Values.securityContext }}
118120
securityContext:

chart/openfaas/values.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -220,6 +220,7 @@ faasnetes:
220220
#
221221
# The Jetstream queue-worker is the default queue-worker for OpenFaaS Pro.
222222
jetstreamQueueWorker:
223+
allowedCallbackHosts: ["*"]
223224
image: ghcr.io/openfaasltd/jetstream-queue-worker:0.5.8
224225
mode: "static"
225226
# Enable adaptive concurrency limiting for functions.

chart/queue-worker/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,7 @@ helm upgrade --install \
115115
| `gateway.host` | The host at which the OpenFaaS gateway can be reached | `http://gateway.openfaas` |
116116
| `gateway.port` | The port at which the OpenFaaS gateway can be reached | `8080` |
117117
| `insecureTLS` | Enable insecure tls for callbacks | `false` |
118+
| `allowedCallbackHosts` | List of glob patterns for hosts allowed to receive async callbacks. Defaults to `["*"]` (allow all). Set to empty list `[]` to deny all | `["*"]` |
118119
| `nats.host` | The host at which the NATS JetStream server can be reached | `nats.openfaas` |
119120
| `nats.port` | The port at which the NATS JetStream server can be reached | `4222` |
120121
| `nats.stream.name` | Name of the NATS JetStream stream to use | `faas-request` |

chart/queue-worker/templates/deployment.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,8 @@ spec:
9696
value: "{{ .Values.httpRetryCodes }}"
9797
- name: "backoff"
9898
value: "{{ .Values.backoff }}"
99+
- name: "allowed_callback_hosts"
100+
value: "{{ join \",\" .Values.allowedCallbackHosts }}"
99101
volumeMounts:
100102
- name: license
101103
readOnly: true

chart/queue-worker/values.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@
66

77
image: ghcr.io/openfaasltd/jetstream-queue-worker:0.5.8
88

9+
allowedCallbackHosts: ["*"]
10+
911
replicas: 1
1012

1113
# Change this to your queue name.

0 commit comments

Comments
 (0)