info:
  description: File Management Service V1 Server

redaction-service.url: "http://redaction-service-v1:8080"
pdftron-redaction-service.url: "http://pdftron-redaction-service-v1:8080"
redaction-report-service.url: "http://redaction-report-service-v1:8080"
search-service.url: "http://search-service-v1:8080"
tenant-user-management-service.url: "http://tenant-user-management-service:8080/internal"

application:
  type: "RedactManager"
  
server:
  port: 8080

spring:
  main:
    allow-bean-definition-overriding: true
    allow-circular-references: true
  jpa:
    open-in-view: true
    database-platform: org.hibernate.dialect.PostgreSQL95Dialect
    hibernate:
      ddl-auto: none
      naming-strategy: org.hibernate.cfg.ImprovedNamingStrategy
    properties:
      hibernate:
        jdbc:
          batch_size: 1000
          order_inserts: true
          order_updates: true
  cache:
    type: redis
  mvc:
    pathmatch:
      matching-strategy: ant-path-matcher

  rabbitmq:
    host: ${RABBITMQ_HOST:localhost}
    port: ${RABBITMQ_PORT:5672}
    username: ${RABBITMQ_USERNAME:user}
    password: ${RABBITMQ_PASSWORD:rabbitmq}
    listener:
      simple:
        acknowledge-mode: AUTO
        concurrency: 5
        retry:
          enabled: true
          max-attempts: 3
          max-interval: 15000
        prefetch: 1
  application:
    name: persistence-service

management:
  endpoint:
    metrics.enabled: ${monitoring.enabled:false}
    prometheus.enabled: ${monitoring.enabled:false}
    health.enabled: true
  endpoints.web.exposure.include: prometheus, health, metrics
  metrics.export.prometheus.enabled: ${monitoring.enabled:false}
  health:
    db:
      enabled: false

metrics:
  persistence:
    enabled: ${monitoring.enabled:false}

storage:
  backend: 's3'

multitenancy:
  packages:
    repositories: 'com.iqser.red.service.persistence.management.v1.processor.service.persistence.repository'
    entities: 'com.iqser.red.service.persistence.management.v1.processor.entity'
  datasource-cache:
    maximumSize: 100
    expireAfterAccess: 1
  tenant:
    datasource:
      driverClassName: org.postgresql.Driver
      hikari:
        maximumPoolSize: 8
        minimum-idle: 5
        data-source-properties:
          cachePrepStmts: true
          prepStmtCacheSize: 1000
          prepStmtCacheSqlLimit: 2048
    liquibase:
      changeLog: classpath:db/changelog/db.changelog-tenant.yaml


bucket4j:
  enabled: ${rate_limit.enabled:true}
  filters:
    - cache-name: buckets
      expression: "@securityService.username()?: getRemoteAddr()"
      url: .*
      rate-limits:
        - bandwidths:
            - capacity: ${rate_limit.capacity:600}
              time: ${rate_limit.replenishment:60}
              unit: seconds



fforesight:
  keycloak:
    ignored-endpoints: [ '/redaction-gateway-v1','/actuator/health/**', '/redaction-gateway-v1/async/download/with-ott/**',
                         '/internal-api/**', '/redaction-gateway-v1/docs/swagger-ui',
                         '/redaction-gateway-v1/docs/**','/redaction-gateway-v1/docs', ]
    enabled: true
  springdoc:
    base-path: '/redaction-gateway-v1'
    auth-server-url: '/auth'
    enabled: true
    default-client-id: 'swagger-ui-client'
    default-tenant: 'redaction'
  tenant-exchange:
    name: 'tenants-exchange'
  user-exchange:
    name: 'users-exchange'
  jobs:
    datasource:
      url: jdbc:postgresql://${PSQL_HOST:localhost}:${PSQL_PORT:5432}/${PSQL_DATABASE:master}?cachePrepStmts=true&useServerPrepStmts=true&rewriteBatchedStatements=true
      driverClassName: org.postgresql.Driver
      username: ${PSQL_USERNAME:fforesight}
      password: ${PSQL_PASSWORD:fforesight}
      platform: org.hibernate.dialect.PostgreSQL95Dialect
    enabled: true
  tenants:
    remote: true

springdoc:
  swagger-ui:
    path: ${fforesight.springdoc.base-path}/docs/swagger-ui
    operations-sorter: alpha
    tags-sorter: alpha
    oauth:
      client-id: swagger-ui-client
    doc-expansion: none
    config-url: ${fforesight.springdoc.base-path}/docs/swagger-config
  api-docs:
    path: ${fforesight.springdoc.base-path}/docs?tenantId=${fforesight.springdoc.default-tenant}
    enabled: ${fforesight.springdoc.enabled}
  pre-loading-enabled: true
  packages-to-scan: [ 'com.iqser.red.persistence.service.v1.external.api' ]
