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 2022/01/27 14:01:35 UTC

[syncope] branch 2_1_X updated (9edaeb4 -> 5938894)

This is an automated email from the ASF dual-hosted git repository.

ilgrosso pushed a change to branch 2_1_X
in repository https://gitbox.apache.org/repos/asf/syncope.git.


    from 9edaeb4  Upgrading FOP
     new 77ff277  Upgrading Mockito and SLF4J
     new 59e109d  Upgrading Mockito and SLF4J
     new 5938894  [SYNCOPE-1660] Using SyncopeAuthenticationDetailsSource with AnonymousAuthenticationFilter

The 3 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 ...urce.java => SyncopeAnonymousAuthenticationFilter.java} | 12 +++++-------
 core/spring/src/main/resources/securityContext.xml         | 14 ++++++++++++--
 pom.xml                                                    |  4 ++--
 3 files changed, 19 insertions(+), 11 deletions(-)
 copy core/spring/src/main/java/org/apache/syncope/core/spring/security/{SyncopeAuthenticationDetailsSource.java => SyncopeAnonymousAuthenticationFilter.java} (66%)

[syncope] 01/03: Upgrading Mockito and SLF4J

Posted by il...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

ilgrosso pushed a commit to branch 2_1_X
in repository https://gitbox.apache.org/repos/asf/syncope.git

commit 77ff2777ff66a94d16514f0d8b32969c06e2ef50
Author: Francesco Chicchiriccò <il...@apache.org>
AuthorDate: Tue Jan 25 16:13:07 2022 +0100

    Upgrading Mockito and SLF4J
---
 pom.xml | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/pom.xml b/pom.xml
index f9ed09e..71a4d60 100644
--- a/pom.xml
+++ b/pom.xml
@@ -428,7 +428,7 @@ under the License.
 
     <camel.version>2.25.4</camel.version>
 
-    <slf4j.version>1.7.33</slf4j.version>
+    <slf4j.version>1.7.34</slf4j.version>
     <opensaml.version>3.3.1</opensaml.version>
 
     <elasticsearch.version>7.15.2</elasticsearch.version>
@@ -451,7 +451,7 @@ under the License.
     <h2.version>1.4.200</h2.version>
 
     <junit.version>5.8.2</junit.version>
-    <mockito.version>4.2.0</mockito.version>
+    <mockito.version>4.3.0</mockito.version>
 
     <conf.directory>${project.build.directory}/test-classes</conf.directory>
     <bundles.directory>${project.build.directory}/bundles</bundles.directory>

[syncope] 02/03: Upgrading Mockito and SLF4J

Posted by il...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

ilgrosso pushed a commit to branch 2_1_X
in repository https://gitbox.apache.org/repos/asf/syncope.git

commit 59e109d973eeb8ec078fd3422adac8c8ce26be3d
Author: Francesco Chicchiriccò <il...@apache.org>
AuthorDate: Wed Jan 26 16:18:50 2022 +0100

    Upgrading Mockito and SLF4J
---
 pom.xml | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/pom.xml b/pom.xml
index 71a4d60..6f8d398 100644
--- a/pom.xml
+++ b/pom.xml
@@ -428,7 +428,7 @@ under the License.
 
     <camel.version>2.25.4</camel.version>
 
-    <slf4j.version>1.7.34</slf4j.version>
+    <slf4j.version>1.7.35</slf4j.version>
     <opensaml.version>3.3.1</opensaml.version>
 
     <elasticsearch.version>7.15.2</elasticsearch.version>
@@ -451,7 +451,7 @@ under the License.
     <h2.version>1.4.200</h2.version>
 
     <junit.version>5.8.2</junit.version>
-    <mockito.version>4.3.0</mockito.version>
+    <mockito.version>4.3.1</mockito.version>
 
     <conf.directory>${project.build.directory}/test-classes</conf.directory>
     <bundles.directory>${project.build.directory}/bundles</bundles.directory>

[syncope] 03/03: [SYNCOPE-1660] Using SyncopeAuthenticationDetailsSource with AnonymousAuthenticationFilter

