helm-charts/authentik-application/templates/secrets.yaml

66 lines
2.4 KiB
YAML
Raw Permalink Normal View History

{{- $clientID := include "authentik-application.staticValue" (dict "root" $ "name" "clientID" "default" (randAlphaNum 32) "overwrite" .Values.blueprint.provider.oidc.clientID) }}
{{- $clientSecret := include "authentik-application.staticValue" (dict "root" $ "name" "clientSecret" "default" (randAlphaNum 32) "overwrite" .Values.blueprint.provider.oidc.clientSecret) }}
{{- $bindPolicyID := include "authentik-application.staticValue" (dict "root" $ "name" "bindPolicyID" "default" (uuidv4) "overwrite" .Values.blueprint.application.bindPolicyID) }}
2023-09-03 14:58:07 +02:00
---
apiVersion: v1
kind: Secret
metadata:
name: {{ include "authentik-application.fullname" . }}
2023-09-03 14:58:07 +02:00
labels:
{{- include "authentik-application.labels" . | nindent 4 }}
{{- with .Values.secret.labels }}
{{- toYaml . | nindent 4 }}
{{- end }}
stringData:
bindPolicyID: {{ $bindPolicyID | quote }}
{{- if .Values.blueprint.provider.enabled }}
2023-09-03 14:58:07 +02:00
issuerURL: {{ print .Values.blueprint.authentik.domain "/application/o/" .Values.blueprint.application.slug "/" }}
{{- with .Values.blueprint.provider.oidc }}
2023-09-03 14:58:07 +02:00
clientID: {{ $clientID | quote }}
clientSecret: {{ $clientSecret | quote }}
redirectURL: {{ .redirectURL }}
{{- with .tokenDuration }}
2023-09-03 14:58:07 +02:00
tokenDuration: {{ . | quote }}
{{- end }}
{{- with .scopes }}
2023-09-03 14:58:07 +02:00
customScopes: {{ . | join "," | quote }}
{{- end }}
{{- with .claimUsername }}
2023-09-03 14:58:07 +02:00
claimUsername: {{ . | quote }}
{{- end }}
{{- with .claimGroups }}
2023-09-03 14:58:07 +02:00
claimGroups: {{ . | quote }}
{{- end }}
{{- end }}{{/* end with oidc */}}
{{- end }}{{/* end if provider */}}
2023-09-03 14:58:07 +02:00
---
apiVersion: v1
kind: Secret
metadata:
name: {{ include "authentik-application.fullname" . }}-blueprint
labels:
{{- include "authentik-application.labels" . | nindent 4 }}
{{- with .Values.blueprint.labels }}
{{- toYaml . | nindent 4 }}
{{- end }}
stringData:
blueprint.yaml: |-
version: 1
metadata:
name: {{ include "authentik-application.fullname" . }}
entries:
{{- $tplValues := (dict "root" $ "Template" .Template "bindPolicyID" $bindPolicyID "clientID" $clientID "clientSecret" $clientSecret) }}
{{- if .Values.blueprint.provider.enabled }}
{{- tpl (.Files.Get (printf "files/provider/%s.yaml.gotmpl" .Values.blueprint.provider.type)) $tplValues | nindent 6 }}
2023-09-03 14:58:07 +02:00
{{- end }}
{{- tpl (.Files.Get "files/application.yaml.gotmpl") $tplValues | nindent 6 }}
{{- tpl (.Files.Get "files/groups.yaml.gotmpl") $tplValues | nindent 6 }}