# 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.enabled-by-default=true
management.endpoints.web.exposure.include=info,health,env,loggers,ssoSessions,registeredServices,refresh,authenticationHandlers,authenticationPolicies,resolveAttributes
management.endpoint.health.show-details=ALWAYS
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

##
# Allow configuration classes to override bean definitions from Spring Boot
#
spring.main.allow-bean-definition-overriding=true
spring.main.lazy-initialization=false

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

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

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

wa.useGZIPCompression=true

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

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

cas.logout.follow-service-redirects=true

cas.authn.saml-idp.core.entity-id=${cas.server.prefix}/saml
cas.authn.saml-idp.metadata.http.metadata-backup-location=file:${conf.directory}/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.oauth.core.user-profile-view-type=FLAT

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

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

spring.security.user.name=${anonymousUser}
spring.security.user.password=${anonymousKey}

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

cas.authn.syncope.url=${cas.server.name}/syncope
cas.authn.syncope.name=DefaultSyncopeAuthModule

##
# 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
