[java-opensaml] branch main updated: Duplicate a small test class to excise another test-jar dependency.

Scott Cantor cantor.2 at osu.edu
Thu Sep 15 14:45:00 UTC 2022


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

scantor pushed a commit to branch main
in repository java-opensaml.

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

The following commit(s) were added to refs/heads/main by this push:
     new fdf1b256c Duplicate a small test class to excise another test-jar dependency.
fdf1b256c is described below

commit fdf1b256c0de5d9e8c69b61833b4671e63c22ad5
Author: Scott Cantor <cantor.2 at osu.edu>
AuthorDate: Thu Sep 15 10:44:57 2022 -0400

    Duplicate a small test class to excise another test-jar dependency.
---
 opensaml-saml-impl/pom.xml                         |  7 ---
 .../saml/saml2/encryption/tests/ECDHTest.java      |  1 -
 .../tests/XMLSecurityTestingSupport.java           | 66 ++++++++++++++++++++++
 3 files changed, 66 insertions(+), 8 deletions(-)

diff --git a/opensaml-saml-impl/pom.xml b/opensaml-saml-impl/pom.xml
index 1e244b3de..1adc28eae 100644
--- a/opensaml-saml-impl/pom.xml
+++ b/opensaml-saml-impl/pom.xml
@@ -158,13 +158,6 @@
             <version>${project.version}</version>
             <scope>test</scope>
         </dependency>
-        <dependency>
-            <groupId>${project.groupId}</groupId>
-            <artifactId>opensaml-xmlsec-impl</artifactId>
-            <version>${project.version}</version>
-            <type>test-jar</type>
-            <scope>test</scope>
-        </dependency>
         <dependency>
             <groupId>${project.groupId}</groupId>
             <artifactId>opensaml-testing</artifactId>
diff --git a/opensaml-saml-impl/src/test/java/org/opensaml/saml/saml2/encryption/tests/ECDHTest.java b/opensaml-saml-impl/src/test/java/org/opensaml/saml/saml2/encryption/tests/ECDHTest.java
index 2cdb274c4..1f28f2a92 100644
--- a/opensaml-saml-impl/src/test/java/org/opensaml/saml/saml2/encryption/tests/ECDHTest.java
+++ b/opensaml-saml-impl/src/test/java/org/opensaml/saml/saml2/encryption/tests/ECDHTest.java
@@ -77,7 +77,6 @@ import org.opensaml.xmlsec.keyinfo.impl.KeyInfoProvider;
 import org.opensaml.xmlsec.keyinfo.impl.LocalKeyInfoCredentialResolver;
 import org.opensaml.xmlsec.keyinfo.impl.provider.AgreementMethodKeyInfoProvider;
 import org.opensaml.xmlsec.signature.KeyInfo;
-import org.opensaml.xmlsec.testing.XMLSecurityTestingSupport;
 import org.testng.Assert;
 import org.testng.annotations.BeforeClass;
 import org.testng.annotations.BeforeMethod;
diff --git a/opensaml-saml-impl/src/test/java/org/opensaml/saml/saml2/encryption/tests/XMLSecurityTestingSupport.java b/opensaml-saml-impl/src/test/java/org/opensaml/saml/saml2/encryption/tests/XMLSecurityTestingSupport.java
new file mode 100644
index 000000000..b79129a57
--- /dev/null
+++ b/opensaml-saml-impl/src/test/java/org/opensaml/saml/saml2/encryption/tests/XMLSecurityTestingSupport.java
@@ -0,0 +1,66 @@
+/*
+ * 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 org.opensaml.saml.saml2.encryption.tests;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.opensaml.xmlsec.keyinfo.KeyInfoCredentialResolver;
+import org.opensaml.xmlsec.keyinfo.impl.BasicProviderKeyInfoCredentialResolver;
+import org.opensaml.xmlsec.keyinfo.impl.KeyInfoProvider;
+import org.opensaml.xmlsec.keyinfo.impl.provider.DEREncodedKeyValueProvider;
+import org.opensaml.xmlsec.keyinfo.impl.provider.DSAKeyValueProvider;
+import org.opensaml.xmlsec.keyinfo.impl.provider.ECKeyValueProvider;
+import org.opensaml.xmlsec.keyinfo.impl.provider.InlineX509DataProvider;
+import org.opensaml.xmlsec.keyinfo.impl.provider.RSAKeyValueProvider;
+
+/**
+ * Helper methods for security-related requirements.
+ * 
+ * <p>This was copied from -xmlsec-impl to pull a test-jar dependency.
+ */
+public final class XMLSecurityTestingSupport {
+    
+    private XMLSecurityTestingSupport() { }
+
+    /**
+     * Get a basic KeyInfo credential resolver which can process standard inline
+     * data - RSAKeyValue, DSAKeyValue, X509Data.
+     * 
+     * @return a new KeyInfoCredentialResolver instance
+     */
+    public static KeyInfoCredentialResolver buildBasicInlineKeyInfoResolver() {
+        return new BasicProviderKeyInfoCredentialResolver(getBasicInlineKeyInfoProviders());
+    }
+    
+    /**
+     * Get a list of basic inline providers.
+     * 
+     * @return list of providers
+     */
+    public static List<KeyInfoProvider> getBasicInlineKeyInfoProviders() {
+        List<KeyInfoProvider> providers = new ArrayList<>();
+        providers.add( new RSAKeyValueProvider() );
+        providers.add( new DSAKeyValueProvider() );
+        providers.add( new ECKeyValueProvider() );
+        providers.add( new DEREncodedKeyValueProvider() );
+        providers.add( new InlineX509DataProvider() );
+        return providers;
+    }
+
+}
\ No newline at end of file

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


More information about the commits mailing list