{{- if .Values.basicAuth.enabled }}
---
apiVersion: v1
kind: Secret
metadata:
  name: {{ include "taskplaner.fullname" . }}-basic-auth
  labels:
    {{- include "taskplaner.labels" . | nindent 4 }}
type: Opaque
stringData:
  users: {{ .Values.basicAuth.htpasswd | quote }}
---
apiVersion: traefik.io/v1alpha1
kind: Middleware
metadata:
  name: {{ include "taskplaner.fullname" . }}-basic-auth
  labels:
    {{- include "taskplaner.labels" . | nindent 4 }}
spec:
  basicAuth:
    secret: {{ include "taskplaner.fullname" . }}-basic-auth
{{- end }}
