Skip to content

Commit d99de06

Browse files
committed
add heimdall middleware
This is needed if this service is installed in a namespace that doesn't otherwise have the middleware, since there is no current way to reference a middleware in the gateway api spec outside of the current namespace. Signed-off-by: Jordan Evans <[email protected]>
1 parent 399bd80 commit d99de06

File tree

3 files changed

+39
-1
lines changed

3 files changed

+39
-1
lines changed

charts/lfx-v2-query-service/Chart.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,5 @@ apiVersion: v2
55
name: lfx-v2-query-service
66
description: LFX Platform V2 Query Service chart
77
type: application
8-
version: 0.2.3
8+
version: 0.2.4
99
appVersion: "latest"
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
# Copyright The Linux Foundation and each contributor to LFX.
2+
# SPDX-License-Identifier: MIT
3+
{{ if .Values.heimdall.add_middleware }}
4+
---
5+
# Heimdall middleware with body forwarding capability
6+
# This is the default middleware that should be used in most cases, particularly
7+
# when parentRef requiring authentication is in the request body.
8+
# Note: For routes handling very large payloads (like file uploads), consider using
9+
# the lighter-weight middleware below to reduce overhead.
10+
apiVersion: traefik.io/v1alpha1
11+
kind: Middleware
12+
metadata:
13+
name: heimdall-forward-body
14+
namespace: {{ .Release.Namespace }}
15+
spec:
16+
forwardAuth:
17+
address: "{{ .Values.heimdall.url }}"
18+
authResponseHeaders:
19+
- Authorization
20+
forwardBody: true
21+
---
22+
# Alternative Heimdall middleware without body forwarding
23+
# Use this middleware only for routes where body inspection isn't required for authentication
24+
# and when dealing with large payloads where forwarding the entire body would be inefficient.
25+
apiVersion: traefik.io/v1alpha1
26+
kind: Middleware
27+
metadata:
28+
name: heimdall
29+
namespace: {{ .Release.Namespace }}
30+
spec:
31+
forwardAuth:
32+
address: "{{ .Values.heimdall.url }}"
33+
authResponseHeaders:
34+
- Authorization
35+
{{- end }}

charts/lfx-v2-query-service/values.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,8 @@ heimdall:
5353
# enabled is a boolean to determine if the heimdall middleware is enabled
5454
# If disabled, there will be no authorization check on the query routes
5555
enabled: true
56+
add_middleware: false
57+
url: http://lfx-platform-heimdall.lfx.svc.cluster.local:4456
5658

5759
# secret is the configuration for the Kubernetes Secret
5860
secret:
@@ -66,3 +68,4 @@ jwks:
6668
url: http://lfx-platform-heimdall:4457/.well-known/jwks
6769
jwt:
6870
signatureAlgorithm: PS256
71+

0 commit comments

Comments
 (0)