[java-opensaml] 01/02: OSJ-307: Support Santuario's XMLParser interface

Brent Putman putmanb at georgetown.edu
Fri Aug 11 00:52:48 UTC 2023


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

putmanb 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=3efd0b71e8335718b64abeaeb94ab221bddfcb69

commit 3efd0b71e8335718b64abeaeb94ab221bddfcb69
Author: Brent Putman <putmanb at georgetown.edu>
AuthorDate: Thu Aug 10 20:27:27 2023 -0400

    OSJ-307: Support Santuario's XMLParser interface
    
    Move parser and test out of signing provider package and into own
    package, since isn't limited to signing cases.
    
    In initializer make use of class literal getName() instead of hardcoding
    the class name in system property.
---
 .../config/impl/ApacheXMLSecurityInitializer.java     |  5 ++---
 .../impl/provider/ApacheSantuarioXMLParser.java       |  2 +-
 .../opensaml/xmlsec/impl/provider/package-info.java   | 19 +++++++++++++++++++
 .../impl/provider/ApacheSantuarioXMLParserTest.java   |  2 +-
 4 files changed, 23 insertions(+), 5 deletions(-)

diff --git a/opensaml-xmlsec-impl/src/main/java/org/opensaml/xmlsec/config/impl/ApacheXMLSecurityInitializer.java b/opensaml-xmlsec-impl/src/main/java/org/opensaml/xmlsec/config/impl/ApacheXMLSecurityInitializer.java
index 36134f10f..de44b4170 100644
--- a/opensaml-xmlsec-impl/src/main/java/org/opensaml/xmlsec/config/impl/ApacheXMLSecurityInitializer.java
+++ b/opensaml-xmlsec-impl/src/main/java/org/opensaml/xmlsec/config/impl/ApacheXMLSecurityInitializer.java
@@ -22,7 +22,7 @@ import org.apache.xml.security.Init;
 import org.opensaml.core.config.ConfigurationService;
 import org.opensaml.core.config.InitializationException;
 import org.opensaml.core.config.Initializer;
-import org.opensaml.xmlsec.signature.support.impl.provider.ApacheSantuarioXMLParser;
+import org.opensaml.xmlsec.impl.provider.ApacheSantuarioXMLParser;
 import org.slf4j.Logger;
 
 import net.shibboleth.shared.annotation.constraint.NotEmpty;
@@ -58,8 +58,7 @@ public class ApacheXMLSecurityInitializer implements Initializer {
             // Don't override if it was set explicitly
             if (System.getProperty(xmlParserPropName) == null) {
                 log.trace("Enabling use of ApacheSantuarioXMLParser");
-                System.setProperty(xmlParserPropName,
-                        "org.opensaml.xmlsec.signature.support.impl.provider.ApacheSantuarioXMLParser");
+                System.setProperty(xmlParserPropName, ApacheSantuarioXMLParser.class.getName());
             }
         }
 
diff --git a/opensaml-xmlsec-impl/src/main/java/org/opensaml/xmlsec/signature/support/impl/provider/ApacheSantuarioXMLParser.java b/opensaml-xmlsec-impl/src/main/java/org/opensaml/xmlsec/impl/provider/ApacheSantuarioXMLParser.java
similarity index 98%
rename from opensaml-xmlsec-impl/src/main/java/org/opensaml/xmlsec/signature/support/impl/provider/ApacheSantuarioXMLParser.java
rename to opensaml-xmlsec-impl/src/main/java/org/opensaml/xmlsec/impl/provider/ApacheSantuarioXMLParser.java
index d3c8473ab..bab19a531 100644
--- a/opensaml-xmlsec-impl/src/main/java/org/opensaml/xmlsec/signature/support/impl/provider/ApacheSantuarioXMLParser.java
+++ b/opensaml-xmlsec-impl/src/main/java/org/opensaml/xmlsec/impl/provider/ApacheSantuarioXMLParser.java
@@ -12,7 +12,7 @@
  * limitations under the License.
  */
 
-package org.opensaml.xmlsec.signature.support.impl.provider;
+package org.opensaml.xmlsec.impl.provider;
 
 import java.io.InputStream;
 import java.util.Properties;
diff --git a/opensaml-xmlsec-impl/src/main/java/org/opensaml/xmlsec/impl/provider/package-info.java b/opensaml-xmlsec-impl/src/main/java/org/opensaml/xmlsec/impl/provider/package-info.java
new file mode 100644
index 000000000..085acb19f
--- /dev/null
+++ b/opensaml-xmlsec-impl/src/main/java/org/opensaml/xmlsec/impl/provider/package-info.java
@@ -0,0 +1,19 @@
+/*
+ * Licensed 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.
+ */
+
+/** Provides implementation of Santuario-specific components. */
+ at NonnullElements
+package org.opensaml.xmlsec.impl.provider;
+
+import net.shibboleth.shared.annotation.constraint.NonnullElements;
diff --git a/opensaml-xmlsec-impl/src/test/java/org/opensaml/xmlsec/signature/support/impl/provider/ApacheSantuarioXMLParserTest.java b/opensaml-xmlsec-impl/src/test/java/org/opensaml/xmlsec/impl/provider/ApacheSantuarioXMLParserTest.java
similarity index 97%
rename from opensaml-xmlsec-impl/src/test/java/org/opensaml/xmlsec/signature/support/impl/provider/ApacheSantuarioXMLParserTest.java
rename to opensaml-xmlsec-impl/src/test/java/org/opensaml/xmlsec/impl/provider/ApacheSantuarioXMLParserTest.java
index 35caf0d7b..7c2cc6953 100644
--- a/opensaml-xmlsec-impl/src/test/java/org/opensaml/xmlsec/signature/support/impl/provider/ApacheSantuarioXMLParserTest.java
+++ b/opensaml-xmlsec-impl/src/test/java/org/opensaml/xmlsec/impl/provider/ApacheSantuarioXMLParserTest.java
@@ -12,7 +12,7 @@
  * limitations under the License.
  */
 
-package org.opensaml.xmlsec.signature.support.impl.provider;
+package org.opensaml.xmlsec.impl.provider;
 
 import java.io.IOException;
 import java.io.InputStream;

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


More information about the commits mailing list