apiVersion: v1
kind: ConfigMap
metadata:
  name: excerpt-service-api-properties
data:
  config.yaml: |-
    server.max-http-header-size: 32KB
    {{- if eq .Values.deployProfile "dev" }}
    management.endpoints.web.exposure.include: '*'
    {{- else }}
    management.endpoints.web.exposure.include: 'health, prometheus'
    {{- end }}
    data-platform:
      datasource:
        url: jdbc:postgresql://{{.Values.db.url}}:{{.Values.db.port}}/{{.Values.db.name}}?ApplicationName={{ .Chart.Name }}
        connection-timeout: {{.Values.db.connectionTimeout}}
      kafka:
        bootstrap: {{ .Values.kafka.url }}:{{ .Values.kafka.port }}
        topic-properties:
          creation:
            num-partitions: {{ .Values.kafka.numPartitions }}
            replication-factor: {{ .Values.global.kafkaOperator.replicationFactor }}
        ssl:
          enabled: {{ .Values.kafka.sslEnabled }}
          keystore-type: {{ .Values.kafka.sslCertType }}
          truststore-type: {{ .Values.kafka.sslCertType }}
          keystore-certificate: {{ .Values.kafka.sslUserCertificate }}
          keystore-key: {{ .Values.kafka.sslUserKey }}
          truststore-certificate: {{ .Values.kafka.sslClusterCertificate }}
      signature:
        enabled: true

    s3:
      config:
        client: {{ .Values.s3.config.client | toYaml | nindent 10 }}
        options: {{ .Values.s3.config.options | toYaml | nindent 10 }}

    dso:
      url: {{ .Values.dso.url }}

    datafactory-excerpt-ceph:
      http-endpoint: {{ .Values.datafactoryExcerptCeph.httpEndpoint }}
      bucketName: {{ .Values.datafactoryExcerptCeph.bucketName }}
    excerpt-signature-ceph:
      http-endpoint: {{ .Values.excerptSignatureCeph.httpEndpoint }}
      bucketName: {{ .Values.excerptSignatureCeph.bucketName }}

    audit:
      kafka:
        bootstrap: {{ .Values.kafka.url }}:{{ .Values.kafka.port }}
        topic: {{ .Values.audit.kafka.topic }}
        schema-registry-url: {{ .Values.audit.kafka.schemaRegistryUrl }}
        ssl:
          enabled: {{ .Values.kafka.sslEnabled }}
          keystore-certificate: {{ .Values.kafka.sslUserCertificate }}
          keystore-key: {{ .Values.kafka.sslUserKey }}
          truststore-certificate: {{ .Values.kafka.sslClusterCertificate }}

    storage:
      lowcode-form-form-data-storage:
        type: redis
        backend:
          redis:
            password: ${REDIS_PASSWORD}
            sentinel:
              master: mymaster
              nodes: rfs-redis-sentinel.{{ .Release.Namespace }}.svc:26379
          ceph:
            http-endpoint: ${request-signature-ceph.http-endpoint}
            access-key: ${request-signature-ceph.access-key}
            secret-key: ${request-signature-ceph.secret-key}
            bucket: ${request-signature-ceph.bucket}
      datafactory-excerpt-signature-storage:
        type: ceph
        backend:
          ceph:
            http-endpoint: ${excerpt-signature-ceph.http-endpoint}
            access-key: ${excerpt-signature-ceph.access-key}
            secret-key: ${excerpt-signature-ceph.secret-key}
            bucket: ${excerpt-signature-ceph.bucket}
