[java-metadata-aggregator] branch main updated: MDA-158 - Split legacy keylists into separate artifact, resolve package split

Ian Young ian at iay.org.uk
Fri Apr 21 16:07:16 UTC 2023


This is an automated email from the git hooks/post-receive script.

iay pushed a commit to branch main
in repository java-metadata-aggregator.

View the commit online:
http://git.shibboleth.net/view/?p=java-metadata-aggregator.git;a=commit;h=bde2a658904bb644c874d03a544425b7920e3bc3

The following commit(s) were added to refs/heads/main by this push:
     new bde2a65  MDA-158 - Split legacy keylists into separate artifact, resolve package split
bde2a65 is described below

commit bde2a658904bb644c874d03a544425b7920e3bc3
Author: Ian Young <ian at iay.org.uk>
AuthorDate: Fri Apr 21 17:06:58 2023 +0100

    MDA-158 - Split legacy keylists into separate artifact, resolve package split
    
    https://shibboleth.atlassian.net/browse/MDA-158
---
 mda-bom/pom.xml                                    |   5 ++
 mda-distribution/pom.xml                           |   6 +++
 mda-framework/pom.xml                              |  12 +++++
 .../metadata/validate/x509/MDA183Test.java         |  17 +++++--
 .../x509/X509RSAOpenSSLBlacklistValidatorTest.java |  16 +++++++
 .../metadata/validate/x509/MDA183Test-keystore.jks | Bin
 mda-keylists-rsa-legacy/.gitignore                 |   1 +
 .../pom.xml                                        |  34 ++------------
 .../keylists/rsa/legacy}/compromised-1024.txt      |   0
 .../metadata/keylists/rsa/legacy}/debian-1024.txt  |   0
 .../metadata/keylists/rsa/legacy}/debian-512.txt   |   0
 mda-keylists-rsa/pom.xml                           |  28 -----------
 mda-keylists-rsa/src/main/java/.gitkeep            |   0
 .../x509 => keylists/rsa}/compromised-2048.txt     |   0
 .../x509 => keylists/rsa}/debian-2048.txt          |   0
 .../x509 => keylists/rsa}/debian-4096.txt          |   0
 mda-keylists-rsa/src/test/java/.gitkeep            |   0
 .../x509/X509RSAOpenSSLBlacklistValidatorTest.java |  51 ---------------------
 .../src/test/resources/logback-test.xml            |  17 -------
 pom.xml                                            |   1 +
 20 files changed, 57 insertions(+), 131 deletions(-)

diff --git a/mda-bom/pom.xml b/mda-bom/pom.xml
index 1b19447..c6ece94 100644
--- a/mda-bom/pom.xml
+++ b/mda-bom/pom.xml
@@ -22,6 +22,11 @@
                 <artifactId>mda-keylists-rsa</artifactId>
                 <version>${project.version}</version>
             </dependency>
+            <dependency>
+                <groupId>${project.groupId}</groupId>
+                <artifactId>mda-keylists-rsa-legacy</artifactId>
+                <version>${project.version}</version>
+            </dependency>
             <dependency>
                 <groupId>${project.groupId}</groupId>
                 <artifactId>mda-framework</artifactId>
diff --git a/mda-distribution/pom.xml b/mda-distribution/pom.xml
index 05b7a7f..e3641cb 100644
--- a/mda-distribution/pom.xml
+++ b/mda-distribution/pom.xml
@@ -38,6 +38,12 @@
             <version>${project.version}</version>
             <scope>runtime</scope>
         </dependency>
+        <dependency>
+            <groupId>${project.groupId}</groupId>
+            <artifactId>mda-keylists-rsa-legacy</artifactId>
+            <version>${project.version}</version>
+            <scope>runtime</scope>
+        </dependency>
         <dependency>
             <groupId>ch.qos.logback</groupId>
             <artifactId>logback-classic</artifactId>
