# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements.  See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership.  The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License.  You may obtain a copy of the License at
#
#   http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied.  See the License for the
# specific language governing permissions and limitations
# under the License.
spring.application.name=Apache Syncope ${syncope.version} WA
spring.groovy.template.check-template-location=false
spring.main.banner-mode=log
spring.main.allow-circular-references=true

version=${syncope.version}

server.port=8080

server.servlet.encoding.charset=UTF-8
server.servlet.encoding.enabled=true
server.servlet.encoding.force=true

server.servlet.contextPath=/syncope-wa

server.servlet.session.timeout=300
server.servlet.session.cookie.http-only=true
server.servlet.session.tracking-modes=COOKIE

spring.web.resources.static-locations=classpath:/thymeleaf/static,classpath:/syncope/static,classpath:/static

cas.monitor.endpoints.endpoint.defaults.access=AUTHENTICATED
management.endpoints.access.default=UNRESTRICTED
management.endpoints.web.exposure.include=info,health,env,loggers,ssoSessions,registeredServices,refresh,authenticationHandlers,authenticationPolicies,resolveAttributes,attributeConsent
management.endpoint.health.show-details=ALWAYS
management.endpoint.env.show-values=WHEN_AUTHORIZED
spring.cloud.discovery.client.health-indicator.enabled=false

# Cache service definitions for 5 minutes
cas.service-registry.cache.duration=PT5M

# Reload services and hydrate the cache every 5 minutes
cas.service-registry.schedule.repeat-interval=PT5M
cas.service-registry.schedule.start-delay=PT30S

cas.events.core.enabled=false

cas.slo.disabled=false

spring.main.allow-bean-definition-overriding=true
spring.main.lazy-initialization=false

server.shutdown=graceful
spring.lifecycle.timeout-per-shutdown-phase=30s

service.discovery.address=http://localhost:8080/syncope-wa/

wa.anonymousUser=${anonymousUser}
wa.anonymousKey=${anonymousKey}

wa.useGZIPCompression=true

# Conf directories
conf.directory=${syncope.conf.dir}
cas.standalone.configuration-directory=${syncope.conf.dir}

cas.server.name=http://localhost:8080
cas.server.prefix=${cas.server.name}/syncope-wa
cas.server.scope=syncope.apache.org

cas.logout.follow-service-redirects=true

cas.authn.saml-idp.core.entity-id=${cas.server.prefix}/saml
cas.authn.saml-idp.core.session-replication.replicate-sessions=false
cas.authn.saml-idp.core.session-storage-type=HTTP
cas.authn.saml-idp.metadata.http.metadata-backup-location=file:${syncope.conf.dir}/saml

cas.authn.oidc.core.issuer=${cas.server.prefix}/oidc
cas.authn.oidc.discovery.id-token-signing-alg-values-supported=RS256,RS384,RS512,PS256,PS384,PS512,ES256,ES384,ES512,HS256,HS384,HS512
cas.authn.oidc.discovery.user-info-signing-alg-values-supported=RS256,RS384,RS512,PS256,PS384,PS512,ES256,ES384,ES512,HS256,HS384,HS512
cas.authn.oidc.logout.backchannel-logout-supported=true
cas.authn.oidc.logout.frontchannel-logout-supported=true
cas.authn.oauth.core.user-profile-view-type=FLAT
cas.authn.oauth.session-replication.replicate-sessions=false
cas.authn.pac4j.core.session-replication.replicate-sessions=false

cas.authn.pm.core.enabled=true

# Disable access to the login endpoint
# if no target application is specified.
cas.sso.services.allow-missing-service-parameter=true

# Disable the acceptable usage policy
# by default for now.
cas.acceptable-usage-policy.core.enabled=false

springdoc.show-actuator=true
springdoc.model-and-view-allowed=true
springdoc.writer-with-default-pretty-printer=true
springdoc.swagger-ui.displayRequestDuration=true

cas.authn.mfa.web-authn.core.allowed-origins=${cas.server.name}
cas.authn.mfa.web-authn.core.application-id=https://localhost:8443
cas.authn.mfa.web-authn.core.relying-party-name=Syncope 
cas.authn.mfa.web-authn.core.relying-party-id=syncope.apache.org

##
# Default strategy for matching request paths against
# registered Spring MVC handler mappings
spring.mvc.pathmatch.matching-strategy=ant-path-matcher

##
# Disable CGLib Proxies
spring.aop.auto=true
spring.aop.proxy-target-class=false

##
# Metrics Configuration
management.cloudwatch.metrics.export.enabled=false
management.atlas.metrics.export.enabled=false
management.datadog.metrics.export.enabled=false
management.ganglia.metrics.export.enabled=false
management.graphite.metrics.export.enabled=false
management.influx.metrics.export.enabled=false
management.jmx.metrics.export.enabled=false
management.newrelic.metrics.export.enabled=false
management.prometheus.metrics.export.enabled=false
management.signalfx.metrics.export.enabled=false
management.statsd.metrics.export.enabled=false
management.wavefront.metrics.export.enabled=false
management.elastic.metrics.export.enabled=false

management.defaults.metrics.export.enabled=true

management.metrics.enable.logback=false
management.metrics.enable.process.files=true
management.metrics.enable.system.cpu=true
management.metrics.enable.process.cpu=true
management.metrics.enable.process.uptime=true
management.metrics.enable.process.start.time=true
