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/09/22 07:17:36 UTC

[syncope] branch master updated (56fb5f5eaf -> 4e9d7702c7)

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

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


    from 56fb5f5eaf Upgrading Nimbus JOSE JWT, Log4J2, Elasticsearch, maven-jar-plugin, cargo-maven3-plugin, apache-rat-plugin
     new 4c8c28191c Upgrading Nimbus JOSE JWT
     new 4e9d7702c7 Working around CAS bug

The 2 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:
 pom.xml                                            |  2 +-
 wa/bootstrap/pom.xml                               | 11 +++++
 .../bootstrap/AuthModulePropertySourceMapper.java  |  8 +++-
 .../AuthModulePropertySourceMapperTest.java        | 49 ++++++++++++++++++++++
 4 files changed, 68 insertions(+), 2 deletions(-)
 create mode 100644 wa/bootstrap/src/test/java/org/apache/syncope/wa/bootstrap/AuthModulePropertySourceMapperTest.java


[syncope] 01/02: Upgrading Nimbus JOSE JWT

Posted by il...@apache.org.
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 4c8c28191c24ebd2454eb4697e646a1a685d7a7b
Author: Francesco Chicchiriccò <il...@apache.org>
AuthorDate: Wed Sep 21 15:36:34 2022 +0200

    Upgrading Nimbus JOSE JWT
---
 pom.xml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/pom.xml b/pom.xml
index 2b9ca173c4..6d2aeefc51 100644
--- a/pom.xml
+++ b/pom.xml
@@ -413,7 +413,7 @@ under the License.
 
     <cxf.version>3.5.3</cxf.version>
     <bouncycastle.version>1.70</bouncycastle.version>
-    <nimbus-jose-jwt.version>9.25</nimbus-jose-jwt.version>
+    <nimbus-jose-jwt.version>9.25.1</nimbus-jose-jwt.version>
 
     <jackson.version>2.13.4</jackson.version>
 


[syncope] 02/02: Working around CAS bug

Posted by il...@apache.org.
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 4e9d7702c72f884c99be431b693bb8878d0097a6
Author: Francesco Chicchiriccò <il...@apache.org>
AuthorDate: Thu Sep 22 09:17:26 2022 +0200

    Working around CAS bug
---
 wa/bootstrap/pom.xml                               | 11 +++++
 .../bootstrap/AuthModulePropertySourceMapper.java  |  8 +++-
 .../AuthModulePropertySourceMapperTest.java        | 49 ++++++++++++++++++++++
 3 files changed, 67 insertions(+), 1 deletion(-)

diff --git a/wa/bootstrap/pom.xml b/wa/bootstrap/pom.xml
index 5fe2a70b71..4837838294 100644
--- a/wa/bootstrap/pom.xml
+++ b/wa/bootstrap/pom.xml
@@ -57,6 +57,17 @@ under the License.
       <groupId>org.apereo.cas</groupId>
       <artifactId>cas-server-core-util-api</artifactId>
     </dependency>
+
+    <dependency>
+      <groupId>org.slf4j</groupId>
+      <artifactId>slf4j-simple</artifactId>
+      <scope>test</scope>
+    </dependency>
+    <dependency>
+      <groupId>org.junit.jupiter</groupId>
+      <artifactId>junit-jupiter</artifactId>
+      <scope>test</scope>
+    </dependency>
   </dependencies>
 
   <build>
diff --git a/wa/bootstrap/src/main/java/org/apache/syncope/wa/bootstrap/AuthModulePropertySourceMapper.java b/wa/bootstrap/src/main/java/org/apache/syncope/wa/bootstrap/AuthModulePropertySourceMapper.java
index b14c7fe137..bb3179cf74 100644
--- a/wa/bootstrap/src/main/java/org/apache/syncope/wa/bootstrap/AuthModulePropertySourceMapper.java
+++ b/wa/bootstrap/src/main/java/org/apache/syncope/wa/bootstrap/AuthModulePropertySourceMapper.java
@@ -18,6 +18,8 @@
  */
 package org.apache.syncope.wa.bootstrap;
 
+import com.fasterxml.jackson.databind.ser.impl.SimpleBeanPropertyFilter;
+import com.fasterxml.jackson.databind.ser.impl.SimpleFilterProvider;
 import java.util.Map;
 import java.util.Optional;
 import java.util.concurrent.TimeUnit;
@@ -266,6 +268,10 @@ public class AuthModulePropertySourceMapper extends PropertySourceMapper impleme
             }
         }
 
-        return prefix("cas.authn.mfa.simple.", CasCoreConfigurationUtils.asMap(props));
+        // workaround to remove with CAS >= 6.6.1
+        return prefix("cas.authn.mfa.simple.", CasCoreConfigurationUtils.asMap(
+                props,
+                new SimpleFilterProvider().setDefaultFilter(
+                        SimpleBeanPropertyFilter.filterOutAllExcept("defined", "undefined"))));
     }
 }
diff --git a/wa/bootstrap/src/test/java/org/apache/syncope/wa/bootstrap/AuthModulePropertySourceMapperTest.java b/wa/bootstrap/src/test/java/org/apache/syncope/wa/bootstrap/AuthModulePropertySourceMapperTest.java
new file mode 100644
index 0000000000..a5175ebe98
--- /dev/null
+++ b/wa/bootstrap/src/test/java/org/apache/syncope/wa/bootstrap/AuthModulePropertySourceMapperTest.java
@@ -0,0 +1,49 @@
+/*
+ * 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.wa.bootstrap;
+
+import static org.junit.jupiter.api.Assertions.assertFalse;
+
+import java.util.Map;
+import org.apache.syncope.common.lib.auth.SimpleMfaAuthModuleConf;
+import org.apache.syncope.common.lib.to.AuthModuleTO;
+import org.junit.jupiter.api.Test;
+
+public class AuthModulePropertySourceMapperTest {
+
+    @Test
+    public void mapSimpleMfaAuthModuleConf() {
+        AuthModuleTO authModuleTO = new AuthModuleTO();
+        authModuleTO.setKey("key");
+        authModuleTO.setOrder(0);
+
+        SimpleMfaAuthModuleConf conf = new SimpleMfaAuthModuleConf();
+
+        conf.setEmailAttribute("email");
+        conf.setEmailFrom("syncope@apache.org");
+        conf.setEmailSubject("Subject");
+        conf.setEmailText("Text body");
+
+        conf.setTokenLength(256);
+        conf.setTimeToKillInSeconds(600);
+
+        Map<String, Object> map = new AuthModulePropertySourceMapper(null).map(authModuleTO, conf);
+        assertFalse(map.keySet().stream().anyMatch(k -> k.endsWith("defined")));
+    }
+}