diff --git a/mda-framework/pom.xml b/mda-framework/pom.xml
index 0bb81a4..5e15892 100644
--- a/mda-framework/pom.xml
+++ b/mda-framework/pom.xml
@@ -76,6 +76,18 @@
         </dependency>
 
         <!-- Test Dependencies -->
+        <dependency>
+            <groupId>${project.groupId}</groupId>
+            <artifactId>mda-keylists-rsa</artifactId>
+            <version>${project.version}</version>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
+            <groupId>${project.groupId}</groupId>
+            <artifactId>mda-keylists-rsa-legacy</artifactId>
+            <version>${project.version}</version>
+            <scope>test</scope>
+        </dependency>
         <dependency>
             <groupId>net.shibboleth</groupId>
             <artifactId>shib-spring</artifactId>
diff --git a/mda-keylists-rsa/src/test/java/net/shibboleth/metadata/validate/x509/MDA183Test.java b/mda-framework/src/test/java/net/shibboleth/metadata/validate/x509/MDA183Test.java
similarity index 91%
rename from mda-keylists-rsa/src/test/java/net/shibboleth/metadata/validate/x509/MDA183Test.java
rename to mda-framework/src/test/java/net/shibboleth/metadata/validate/x509/MDA183Test.java
index b6577b0..b451156 100644
--- a/mda-keylists-rsa/src/test/java/net/shibboleth/metadata/validate/x509/MDA183Test.java
+++ b/mda-framework/src/test/java/net/shibboleth/metadata/validate/x509/MDA183Test.java
@@ -96,14 +96,23 @@ public class MDA183Test extends BaseTest {
     }
 
     private Validator<X509Certificate> getValidator(final int keySize) throws Exception {
-        // pick up the blacklist resource
-        final Resource blacklistResource =
-                new ClassPathResource("net/shibboleth/metadata/validate/x509/compromised-" + keySize + ".txt");
+        // pick up the appropriate keylist resource
+        final @Nonnull Resource keylistResource;
+        switch (keySize) {
+        case 1024:
+            keylistResource = new ClassPathResource("net/shibboleth/metadata/keylists/rsa/legacy/compromised-1024.txt");
+            break;
+        case 2048:
+            keylistResource = new ClassPathResource("net/shibboleth/metadata/keylists/rsa/compromised-2048.txt");
+            break;
+        default:
+            throw new IllegalArgumentException();
+        }
 
         // create a validator
         final X509RSAOpenSSLBlacklistValidator val = new X509RSAOpenSSLBlacklistValidator();
         val.setId("validator-" + keySize);
-        val.setBlacklistResource(blacklistResource);
+        val.setBlacklistResource(keylistResource);
         val.setKeySize(keySize);
         val.initialize();
 
diff --git a/mda-framework/src/test/java/net/shibboleth/metadata/validate/x509/X509RSAOpenSSLBlacklistValidatorTest.java b/mda-framework/src/test/java/net/shibboleth/metadata/validate/x509/X509RSAOpenSSLBlacklistValidatorTest.java
index fb1b610..42dbd53 100644
--- a/mda-framework/src/test/java/net/shibboleth/metadata/validate/x509/X509RSAOpenSSLBlacklistValidatorTest.java
+++ b/mda-framework/src/test/java/net/shibboleth/metadata/validate/x509/X509RSAOpenSSLBlacklistValidatorTest.java
@@ -21,6 +21,7 @@ package net.shibboleth.metadata.validate.x509;
 import java.io.IOException;
 import java.security.cert.X509Certificate;
 
+import org.springframework.core.io.ClassPathResource;
 import org.testng.Assert;
 import org.testng.annotations.Test;
 
@@ -210,4 +211,19 @@ public class X509RSAOpenSSLBlacklistValidatorTest extends BaseX509ValidatorTest
         val.initialize();
     }
 
