databases:
  - id: "default"
    name: "cordacluster"
    host: null  # passed in from jenkins pipeline
    port: 5432
    type: "postgresql"
  - id: "isolated-state-manager"
    name: "state-manager"
    host: null # passed in from jenkins pipeline
    port: 5432
    type: "postgresql"

# Fields 'type' and 'partition' already have defaults set by the Helm Chart, adding them here just for clarity
stateManager:
  flowCheckpoint:
    type: Database
    storageId: "isolated-state-manager"
    partition: "sm_flow_checkpoint"
  flowMapping:
    type: Database
    storageId: "isolated-state-manager"
    partition: "sm_flow_mapping"
  flowStatus:
    type: Database
    storageId: "isolated-state-manager"
    partition: "sm_flow_status"
  keyRotation:
    type: Database
    storageId: "isolated-state-manager"
    partition: "sm_key_rotation"
  p2pSession:
    type: Database
    storageId: "isolated-state-manager"
    partition: "sm_p2p_session"
  tokenPoolCache:
    type: Database
    storageId: "isolated-state-manager"
    partition: "sm_token_pool_cache"

bootstrap:
  db:
    databases:
      - id: "default"
        username:
          value: "postgres"
        password:
          valueFrom:
            secretKeyRef:
              key: "postgres-password"
              name: "" # passed in from jenkins pipeline
      - id: "isolated-state-manager"
        username:
          value: "state-manager-user"
        password:
          valueFrom:
            secretKeyRef:
              key: "password"
              name: "" # passed in from jenkins pipeline
  kafka:
    sasl:
      username:
        value: "bootstrap"
      password:
        valueFrom:
          secretKeyRef:
            name: "kafka-credentials"
            key: "bootstrap"


logging:
  format: "text"

kafka:
  bootstrapServers: "prereqs-kafka:9092"
  tls:
    enabled: true
    truststore:
      valueFrom:
        secretKeyRef:
          name: "prereqs-kafka-tls"
          key: "kafka-ca.crt"
  sasl:
    enabled: true

workers:
  crypto:
    kafka:
      sasl:
        username:
          value: "crypto"
        password:
          valueFrom:
            secretKeyRef:
              name: "kafka-credentials"
              key: "crypto"
  db:
    kafka:
      sasl:
        username:
          value: "db"
        password:
          valueFrom:
            secretKeyRef:
              name: "kafka-credentials"
              key: "db"
  flow:
    kafka:
      sasl:
        username:
          value: "flow"
        password:
          valueFrom:
            secretKeyRef:
              name: "kafka-credentials"
              key: "flow"
  flowMapper:
    kafka:
      sasl:
        username:
          value: "flowMapper"
        password:
          valueFrom:
            secretKeyRef:
              name: "kafka-credentials"
              key: "flowMapper"
  verification:
    kafka:
      sasl:
        username:
          value: "verification"
        password:
          valueFrom:
            secretKeyRef:
              name: "kafka-credentials"
              key: "verification"
  membership:
    kafka:
      sasl:
        username:
          value: "membership"
        password:
          valueFrom:
            secretKeyRef:
              name: "kafka-credentials"
              key: "membership"
  p2pGateway:
    kafka:
      sasl:
        username:
          value: "p2pGateway"
        password:
          valueFrom:
            secretKeyRef:
              name: "kafka-credentials"
              key: "p2pGateway"
  p2pLinkManager:
    kafka:
      sasl:
        username:
          value: "p2pLinkManager"
        password:
          valueFrom:
            secretKeyRef:
              name: "kafka-credentials"
              key: "p2pLinkManager"
  persistence:
    kafka:
      sasl:
        username:
          value: "persistence"
        password:
          valueFrom:
            secretKeyRef:
              name: "kafka-credentials"
              key: "persistence"
  tokenSelection:
    kafka:
      sasl:
        username:
          value: "tokenSelection"
        password:
          valueFrom:
            secretKeyRef:
              name: "kafka-credentials"
              key: "tokenSelection"
  rest:
    kafka:
      sasl:
        username:
          value: "rest"
        password:
          valueFrom:
            secretKeyRef:
              name: "kafka-credentials"
              key: "rest"
  uniqueness:
    kafka:
      sasl:
        username:
          value: "uniqueness"
        password:
          valueFrom:
            secretKeyRef:
              name: "kafka-credentials"
              key: "uniqueness"
