{{/*
AUTOGENERATED FILE - DO NOT EDIT.
Generated by scripts/generate_env_tpls.py from charts/agentarea/config.yaml
*/}}

{{- define "agentarea.backend.configVars" -}}
PORT: "8000"
LOG_LEVEL: "info"
MCP_MANAGER_URL: "http://{{ include "agentarea.fullname" . }}-mcp-manager:{{ .Values.mcpManager.service.port }}"
MCP_CLIENT_TIMEOUT: "30"
API_HOST: "{{ .Values.global.api.host }}"
API_PORT: "{{ .Values.global.api.port }}"
API_BASE_URL: "{{ include "agentarea.backend.apiUrl" . }}"
API_AUTH_ENABLED: "{{ .Values.global.api.auth.enabled }}"
API_RATE_LIMIT_ENABLED: "{{ .Values.global.api.rateLimit.enabled }}"
API_RATE_LIMIT_REQUESTS_PER_MINUTE: "{{ .Values.global.api.rateLimit.requestsPerMinute }}"
METRICS_ENABLED: "{{ .Values.global.monitoring.prometheus.enabled }}"
METRICS_PORT: "{{ .Values.global.monitoring.prometheus.port }}"
HEALTH_CHECK_ENABLED: "{{ .Values.global.monitoring.health.enabled }}"
HEALTH_CHECK_PORT: "{{ .Values.global.monitoring.health.port }}"
KRATOS_JWKS_B64: "{{ .Values.kratos.jwt.jwks_b64 }}"
KRATOS_ISSUER: "{{ .Values.kratos.jwt.issuer }}"
KRATOS_AUDIENCE: "{{ .Values.kratos.jwt.audience }}"
{{- end }}

{{- define "agentarea.backend.envs" }}
- name: PORT
  valueFrom:
    configMapKeyRef:
      name: {{ include "agentarea.fullname" . }}-env-backend
      key: PORT
- name: LOG_LEVEL
  valueFrom:
    configMapKeyRef:
      name: {{ include "agentarea.fullname" . }}-env-backend
      key: LOG_LEVEL
- name: MCP_MANAGER_URL
  valueFrom:
    configMapKeyRef:
      name: {{ include "agentarea.fullname" . }}-env-backend
      key: MCP_MANAGER_URL
- name: MCP_CLIENT_TIMEOUT
  valueFrom:
    configMapKeyRef:
      name: {{ include "agentarea.fullname" . }}-env-backend
      key: MCP_CLIENT_TIMEOUT
- name: API_HOST
  valueFrom:
    configMapKeyRef:
      name: {{ include "agentarea.fullname" . }}-env-backend
      key: API_HOST
- name: API_PORT
  valueFrom:
    configMapKeyRef:
      name: {{ include "agentarea.fullname" . }}-env-backend
      key: API_PORT
- name: API_BASE_URL
  valueFrom:
    configMapKeyRef:
      name: {{ include "agentarea.fullname" . }}-env-backend
      key: API_BASE_URL
- name: API_AUTH_ENABLED
  valueFrom:
    configMapKeyRef:
      name: {{ include "agentarea.fullname" . }}-env-backend
      key: API_AUTH_ENABLED
- name: API_RATE_LIMIT_ENABLED
  valueFrom:
    configMapKeyRef:
      name: {{ include "agentarea.fullname" . }}-env-backend
      key: API_RATE_LIMIT_ENABLED
- name: API_RATE_LIMIT_REQUESTS_PER_MINUTE
  valueFrom:
    configMapKeyRef:
      name: {{ include "agentarea.fullname" . }}-env-backend
      key: API_RATE_LIMIT_REQUESTS_PER_MINUTE
- name: METRICS_ENABLED
  valueFrom:
    configMapKeyRef:
      name: {{ include "agentarea.fullname" . }}-env-backend
      key: METRICS_ENABLED
- name: METRICS_PORT
  valueFrom:
    configMapKeyRef:
      name: {{ include "agentarea.fullname" . }}-env-backend
      key: METRICS_PORT
- name: HEALTH_CHECK_ENABLED
  valueFrom:
    configMapKeyRef:
      name: {{ include "agentarea.fullname" . }}-env-backend
      key: HEALTH_CHECK_ENABLED
- name: HEALTH_CHECK_PORT
  valueFrom:
    configMapKeyRef:
      name: {{ include "agentarea.fullname" . }}-env-backend
      key: HEALTH_CHECK_PORT
- name: KRATOS_JWKS_B64
  valueFrom:
    configMapKeyRef:
      name: {{ include "agentarea.fullname" . }}-env-backend
      key: KRATOS_JWKS_B64
- name: KRATOS_ISSUER
  valueFrom:
    configMapKeyRef:
      name: {{ include "agentarea.fullname" . }}-env-backend
      key: KRATOS_ISSUER
- name: KRATOS_AUDIENCE
  valueFrom:
    configMapKeyRef:
      name: {{ include "agentarea.fullname" . }}-env-backend
      key: KRATOS_AUDIENCE
{{- end }}

{{- define "agentarea.backend.secrets.envs" }}
- name: API_AUTH_HEADER_NAME
  value: {{ .Values.global.api.auth.headerName }}
- name: API_AUTH_HEADER_VALUE
  valueFrom:
    secretKeyRef:
      name: "{{ .Values.global.secrets.application }}"
      key: api-auth-header-value
{{- end }}