+
+    @Test
+    public void classPathResource() throws Exception {
+        final X509RSAOpenSSLBlacklistValidator val = new X509RSAOpenSSLBlacklistValidator();
+        val.setBlacklistResource(new ClassPathResource("net/shibboleth/metadata/keylists/rsa/debian-2048.txt"));
+        val.setKeySize(2048);
+        val.setId("test");
+        val.initialize();
+
+        final Item<String> item = new MockItem("foo");
+        final X509Certificate cert = getCertificate("2048.pem");
+        Assert.assertEquals(val.validate(cert, item, "stage"), Validator.Action.CONTINUE);
+        errorsAndWarnings(item, 1, 0);
+    }
+
 }
diff --git a/mda-keylists-rsa/src/test/resources/net/shibboleth/metadata/validate/x509/MDA183Test-keystore.jks b/mda-framework/src/test/resources/net/shibboleth/metadata/validate/x509/MDA183Test-keystore.jks
similarity index 100%
rename from mda-keylists-rsa/src/test/resources/net/shibboleth/metadata/validate/x509/MDA183Test-keystore.jks
rename to mda-framework/src/test/resources/net/shibboleth/metadata/validate/x509/MDA183Test-keystore.jks
diff --git a/mda-keylists-rsa-legacy/.gitignore b/mda-keylists-rsa-legacy/.gitignore
new file mode 100644
index 0000000..b83d222
--- /dev/null
+++ b/mda-keylists-rsa-legacy/.gitignore
@@ -0,0 +1 @@
+/target/
diff --git a/mda-keylists-rsa/pom.xml b/mda-keylists-rsa-legacy/pom.xml
similarity index 56%
copy from mda-keylists-rsa/pom.xml
copy to mda-keylists-rsa-legacy/pom.xml
index 95f261e..a9e14c9 100644
--- a/mda-keylists-rsa/pom.xml
+++ b/mda-keylists-rsa-legacy/pom.xml
@@ -10,12 +10,12 @@
         <version>0.10.0-SNAPSHOT</version>
     </parent>
 
-    <name>RSA Key Lists</name>
-    <artifactId>mda-keylists-rsa</artifactId>
+    <name>Legacy RSA Key Lists</name>
+    <artifactId>mda-keylists-rsa-legacy</artifactId>
     <packaging>jar</packaging>
 
     <properties>
-        <automatic.module.name>net.shibboleth.metadata.keylists.rsa</automatic.module.name>
+        <automatic.module.name>net.shibboleth.metadata.keylists.rsa.legacy</automatic.module.name>
         <checkstyle.configLocation>${project.basedir}/../resources/checkstyle/checkstyle.xml</checkstyle.configLocation>
     </properties>
 
@@ -27,34 +27,6 @@
         <!-- Runtime Dependencies -->
 
         <!-- Test Dependencies -->
-        <dependency>
-            <groupId>${project.groupId}</groupId>
-            <artifactId>mda-framework</artifactId>
-            <version>${project.version}</version>
-            <scope>test</scope>
-        </dependency>
-        <dependency>
-            <groupId>${project.groupId}</groupId>
-            <artifactId>mda-framework</artifactId>
-            <version>${project.version}</version>
-            <type>test-jar</type>
-            <scope>test</scope>
-        </dependency>
-        <dependency>
-            <groupId>net.shibboleth</groupId>
-            <artifactId>shib-support</artifactId>
-            <scope>test</scope>
-        </dependency>
-        <dependency>
-            <groupId>commons-codec</groupId>
-            <artifactId>commons-codec</artifactId>
-            <scope>test</scope>
-        </dependency>
-        <dependency>
-           <groupId>org.springframework</groupId>
-           <artifactId>spring-core</artifactId>
-           <scope>test</scope>
-        </dependency>
 
         <!-- Managed Dependencies -->
     </dependencies>
