Skip to content

Commit 5d0ff4c

Browse files
committed
Add allowedCallbackURLs parameter for queue-worker
Allow users to restrict which URLs receive async function callbacks via a list of glob patterns. 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 5d0ff4c

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+
| `queueWorkerPro.allowedCallbackURLs` | List of glob patterns for URLs 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_urls"
117+
value: "{{ join "," .Values.queueWorkerPro.allowedCallbackURLs }}"
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
@@ -271,6 +271,7 @@ queueWorkerPro:
271271
printResponseBody: false
272272
# Control the concurrent invocations
273273
maxInflight: 50
274+
allowedCallbackURLs: ["*"]
274275

275276
# Community Edition, maxInflight is 1
276277
# Name of shared queue is "faas-request"

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+
| `allowedCallbackURLs` | List of glob patterns for URLs 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_urls"
100+
value: "{{ join "," .Values.allowedCallbackURLs }}"
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+
allowedCallbackURLs: ["*"]
10+
911
replicas: 1
1012

1113
# Change this to your queue name.

0 commit comments

Comments
 (0)