apiVersion: v1
kind: Secret
metadata:
  name: {{ include "mongoclaw.fullname" . }}-secrets
  labels:
    {{- include "mongoclaw.labels" . | nindent 4 }}
type: Opaque
stringData:
  MONGOCLAW_MONGODB_URI: {{ .Values.secrets.mongodb.uri | quote }}
  {{- if .Values.redis.enabled }}
  MONGOCLAW_REDIS_URL: "redis://{{ include "mongoclaw.redisHost" . }}:6379/0"
  {{- else }}
  MONGOCLAW_REDIS_URL: {{ .Values.secrets.redis.url | quote }}
  {{- end }}
  {{- if .Values.secrets.ai.openaiApiKey }}
  MONGOCLAW_AI_OPENAI_API_KEY: {{ .Values.secrets.ai.openaiApiKey | quote }}
  {{- end }}
  {{- if .Values.secrets.ai.anthropicApiKey }}
  MONGOCLAW_AI_ANTHROPIC_API_KEY: {{ .Values.secrets.ai.anthropicApiKey | quote }}
  {{- end }}
  {{- if .Values.secrets.security.apiKeys }}
  MONGOCLAW_SECURITY_API_KEYS: {{ .Values.secrets.security.apiKeys | join "," | quote }}
  {{- end }}