diff --git a/mda-keylists-rsa/src/main/resources/net/shibboleth/metadata/validate/x509/compromised-1024.txt b/mda-keylists-rsa-legacy/src/main/resources/net/shibboleth/metadata/keylists/rsa/legacy/compromised-1024.txt
similarity index 100%
rename from mda-keylists-rsa/src/main/resources/net/shibboleth/metadata/validate/x509/compromised-1024.txt
rename to mda-keylists-rsa-legacy/src/main/resources/net/shibboleth/metadata/keylists/rsa/legacy/compromised-1024.txt
diff --git a/mda-keylists-rsa/src/main/resources/net/shibboleth/metadata/validate/x509/debian-1024.txt b/mda-keylists-rsa-legacy/src/main/resources/net/shibboleth/metadata/keylists/rsa/legacy/debian-1024.txt
similarity index 100%
rename from mda-keylists-rsa/src/main/resources/net/shibboleth/metadata/validate/x509/debian-1024.txt
rename to mda-keylists-rsa-legacy/src/main/resources/net/shibboleth/metadata/keylists/rsa/legacy/debian-1024.txt
diff --git a/mda-keylists-rsa/src/main/resources/net/shibboleth/metadata/validate/x509/debian-512.txt b/mda-keylists-rsa-legacy/src/main/resources/net/shibboleth/metadata/keylists/rsa/legacy/debian-512.txt
similarity index 100%
rename from mda-keylists-rsa/src/main/resources/net/shibboleth/metadata/validate/x509/debian-512.txt
rename to mda-keylists-rsa-legacy/src/main/resources/net/shibboleth/metadata/keylists/rsa/legacy/debian-512.txt
diff --git a/mda-keylists-rsa/pom.xml b/mda-keylists-rsa/pom.xml
index 95f261e..74df9c8 100644
--- a/mda-keylists-rsa/pom.xml
+++ b/mda-keylists-rsa/pom.xml
@@ -27,34 +27,6 @@
         <!-- Runtime Dependencies -->
 
         <!-- Test Dependencies -->
-        <dependency>
-            <groupId>${project.groupId}</groupId>
-            <artifactId>mda-framework</artifactId>
-            <version>${project.version}</version>
-            <scope>test</scope>
-        </dependency>
-        <dependency>
-            <groupId>${project.groupId}</groupId>
-            <artifactId>mda-framework</artifactId>
-            <version>${project.version}</version>
-            <type>test-jar</type>
-            <scope>test</scope>
-        </dependency>
-        <dependency>
-            <groupId>net.shibboleth</groupId>
-            <artifactId>shib-support</artifactId>
-            <scope>test</scope>
-        </dependency>
-        <dependency>
-            <groupId>commons-codec</groupId>
-            <artifactId>commons-codec</artifactId>
-            <scope>test</scope>
-        </dependency>
-        <dependency>
-           <groupId>org.springframework</groupId>
-           <artifactId>spring-core</artifactId>
-           <scope>test</scope>
-        </dependency>
 
         <!-- Managed Dependencies -->
     </dependencies>
