2023-11-05 18:33:34 +01:00
|
|
|
{{- $bindPolicyID := get . "bindPolicyID" }}
|
|
|
|
{{- with get . "root" }}
|
2023-11-28 22:52:06 +01:00
|
|
|
{{- $ = . }}
|
2023-11-05 18:33:34 +01:00
|
|
|
{{- if (not (kindIs "slice" .Values.blueprint.groups)) }}
|
|
|
|
|
|
|
|
- model: authentik_core.group
|
2024-12-04 16:54:29 +01:00
|
|
|
id: group
|
2023-11-05 18:33:34 +01:00
|
|
|
identifiers:
|
|
|
|
name: "app: {{ .Values.blueprint.application.slug }}"
|
|
|
|
state: "present"
|
|
|
|
attrs:
|
|
|
|
name: "app: {{ .Values.blueprint.application.slug }}"
|
|
|
|
|
|
|
|
- model: authentik_policies.PolicyBinding
|
|
|
|
id: {{ printf "%s-app-%s" (include "authentik-application.fullname" .) .Values.blueprint.application.slug | quote }}
|
|
|
|
identifiers:
|
|
|
|
pk: {{ $bindPolicyID | quote }}
|
|
|
|
attrs:
|
2024-12-04 16:54:29 +01:00
|
|
|
group: !KeyOf group
|
2023-11-05 18:33:34 +01:00
|
|
|
order: 10
|
2024-12-04 16:54:29 +01:00
|
|
|
target: !KeyOf app
|
2023-11-05 18:33:34 +01:00
|
|
|
{{- end }}
|
|
|
|
|
|
|
|
{{- range $group := .Values.blueprint.groups }}
|
|
|
|
|
|
|
|
- model: authentik_core.group
|
|
|
|
id: {{ $group.slug | quote }}
|
|
|
|
identifiers:
|
|
|
|
name: {{ $group.slug | quote }}
|
|
|
|
state: {{ $group.state | default "present" | quote }}
|
|
|
|
attrs:
|
|
|
|
name: {{ $group.slug | quote }}
|
|
|
|
{{- with $group.parent }}
|
|
|
|
parent: !Find [authentik_core.group, [name, {{ . | quote }}]]
|
|
|
|
{{- else}}
|
|
|
|
parent: null
|
|
|
|
{{- end }}
|
|
|
|
|
|
|
|
- model: authentik_policies.PolicyBinding
|
|
|
|
id: {{ printf "%s-app-%s" (include "authentik-application.fullname" $) $group.slug | quote }}
|
|
|
|
identifiers:
|
|
|
|
pk: {{ $group.bindID | quote }}
|
|
|
|
attrs:
|
2023-12-29 16:39:05 +01:00
|
|
|
pk: {{ $group.bindID | quote }}
|
2023-11-05 18:33:34 +01:00
|
|
|
group: !KeyOf {{ $group.slug | quote}}
|
|
|
|
order: 10
|
2024-12-04 16:54:29 +01:00
|
|
|
target: !KeyOf app
|
2023-11-05 18:33:34 +01:00
|
|
|
{{- end }}
|
2024-12-04 16:54:29 +01:00
|
|
|
|
|
|
|
{{ end }}{{/* end with of get-root */}}
|