apiVersion: v1
kind: Secret
metadata:
  name: backend
  namespace: {{ .Release.Namespace | quote }}
  annotations:
    "helm.sh/hook": pre-install,pre-upgrade
    "helm.sh/hook-weight": "-5"
    "helm.sh/hook-delete-policy": before-hook-creation
stringData:
  DJANGO_SUPERUSER_EMAIL: {{ .Values.djangoSuperUserEmail }}
  DJANGO_SUPERUSER_PASSWORD: {{ .Values.djangoSuperUserPass }}
  DJANGO_SECRET_KEY: {{ .Values.djangoSecretKey }}
  OIDC_RP_CLIENT_ID: {{ .Values.oidc.clientId }}
  OIDC_RP_CLIENT_SECRET: {{ .Values.oidc.clientSecret }}
{{- if .Values.resourceServer }}
  OIDC_RS_CLIENT_ID: {{ .Values.resourceServer.clientId }}
  OIDC_RS_CLIENT_SECRET: {{ .Values.resourceServer.clientSecret }}
  OIDC_RS_PRIVATE_KEY_STR: |
{{ .Values.resourceServer.privateKey | indent 4 }}
{{- end }}
{{- if .Values.mail_provisioning_api_credentials }}
  MAIL_PROVISIONING_API_CREDENTIALS: {{ .Values.mail_provisioning_api_credentials }}
{{- end }}
{{- if .Values.djangoEmailHostUser }}
  DJANGO_EMAIL_HOST_USER: {{ .Values.djangoEmailHostUser }}
{{- end }}
{{- if .Values.djangoEmailHostPassword }}
  DJANGO_EMAIL_HOST_PASSWORD: {{ .Values.djangoEmailHostPassword }}
{{- end }}
