Skip to content

Commit 7ebcbdb

Browse files
authored
Merge branch 'main' into helm-frozen-deps
2 parents 9bc4fed + a38b650 commit 7ebcbdb

File tree

6 files changed

+126
-6
lines changed

6 files changed

+126
-6
lines changed

charts/lfx-platform/Chart.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ apiVersion: v2
55
name: lfx-platform
66
description: LFX Platform v2 Helm chart
77
type: application
8-
version: 0.1.10
8+
version: 0.1.11
99
icon: https://github.com/linuxfoundation/lfx-v2-helm/raw/main/img/lfx-logo-color.svg
1010
dependencies:
1111
- name: traefik
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
# Copyright The Linux Foundation and each contributor to LFX.
2+
# SPDX-License-Identifier: MIT
3+
---
4+
{{- if .Values.lfx.whoami.enabled }}
5+
kind: Deployment
6+
apiVersion: apps/v1
7+
metadata:
8+
name: whoami
9+
namespace: lfx
10+
labels:
11+
app: whoami
12+
13+
spec:
14+
replicas: 1
15+
selector:
16+
matchLabels:
17+
app: whoami
18+
template:
19+
metadata:
20+
labels:
21+
app: whoami
22+
spec:
23+
containers:
24+
- name: whoami
25+
image: traefik/whoami
26+
ports:
27+
- name: web
28+
containerPort: 80
29+
{{- end }}
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
# Copyright The Linux Foundation and each contributor to LFX.
2+
# SPDX-License-Identifier: MIT
3+
---
4+
{{- if and .Values.lfx.whoami.enabled .Values.traefik.enabled }}
5+
apiVersion: gateway.networking.k8s.io/v1
6+
kind: HTTPRoute
7+
metadata:
8+
name: whoami
9+
namespace: {{ .Release.Namespace }}
10+
spec:
11+
parentRefs:
12+
- name: {{ .Values.traefik.gateway.name }}
13+
namespace: {{ .Release.Namespace }}
14+
hostnames:
15+
- "lfx-api.{{ .Values.lfx.domain }}"
16+
rules:
17+
# Main application endpoints (with authentication)
18+
- matches:
19+
- path:
20+
type: Exact
21+
value: /whoami
22+
{{- if .Values.heimdall.enabled }}
23+
filters:
24+
- type: ExtensionRef
25+
extensionRef:
26+
group: traefik.io
27+
kind: Middleware
28+
name: heimdall
29+
{{- end }}
30+
backendRefs:
31+
- name: whoami
32+
port: 80
33+
{{- end }}
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
# Copyright The Linux Foundation and each contributor to LFX.
2+
# SPDX-License-Identifier: MIT
3+
---
4+
{{- if and .Values.lfx.whoami.enabled .Values.heimdall.enabled }}
5+
apiVersion: heimdall.dadrus.github.com/v1alpha4
6+
kind: RuleSet
7+
metadata:
8+
name: lfx-whoami
9+
namespace: lfx
10+
spec:
11+
rules:
12+
- id: "rule:lfx:whoami:public"
13+
match:
14+
methods:
15+
- GET
16+
routes:
17+
- path: /whoami
18+
execute:
19+
- authenticator: oidc
20+
- authenticator: anonymous_authenticator
21+
{{- if .Values.lfx.use_oidc_contextualizer }}
22+
- contextualizer: oidc_contextualizer
23+
{{- end}}
24+
- authorizer: allow_all
25+
- finalizer: create_jwt
26+
config:
27+
values:
28+
aud: whoami
29+
{{- end }}
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# Copyright The Linux Foundation and each contributor to LFX.
2+
# SPDX-License-Identifier: MIT
3+
---
4+
{{- if .Values.lfx.whoami.enabled }}
5+
apiVersion: v1
6+
kind: Service
7+
metadata:
8+
name: whoami
9+
namespace: lfx
10+
11+
spec:
12+
ports:
13+
- name: web
14+
port: 80
15+
targetPort: web
16+
17+
selector:
18+
app: whoami
19+
20+
{{- end }}

charts/lfx-platform/values.yaml

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,14 @@ lfx:
1616
name: heimdall-trust-bundle
1717
configKey: ca-certificates.crt
1818

19+
whoami:
20+
enabled: true
21+
22+
# Tells rulesets to use the oidc_contextualizer, needed for
23+
# local dev with authelia
24+
use_oidc_contextualizer: true
25+
26+
1927
fga-operator:
2028
enabled: true
2129
# Non-chart value
@@ -127,7 +135,7 @@ heimdall:
127135
type: anonymous
128136
config:
129137
subject: "_anonymous"
130-
- id: authelia
138+
- id: oidc
131139
type: oauth2_introspection
132140
config:
133141
metadata_endpoint:
@@ -150,7 +158,7 @@ heimdall:
150158
# the `sub` claim should NOT be used downstream.
151159
id: '[username,client_id].0'
152160
contextualizers:
153-
- id: authelia_userinfo
161+
- id: oidc_contextualizer
154162
type: generic
155163
config:
156164
endpoint:
@@ -214,8 +222,8 @@ heimdall:
214222
(list "clients@" .Subject.Attributes.client_id | join ""))
215223
| quote
216224
}}
217-
{{ if .Outputs.authelia_userinfo.email -}},
218-
"email": {{ quote .Outputs.authelia_userinfo.email }}
225+
{{ if .Outputs.oidc_contextualizer.email -}},
226+
"email": {{ quote .Outputs.oidc_contextualizer.email }}
219227
{{ end -}}
220228
{{ if .Values.aud -}},
221229
"aud": {{ quote .Values.aud }}
@@ -224,7 +232,8 @@ heimdall:
224232
225233
default_rule:
226234
execute:
227-
- authenticator: anonymous_authenticator
235+
- authenticator: oidc
236+
- contextualizer: oidc_contextualizer
228237
- authorizer: deny_all
229238
- finalizer: create_jwt
230239

0 commit comments

Comments
 (0)