You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@syncope.apache.org by il...@apache.org on 2020/07/07 11:16:27 UTC
[syncope] 03/03: Adding profile to develop WA with running Core
This is an automated email from the ASF dual-hosted git repository.
ilgrosso pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/syncope.git
commit d77e0022fe9c6d8c7b2887768683d1454719e703
Author: Francesco Chicchiriccò <il...@apache.org>
AuthorDate: Tue Jul 7 13:16:03 2020 +0200
Adding profile to develop WA with running Core
---
wa/starter/pom.xml | 51 ++++++++++++++++++++
wa/starter/src/main/resources/log4j2.xml | 4 ++
.../test/resources/dev/application-dev.properties | 16 +++++++
.../src/test/resources/dev/keymaster.properties | 19 ++++++++
.../resources => test/resources/dev}/log4j2.xml | 31 ++++++------
wa/starter/src/test/resources/dev/wa.properties | 56 ++++++++++++++++++++++
6 files changed, 162 insertions(+), 15 deletions(-)
diff --git a/wa/starter/pom.xml b/wa/starter/pom.xml
index 419dfd3..30f2d15 100644
--- a/wa/starter/pom.xml
+++ b/wa/starter/pom.xml
@@ -447,6 +447,9 @@ under the License.
<resource>
<directory>${basedir}/src/test/resources</directory>
<filtering>true</filtering>
+ <excludes>
+ <exclude>dev/**</exclude>
+ </excludes>
</resource>
</resources>
@@ -458,5 +461,53 @@ under the License.
</testResources>
</build>
</profile>
+
+ <profile>
+ <id>dev</id>
+
+ <properties>
+ <maven.test.skip>true</maven.test.skip>
+ </properties>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.springframework.boot</groupId>
+ <artifactId>spring-boot-starter-undertow</artifactId>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.syncope.ext.self-keymaster</groupId>
+ <artifactId>syncope-ext-self-keymaster-client</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ </dependencies>
+
+ <build>
+ <defaultGoal>clean package spring-boot:run</defaultGoal>
+
+ <plugins>
+ <plugin>
+ <groupId>org.springframework.boot</groupId>
+ <artifactId>spring-boot-maven-plugin</artifactId>
+ <configuration>
+ <mainClass>org.apache.syncope.wa.starter.SyncopeWAApplication</mainClass>
+ <jvmArguments>
+ -Xdebug -Xrunjdwp:transport=dt_socket,address=8001,server=y,suspend=n
+ </jvmArguments>
+ <profiles>
+ <profile>dev</profile>
+ </profiles>
+ </configuration>
+ </plugin>
+ </plugins>
+
+ <resources>
+ <resource>
+ <directory>${basedir}/src/test/resources/dev</directory>
+ <filtering>true</filtering>
+ </resource>
+ </resources>
+ </build>
+ </profile>
</profiles>
</project>
diff --git a/wa/starter/src/main/resources/log4j2.xml b/wa/starter/src/main/resources/log4j2.xml
index e184c60..45979c0 100644
--- a/wa/starter/src/main/resources/log4j2.xml
+++ b/wa/starter/src/main/resources/log4j2.xml
@@ -44,6 +44,10 @@ under the License.
<appender-ref ref="main"/>
</asyncLogger>
+ <asyncLogger name="org.pac4j" additivity="false" level="ERROR">
+ <appender-ref ref="main"/>
+ </asyncLogger>
+
<asyncLogger name="org.springframework" additivity="false" level="INFO">
<appender-ref ref="main"/>
</asyncLogger>
diff --git a/wa/starter/src/test/resources/dev/application-dev.properties b/wa/starter/src/test/resources/dev/application-dev.properties
new file mode 100644
index 0000000..13a8339
--- /dev/null
+++ b/wa/starter/src/test/resources/dev/application-dev.properties
@@ -0,0 +1,16 @@
+# 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.
diff --git a/wa/starter/src/test/resources/dev/keymaster.properties b/wa/starter/src/test/resources/dev/keymaster.properties
new file mode 100644
index 0000000..033fe3b
--- /dev/null
+++ b/wa/starter/src/test/resources/dev/keymaster.properties
@@ -0,0 +1,19 @@
+# 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.
+keymaster.address=http://localhost:9080/syncope/rest/keymaster
+keymaster.username=${anonymousUser}
+keymaster.password=${anonymousKey}
diff --git a/wa/starter/src/main/resources/log4j2.xml b/wa/starter/src/test/resources/dev/log4j2.xml
similarity index 65%
copy from wa/starter/src/main/resources/log4j2.xml
copy to wa/starter/src/test/resources/dev/log4j2.xml
index e184c60..1e1393f 100644
--- a/wa/starter/src/main/resources/log4j2.xml
+++ b/wa/starter/src/test/resources/dev/log4j2.xml
@@ -19,21 +19,18 @@ under the License.
-->
<configuration status="WARN">
- <appenders>
-
- <RollingRandomAccessFile name="main" fileName="${log.directory}/wa.log"
- filePattern="${log.directory}/wa-%d{yyyy-MM-dd}.log.gz"
- immediateFlush="false" append="true">
- <PatternLayout>
- <pattern>%d{HH:mm:ss.SSS} %-5level %logger - %msg%n</pattern>
- </PatternLayout>
- <Policies>
- <TimeBasedTriggeringPolicy/>
- <SizeBasedTriggeringPolicy size="250 MB"/>
- </Policies>
- </RollingRandomAccessFile>
-
- </appenders>
+ <Properties>
+ <Property name="LOG_EXCEPTION_CONVERSION_WORD">%xwEx</Property>
+ <Property name="LOG_LEVEL_PATTERN">%5p</Property>
+ <Property name="LOG_DATEFORMAT_PATTERN">yyyy-MM-dd HH:mm:ss.SSS</Property>
+ <Property name="CONSOLE_LOG_PATTERN">%clr{%d{${LOG_DATEFORMAT_PATTERN}}}{faint} %clr{${LOG_LEVEL_PATTERN}} %clr{%pid}{magenta} %clr{---}{faint} %clr{[%15.15t]}{faint} %clr{%-40.40c{1.}}{cyan} %clr{:}{faint} %m%n${sys:LOG_EXCEPTION_CONVERSION_WORD}</Property>
+ <Property name="FILE_LOG_PATTERN">%d{${LOG_DATEFORMAT_PATTERN}} ${LOG_LEVEL_PATTERN} %pid --- [%t] %-40.40c{1.} : %m%n${sys:LOG_EXCEPTION_CONVERSION_WORD}</Property>
+ </Properties>
+ <Appenders>
+ <Console name="main" target="SYSTEM_OUT" follow="true">
+ <PatternLayout pattern="${sys:CONSOLE_LOG_PATTERN}" />
+ </Console>
+ </Appenders>
<loggers>
@@ -44,6 +41,10 @@ under the License.
<appender-ref ref="main"/>
</asyncLogger>
+ <asyncLogger name="org.pac4j" additivity="false" level="ERROR">
+ <appender-ref ref="main"/>
+ </asyncLogger>
+
<asyncLogger name="org.springframework" additivity="false" level="INFO">
<appender-ref ref="main"/>
</asyncLogger>
diff --git a/wa/starter/src/test/resources/dev/wa.properties b/wa/starter/src/test/resources/dev/wa.properties
new file mode 100644
index 0000000..e61422d
--- /dev/null
+++ b/wa/starter/src/test/resources/dev/wa.properties
@@ -0,0 +1,56 @@
+# 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.
+anonymousUser=${anonymousUser}
+anonymousKey=${anonymousKey}
+
+useGZIPCompression=true
+
+# Conf directories
+conf.directory=${conf.directory}
+cas.standalone.configurationDirectory=${conf.directory}
+cas.authn.oidc.jwks.jwks-file=file:${conf.directory}/oidc.keystore
+
+cas.server.name=http://localhost:8080
+cas.server.prefix=${cas.server.name}/syncope-wa
+cas.server.scope=syncope.org
+cas.authn.syncope.url=http://localhost:9080/syncope/rest/
+
+cas.tgc.secure=false
+
+cas.authn.saml-idp.entity-id=https://syncope.apache.org/saml
+
+cas.authn.oidc.issuer=http://localhost:8080/syncope-wa/oidc/
+
+# 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.enabled=false
+
+management.endpoints.web.exposure.include=health,loggers,refresh
+management.endpoint.health.show-details=always
+
+management.endpoint.health.enabled=true
+management.endpoint.loggers.enabled=true
+management.endpoint.refresh.enabled=true
+
+cas.monitor.endpoints.endpoint.defaults.access=AUTHENTICATED
+
+spring.security.user.name=${anonymousUser}
+spring.security.user.password=${anonymousKey}