apiVersion: v1
kind: Secret
type: Opaque
metadata:
  name: taskcluster-auth
  labels:
    app.kubernetes.io/name: taskcluster-auth
    app.kubernetes.io/instance: '{{ .Release.Name }}'
    app.kubernetes.io/component: taskcluster-auth-secrets
    app.kubernetes.io/part-of: taskcluster
data:
  TASKCLUSTER_ROOT_URL: '{{ if typeIs "<nil>" .Values.rootUrl }}{{ else }}{{ if typeIs "string" .Values.rootUrl }}{{ .Values.rootUrl | b64enc }}{{ else }}{{ .Values.rootUrl | toJson | b64enc }}{{ end }}{{ end }}'
  STATIC_CLIENTS: '{{ if typeIs "<nil>" .Values.auth.static_clients }}{{ else }}{{ if typeIs "string" .Values.auth.static_clients }}{{ .Values.auth.static_clients | b64enc }}{{ else }}{{ .Values.auth.static_clients | toJson | b64enc }}{{ end }}{{ end }}'
  AZURE_ACCOUNTS: '{{ if typeIs "<nil>" .Values.auth.azure_accounts }}{{ else }}{{ if typeIs "string" .Values.auth.azure_accounts }}{{ .Values.auth.azure_accounts | b64enc }}{{ else }}{{ .Values.auth.azure_accounts | toJson | b64enc }}{{ end }}{{ end }}'
  SENTRY_ORGANIZATION: '{{ if typeIs "<nil>" .Values.auth.sentry_organization }}{{ else }}{{ if typeIs "string" .Values.auth.sentry_organization }}{{ .Values.auth.sentry_organization | b64enc }}{{ else }}{{ .Values.auth.sentry_organization | toJson | b64enc }}{{ end }}{{ end }}'
  SENTRY_HOST: '{{ if typeIs "<nil>" .Values.auth.sentry_host }}{{ else }}{{ if typeIs "string" .Values.auth.sentry_host }}{{ .Values.auth.sentry_host | b64enc }}{{ else }}{{ .Values.auth.sentry_host | toJson | b64enc }}{{ end }}{{ end }}'
  SENTRY_AUTH_TOKEN: '{{ if typeIs "<nil>" .Values.auth.sentry_auth_token }}{{ else }}{{ if typeIs "string" .Values.auth.sentry_auth_token }}{{ .Values.auth.sentry_auth_token | b64enc }}{{ else }}{{ .Values.auth.sentry_auth_token | toJson | b64enc }}{{ end }}{{ end }}'
  SENTRY_TEAM: '{{ if typeIs "<nil>" .Values.auth.sentry_team }}{{ else }}{{ if typeIs "string" .Values.auth.sentry_team }}{{ .Values.auth.sentry_team | b64enc }}{{ else }}{{ .Values.auth.sentry_team | toJson | b64enc }}{{ end }}{{ end }}'
  SENTRY_KEY_PREFIX: '{{ if typeIs "<nil>" .Values.auth.sentry_key_prefix }}{{ else }}{{ if typeIs "string" .Values.auth.sentry_key_prefix }}{{ .Values.auth.sentry_key_prefix | b64enc }}{{ else }}{{ .Values.auth.sentry_key_prefix | toJson | b64enc }}{{ end }}{{ end }}'
  WEBSOCKTUNNEL_SECRET: '{{ if typeIs "<nil>" .Values.auth.websocktunnel_secret }}{{ else }}{{ if typeIs "string" .Values.auth.websocktunnel_secret }}{{ .Values.auth.websocktunnel_secret | b64enc }}{{ else }}{{ .Values.auth.websocktunnel_secret | toJson | b64enc }}{{ end }}{{ end }}'
  DOCS_BUCKET: '{{ if typeIs "<nil>" .Values.auth.docs_bucket }}{{ else }}{{ if typeIs "string" .Values.auth.docs_bucket }}{{ .Values.auth.docs_bucket | b64enc }}{{ else }}{{ .Values.auth.docs_bucket | toJson | b64enc }}{{ end }}{{ end }}'
  SCHEMAS_BUCKET: '{{ if typeIs "<nil>" .Values.auth.schemas_bucket }}{{ else }}{{ if typeIs "string" .Values.auth.schemas_bucket }}{{ .Values.auth.schemas_bucket | b64enc }}{{ else }}{{ .Values.auth.schemas_bucket | toJson | b64enc }}{{ end }}{{ end }}'
  REFS_BUCKET: '{{ if typeIs "<nil>" .Values.auth.refs_bucket }}{{ else }}{{ if typeIs "string" .Values.auth.refs_bucket }}{{ .Values.auth.refs_bucket | b64enc }}{{ else }}{{ .Values.auth.refs_bucket | toJson | b64enc }}{{ end }}{{ end }}'
  AUDIT_LOG: '{{ if typeIs "<nil>" .Values.auth.audit_log }}{{ else }}{{ if typeIs "string" .Values.auth.audit_log }}{{ .Values.auth.audit_log | b64enc }}{{ else }}{{ .Values.auth.audit_log | toJson | b64enc }}{{ end }}{{ end }}'
  LEVEL: '{{ if typeIs "<nil>" .Values.auth.level }}{{ else }}{{ if typeIs "string" .Values.auth.level }}{{ .Values.auth.level | b64enc }}{{ else }}{{ .Values.auth.level | toJson | b64enc }}{{ end }}{{ end }}'
  ERROR_CONFIG: '{{ if typeIs "<nil>" .Values.errorConfig }}{{ else }}{{ if typeIs "string" .Values.errorConfig }}{{ .Values.errorConfig | b64enc }}{{ else }}{{ .Values.errorConfig | toJson | b64enc }}{{ end }}{{ end }}'
  FORCE_SSL: '{{ if typeIs "<nil>" .Values.forceSSL }}{{ else }}{{ if typeIs "string" .Values.forceSSL }}{{ .Values.forceSSL | b64enc }}{{ else }}{{ .Values.forceSSL | toJson | b64enc }}{{ end }}{{ end }}'
  TRUST_PROXY: '{{ if typeIs "<nil>" .Values.trustProxy }}{{ else }}{{ if typeIs "string" .Values.trustProxy }}{{ .Values.trustProxy | b64enc }}{{ else }}{{ .Values.trustProxy | toJson | b64enc }}{{ end }}{{ end }}'
  AZURE_CRYPTO_KEY: '{{ if typeIs "<nil>" .Values.auth.azure_crypto_key }}{{ else }}{{ if typeIs "string" .Values.auth.azure_crypto_key }}{{ .Values.auth.azure_crypto_key | b64enc }}{{ else }}{{ .Values.auth.azure_crypto_key | toJson | b64enc }}{{ end }}{{ end }}'
  READ_DB_URL: '{{ if typeIs "<nil>" .Values.auth.read_db_url }}{{ else }}{{ if typeIs "string" .Values.auth.read_db_url }}{{ .Values.auth.read_db_url | b64enc }}{{ else }}{{ .Values.auth.read_db_url | toJson | b64enc }}{{ end }}{{ end }}'
  WRITE_DB_URL: '{{ if typeIs "<nil>" .Values.auth.write_db_url }}{{ else }}{{ if typeIs "string" .Values.auth.write_db_url }}{{ .Values.auth.write_db_url | b64enc }}{{ else }}{{ .Values.auth.write_db_url | toJson | b64enc }}{{ end }}{{ end }}'
  DB_CRYPTO_KEYS: '{{ if typeIs "<nil>" .Values.auth.db_crypto_keys }}{{ else }}{{ if typeIs "string" .Values.auth.db_crypto_keys }}{{ .Values.auth.db_crypto_keys | b64enc }}{{ else }}{{ .Values.auth.db_crypto_keys | toJson | b64enc }}{{ end }}{{ end }}'
  PULSE_USERNAME: '{{ if typeIs "<nil>" .Values.auth.pulse_username }}{{ else }}{{ if typeIs "string" .Values.auth.pulse_username }}{{ .Values.auth.pulse_username | b64enc }}{{ else }}{{ .Values.auth.pulse_username | toJson | b64enc }}{{ end }}{{ end }}'
  PULSE_PASSWORD: '{{ if typeIs "<nil>" .Values.auth.pulse_password }}{{ else }}{{ if typeIs "string" .Values.auth.pulse_password }}{{ .Values.auth.pulse_password | b64enc }}{{ else }}{{ .Values.auth.pulse_password | toJson | b64enc }}{{ end }}{{ end }}'
  PULSE_HOSTNAME: '{{ if typeIs "<nil>" .Values.pulseHostname }}{{ else }}{{ if typeIs "string" .Values.pulseHostname }}{{ .Values.pulseHostname | b64enc }}{{ else }}{{ .Values.pulseHostname | toJson | b64enc }}{{ end }}{{ end }}'
  PULSE_VHOST: '{{ if typeIs "<nil>" .Values.pulseVhost }}{{ else }}{{ if typeIs "string" .Values.pulseVhost }}{{ .Values.pulseVhost | b64enc }}{{ else }}{{ .Values.pulseVhost | toJson | b64enc }}{{ end }}{{ end }}'
  AWS_CREDENTIALS_ALLOWED_BUCKETS: '{{ if typeIs "<nil>" .Values.auth.aws_credentials_allowed_buckets }}{{ else }}{{ if typeIs "string" .Values.auth.aws_credentials_allowed_buckets }}{{ .Values.auth.aws_credentials_allowed_buckets | b64enc }}{{ else }}{{ .Values.auth.aws_credentials_allowed_buckets | toJson | b64enc }}{{ end }}{{ end }}'
  GCP_CREDENTIALS_ALLOWED_PROJECTS: '{{ if typeIs "<nil>" .Values.auth.gcp_credentials_allowed_projects }}{{ else }}{{ if typeIs "string" .Values.auth.gcp_credentials_allowed_projects }}{{ .Values.auth.gcp_credentials_allowed_projects | b64enc }}{{ else }}{{ .Values.auth.gcp_credentials_allowed_projects | toJson | b64enc }}{{ end }}{{ end }}'
  NEW_RELIC: '{{ if typeIs "<nil>" .Values.newRelic }}{{ else }}{{ if typeIs "string" .Values.newRelic }}{{ .Values.newRelic | b64enc }}{{ else }}{{ .Values.newRelic | toJson | b64enc }}{{ end }}{{ end }}'
  DEBUG: '{{ if typeIs "<nil>" .Values.auth.debug }}{{ else }}{{ if typeIs "string" .Values.auth.debug }}{{ .Values.auth.debug | b64enc }}{{ else }}{{ .Values.auth.debug | toJson | b64enc }}{{ end }}{{ end }}'
