server:
    port : 8080

management:
    server:
        port: 8081
        address: 127.0.0.1
    endpoints:
        web:
            exposure:
                # HOWTO: view _clickable_ Spring Actuator (Micrometer) Metrics endpoints:
                #   http://localhost:8081/actuator/metric-links

                # HOWTO: view all configured endpoints of the running application:
                #   http://localhost:8081/actuator/mappings

                # HOWTO: view the effective application configuration properties:
                #   http://localhost:8081/actuator/configprops

                include: info, health, metrics, metric-links, mappings, openapi, configprops, env
    endpoint:
        env:
            # TODO.spec: check this, maybe set to when_authorized?
            show-values: always
        configprops:
            # TODO.spec: check this, maybe set to when_authorized?
            show-values: always
    observations:
        annotations:
            enabled: true

spring:

    datasource:
        driver-class-name: org.postgresql.Driver
        password: password
        url: ${HSADMINNG_POSTGRES_JDBC_URL}
        username: postgres

    data:
        rest:
            # do NOT implicilty expose SpringData repositories as REST-controllers
            detection-strategy: annotated

    sql:
        init:
            mode: never

    jpa:
        properties:
            hibernate:
                dialect: net.hostsharing.hsadminng.config.PostgresCustomDialect

    liquibase:
        contexts: ${spring.profiles.active}

    security:
        oauth2:
            resourceserver:
                jwt:
                    issuer-uri: ${HSADMINNG_JWT_ISSUER:}
                    jwk-set-uri: ${HSADMINNG_JWT_JWKS_URL:}

hsadminng:
    postgres:
        leakproof:

metrics:
    distribution:
        percentiles-histogram:
            http:
                server:
                    requests: true

# HOWTO set logging-levels for certain Java packages (trace, debug, info, warn, error)
logging:
    level:
#        org.springframework.security: info
#        org.hibernate.SQL: DEBUG # Enable SQL query logging
#        org.hibernate.orm.jdbc.bind: TRACE # Enable SQL parameter binding logging
#        org.springframework.web: DEBUG
#        org.springframework.web.method.annotation: DEBUG
#        org.springframework.validation: DEBUG
# HOWTO configure logging, e.g. logging to a separate file, see:
#   https://docs.spring.io/spring-boot/reference/features/logging.html

---

spring:
    config:
        activate:
            on-profile: fake-jwt
    security:
        oauth2:
            resourceserver:
                jwt:
                    issuer-uri: "http://localhost:${server.port}/fake-jwt"
                    jwk-set-uri: "http://localhost:${server.port}/fake-jwt/.well-known/jwks.json"


