Skip to content

Commit 3cc6f02

Browse files
authored
Merge pull request #20 from linuxfoundation/bramwelt/openfga-config
[LFXV2-135] Add OpenFGA Authorizer to Heimdall Config
2 parents e312608 + 80fd51b commit 3cc6f02

File tree

2 files changed

+34
-1
lines changed

2 files changed

+34
-1
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.3
8+
version: 0.1.4
99
icon: https://github.com/linuxfoundation/lfx-v2-helm/raw/main/img/lfx-logo-color.svg
1010
dependencies:
1111
- name: traefik

charts/lfx-platform/values.yaml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,10 +84,13 @@ heimdall:
8484
image:
8585
tag: 0.16.6
8686

87+
8788
deployment:
8889
replicaCount: 1
8990
autoscaling:
9091
enabled: false
92+
labels:
93+
openfga-store: "lfx-core"
9194
volumes:
9295
- name: heimdall-signer-cert
9396
secret:
@@ -158,6 +161,36 @@ heimdall:
158161
type: allow
159162
- id: deny_all
160163
type: deny
164+
- id: openfga_check
165+
type: remote
166+
config:
167+
endpoint: "http://lfx-platform-openfga:8080/stores/${OPENFGA_STORE_ID}/check"
168+
values:
169+
model_id: ${OPENFGA_AUTH_MODEL_ID}
170+
payload: |
171+
{
172+
"authorization_model_id": "{{ .Values.model_id }}",
173+
"tuple_key": {
174+
"user": {{
175+
list
176+
"user:"
177+
(
178+
eq .Subject.ID "_anonymous"
179+
| ternary
180+
"_anonymous"
181+
(or
182+
.Subject.Attributes.username
183+
(list "clients@" .Subject.Attributes.client_id | join ""))
184+
)
185+
| join "" | quote
186+
}},
187+
"relation": "{{ .Values.relation }}",
188+
"object": "{{ .Values.object }}"
189+
}
190+
}
191+
expressions:
192+
- expression: |
193+
Payload.allowed == true
161194
finalizers:
162195
- id: create_jwt
163196
type: jwt

0 commit comments

Comments
 (0)