Skip to content

Commit bce0560

Browse files
authored
Merge pull request #12 from linuxfoundation/jme/LFXV2-432
add heimdall middleware
2 parents 399bd80 + 46a3fb7 commit bce0560

File tree

5 files changed

+46
-7
lines changed

5 files changed

+46
-7
lines changed

.github/workflows/ko-build-tag.yaml

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
---
44
name: Publish Tagged Release
55

6-
on:
6+
"on":
77
push:
88
tags:
99
- v*
@@ -28,7 +28,7 @@ jobs:
2828
chart_version: ${{ steps.prepare.outputs.chart_version }}
2929
steps:
3030
- name: Checkout repository
31-
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
31+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
3232

3333
- name: Prepare versions and chart name
3434
id: prepare
@@ -75,11 +75,12 @@ jobs:
7575
image_name: ${{ steps.publish-ghcr.outputs.image_name }}
7676
steps:
7777
- name: Checkout repository
78-
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
78+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
7979

8080
- name: Publish Chart to GHCR
8181
id: publish-ghcr
82-
uses: linuxfoundation/lfx-public-workflows/.github/actions/helm-chart-oci-publisher@c465d6571fa0b8be9d551d902955164ea04a00af # main
82+
# yamllint disable-line rule:line-length
83+
uses: linuxfoundation/lfx-public-workflows/.github/actions/helm-chart-oci-publisher@c465d6571fa0b8be9d551d902955164ea04a00af # main
8384
with:
8485
name: ${{ needs.publish.outputs.chart_name }}
8586
repository: ${{ github.repository }}/chart
@@ -90,12 +91,12 @@ jobs:
9091
registry_password: ${{ secrets.GITHUB_TOKEN }}
9192

9293
- name: Install Cosign
93-
uses: sigstore/cosign-installer@d58896d6a1865668819e1d91763c7751a165e159 # v3.9.2
94+
uses: sigstore/cosign-installer@d58896d6a1865668819e1d91763c7751a165e159 # v3.9.2
9495
with:
9596
cosign-release: "${{ env.COSIGN_VERSION }}"
9697

9798
- name: Login to GitHub
98-
uses: docker/login-action@74a5d142397b4f367a81961eba4e8cd7edddf772 # v3.4.0
99+
uses: docker/login-action@74a5d142397b4f367a81961eba4e8cd7edddf772 # v3.4.0
99100
with:
100101
registry: ghcr.io
101102
username: ${{ github.actor }}

.github/workflows/license-header-check.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ permissions:
1212
jobs:
1313
license-header-check:
1414
name: License Header Check
15+
# yamllint disable-line rule:line-length
1516
uses: linuxfoundation/lfx-public-workflows/.github/workflows/license-header-check.yml@c465d6571fa0b8be9d551d902955164ea04a00af
1617
with:
1718
copyright_line: "Copyright The Linux Foundation and each contributor to LFX."

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: 2 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:

0 commit comments

Comments
 (0)