diff --git a/mda-keylists-rsa/src/main/java/.gitkeep b/mda-keylists-rsa/src/main/java/.gitkeep
deleted file mode 100644
index e69de29..0000000
diff --git a/mda-keylists-rsa/src/main/resources/net/shibboleth/metadata/validate/x509/compromised-2048.txt b/mda-keylists-rsa/src/main/resources/net/shibboleth/metadata/keylists/rsa/compromised-2048.txt
similarity index 100%
rename from mda-keylists-rsa/src/main/resources/net/shibboleth/metadata/validate/x509/compromised-2048.txt
rename to mda-keylists-rsa/src/main/resources/net/shibboleth/metadata/keylists/rsa/compromised-2048.txt
diff --git a/mda-keylists-rsa/src/main/resources/net/shibboleth/metadata/validate/x509/debian-2048.txt b/mda-keylists-rsa/src/main/resources/net/shibboleth/metadata/keylists/rsa/debian-2048.txt
similarity index 100%
rename from mda-keylists-rsa/src/main/resources/net/shibboleth/metadata/validate/x509/debian-2048.txt
rename to mda-keylists-rsa/src/main/resources/net/shibboleth/metadata/keylists/rsa/debian-2048.txt
diff --git a/mda-keylists-rsa/src/main/resources/net/shibboleth/metadata/validate/x509/debian-4096.txt b/mda-keylists-rsa/src/main/resources/net/shibboleth/metadata/keylists/rsa/debian-4096.txt
similarity index 100%
rename from mda-keylists-rsa/src/main/resources/net/shibboleth/metadata/validate/x509/debian-4096.txt
rename to mda-keylists-rsa/src/main/resources/net/shibboleth/metadata/keylists/rsa/debian-4096.txt
diff --git a/mda-keylists-rsa/src/test/java/.gitkeep b/mda-keylists-rsa/src/test/java/.gitkeep
deleted file mode 100644
index e69de29..0000000
diff --git a/mda-keylists-rsa/src/test/java/net/shibboleth/metadata/validate/x509/X509RSAOpenSSLBlacklistValidatorTest.java b/mda-keylists-rsa/src/test/java/net/shibboleth/metadata/validate/x509/X509RSAOpenSSLBlacklistValidatorTest.java
deleted file mode 100644
index 9464ee2..0000000
--- a/mda-keylists-rsa/src/test/java/net/shibboleth/metadata/validate/x509/X509RSAOpenSSLBlacklistValidatorTest.java
+++ /dev/null
@@ -1,51 +0,0 @@
-/*
- * Licensed to the University Corporation for Advanced Internet Development,
- * Inc. (UCAID) under one or more contributor license agreements.  See the
- * NOTICE file distributed with this work for additional information regarding
- * copyright ownership. The UCAID 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 net.shibboleth.metadata.validate.x509;
-
-import java.security.cert.X509Certificate;
-
-import org.springframework.core.io.ClassPathResource;
-import org.testng.Assert;
-import org.testng.annotations.Test;
-
-import net.shibboleth.metadata.Item;
-import net.shibboleth.metadata.testing.MockItem;
-import net.shibboleth.metadata.validate.Validator;
-
-public class X509RSAOpenSSLBlacklistValidatorTest extends BaseX509ValidatorTest {
-
-    public X509RSAOpenSSLBlacklistValidatorTest() throws Exception {
-        super(X509RSAOpenSSLBlacklistValidator.class);
-    }
-
-    @Test
-    public void classPathResource() throws Exception {
-        final X509RSAOpenSSLBlacklistValidator val = new X509RSAOpenSSLBlacklistValidator();
-        val.setBlacklistResource(new ClassPathResource("net/shibboleth/metadata/validate/x509/debian-2048.txt"));
-        val.setKeySize(2048);
-        val.setId("test");
-        val.initialize();
-
-        final Item<String> item = new MockItem("foo");
-        final X509Certificate cert = getCertificate("2048.pem");
-        Assert.assertEquals(val.validate(cert, item, "stage"), Validator.Action.CONTINUE);
-        errorsAndWarnings(item, 1, 0);
-    }
-
-}
diff --git a/mda-keylists-rsa/src/test/resources/logback-test.xml b/mda-keylists-rsa/src/test/resources/logback-test.xml
deleted file mode 100644
index f3280e5..0000000
--- a/mda-keylists-rsa/src/test/resources/logback-test.xml
+++ /dev/null
@@ -1,17 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-
-<configuration>
-
-    <appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
-        <encoder class="ch.qos.logback.classic.encoder.PatternLayoutEncoder">
-            <pattern>%level [%logger:%line] - %msg%n</pattern>
-            <charset>UTF-8</charset>
-        </encoder>
-    </appender>
-
-    <root>
-        <level value="warn" />
-        <appender-ref ref="STDOUT" />
-    </root>
-    
-</configuration>
\ No newline at end of file
diff --git a/pom.xml b/pom.xml
index 08fe186..d453675 100644
--- a/pom.xml
+++ b/pom.xml
@@ -26,6 +26,7 @@
 
     <modules>
         <module>mda-keylists-rsa</module>
+        <module>mda-keylists-rsa-legacy</module>
         <module>mda-framework</module>
         <module>mda-cli</module>
         <module>mda-distribution</module>

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the commits mailing list