{{- if or .Values.auth.secret .Values.proxy.secret }}
apiVersion: v1
kind: Secret
metadata:
  name: {{ template "buzzfeed-sso.fullname" . }}
  labels:
    app: {{ template "buzzfeed-sso.name" . }}
    chart: {{ template "buzzfeed-sso.chart" . }}
    release: {{ .Release.Name }}
    heritage: {{ .Release.Service }}
type: Opaque
data:
{{- with .Values.proxy.secret }}
  proxy-client-id: {{ .clientId | b64enc }}
  {{- if .clientSecret }}
  proxy-client-secret: {{ .clientSecret | b64enc }}
  {{- end }}
  {{- if .cookieSecret }}
  proxy-cookie-secret: {{ .cookieSecret | b64enc }}
  {{- end }}
{{- end }}
{{- with .Values.auth.secret }}
  auth-code-secret: {{ .codeSecret | b64enc }}
  auth-cookie-secret: {{ .cookieSecret | b64enc }}
{{- end }}
{{- end }}