Posted by il...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

ilgrosso pushed a commit to branch 2_1_X
in repository https://gitbox.apache.org/repos/asf/syncope.git

commit 5938894368c255600175de0b66e5f139605bb774
Author: Francesco Chicchiriccò <il...@apache.org>
AuthorDate: Thu Jan 27 14:58:39 2022 +0100

    [SYNCOPE-1660] Using SyncopeAuthenticationDetailsSource with AnonymousAuthenticationFilter
---
 .../SyncopeAnonymousAuthenticationFilter.java      | 29 ++++++++++++++++++++++
 core/spring/src/main/resources/securityContext.xml | 14 +++++++++--
 2 files changed, 41 insertions(+), 2 deletions(-)

diff --git a/core/spring/src/main/java/org/apache/syncope/core/spring/security/SyncopeAnonymousAuthenticationFilter.java b/core/spring/src/main/java/org/apache/syncope/core/spring/security/SyncopeAnonymousAuthenticationFilter.java
new file mode 100644
index 0000000..c85e942
--- /dev/null
+++ b/core/spring/src/main/java/org/apache/syncope/core/spring/security/SyncopeAnonymousAuthenticationFilter.java
@@ -0,0 +1,29 @@
+/*
+ * 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.
+ */
+package org.apache.syncope.core.spring.security;
+
+import org.springframework.security.core.authority.AuthorityUtils;
+import org.springframework.security.web.authentication.AnonymousAuthenticationFilter;
+
+public class SyncopeAnonymousAuthenticationFilter extends AnonymousAuthenticationFilter {
+
+    public SyncopeAnonymousAuthenticationFilter(final String key, final String anonymousUser) {
+        super(key, anonymousUser, AuthorityUtils.createAuthorityList("ROLE_ANONYMOUS"));
+    }
+}
diff --git a/core/spring/src/main/resources/securityContext.xml b/core/spring/src/main/resources/securityContext.xml
index bec0d12..5f7490b 100644
--- a/core/spring/src/main/resources/securityContext.xml
+++ b/core/spring/src/main/resources/securityContext.xml
@@ -96,6 +96,15 @@ under the License.
     <property name="realmName" value="Apache Syncope authentication"/>
   </bean>
   
+  <bean id="anonymousAuthenticationFilter" class="org.apache.syncope.core.spring.security.SyncopeAnonymousAuthenticationFilter">
+    <constructor-arg value="doesNotMatter"/>
+    <constructor-arg value="${anonymousUser}"/>
+    <property name="authenticationDetailsSource" ref="authenticationDetailsSource"/>
+  </bean>
+  <bean id="anonymousAuthenticationProvider" class="org.springframework.security.authentication.AnonymousAuthenticationProvider">
+    <constructor-arg value="doesNotMatter"/>
+  </bean>
+
   <bean id="jwtAuthenticationFilter" class="org.apache.syncope.core.spring.security.JWTAuthenticationFilter">
     <property name="authenticationManager" ref="authenticationManager"/>
     <property name="authenticationEntryPoint" ref="basicAuthenticationEntryPoint"/>
@@ -112,12 +121,13 @@ under the License.
                  use-expressions="false" disable-url-rewriting="false"
                  pattern="/**">
 
-    <security:anonymous username="${anonymousUser}"/>
+    <security:anonymous enabled="false"/>
+    <security:custom-filter ref="anonymousAuthenticationFilter" position="ANONYMOUS_FILTER"/>
 
     <security:custom-filter ref="jwtAuthenticationFilter" before="BASIC_AUTH_FILTER"/>
     <security:http-basic authentication-details-source-ref="authenticationDetailsSource"/>
     
-    <security:custom-filter before="FILTER_SECURITY_INTERCEPTOR" ref="mustChangePasswordFilter"/>
+    <security:custom-filter ref="mustChangePasswordFilter" before="FILTER_SECURITY_INTERCEPTOR"/>
     
     <security:access-denied-handler ref="syncopeAccessDeniedHandler"/>