---
# for descriptions of the properties s. the same file in https://gitlab.eccenca.com/devops/eccenca-graphinsights-docker
semspect:
  extensions: cmem
  extension.cmem:
    baseUri: "${DEPLOY_BASE_URL}"
    authorization:
      cacheDuration: 60
  core:
    enableCaptionPropertySelection: false
    enableDescriptionPropertySelection: false

frontend:
  appNameOverride: "Graph Insights"
  enableLogo: false
  enableAboutWindow: false
  singleDatabaseMode: true
  enableIframeOnlyMode: true
  enableCopyDeepLink: false
  fontFamily: "Roboto, helvetica, arial, sans-serif"
  fontFace: >
    @font-face {
          font-family: 'Roboto';
          font-style: normal;
          font-weight: 400;
          src: url('https://eccenca.com/layouts/default/fonts/roboto-v20-latin-regular.woff2') format('woff2');
    }

  trustedOrigins:
    - "${DEPLOY_BASE_URL}"
    - "${DEPLOY_BASE_URL}/*"

  backlink:
    objectURLTemplate: ${DEPLOY_BASE_URL}/{workspaceID}/explore?resource={objectID}&graph={contextGraphIRI}
    categoryURLTemplate: ${DEPLOY_BASE_URL}/{workspaceID}/explore?type={categoryID}&graph={contextGraphIRI}
    objectBacklinkDestination: "CMEM"
    categoryBacklinkDestination: "CMEM"
    multiObjectBacklinkDestination: "CMEM"
  debug: true
  logLevel: DEBUG

# secure /api/** via resourceserver
spring.security.oauth2:
  resourceserver:
    jwt:
      jwk-set-uri: "${OAUTH_JWK_SET_URL}"
  # semspect backend for frontent as oauth2client
  # To enable SLO add this as back-channel logout uri to the client semspect uses:
  # http://docker.localhost/graphinsights/logout/connect/back-channel/keycloak
  client:
    registration:
      keycloak:
        client-id: "${GRAPHINSIGHTS_OAUTH_CLIENT_ID}"
        authorization-grant-type: "authorization_code"
        client-authentication-method: "client_secret_basic"
        # not needed here because we never login to semspect directly
        redirectUri: "${DEPLOY_BASE_URL}/graphinsights/login/oauth2/code/{registrationId}"
        # openid is mandatory as spring somehow does not add it to the userinfo request
        scope:
          - openid
          - profile
          - email
      # service account used for datastore access
      semspect-service:
        client-id: "${GRAPHINSIGHTS_OAUTH_SERVICE_CLIENT_ID}"
        client-secret: "${GRAPHINSIGHTS_OAUTH_SERVICE_CLIENT_SECRET}"
        authorization-grant-type: client_credentials
        provider: keycloak
    provider:
      keycloak:
        issuer-uri: "${OAUTH_ISSUER_URL}"
        user-name-attribute: "preferred_username"

# same (fixed) session timeout as explore backend
server.servlet.session.timeout: "36000s"
server.frame.ancestors: "${DEPLOY_BASE_URL}"

logging:
  level:
    root: DEBUG
    org.springframework: WARN
    org.springframework.security: WARN

  pattern:
    console: "%d{yyyy-MM-dd'T'HH:mm:ss.SSSX,UTC} %-5level %logger{15} - %message%n%xException"
