This is an automated email from the ASF dual-hosted git repository.
garydgregory pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/commons-xml.git
The following commit(s) were added to refs/heads/main by this push:
new 3b25119 Rename Java package from `org.apache.commons.xml` to
`org.apache.commons.xml.secure`
3b25119 is described below
commit 3b25119ae6f20fd660f6f22dbb0279888fc1aa08
Author: Gary Gregory <[email protected]>
AuthorDate: Sun Aug 30 17:29:16 2026 -0400
Rename Java package from `org.apache.commons.xml` to
`org.apache.commons.xml.secure`
---
RELEASE-NOTES.txt | 4 +-
android-tests/build.gradle.kts | 2 +-
pom.xml | 8 ++--
src/changes/changes.xml | 4 +-
.../FallbackIgnoreEntityResolver2.java | 2 +-
.../FallbackIgnoreLSResourceResolver.java | 2 +-
.../{ => secure}/FallbackIgnoreURIResolver.java | 2 +-
.../{ => secure}/FallbackIgnoreXMLResolver.java | 2 +-
.../xml/{ => secure}/MethodHandleFactory.java | 2 +-
.../commons/xml/{ => secure}/SaxonProvider.java | 2 +-
.../xml/{ => secure}/SecureDocumentBuilder.java | 2 +-
.../{ => secure}/SecureDocumentBuilderFactory.java | 8 ++--
.../commons/xml/{ => secure}/SecureException.java | 4 +-
.../commons/xml/{ => secure}/SecureSAXParser.java | 2 +-
.../xml/{ => secure}/SecureSAXParserFactory.java | 8 ++--
.../commons/xml/{ => secure}/SecureSchema.java | 2 +-
.../xml/{ => secure}/SecureSchemaFactory.java | 8 ++--
.../commons/xml/{ => secure}/SecureTemplates.java | 2 +-
.../xml/{ => secure}/SecureTemplatesHandler.java | 2 +-
.../xml/{ => secure}/SecureTransformer.java | 2 +-
.../xml/{ => secure}/SecureTransformerFactory.java | 12 ++---
.../xml/{ => secure}/SecureTransformerHandler.java | 2 +-
.../commons/xml/{ => secure}/SecureValidator.java | 2 +-
.../xml/{ => secure}/SecureValidatorHandler.java | 2 +-
.../commons/xml/{ => secure}/SecureXMLFilter.java | 2 +-
.../xml/{ => secure}/SecureXMLInputFactory.java | 8 ++--
.../commons/xml/{ => secure}/SecureXMLReader.java | 2 +-
.../commons/xml/{ => secure}/SecureXPath.java | 2 +-
.../xml/{ => secure}/SecureXPathExpression.java | 2 +-
.../xml/{ => secure}/SecureXPathFactory.java | 8 ++--
.../commons/xml/{ => secure}/doc-files/leaf.svg | 0
.../commons/xml/{ => secure}/doc-files/logo.png | Bin
.../commons/xml/{ => secure}/doc-files/rewrite.yml | 14 +++---
.../commons/xml/{ => secure}/package-info.java | 4 +-
src/main/javadoc/overview.html | 50 ++++++++++-----------
src/site/markdown/index.md | 2 +-
src/site/markdown/shading.md | 2 +-
src/site/markdown/threat_model.md | 20 ++++-----
.../xml/{ => secure}/AssociatedStylesheetTest.java | 2 +-
.../xml/{ => secure}/AttackTestSupport.java | 4 +-
.../xml/{ => secure}/BillionLaughsTest.java | 2 +-
.../xml/{ => secure}/DenyUnresolvedTest.java | 2 +-
.../commons/xml/{ => secure}/DoctypeOnlyTest.java | 2 +-
.../xml/{ => secure}/EntityResolverFloorTest.java | 6 +--
.../commons/xml/{ => secure}/ExternalDtdTest.java | 2 +-
.../{ => secure}/ExternalGeneralEntityTest.java | 2 +-
.../{ => secure}/ExternalParameterEntityTest.java | 2 +-
.../FallbackIgnoreEntityResolver2Test.java | 2 +-
.../FallbackIgnoreLSResourceResolverTest.java | 2 +-
.../FallbackIgnoreURIResolverTest.java | 2 +-
.../FallbackIgnoreXMLResolverTest.java | 2 +-
.../xml/{ => secure}/MethodHandleFactoryTest.java | 2 +-
.../commons/xml/{ => secure}/NoDoctypeTest.java | 2 +-
.../{ => secure}/OverrideDefaultParserTest.java | 2 +-
.../commons/xml/{ => secure}/ResetSecureTest.java | 2 +-
.../xml/{ => secure}/SaxSurfaceTestSupport.java | 2 +-
.../{ => secure}/SaxonAlternateFactoryTest.java | 2 +-
.../xml/{ => secure}/SaxonProviderTest.java | 2 +-
.../{ => secure}/SaxonXPathExternalCallsTest.java | 2 +-
.../{ => secure}/SchemaFactoryLanguageTest.java | 2 +-
.../commons/xml/{ => secure}/SchemaImportTest.java | 2 +-
.../xml/{ => secure}/SchemaIncludeTest.java | 2 +-
.../xml/{ => secure}/SchemaLocationDomTest.java | 6 +--
.../{ => secure}/SchemaLocationPropertyTest.java | 16 +++----
.../xml/{ => secure}/SchemaLocationSaxTest.java | 6 +--
.../xml/{ => secure}/SchemaRedefineTest.java | 2 +-
.../SecureDocumentBuilderFactoryTest.java | 2 +-
.../{ => secure}/SecureDocumentBuilderTest.java | 2 +-
.../xml/{ => secure}/SecureExceptionTest.java | 2 +-
.../xml/{ => secure}/SecureFactoriesSmokeTest.java | 6 +--
.../{ => secure}/SecureSAXParserFactoryTest.java | 2 +-
.../xml/{ => secure}/SecureSAXParserTest.java | 2 +-
.../xml/{ => secure}/SecureSchemaFactoryTest.java | 2 +-
.../commons/xml/{ => secure}/SecureSchemaTest.java | 2 +-
.../{ => secure}/SecureTemplatesHandlerTest.java | 2 +-
.../xml/{ => secure}/SecureTemplatesTest.java | 2 +-
.../{ => secure}/SecureTransformerFactoryTest.java | 4 +-
.../{ => secure}/SecureTransformerHandlerTest.java | 2 +-
.../xml/{ => secure}/SecureTransformerTest.java | 2 +-
.../{ => secure}/SecureValidatorHandlerTest.java | 2 +-
.../xml/{ => secure}/SecureValidatorTest.java | 2 +-
.../xml/{ => secure}/SecureXMLFilterTest.java | 3 +-
.../{ => secure}/SecureXMLInputFactoryTest.java | 4 +-
.../xml/{ => secure}/SecureXMLReaderTest.java | 2 +-
.../{ => secure}/SecureXPathExpressionTest.java | 4 +-
.../xml/{ => secure}/SecureXPathFactoryTest.java | 2 +-
.../commons/xml/{ => secure}/SecureXPathTest.java | 2 +-
.../xml/{ => secure}/ShadingFootprintTest.java | 6 +--
.../xml/{ => secure}/TemplatesHandlerTest.java | 2 +-
.../xml/{ => secure}/TemplatesImportTest.java | 2 +-
.../xml/{ => secure}/TemplatesIncludeTest.java | 2 +-
.../commons/xml/{ => secure}/TestConstants.java | 2 +-
.../xml/{ => secure}/TransformerDocumentTest.java | 2 +-
.../xml/{ => secure}/TransformerHandlerTest.java | 2 +-
.../UnsupportedXmlImplementationTest.java | 2 +-
.../commons/xml/{ => secure}/XIncludeTest.java | 12 ++---
.../xml/{ => secure}/XMLFilterParseStringTest.java | 2 +-
.../commons/xml/{ => secure}/XMLFilterTest.java | 2 +-
.../xml/{ => secure}/XPathInputSourceTest.java | 2 +-
.../org/apache/commons/xml/DescriptorIT.java | 2 +-
100 files changed, 189 insertions(+), 192 deletions(-)
diff --git a/RELEASE-NOTES.txt b/RELEASE-NOTES.txt
index 2170cae..9e0102a 100644
--- a/RELEASE-NOTES.txt
+++ b/RELEASE-NOTES.txt
@@ -30,7 +30,7 @@ New features
------------
* This is the first release of Apache Commons Secure XML.
Thanks to Piotr P. Karwasz, Gary Gregory.
-* Add secure-by-default JAXP factory creation via
org.apache.commons.xml, donated from the copernik-xml-factory project
(https://github.com/copernik-eu/copernik-xml-factory) and covering the stock
JDK, Android, Apache Xalan, Apache Xerces, Woodstox, and Saxon-HE. Thanks to
Piotr P. Karwasz, Gary Gregory.
+* Add secure-by-default JAXP factory creation via
org.apache.commons.xml.secure, donated from the copernik-xml-factory project
(https://github.com/copernik-eu/copernik-xml-factory) and covering the stock
JDK, Android, Apache Xalan, Apache Xerces, Woodstox, and Saxon-HE. Thanks to
Piotr P. Karwasz, Gary Gregory.
* COMMONSXML-9: Install a non-removable resolver floor on every resolver
channel (EntityResolver, LSResourceResolver, URIResolver, and XMLResolver),
routing caller-supplied resolvers through it as allow-lists. Thanks to Piotr P.
Karwasz, Gary Gregory.
* Secure the SAXTransformerFactory extension surface
(TransformerHandler, TemplatesHandler, and XMLFilter) and
TransformerFactory.getAssociatedStylesheet. Thanks to Piotr P. Karwasz, Gary
Gregory.
* Document the threat model on the project site, including
the denied-fetch contract and the supported runtime floor (OpenJDK 8 and
Android API 33 or later). Thanks to Piotr P. Karwasz, Jarek Potiuk, Gary
Gregory.
@@ -51,7 +51,7 @@ Changes
-------
* COMMONSXML-1,COMMONSXML-5,COMMONSXML-6,COMMONSXML-7,COMMONSXML-8: Recognize
XML implementations by the JAXP features and properties they support instead of
by their implementation class name, extending the securing to any compliant
implementation. Thanks to Piotr P. Karwasz, Gary Gregory.
-* COMMONSXML-4: Define a consistent contract for denied external fetches:
unresolved external references resolve to empty content on every
implementation, unless the org.apache.commons.xml.throwOnUnresolved system
property requests rejection. Thanks to Piotr P. Karwasz, Gary Gregory.
+* COMMONSXML-4: Define a consistent contract for denied external fetches:
unresolved external references resolve to empty content on every
implementation, unless the org.apache.commons.xml.secure.throwOnUnresolved
system property requests rejection. Thanks to Piotr P. Karwasz, Gary Gregory.
* COMMONSXML-3: Reduce the shaded footprint by splitting the secure classes
and resolver floors into independent entry points. Thanks to Piotr P. Karwasz,
Gary Gregory.
Removed
diff --git a/android-tests/build.gradle.kts b/android-tests/build.gradle.kts
index 61dbe2f..c5fd720 100644
--- a/android-tests/build.gradle.kts
+++ b/android-tests/build.gradle.kts
@@ -27,7 +27,7 @@ val libraryVersion = "1.0.0-SNAPSHOT"
val libraryJar =
rootProject.file("../target/commons-secure-xml-${libraryVersion}.jar")
android {
- namespace = "org.apache.commons.xml.androidtests"
+ namespace = "org.apache.commons.xml.secure.androidtests"
compileSdk = 34
defaultConfig {
diff --git a/pom.xml b/pom.xml
index c6f10d1..0f67c6a 100644
--- a/pom.xml
+++ b/pom.xml
@@ -48,12 +48,12 @@ limitations under the License.
<commons.release.next>1.0.1</commons.release.next>
<commons.componentid>xml</commons.componentid>
<commons.packageId>xml</commons.packageId>
- <commons.module.name>org.apache.commons.xml</commons.module.name>
+ <commons.module.name>org.apache.commons.xml.secure</commons.module.name>
<commons.jira.id>COMMONSXML</commons.jira.id>
<commons.scmPubUrl>https://svn.apache.org/repos/infra/websites/production/commons/content/proper/commons-secure-xml</commons.scmPubUrl>
<!-- OSGi bundle metadata: override commons-parent's org.apache.commons.*
defaults. -->
-
<commons.osgi.symbolicName>org.apache.commons.xml</commons.osgi.symbolicName>
-
<commons.osgi.export>org.apache.commons.xml.*;version=${project.version};-noimport:=true</commons.osgi.export>
+
<commons.osgi.symbolicName>org.apache.commons.xml.secure</commons.osgi.symbolicName>
+
<commons.osgi.export>org.apache.commons.xml.secure.*;version=${project.version};-noimport:=true</commons.osgi.export>
<!-- The negation drops the JDK-internal package bnd infers from the
reflective Java 8 fallback in SecureXMLInputFactory.newDefaultFactory(). -->
<commons.osgi.import>
!com.sun.xml.internal.stream,
@@ -180,7 +180,7 @@ limitations under the License.
<artifactId>maven-surefire-plugin</artifactId>
<!--
Make the underlying JAXP factories as permissive as the JDK allows.
Secure factories produced by
- org.apache.commons.xml should still block every attack the test
suite throws at them; if a test passes only
+ org.apache.commons.xml.secure should still block every attack the
test suite throws at them; if a test passes only
because the JDK's defaults intervened, we want it to fail here so
the gap shows up.
Inherited by every execution defined below.
diff --git a/src/changes/changes.xml b/src/changes/changes.xml
index 74bec26..64685ed 100644
--- a/src/changes/changes.xml
+++ b/src/changes/changes.xml
@@ -35,7 +35,7 @@ The <action> type attribute can be add, update, fix, or
remove.
<!-- SPECIAL -->
<action type="add" dev="ggregory" due-to="Piotr P. Karwasz, Gary
Gregory">This is the first release of Apache Commons Secure XML.</action>
<!-- ADD -->
- <action type="add" dev="ppkarwasz" due-to="Piotr P. Karwasz, Gary
Gregory">Add secure-by-default JAXP factory creation via
org.apache.commons.xml, donated from the copernik-xml-factory project
(https://github.com/copernik-eu/copernik-xml-factory) and covering the stock
JDK, Android, Apache Xalan, Apache Xerces, Woodstox, and Saxon-HE.</action>
+ <action type="add" dev="ppkarwasz" due-to="Piotr P. Karwasz, Gary
Gregory">Add secure-by-default JAXP factory creation via
org.apache.commons.xml.secure, donated from the copernik-xml-factory project
(https://github.com/copernik-eu/copernik-xml-factory) and covering the stock
JDK, Android, Apache Xalan, Apache Xerces, Woodstox, and Saxon-HE.</action>
<action type="add" dev="ppkarwasz" due-to="Piotr P. Karwasz, Gary
Gregory" issue="COMMONSXML-9">Install a non-removable resolver floor on every
resolver channel (EntityResolver, LSResourceResolver, URIResolver, and
XMLResolver), routing caller-supplied resolvers through it as
allow-lists.</action>
<action type="add" dev="ppkarwasz" due-to="Piotr P. Karwasz, Gary
Gregory">Secure the SAXTransformerFactory extension surface
(TransformerHandler, TemplatesHandler, and XMLFilter) and
TransformerFactory.getAssociatedStylesheet.</action>
<action type="add" dev="ppkarwasz" due-to="Piotr P. Karwasz, Jarek
Potiuk, Gary Gregory">Document the threat model on the project site, including
the denied-fetch contract and the supported runtime floor (OpenJDK 8 and
Android API 33 or later).</action>
@@ -50,7 +50,7 @@ The <action> type attribute can be add, update, fix, or
remove.
<action type="fix" dev="ppkarwasz" due-to="Piotr P. Karwasz, Gary
Gregory">Fall back to the standard factory lookup in the DOM, SAX and schema
newDefaultInstance methods on Android.</action>
<!-- UPDATE -->
<action type="update" dev="ppkarwasz" due-to="Piotr P. Karwasz, Gary
Gregory"
issue="COMMONSXML-1,COMMONSXML-5,COMMONSXML-6,COMMONSXML-7,COMMONSXML-8">Recognize
XML implementations by the JAXP features and properties they support instead
of by their implementation class name, extending the securing to any compliant
implementation.</action>
- <action type="update" dev="ppkarwasz" due-to="Piotr P. Karwasz, Gary
Gregory" issue="COMMONSXML-4">Define a consistent contract for denied external
fetches: unresolved external references resolve to empty content on every
implementation, unless the org.apache.commons.xml.throwOnUnresolved system
property requests rejection.</action>
+ <action type="update" dev="ppkarwasz" due-to="Piotr P. Karwasz, Gary
Gregory" issue="COMMONSXML-4">Define a consistent contract for denied external
fetches: unresolved external references resolve to empty content on every
implementation, unless the org.apache.commons.xml.secure.throwOnUnresolved
system property requests rejection.</action>
<action type="update" dev="ppkarwasz" due-to="Piotr P. Karwasz, Gary
Gregory" issue="COMMONSXML-3">Reduce the shaded footprint by splitting the
secure classes and resolver floors into independent entry points.</action>
<!-- REMOVE -->
<action type="remove" dev="ppkarwasz" due-to="Piotr P. Karwasz, Gary
Gregory" issue="COMMONSXML-2">Remove the Limits class that applied uniform
processing limits across implementations.</action>
diff --git
a/src/main/java/org/apache/commons/xml/FallbackIgnoreEntityResolver2.java
b/src/main/java/org/apache/commons/xml/secure/FallbackIgnoreEntityResolver2.java
similarity index 99%
rename from
src/main/java/org/apache/commons/xml/FallbackIgnoreEntityResolver2.java
rename to
src/main/java/org/apache/commons/xml/secure/FallbackIgnoreEntityResolver2.java
index bd7d1a5..aa840a6 100644
--- a/src/main/java/org/apache/commons/xml/FallbackIgnoreEntityResolver2.java
+++
b/src/main/java/org/apache/commons/xml/secure/FallbackIgnoreEntityResolver2.java
@@ -15,7 +15,7 @@
* limitations under the License.
*/
-package org.apache.commons.xml;
+package org.apache.commons.xml.secure;
import java.io.ByteArrayInputStream;
import java.io.IOException;
diff --git
a/src/main/java/org/apache/commons/xml/FallbackIgnoreLSResourceResolver.java
b/src/main/java/org/apache/commons/xml/secure/FallbackIgnoreLSResourceResolver.java
similarity index 99%
rename from
src/main/java/org/apache/commons/xml/FallbackIgnoreLSResourceResolver.java
rename to
src/main/java/org/apache/commons/xml/secure/FallbackIgnoreLSResourceResolver.java
index 11aecee..06ae99e 100644
--- a/src/main/java/org/apache/commons/xml/FallbackIgnoreLSResourceResolver.java
+++
b/src/main/java/org/apache/commons/xml/secure/FallbackIgnoreLSResourceResolver.java
@@ -15,7 +15,7 @@
* limitations under the License.
*/
-package org.apache.commons.xml;
+package org.apache.commons.xml.secure;
import java.io.StringReader;
diff --git
a/src/main/java/org/apache/commons/xml/FallbackIgnoreURIResolver.java
b/src/main/java/org/apache/commons/xml/secure/FallbackIgnoreURIResolver.java
similarity index 99%
rename from src/main/java/org/apache/commons/xml/FallbackIgnoreURIResolver.java
rename to
src/main/java/org/apache/commons/xml/secure/FallbackIgnoreURIResolver.java
index ccef795..3a14701 100644
--- a/src/main/java/org/apache/commons/xml/FallbackIgnoreURIResolver.java
+++ b/src/main/java/org/apache/commons/xml/secure/FallbackIgnoreURIResolver.java
@@ -15,7 +15,7 @@
* limitations under the License.
*/
-package org.apache.commons.xml;
+package org.apache.commons.xml.secure;
import java.util.function.BooleanSupplier;
import java.util.function.Supplier;
diff --git
a/src/main/java/org/apache/commons/xml/FallbackIgnoreXMLResolver.java
b/src/main/java/org/apache/commons/xml/secure/FallbackIgnoreXMLResolver.java
similarity index 98%
rename from src/main/java/org/apache/commons/xml/FallbackIgnoreXMLResolver.java
rename to
src/main/java/org/apache/commons/xml/secure/FallbackIgnoreXMLResolver.java
index 80a7f7f..9978b64 100644
--- a/src/main/java/org/apache/commons/xml/FallbackIgnoreXMLResolver.java
+++ b/src/main/java/org/apache/commons/xml/secure/FallbackIgnoreXMLResolver.java
@@ -15,7 +15,7 @@
* limitations under the License.
*/
-package org.apache.commons.xml;
+package org.apache.commons.xml.secure;
import java.io.ByteArrayInputStream;
import java.io.InputStream;
diff --git a/src/main/java/org/apache/commons/xml/MethodHandleFactory.java
b/src/main/java/org/apache/commons/xml/secure/MethodHandleFactory.java
similarity index 98%
rename from src/main/java/org/apache/commons/xml/MethodHandleFactory.java
rename to src/main/java/org/apache/commons/xml/secure/MethodHandleFactory.java
index 15df970..6267380 100644
--- a/src/main/java/org/apache/commons/xml/MethodHandleFactory.java
+++ b/src/main/java/org/apache/commons/xml/secure/MethodHandleFactory.java
@@ -15,7 +15,7 @@
* limitations under the License.
*/
-package org.apache.commons.xml;
+package org.apache.commons.xml.secure;
import java.lang.invoke.MethodHandle;
import java.lang.invoke.MethodHandles;
diff --git a/src/main/java/org/apache/commons/xml/SaxonProvider.java
b/src/main/java/org/apache/commons/xml/secure/SaxonProvider.java
similarity index 99%
rename from src/main/java/org/apache/commons/xml/SaxonProvider.java
rename to src/main/java/org/apache/commons/xml/secure/SaxonProvider.java
index 83632e3..ac55599 100644
--- a/src/main/java/org/apache/commons/xml/SaxonProvider.java
+++ b/src/main/java/org/apache/commons/xml/secure/SaxonProvider.java
@@ -15,7 +15,7 @@
* limitations under the License.
*/
-package org.apache.commons.xml;
+package org.apache.commons.xml.secure;
import java.util.function.Supplier;
diff --git a/src/main/java/org/apache/commons/xml/SecureDocumentBuilder.java
b/src/main/java/org/apache/commons/xml/secure/SecureDocumentBuilder.java
similarity index 98%
rename from src/main/java/org/apache/commons/xml/SecureDocumentBuilder.java
rename to src/main/java/org/apache/commons/xml/secure/SecureDocumentBuilder.java
index 76386b7..069f383 100644
--- a/src/main/java/org/apache/commons/xml/SecureDocumentBuilder.java
+++ b/src/main/java/org/apache/commons/xml/secure/SecureDocumentBuilder.java
@@ -15,7 +15,7 @@
* limitations under the License.
*/
-package org.apache.commons.xml;
+package org.apache.commons.xml.secure;
import java.io.IOException;
import java.util.Objects;
diff --git
a/src/main/java/org/apache/commons/xml/SecureDocumentBuilderFactory.java
b/src/main/java/org/apache/commons/xml/secure/SecureDocumentBuilderFactory.java
similarity index 99%
rename from
src/main/java/org/apache/commons/xml/SecureDocumentBuilderFactory.java
rename to
src/main/java/org/apache/commons/xml/secure/SecureDocumentBuilderFactory.java
index 1fab6e3..819947e 100644
--- a/src/main/java/org/apache/commons/xml/SecureDocumentBuilderFactory.java
+++
b/src/main/java/org/apache/commons/xml/secure/SecureDocumentBuilderFactory.java
@@ -15,7 +15,7 @@
* limitations under the License.
*/
-package org.apache.commons.xml;
+package org.apache.commons.xml.secure;
import java.lang.invoke.MethodHandle;
import java.lang.invoke.MethodType;
@@ -33,7 +33,7 @@
/**
* Creates new, secure {@link DocumentBuilderFactory} instances.
* <p>
- * Beyond the three universal guarantees on {@link org.apache.commons.xml},
XInclude resolution is denied by default. When
+ * Beyond the three universal guarantees on {@link
org.apache.commons.xml.secure}, XInclude resolution is denied by default. When
* {@link DocumentBuilderFactory#setXIncludeAware(boolean)
setXIncludeAware(true)} is called on the returned factory, the parser will
process
* {@code xi:include} elements but every external resource lookup is rejected.
To permit specific trusted resources, install an
* {@link org.xml.sax.EntityResolver EntityResolver} on the {@link
DocumentBuilder} that allow-lists them; any href the resolver does not
explicitly allow
@@ -44,7 +44,7 @@
* by calling an inherited method such as {@code newDefaultInstance()}. The
secure factories are instances of a nested, non-public wrapper class.
* </p>
*
- * @see org.apache.commons.xml
+ * @see org.apache.commons.xml.secure
*/
public final class SecureDocumentBuilderFactory {
@@ -56,7 +56,7 @@ public final class SecureDocumentBuilderFactory {
* as a standalone wrapper so any secure class can reuse the floor.
* </p>
*
- * @see org.apache.commons.xml
+ * @see org.apache.commons.xml.secure
*/
private static final class Wrapper extends DocumentBuilderFactory {
diff --git a/src/main/java/org/apache/commons/xml/SecureException.java
b/src/main/java/org/apache/commons/xml/secure/SecureException.java
similarity index 98%
rename from src/main/java/org/apache/commons/xml/SecureException.java
rename to src/main/java/org/apache/commons/xml/secure/SecureException.java
index 67a45b1..3a5dcca 100644
--- a/src/main/java/org/apache/commons/xml/SecureException.java
+++ b/src/main/java/org/apache/commons/xml/secure/SecureException.java
@@ -15,7 +15,7 @@
* limitations under the License.
*/
-package org.apache.commons.xml;
+package org.apache.commons.xml.secure;
/**
* Thrown when a factory cannot be made secure.
@@ -43,7 +43,7 @@ final class SecureException extends IllegalStateException {
* created before it was set; references resolved by a caller-supplied
resolver are unaffected.
* </p>
*/
- static final String THROW_ON_UNRESOLVED =
"org.apache.commons.xml.throwOnUnresolved";
+ static final String THROW_ON_UNRESOLVED =
"org.apache.commons.xml.secure.throwOnUnresolved";
/**
* Builds the standard exception for a rejected secure setting.
diff --git a/src/main/java/org/apache/commons/xml/SecureSAXParser.java
b/src/main/java/org/apache/commons/xml/secure/SecureSAXParser.java
similarity index 99%
rename from src/main/java/org/apache/commons/xml/SecureSAXParser.java
rename to src/main/java/org/apache/commons/xml/secure/SecureSAXParser.java
index 0b3b1b9..81272a0 100644
--- a/src/main/java/org/apache/commons/xml/SecureSAXParser.java
+++ b/src/main/java/org/apache/commons/xml/secure/SecureSAXParser.java
@@ -15,7 +15,7 @@
* limitations under the License.
*/
-package org.apache.commons.xml;
+package org.apache.commons.xml.secure;
import java.util.Objects;
diff --git a/src/main/java/org/apache/commons/xml/SecureSAXParserFactory.java
b/src/main/java/org/apache/commons/xml/secure/SecureSAXParserFactory.java
similarity index 99%
rename from src/main/java/org/apache/commons/xml/SecureSAXParserFactory.java
rename to
src/main/java/org/apache/commons/xml/secure/SecureSAXParserFactory.java
index 025df45..936ee9e 100644
--- a/src/main/java/org/apache/commons/xml/SecureSAXParserFactory.java
+++ b/src/main/java/org/apache/commons/xml/secure/SecureSAXParserFactory.java
@@ -15,7 +15,7 @@
* limitations under the License.
*/
-package org.apache.commons.xml;
+package org.apache.commons.xml.secure;
import java.lang.invoke.MethodHandle;
import java.lang.invoke.MethodType;
@@ -41,7 +41,7 @@
/**
* Creates new, secure {@link SAXParserFactory} instances.
* <p>
- * Beyond the three universal guarantees on {@link org.apache.commons.xml},
XInclude resolution is denied by default. When
+ * Beyond the three universal guarantees on {@link
org.apache.commons.xml.secure}, XInclude resolution is denied by default. When
* {@link SAXParserFactory#setXIncludeAware(boolean) setXIncludeAware(true)}
is called on the returned factory, the parser will process {@code xi:include}
* elements but every external resource lookup is rejected. To permit specific
trusted resources, install an {@link org.xml.sax.EntityResolver
* EntityResolver} on the {@link org.xml.sax.XMLReader} that allow-lists them;
any href the resolver does not explicitly allow stays blocked.
@@ -51,7 +51,7 @@
* by calling an inherited method such as {@code newDefaultInstance()}. The
secure factories are instances of a nested, non-public wrapper class.
* </p>
*
- * @see org.apache.commons.xml
+ * @see org.apache.commons.xml.secure
*/
public final class SecureSAXParserFactory {
@@ -87,7 +87,7 @@ public void setFeature(final String name, final boolean
value) throws SAXNotReco
* SAX 2 {@link XMLReader} and the SAX 1 {@link org.xml.sax.Parser} it
exposes.
* </p>
*
- * @see org.apache.commons.xml
+ * @see org.apache.commons.xml.secure
*/
private static final class Wrapper extends SAXParserFactory {
diff --git a/src/main/java/org/apache/commons/xml/SecureSchema.java
b/src/main/java/org/apache/commons/xml/secure/SecureSchema.java
similarity index 98%
rename from src/main/java/org/apache/commons/xml/SecureSchema.java
rename to src/main/java/org/apache/commons/xml/secure/SecureSchema.java
index 8eda7ff..eaccf80 100644
--- a/src/main/java/org/apache/commons/xml/SecureSchema.java
+++ b/src/main/java/org/apache/commons/xml/secure/SecureSchema.java
@@ -15,7 +15,7 @@
* limitations under the License.
*/
-package org.apache.commons.xml;
+package org.apache.commons.xml.secure;
import java.util.Objects;
diff --git a/src/main/java/org/apache/commons/xml/SecureSchemaFactory.java
b/src/main/java/org/apache/commons/xml/secure/SecureSchemaFactory.java
similarity index 99%
rename from src/main/java/org/apache/commons/xml/SecureSchemaFactory.java
rename to src/main/java/org/apache/commons/xml/secure/SecureSchemaFactory.java
index e948021..e2613c8 100644
--- a/src/main/java/org/apache/commons/xml/SecureSchemaFactory.java
+++ b/src/main/java/org/apache/commons/xml/secure/SecureSchemaFactory.java
@@ -15,7 +15,7 @@
* limitations under the License.
*/
-package org.apache.commons.xml;
+package org.apache.commons.xml.secure;
import java.lang.invoke.MethodHandle;
import java.lang.invoke.MethodType;
@@ -38,7 +38,7 @@
/**
* Creates new, secure {@link SchemaFactory} instances.
* <p>
- * Beyond the three universal guarantees on {@link org.apache.commons.xml}:
+ * Beyond the three universal guarantees on {@link
org.apache.commons.xml.secure}:
* </p>
* <ul>
* <li>{@code xs:import}, {@code xs:include} and {@code xs:redefine}
schemaLocation URIs are not resolved during schema compilation, and</li>
@@ -53,7 +53,7 @@
* by calling an inherited method such as {@code newDefaultInstance()}. The
secure factories are instances of a nested, non-public wrapper class.
* </p>
*
- * @see org.apache.commons.xml
+ * @see org.apache.commons.xml.secure
*/
public final class SecureSchemaFactory {
@@ -81,7 +81,7 @@ public final class SecureSchemaFactory {
* replacing it, so secure cannot be dropped by swapping the resolver.
* </p>
*
- * @see org.apache.commons.xml
+ * @see org.apache.commons.xml.secure
*/
private static final class Wrapper extends SchemaFactory {
diff --git a/src/main/java/org/apache/commons/xml/SecureTemplates.java
b/src/main/java/org/apache/commons/xml/secure/SecureTemplates.java
similarity index 99%
rename from src/main/java/org/apache/commons/xml/SecureTemplates.java
rename to src/main/java/org/apache/commons/xml/secure/SecureTemplates.java
index c1188c4..3ff9eb4 100644
--- a/src/main/java/org/apache/commons/xml/SecureTemplates.java
+++ b/src/main/java/org/apache/commons/xml/secure/SecureTemplates.java
@@ -15,7 +15,7 @@
* limitations under the License.
*/
-package org.apache.commons.xml;
+package org.apache.commons.xml.secure;
import java.util.Objects;
import java.util.Properties;
diff --git a/src/main/java/org/apache/commons/xml/SecureTemplatesHandler.java
b/src/main/java/org/apache/commons/xml/secure/SecureTemplatesHandler.java
similarity index 99%
rename from src/main/java/org/apache/commons/xml/SecureTemplatesHandler.java
rename to
src/main/java/org/apache/commons/xml/secure/SecureTemplatesHandler.java
index f4b7056..bdb04ba 100644
--- a/src/main/java/org/apache/commons/xml/SecureTemplatesHandler.java
+++ b/src/main/java/org/apache/commons/xml/secure/SecureTemplatesHandler.java
@@ -15,7 +15,7 @@
* limitations under the License.
*/
-package org.apache.commons.xml;
+package org.apache.commons.xml.secure;
import java.util.Objects;
import java.util.function.Supplier;
diff --git a/src/main/java/org/apache/commons/xml/SecureTransformer.java
b/src/main/java/org/apache/commons/xml/secure/SecureTransformer.java
similarity index 99%
rename from src/main/java/org/apache/commons/xml/SecureTransformer.java
rename to src/main/java/org/apache/commons/xml/secure/SecureTransformer.java
index f9cf9f2..dfa9473 100644
--- a/src/main/java/org/apache/commons/xml/SecureTransformer.java
+++ b/src/main/java/org/apache/commons/xml/secure/SecureTransformer.java
@@ -15,7 +15,7 @@
* limitations under the License.
*/
-package org.apache.commons.xml;
+package org.apache.commons.xml.secure;
import java.util.Objects;
import java.util.Properties;
diff --git a/src/main/java/org/apache/commons/xml/SecureTransformerFactory.java
b/src/main/java/org/apache/commons/xml/secure/SecureTransformerFactory.java
similarity index 98%
rename from src/main/java/org/apache/commons/xml/SecureTransformerFactory.java
rename to
src/main/java/org/apache/commons/xml/secure/SecureTransformerFactory.java
index 4e5b98c..57e81e5 100644
--- a/src/main/java/org/apache/commons/xml/SecureTransformerFactory.java
+++ b/src/main/java/org/apache/commons/xml/secure/SecureTransformerFactory.java
@@ -15,7 +15,7 @@
* limitations under the License.
*/
-package org.apache.commons.xml;
+package org.apache.commons.xml.secure;
import java.io.IOException;
import java.lang.invoke.MethodHandle;
@@ -51,7 +51,7 @@
/**
* Creates new, secure {@link TransformerFactory} instances.
* <p>
- * Beyond the three universal guarantees on {@link org.apache.commons.xml}:
{@code xsl:import}, {@code xsl:include} and {@code document()} URIs are not
resolved.
+ * Beyond the three universal guarantees on {@link
org.apache.commons.xml.secure}: {@code xsl:import}, {@code xsl:include} and
{@code document()} URIs are not resolved.
* </p>
* <p>
* The guarantees govern what the transform reads, not what it writes: an
output instruction like {@code xsl:result-document} still writes wherever the
@@ -72,7 +72,7 @@
* by calling an inherited method such as {@code newDefaultInstance()}. The
secure factories are instances of a nested, non-public wrapper class.
* </p>
*
- * @see org.apache.commons.xml
+ * @see org.apache.commons.xml.secure
*/
public final class SecureTransformerFactory {
@@ -82,7 +82,7 @@ public final class SecureTransformerFactory {
*
* <p>Used by providers whose underlying TrAX implementation pulls a new
{@code SAXParserFactory.newInstance()} for any Source that is not already a
* {@link SAXSource} carrying its own {@link XMLReader}, and only sets
{@link javax.xml.XMLConstants#FEATURE_SECURE_PROCESSING FSP} on the resulting
reader.
- * Wrapping the factory and rewriting the Source upstream guarantees the
parse runs through an {@link org.apache.commons.xml}-secured reader instead.</p>
+ * Wrapping the factory and rewriting the Source upstream guarantees the
parse runs through an {@link org.apache.commons.xml.secure}-secured reader
instead.</p>
*
* <p>Three layers cooperate:</p>
* <ol>
@@ -105,7 +105,7 @@ public final class SecureTransformerFactory {
* caller sets on a returned {@link XMLFilter}.</li>
* </ul>
*
- * @see org.apache.commons.xml
+ * @see org.apache.commons.xml.secure
*/
private static final class Wrapper extends SAXTransformerFactory {
@@ -424,7 +424,7 @@ public static TransformerFactory newInstance(final String
factoryClassName, fina
* routed through the floor rather than replacing it, so a caller
can opt a specific URI in but cannot reopen the fetch.</li>
* <li><strong>The nested wrapper</strong>: required. Both
implementations fall back to {@code SAXParserFactory.newInstance()} to parse a
* stylesheet or source document that does not carry its own
reader, and only set FSP on it; wrapping the factory rewrites every {@link
Source} through an
- * {@link org.apache.commons.xml}-secured reader instead.</li>
+ * {@link org.apache.commons.xml.secure}-secured reader
instead.</li>
* </ul>
*
* @param factory the factory to secure; never {@code null}.
diff --git a/src/main/java/org/apache/commons/xml/SecureTransformerHandler.java
b/src/main/java/org/apache/commons/xml/secure/SecureTransformerHandler.java
similarity index 99%
rename from src/main/java/org/apache/commons/xml/SecureTransformerHandler.java
rename to
src/main/java/org/apache/commons/xml/secure/SecureTransformerHandler.java
index a2b0043..c8cf1f2 100644
--- a/src/main/java/org/apache/commons/xml/SecureTransformerHandler.java
+++ b/src/main/java/org/apache/commons/xml/secure/SecureTransformerHandler.java
@@ -15,7 +15,7 @@
* limitations under the License.
*/
-package org.apache.commons.xml;
+package org.apache.commons.xml.secure;
import java.util.Objects;
import java.util.function.Supplier;
diff --git a/src/main/java/org/apache/commons/xml/SecureValidator.java
b/src/main/java/org/apache/commons/xml/secure/SecureValidator.java
similarity index 99%
rename from src/main/java/org/apache/commons/xml/SecureValidator.java
rename to src/main/java/org/apache/commons/xml/secure/SecureValidator.java
index f49645a..784b0f1 100644
--- a/src/main/java/org/apache/commons/xml/SecureValidator.java
+++ b/src/main/java/org/apache/commons/xml/secure/SecureValidator.java
@@ -15,7 +15,7 @@
* limitations under the License.
*/
-package org.apache.commons.xml;
+package org.apache.commons.xml.secure;
import java.io.IOException;
import java.util.Objects;
diff --git a/src/main/java/org/apache/commons/xml/SecureValidatorHandler.java
b/src/main/java/org/apache/commons/xml/secure/SecureValidatorHandler.java
similarity index 99%
rename from src/main/java/org/apache/commons/xml/SecureValidatorHandler.java
rename to
src/main/java/org/apache/commons/xml/secure/SecureValidatorHandler.java
index 89e361b..e07f068 100644
--- a/src/main/java/org/apache/commons/xml/SecureValidatorHandler.java
+++ b/src/main/java/org/apache/commons/xml/secure/SecureValidatorHandler.java
@@ -15,7 +15,7 @@
* limitations under the License.
*/
-package org.apache.commons.xml;
+package org.apache.commons.xml.secure;
import java.util.Objects;
diff --git a/src/main/java/org/apache/commons/xml/SecureXMLFilter.java
b/src/main/java/org/apache/commons/xml/secure/SecureXMLFilter.java
similarity index 99%
rename from src/main/java/org/apache/commons/xml/SecureXMLFilter.java
rename to src/main/java/org/apache/commons/xml/secure/SecureXMLFilter.java
index 42a45f9..b0f6aa9 100644
--- a/src/main/java/org/apache/commons/xml/SecureXMLFilter.java
+++ b/src/main/java/org/apache/commons/xml/secure/SecureXMLFilter.java
@@ -15,7 +15,7 @@
* limitations under the License.
*/
-package org.apache.commons.xml;
+package org.apache.commons.xml.secure;
import java.io.IOException;
import java.util.Objects;
diff --git a/src/main/java/org/apache/commons/xml/SecureXMLInputFactory.java
b/src/main/java/org/apache/commons/xml/secure/SecureXMLInputFactory.java
similarity index 98%
rename from src/main/java/org/apache/commons/xml/SecureXMLInputFactory.java
rename to src/main/java/org/apache/commons/xml/secure/SecureXMLInputFactory.java
index 2b18de9..8c1784a 100644
--- a/src/main/java/org/apache/commons/xml/SecureXMLInputFactory.java
+++ b/src/main/java/org/apache/commons/xml/secure/SecureXMLInputFactory.java
@@ -15,7 +15,7 @@
* limitations under the License.
*/
-package org.apache.commons.xml;
+package org.apache.commons.xml.secure;
import java.io.InputStream;
import java.io.Reader;
@@ -38,14 +38,14 @@
/**
* Creates new, secure {@link XMLInputFactory} instances.
* <p>
- * The three universal guarantees on {@link org.apache.commons.xml} apply;
StAX exposes no additional vectors beyond them.
+ * The three universal guarantees on {@link org.apache.commons.xml.secure}
apply; StAX exposes no additional vectors beyond them.
* </p>
* <p>
* Not a {@link XMLInputFactory} itself, so none of the JAXP static factory
methods is inherited: a caller cannot reach a non-secured factory through this
class
* by calling an inherited method such as {@code newDefaultFactory()}. The
secure factories are instances of a nested, non-public wrapper class.
* </p>
*
- * @see org.apache.commons.xml
+ * @see org.apache.commons.xml.secure
*/
public final class SecureXMLInputFactory {
@@ -67,7 +67,7 @@ public final class SecureXMLInputFactory {
* through to fetching the systemId URL itself, so a caller-set resolver
that returns {@code null} must still land behind the floor. {@link
#getXMLResolver()} and
* {@code getProperty} report the caller's resolver unwrapped.</p>
*
- * @see org.apache.commons.xml
+ * @see org.apache.commons.xml.secure
*/
private static final class Wrapper extends XMLInputFactory {
diff --git a/src/main/java/org/apache/commons/xml/SecureXMLReader.java
b/src/main/java/org/apache/commons/xml/secure/SecureXMLReader.java
similarity index 99%
rename from src/main/java/org/apache/commons/xml/SecureXMLReader.java
rename to src/main/java/org/apache/commons/xml/secure/SecureXMLReader.java
index 25d9408..98817f6 100644
--- a/src/main/java/org/apache/commons/xml/SecureXMLReader.java
+++ b/src/main/java/org/apache/commons/xml/secure/SecureXMLReader.java
@@ -15,7 +15,7 @@
* limitations under the License.
*/
-package org.apache.commons.xml;
+package org.apache.commons.xml.secure;
import java.io.IOException;
import java.util.Objects;
diff --git a/src/main/java/org/apache/commons/xml/SecureXPath.java
b/src/main/java/org/apache/commons/xml/secure/SecureXPath.java
similarity index 99%
rename from src/main/java/org/apache/commons/xml/SecureXPath.java
rename to src/main/java/org/apache/commons/xml/secure/SecureXPath.java
index 3310be7..19f834d 100644
--- a/src/main/java/org/apache/commons/xml/SecureXPath.java
+++ b/src/main/java/org/apache/commons/xml/secure/SecureXPath.java
@@ -15,7 +15,7 @@
* limitations under the License.
*/
-package org.apache.commons.xml;
+package org.apache.commons.xml.secure;
import java.io.IOException;
import java.util.Objects;
diff --git a/src/main/java/org/apache/commons/xml/SecureXPathExpression.java
b/src/main/java/org/apache/commons/xml/secure/SecureXPathExpression.java
similarity index 98%
rename from src/main/java/org/apache/commons/xml/SecureXPathExpression.java
rename to src/main/java/org/apache/commons/xml/secure/SecureXPathExpression.java
index 9682929..002d603 100644
--- a/src/main/java/org/apache/commons/xml/SecureXPathExpression.java
+++ b/src/main/java/org/apache/commons/xml/secure/SecureXPathExpression.java
@@ -15,7 +15,7 @@
* limitations under the License.
*/
-package org.apache.commons.xml;
+package org.apache.commons.xml.secure;
import java.util.Objects;
diff --git a/src/main/java/org/apache/commons/xml/SecureXPathFactory.java
b/src/main/java/org/apache/commons/xml/secure/SecureXPathFactory.java
similarity index 98%
rename from src/main/java/org/apache/commons/xml/SecureXPathFactory.java
rename to src/main/java/org/apache/commons/xml/secure/SecureXPathFactory.java
index b2494b0..8450345 100644
--- a/src/main/java/org/apache/commons/xml/SecureXPathFactory.java
+++ b/src/main/java/org/apache/commons/xml/secure/SecureXPathFactory.java
@@ -15,7 +15,7 @@
* limitations under the License.
*/
-package org.apache.commons.xml;
+package org.apache.commons.xml.secure;
import java.lang.invoke.MethodHandle;
import java.lang.invoke.MethodType;
@@ -31,7 +31,7 @@
/**
* Creates new, secure {@link XPathFactory} instances.
* <p>
- * Beyond the three universal guarantees on {@link org.apache.commons.xml},
URI-fetching XPath 3.1+ functions ({@code doc()}, {@code collection()},
+ * Beyond the three universal guarantees on {@link
org.apache.commons.xml.secure}, URI-fetching XPath 3.1+ functions ({@code
doc()}, {@code collection()},
* {@code unparsed-text()}) are not resolved.
* </p>
* <p>
@@ -43,7 +43,7 @@
* by calling an inherited method such as {@code newDefaultInstance()}. The
secure factories are instances of a nested, non-public wrapper class.
* </p>
*
- * @see org.apache.commons.xml
+ * @see org.apache.commons.xml.secure
*/
public final class SecureXPathFactory {
@@ -54,7 +54,7 @@ public final class SecureXPathFactory {
* implement the {@link org.xml.sax.InputSource}-taking {@code evaluate}
entry points by provisioning an internal document parser the feature does not
reach.
* The wrapper performs that document build itself through a secure parser
instead; see {@link SecureXPath}.</p>
*
- * @see org.apache.commons.xml
+ * @see org.apache.commons.xml.secure
*/
private static final class Wrapper extends XPathFactory {
diff --git a/src/main/java/org/apache/commons/xml/doc-files/leaf.svg
b/src/main/java/org/apache/commons/xml/secure/doc-files/leaf.svg
similarity index 100%
rename from src/main/java/org/apache/commons/xml/doc-files/leaf.svg
rename to src/main/java/org/apache/commons/xml/secure/doc-files/leaf.svg
diff --git a/src/main/java/org/apache/commons/xml/doc-files/logo.png
b/src/main/java/org/apache/commons/xml/secure/doc-files/logo.png
similarity index 100%
rename from src/main/java/org/apache/commons/xml/doc-files/logo.png
rename to src/main/java/org/apache/commons/xml/secure/doc-files/logo.png
diff --git a/src/main/java/org/apache/commons/xml/doc-files/rewrite.yml
b/src/main/java/org/apache/commons/xml/secure/doc-files/rewrite.yml
similarity index 73%
rename from src/main/java/org/apache/commons/xml/doc-files/rewrite.yml
rename to src/main/java/org/apache/commons/xml/secure/doc-files/rewrite.yml
index dc9c074..dd9810c 100644
--- a/src/main/java/org/apache/commons/xml/doc-files/rewrite.yml
+++ b/src/main/java/org/apache/commons/xml/secure/doc-files/rewrite.yml
@@ -14,25 +14,25 @@
# limitations under the License.
type: specs.openrewrite.org/v1beta/recipe
-name: org.apache.commons.xml.UseSecureXmlFactories
+name: org.apache.commons.xml.secure.UseSecureXmlFactories
displayName: Use Apache Commons secure XML factories
description: Replaces JAXP factory types with their Apache Commons XML secure
equivalents.
recipeList:
- org.openrewrite.java.ChangeType:
oldFullyQualifiedTypeName: javax.xml.parsers.DocumentBuilderFactory
- newFullyQualifiedTypeName:
org.apache.commons.xml.SecureDocumentBuilderFactory
+ newFullyQualifiedTypeName:
org.apache.commons.xml.secure.SecureDocumentBuilderFactory
- org.openrewrite.java.ChangeType:
oldFullyQualifiedTypeName: javax.xml.parsers.SAXParserFactory
- newFullyQualifiedTypeName: org.apache.commons.xml.SecureSAXParserFactory
+ newFullyQualifiedTypeName:
org.apache.commons.xml.secure.SecureSAXParserFactory
- org.openrewrite.java.ChangeType:
oldFullyQualifiedTypeName: javax.xml.validation.SchemaFactory
- newFullyQualifiedTypeName: org.apache.commons.xml.SecureSchemaFactory
+ newFullyQualifiedTypeName:
org.apache.commons.xml.secure.SecureSchemaFactory
- org.openrewrite.java.ChangeType:
oldFullyQualifiedTypeName: javax.xml.transform.TransformerFactory
- newFullyQualifiedTypeName:
org.apache.commons.xml.SecureTransformerFactory
+ newFullyQualifiedTypeName:
org.apache.commons.xml.secure.SecureTransformerFactory
- org.openrewrite.java.ChangeType:
oldFullyQualifiedTypeName: javax.xml.stream.XMLInputFactory
- newFullyQualifiedTypeName: org.apache.commons.xml.SecureXMLInputFactory
+ newFullyQualifiedTypeName:
org.apache.commons.xml.secure.SecureXMLInputFactory
- org.openrewrite.java.ChangeType:
oldFullyQualifiedTypeName: javax.xml.xpath.XPathFactory
- newFullyQualifiedTypeName: org.apache.commons.xml.SecureXPathFactory
+ newFullyQualifiedTypeName:
org.apache.commons.xml.secure.SecureXPathFactory
diff --git a/src/main/java/org/apache/commons/xml/package-info.java
b/src/main/java/org/apache/commons/xml/secure/package-info.java
similarity index 96%
rename from src/main/java/org/apache/commons/xml/package-info.java
rename to src/main/java/org/apache/commons/xml/secure/package-info.java
index 4433e07..771c011 100644
--- a/src/main/java/org/apache/commons/xml/package-info.java
+++ b/src/main/java/org/apache/commons/xml/secure/package-info.java
@@ -80,7 +80,7 @@
* </p>
* <p>
* An unresolved external reference resolves to empty content by default, so
the parse continues without the resource. To reject it with an exception
instead,
- * set the system property {@code org.apache.commons.xml.throwOnUnresolved} to
{@code true}; the property is read at resolution time, and references resolved
by
+ * set the system property {@code
org.apache.commons.xml.secure.throwOnUnresolved} to {@code true}; the property
is read at resolution time, and references resolved by
* a caller-supplied resolver are unaffected.
* </p>
* <h2>Caller-supplied URIs</h2>
@@ -96,4 +96,4 @@
* </p>
*/
-package org.apache.commons.xml;
+package org.apache.commons.xml.secure;
diff --git a/src/main/javadoc/overview.html b/src/main/javadoc/overview.html
index 5bba4ca..36f3695 100644
--- a/src/main/javadoc/overview.html
+++ b/src/main/javadoc/overview.html
@@ -19,10 +19,10 @@
<title>Apache Commons Secure XML Overview</title>
</head>
<body>
- <a href="https://commons.apache.org/xml"><img
src="org/apache/commons/xml/doc-files/logo.png" alt="Apache Commons Secure
XML"> </a>
+ <a href="https://commons.apache.org/xml"><img
src="org/apache/commons/xml/secure/doc-files/logo.png" alt="Apache Commons
Secure XML"> </a>
<section id="apache-commons-secure-xml">
<h1>
- <img src="org/apache/commons/xml/doc-files/leaf.svg" style="height: 1em;
padding-right: 0.25em" alt="leaf">Apache Commons Secure XML
+ <img src="org/apache/commons/xml/secure/doc-files/leaf.svg"
style="height: 1em; padding-right: 0.25em" alt="leaf">Apache Commons Secure XML
</h1>
<p>
<a href="https://commons.apache.org/xml">Apache Commons Secure XML</a>
is part of the <a href="https://commons.apache.org/index.html">Apache
Commons</a>
@@ -33,7 +33,7 @@ <h1>
</section>
<section id="tldr">
<h1>
- <img src="org/apache/commons/xml/doc-files/leaf.svg" style="height: 1em;
padding-right: 0.25em" alt="leaf">TL;DR
+ <img src="org/apache/commons/xml/secure/doc-files/leaf.svg"
style="height: 1em; padding-right: 0.25em" alt="leaf">TL;DR
</h1>
<p>To secure XML processing:</p>
<table>
@@ -44,36 +44,36 @@ <h1>
</tr>
<tr>
<td><code>javax.xml.parsers.DocumentBuilderFactory</code></td>
-
<td><code>org.apache.commons.xml.SecureDocumentBuilderFactory</code></td>
+
<td><code>org.apache.commons.xml.secure.SecureDocumentBuilderFactory</code></td>
</tr>
<tr>
<td><code>javax.xml.parsers.SAXParserFactory</code></td>
- <td><code>org.apache.commons.xml.SecureSAXParserFactory</code></td>
+
<td><code>org.apache.commons.xml.secure.SecureSAXParserFactory</code></td>
</tr>
<tr>
<td><code>javax.xml.validation.SchemaFactory</code></td>
- <td><code>org.apache.commons.xml.SecureSchemaFactory</code></td>
+ <td><code>org.apache.commons.xml.secure.SecureSchemaFactory</code></td>
</tr>
<tr>
<td><code>javax.xml.transform.TransformerFactory</code></td>
- <td><code>org.apache.commons.xml.SecureTransformerFactory</code></td>
+
<td><code>org.apache.commons.xml.secure.SecureTransformerFactory</code></td>
</tr>
<tr>
<td><code>javax.xml.stream.XMLInputFactory</code></td>
- <td><code>org.apache.commons.xml.SecureXMLInputFactory</code></td>
+
<td><code>org.apache.commons.xml.secure.SecureXMLInputFactory</code></td>
</tr>
<tr>
<td><code>javax.xml.xpath.XPathFactory</code></td>
- <td><code>org.apache.commons.xml.SecureXPathFactory</code></td>
+ <td><code>org.apache.commons.xml.secure.SecureXPathFactory</code></td>
</tr>
</table>
<p>
- Or use the <a
href="org/apache/commons/xml/doc-files/rewrite.yml">OpenRewrite recipe</a>.
+ Or use the <a
href="org/apache/commons/xml/secure/doc-files/rewrite.yml">OpenRewrite
recipe</a>.
</p>
</section>
<section id="why">
<h1>
- <img src="org/apache/commons/xml/doc-files/leaf.svg" style="height: 1em;
padding-right: 0.25em" alt="leaf">Why
+ <img src="org/apache/commons/xml/secure/doc-files/leaf.svg"
style="height: 1em; padding-right: 0.25em" alt="leaf">Why
</h1>
<p>Any Java library that parses XML has to secure JAXP before handing a
factory to user code, and every library ends up copy-pasting the same securing
snippet. The snippet is fragile: the attributes and features needed to
secure a factory are not standardized, each JAXP implementation exposes a
slightly
@@ -88,7 +88,7 @@ <h1>
</p>
<p>
This library provides that baseline. Each
- <code>org.apache.commons.xml</code>
+ <code>org.apache.commons.xml.secure</code>
factory call returns a new factory secured by an implementation-specific
recipe, so the returned object behaves the same way security-wise regardless of
which JAXP implementation resolved. Security becomes a property of the
call, not of the classpath, and there is one place to update when a new securing
setting becomes available or a default changes.
@@ -96,14 +96,14 @@ <h1>
</section>
<section id="usage">
<h1>
- <img src="org/apache/commons/xml/doc-files/leaf.svg" style="height: 1em;
padding-right: 0.25em" alt="leaf">Usage
+ <img src="org/apache/commons/xml/secure/doc-files/leaf.svg"
style="height: 1em; padding-right: 0.25em" alt="leaf">Usage
</h1>
<p>
To add the library to your build, see <a
href="dependency-info.html">Maven Coordinates</a>. (Maven
Coordinates)[dependency-info.html]
</p>
<p>
Every factory method in
- <code>org.apache.commons.xml</code>
+ <code>org.apache.commons.xml.secure</code>
returns a new, secured factory. Pick the one that matches the API you
already use; no other configuration is required. On secured factories an
external
resource reference (DTD, entity, schema, stylesheet) is never fetched:
it resolves to empty content, so the parse continues without it (see
Configuration
below).
@@ -125,7 +125,7 @@ <h2>Supported Implementations</h2>
<p>
Out of the box the library recognizes the stock JDK JAXP
implementations, Apache Xerces 2.x, Woodstox, and Saxon-HE. If a factory
resolves to an
implementation not covered by any bundled securing recipe, every
- <code>org.apache.commons.xml</code>
+ <code>org.apache.commons.xml.secure</code>
factory method throws
<code>IllegalStateException</code>
with a message naming the unsupported class. Adding support for a new
JAXP implementation requires a code change to this library.
@@ -139,7 +139,7 @@ <h2>Supported Implementations</h2>
<pre class="sourceCode java">
<code class="sourceCode java">
import org.w3c.dom.Document;
-import org.apache.commons.xml.SecureDocumentBuilderFactory;
+import org.apache.commons.xml.secure.SecureDocumentBuilderFactory;
Document doc =
SecureDocumentBuilderFactory.newInstance().newDocumentBuilder().parse(inputStream);
</code>
@@ -153,7 +153,7 @@ <h2>Supported Implementations</h2>
<div class="sourceCode" id="cb2">
<pre class="sourceCode java">
<code class="sourceCode java">
-import org.apache.commons.xml.SecureSAXParserFactory;
+import org.apache.commons.xml.secure.SecureSAXParserFactory;
SecureSAXParserFactory.newInstance().newSAXParser().parse(inputStream,
myDefaultHandler);
</code>
@@ -168,7 +168,7 @@ <h2>Supported Implementations</h2>
<pre class="sourceCode java">
<code class="sourceCode java">
import javax.xml.stream.XMLStreamReader;
-import org.apache.commons.xml.SecureXMLInputFactory;
+import org.apache.commons.xml.secure.SecureXMLInputFactory;
XMLStreamReader reader =
SecureXMLInputFactory.newInstance().createXMLStreamReader(inputStream);
</code>
@@ -184,7 +184,7 @@ <h2>Supported Implementations</h2>
<code class="sourceCode java">
import javax.xml.transform.stream.StreamSource;
import javax.xml.transform.stream.StreamResult;
-import org.apache.commons.xml.SecureTransformerFactory;
+import org.apache.commons.xml.secure.SecureTransformerFactory;
SecureTransformerFactory.newInstance()
.newTransformer(new StreamSource(stylesheet))
@@ -202,7 +202,7 @@ <h2>Supported Implementations</h2>
<code class="sourceCode java">
import javax.xml.xpath.XPathConstants;
import org.w3c.dom.NodeList;
-import org.apache.commons.xml.SecureXPathFactory;
+import org.apache.commons.xml.secure.SecureXPathFactory;
NodeList hits = (NodeList) SecureXPathFactory.newInstance()
.newXPath()
@@ -220,7 +220,7 @@ <h2>Supported Implementations</h2>
<code class="sourceCode java">
import javax.xml.XMLConstants;
import javax.xml.transform.stream.StreamSource;
-import org.apache.commons.xml.SecureSchemaFactory;
+import org.apache.commons.xml.secure.SecureSchemaFactory;
SecureSchemaFactory.newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI)
.newSchema(new StreamSource(xsdStream))
@@ -284,7 +284,7 @@ <h2>Stylesheets and Schemas</h2>
<code>SchemaFactory.newSchema(Source)</code>
are read by a parser the implementation picks internally, and that
parser may not be secured (Saxon’s TrAX is one such case, see Building below).
Treat
stylesheets and schemas as trusted input, or pre-parse them through a
secured
- <code>org.apache.commons.xml</code>
+ <code>org.apache.commons.xml.secure</code>
parser and pass the result as a
<code>DOMSource</code>
or
@@ -321,7 +321,7 @@ <h2>Transformer Handlers and Filters</h2>
<h2>Caching and Thread-Safety</h2>
<p>
There is no caching or pooling inside
- <code>org.apache.commons.xml</code>
+ <code>org.apache.commons.xml.secure</code>
; callers on a hot path are responsible for their own caching. The
returned factories inherit the thread-safety properties of the underlying JAXP
implementation, which in practice means they are not thread-safe.
Create a new factory per thread or synchronize externally.
</p>
@@ -329,7 +329,7 @@ <h2>Caching and Thread-Safety</h2>
</section>
<section id="configuration">
<h1>
- <img src="org/apache/commons/xml/doc-files/leaf.svg" style="height: 1em;
padding-right: 0.25em" alt="leaf">Configuration
+ <img src="org/apache/commons/xml/secure/doc-files/leaf.svg"
style="height: 1em; padding-right: 0.25em" alt="leaf">Configuration
</h1>
<p>The secured factories need no configuration. When a document references
an external resource (a DTD, an external entity, a schema, an XInclude
target, or an XSLT document), the securing layer resolves the reference
to an empty stream: nothing is fetched, nothing leaks into the result, and the
@@ -349,7 +349,7 @@ <h1>
</ul>
<p>
As a temporary debugging measure, set the system property
- <code>org.apache.commons.xml.throwOnUnresolved</code>
+ <code>org.apache.commons.xml.secure.throwOnUnresolved</code>
to
<code>true</code>
: every unresolved external reference is then rejected with the
resolution hook’s exception, and the message names the denied resource. The
property is
diff --git a/src/site/markdown/index.md b/src/site/markdown/index.md
index 1826083..891284c 100644
--- a/src/site/markdown/index.md
+++ b/src/site/markdown/index.md
@@ -26,5 +26,5 @@ Full documentation is provided in:
- [**TL;DR**](apidocs/index.html#tldr)
- [Javadoc Overview](apidocs/index.html)
-- [Javadoc Package
Summary](apidocs/org/apache/commons/xml/package-summary.html)
+- [Javadoc Package
Summary](apidocs/org/apache/commons/xml/secure/package-summary.html)
- [Project Reports](project-reports.html)
diff --git a/src/site/markdown/shading.md b/src/site/markdown/shading.md
index 2f8cbeb..a3ba23f 100644
--- a/src/site/markdown/shading.md
+++ b/src/site/markdown/shading.md
@@ -111,7 +111,7 @@ while every other dependency of your project stays an
ordinary external dependen
</artifactSet>
<relocations>
<relocation>
- <pattern>org.apache.commons.xml</pattern>
+ <pattern>org.apache.commons.xml.secure</pattern>
<shadedPattern>com.example.app.internal.xml</shadedPattern>
</relocation>
</relocations>
diff --git a/src/site/markdown/threat_model.md
b/src/site/markdown/threat_model.md
index 1e7d992..5a7bc98 100644
--- a/src/site/markdown/threat_model.md
+++ b/src/site/markdown/threat_model.md
@@ -45,7 +45,7 @@ new, secured factory whose parsers reject the common XML
attacks (external entit
external references, and entity-expansion denial of service such as Billion
Laughs). The exact guarantee each factory
makes is documented in the Javadoc:
-https://commons.apache.org/index/commons-secure-xml/apidocs/org/apache/commons/xml/package-summary.html
+https://commons.apache.org/index/commons-secure-xml/apidocs/org/apache/commons/xml/secure/package-summary.html
Thesecuring applies to the factory and to the parsers, readers, transformers,
validators, schemas and XPath objects it produces.
It governs what those objects read;
@@ -59,7 +59,7 @@ document tries to reach through an entity, DTD, schema,
stylesheet, or XInclude
exists to stop that untrusted document from reading local resources, reaching
the network, or exhausting
memory or CPU.
-The trust boundary is the factory as returned by `org.apache.commons.xml`. The
XML handed to a parser, reader,
+The trust boundary is the factory as returned by
`org.apache.commons.xml.secure`. The XML handed to a parser, reader,
transformer, validator or schema produced by that factory is **untrusted**;
the configuration of the factory
is **trusted**, and keeping it as delivered is the caller's responsibility. A
caller running in the same
process can always reconfigure or replace the factory, so such a caller is not
an adversary this model
@@ -77,7 +77,7 @@ because your reader's settings are indistinguishable from
configuration you chos
### What is in Scope
-- Thesecuring recipes applied by `org.apache.commons.xml`.
+- Thesecuring recipes applied by `org.apache.commons.xml.secure`.
Every implementation of JAXP 1.4 or later is in scope,
as long as it respects the contract of the features, attributes, and
properties the recipes use.
An implementation that cannot accept a required setting makes the factory
method throw
@@ -85,7 +85,7 @@ because your reader's settings are indistinguishable from
configuration you chos
The recipes for Android's Expat/KXmlParser are applied as best-effort and
carry no guarantee
(see **Supported runtimes** under [Assumptions about the
environment](#assumptions-about-the-environment)).
-- A factory returned by `org.apache.commons.xml`, used as delivered, that
fails to provide a guarantee the Javadoc states it
+- A factory returned by `org.apache.commons.xml.secure`, used as delivered,
that fails to provide a guarantee the Javadoc states it
provides. The guarantee covers the documented entry points of each returned
factory type,
including the `SAXTransformerFactory` extension methods when the returned
`TransformerFactory` exposes them.
@@ -95,7 +95,7 @@ The library does not open network connections,
spawn processes,
install signal handlers,
or read environment variables of its own:
-each `org.apache.commons.xml` factory method only configures and returns a
JAXP factory.
+each `org.apache.commons.xml.secure` factory method only configures and
returns a JAXP factory.
Whichsecuring recipe applies depends on the JAXP implementation present on the
classpath.
**Supported runtimes**
@@ -116,7 +116,7 @@ but a report demonstrated only on Android is [out of
scope](#what-is-out-of-scop
**System properties that modify behavior**
The library reads a single system property of its own,
-`org.apache.commons.xml.throwOnUnresolved`:
+`org.apache.commons.xml.secure.throwOnUnresolved`:
when set to `true`,
every secured factory rejects an unresolved external reference with an
exception
instead of resolving it to empty content.
@@ -240,7 +240,7 @@ and reports against a factory reconfigured in any of the
ways below are out of s
`StreamSource(systemId)`, a `SAXSource` built from a system id) is fetched
as-is by the JAXP implementation without
consulting thesecuring layer. Restrict it yourself if the URI is untrusted.
- **Caller-supplied parser instances.**
- A parser built outside `org.apache.commons.xml` and handed to a produced
instance is used as configured:
+ A parser built outside `org.apache.commons.xml.secure` and handed to a
produced instance is used as configured:
a `SAXSource` carrying its own `XMLReader`,
a `StAXSource` carrying a stream or event reader,
or a `DOMSource` holding a document parsed elsewhere.
@@ -276,7 +276,7 @@ re-establishing any protection you remove.
XML-security scanners and static analyzers routinely flag the parsers this
library produces. The following
are **not** vulnerabilities under this model:
-- A claim that a factory or instance produced by `org.apache.commons.xml` is
unsafe, without showing that a reserved
+- A claim that a factory or instance produced by
`org.apache.commons.xml.secure` is unsafe, without showing that a reserved
setting was loosened, a resolver was installed, or an untrusted top-level
URI was passed (see
[Assumptions about the environment](#assumptions-about-the-environment) and
[What is out of scope](#what-is-out-of-scope)). As delivered, the instance
is secured; the bare presence
@@ -302,7 +302,7 @@ are **not** vulnerabilities under this model:
instruction of a stylesheet
(see **Transform output destinations** under [What is out of
scope](#what-is-out-of-scope)).
- Reports in a JAXP implementation that does not respect the contract of the
settings asecuring recipe
- requires: `org.apache.commons.xml` factory method throws rather than
returning an unsecured factory, so there is no instance to attack.
+ requires: `org.apache.commons.xml.secure` factory method throws rather than
returning an unsecured factory, so there is no instance to attack.
### Triage Dispositions
@@ -320,7 +320,7 @@ A report judged against this model receives exactly one of:
### Conditions That Would Change This Model
Revise this model when any of the following change:
-a new `org.apache.commons.xml` factory or other public surface;
+a new `org.apache.commons.xml.secure` factory or other public surface;
support for a JAXP implementation beyond those listed under [What is in
scope](#what-is-in-scope);
a change to the supported runtimes (see **Supported runtimes** under
[Assumptions about the environment](#assumptions-about-the-environment));
a new reserved setting;
diff --git a/src/test/java/org/apache/commons/xml/AssociatedStylesheetTest.java
b/src/test/java/org/apache/commons/xml/secure/AssociatedStylesheetTest.java
similarity index 99%
rename from src/test/java/org/apache/commons/xml/AssociatedStylesheetTest.java
rename to
src/test/java/org/apache/commons/xml/secure/AssociatedStylesheetTest.java
index a417207..25b98f3 100644
--- a/src/test/java/org/apache/commons/xml/AssociatedStylesheetTest.java
+++ b/src/test/java/org/apache/commons/xml/secure/AssociatedStylesheetTest.java
@@ -15,7 +15,7 @@
* limitations under the License.
*/
-package org.apache.commons.xml;
+package org.apache.commons.xml.secure;
import static org.junit.jupiter.api.Assertions.assertNotNull;
import static org.junit.jupiter.api.Assertions.assertThrows;
diff --git a/src/test/java/org/apache/commons/xml/AttackTestSupport.java
b/src/test/java/org/apache/commons/xml/secure/AttackTestSupport.java
similarity index 99%
rename from src/test/java/org/apache/commons/xml/AttackTestSupport.java
rename to src/test/java/org/apache/commons/xml/secure/AttackTestSupport.java
index c9214f0..d15f2e5 100644
--- a/src/test/java/org/apache/commons/xml/AttackTestSupport.java
+++ b/src/test/java/org/apache/commons/xml/secure/AttackTestSupport.java
@@ -2,7 +2,7 @@
* SPDX-FileCopyrightText: 2026 Piotr P. Karwasz
* SPDX-License-Identifier: Apache-2.0
*/
-package org.apache.commons.xml;
+package org.apache.commons.xml.secure;
import static org.junit.jupiter.api.Assertions.assertDoesNotThrow;
import static org.junit.jupiter.api.Assertions.assertFalse;
@@ -61,7 +61,7 @@
* <p>The secure-side helpers come in three flavors, distinguished by their
suffix:</p>
*
* <ul>
- * <li>{@code assert*Blocks(...)} runs the payload through a secure factory
from {@link org.apache.commons.xml} and asserts the parse throws. Used when the
secure
+ * <li>{@code assert*Blocks(...)} runs the payload through a secure factory
from {@link org.apache.commons.xml.secure} and asserts the parse throws. Used
when the secure
* layer is expected to reject the attack outright.</li>
* <li>{@code assert*DoesNotLeak(...)} runs the payload through a secure
factory and asserts the parse completes without throwing and without producing
the
* {@link #LEAKED_MARKER} string. Used when the secure contract
guarantees the parse succeeds but never resolves the external resource (for
example,
diff --git a/src/test/java/org/apache/commons/xml/BillionLaughsTest.java
b/src/test/java/org/apache/commons/xml/secure/BillionLaughsTest.java
similarity index 99%
rename from src/test/java/org/apache/commons/xml/BillionLaughsTest.java
rename to src/test/java/org/apache/commons/xml/secure/BillionLaughsTest.java
index 0f058d2..1285c54 100644
--- a/src/test/java/org/apache/commons/xml/BillionLaughsTest.java
+++ b/src/test/java/org/apache/commons/xml/secure/BillionLaughsTest.java
@@ -15,7 +15,7 @@
* limitations under the License.
*/
-package org.apache.commons.xml;
+package org.apache.commons.xml.secure;
import org.junit.jupiter.api.Assumptions;
import org.junit.jupiter.api.Tag;
diff --git a/src/test/java/org/apache/commons/xml/DenyUnresolvedTest.java
b/src/test/java/org/apache/commons/xml/secure/DenyUnresolvedTest.java
similarity index 98%
rename from src/test/java/org/apache/commons/xml/DenyUnresolvedTest.java
rename to src/test/java/org/apache/commons/xml/secure/DenyUnresolvedTest.java
index aaed8b9..8c4b628 100644
--- a/src/test/java/org/apache/commons/xml/DenyUnresolvedTest.java
+++ b/src/test/java/org/apache/commons/xml/secure/DenyUnresolvedTest.java
@@ -15,7 +15,7 @@
* limitations under the License.
*/
-package org.apache.commons.xml;
+package org.apache.commons.xml.secure;
import static org.junit.jupiter.api.Assertions.assertThrows;
diff --git a/src/test/java/org/apache/commons/xml/DoctypeOnlyTest.java
b/src/test/java/org/apache/commons/xml/secure/DoctypeOnlyTest.java
similarity index 98%
rename from src/test/java/org/apache/commons/xml/DoctypeOnlyTest.java
rename to src/test/java/org/apache/commons/xml/secure/DoctypeOnlyTest.java
index 55fa6fc..285e4e4 100644
--- a/src/test/java/org/apache/commons/xml/DoctypeOnlyTest.java
+++ b/src/test/java/org/apache/commons/xml/secure/DoctypeOnlyTest.java
@@ -15,7 +15,7 @@
* limitations under the License.
*/
-package org.apache.commons.xml;
+package org.apache.commons.xml.secure;
import org.junit.jupiter.api.Assumptions;
import org.junit.jupiter.api.Tag;
diff --git a/src/test/java/org/apache/commons/xml/EntityResolverFloorTest.java
b/src/test/java/org/apache/commons/xml/secure/EntityResolverFloorTest.java
similarity index 99%
rename from src/test/java/org/apache/commons/xml/EntityResolverFloorTest.java
rename to
src/test/java/org/apache/commons/xml/secure/EntityResolverFloorTest.java
index f89f8cb..ef4b5be 100644
--- a/src/test/java/org/apache/commons/xml/EntityResolverFloorTest.java
+++ b/src/test/java/org/apache/commons/xml/secure/EntityResolverFloorTest.java
@@ -15,10 +15,10 @@
* limitations under the License.
*/
-package org.apache.commons.xml;
+package org.apache.commons.xml.secure;
-import static org.apache.commons.xml.AttackTestSupport.assertParseFails;
-import static org.apache.commons.xml.AttackTestSupport.assertParseSucceeds;
+import static org.apache.commons.xml.secure.AttackTestSupport.assertParseFails;
+import static
org.apache.commons.xml.secure.AttackTestSupport.assertParseSucceeds;
import static org.junit.jupiter.api.Assertions.assertDoesNotThrow;
import static org.junit.jupiter.api.Assertions.assertFalse;
import static org.junit.jupiter.api.Assertions.assertSame;
diff --git a/src/test/java/org/apache/commons/xml/ExternalDtdTest.java
b/src/test/java/org/apache/commons/xml/secure/ExternalDtdTest.java
similarity index 99%
rename from src/test/java/org/apache/commons/xml/ExternalDtdTest.java
rename to src/test/java/org/apache/commons/xml/secure/ExternalDtdTest.java
index 92f6650..f6d5688 100644
--- a/src/test/java/org/apache/commons/xml/ExternalDtdTest.java
+++ b/src/test/java/org/apache/commons/xml/secure/ExternalDtdTest.java
@@ -15,7 +15,7 @@
* limitations under the License.
*/
-package org.apache.commons.xml;
+package org.apache.commons.xml.secure;
import javax.xml.transform.Source;
import javax.xml.validation.Validator;
diff --git
a/src/test/java/org/apache/commons/xml/ExternalGeneralEntityTest.java
b/src/test/java/org/apache/commons/xml/secure/ExternalGeneralEntityTest.java
similarity index 99%
rename from src/test/java/org/apache/commons/xml/ExternalGeneralEntityTest.java
rename to
src/test/java/org/apache/commons/xml/secure/ExternalGeneralEntityTest.java
index e07c70f..bf3ead4 100644
--- a/src/test/java/org/apache/commons/xml/ExternalGeneralEntityTest.java
+++ b/src/test/java/org/apache/commons/xml/secure/ExternalGeneralEntityTest.java
@@ -15,7 +15,7 @@
* limitations under the License.
*/
-package org.apache.commons.xml;
+package org.apache.commons.xml.secure;
import javax.xml.transform.Source;
import javax.xml.validation.Validator;
diff --git
a/src/test/java/org/apache/commons/xml/ExternalParameterEntityTest.java
b/src/test/java/org/apache/commons/xml/secure/ExternalParameterEntityTest.java
similarity index 99%
rename from
src/test/java/org/apache/commons/xml/ExternalParameterEntityTest.java
rename to
src/test/java/org/apache/commons/xml/secure/ExternalParameterEntityTest.java
index a11fe21..ec61d34 100644
--- a/src/test/java/org/apache/commons/xml/ExternalParameterEntityTest.java
+++
b/src/test/java/org/apache/commons/xml/secure/ExternalParameterEntityTest.java
@@ -15,7 +15,7 @@
* limitations under the License.
*/
-package org.apache.commons.xml;
+package org.apache.commons.xml.secure;
import static org.junit.jupiter.api.Assertions.assertDoesNotThrow;
diff --git
a/src/test/java/org/apache/commons/xml/FallbackIgnoreEntityResolver2Test.java
b/src/test/java/org/apache/commons/xml/secure/FallbackIgnoreEntityResolver2Test.java
similarity index 98%
rename from
src/test/java/org/apache/commons/xml/FallbackIgnoreEntityResolver2Test.java
rename to
src/test/java/org/apache/commons/xml/secure/FallbackIgnoreEntityResolver2Test.java
index 30ff875..2148ae4 100644
---
a/src/test/java/org/apache/commons/xml/FallbackIgnoreEntityResolver2Test.java
+++
b/src/test/java/org/apache/commons/xml/secure/FallbackIgnoreEntityResolver2Test.java
@@ -15,7 +15,7 @@
* limitations under the License.
*/
-package org.apache.commons.xml;
+package org.apache.commons.xml.secure;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertNotNull;
diff --git
a/src/test/java/org/apache/commons/xml/FallbackIgnoreLSResourceResolverTest.java
b/src/test/java/org/apache/commons/xml/secure/FallbackIgnoreLSResourceResolverTest.java
similarity index 98%
rename from
src/test/java/org/apache/commons/xml/FallbackIgnoreLSResourceResolverTest.java
rename to
src/test/java/org/apache/commons/xml/secure/FallbackIgnoreLSResourceResolverTest.java
index ac5c8aa..0878b98 100644
---
a/src/test/java/org/apache/commons/xml/FallbackIgnoreLSResourceResolverTest.java
+++
b/src/test/java/org/apache/commons/xml/secure/FallbackIgnoreLSResourceResolverTest.java
@@ -15,7 +15,7 @@
* limitations under the License.
*/
-package org.apache.commons.xml;
+package org.apache.commons.xml.secure;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertSame;
diff --git
a/src/test/java/org/apache/commons/xml/FallbackIgnoreURIResolverTest.java
b/src/test/java/org/apache/commons/xml/secure/FallbackIgnoreURIResolverTest.java
similarity index 98%
rename from
src/test/java/org/apache/commons/xml/FallbackIgnoreURIResolverTest.java
rename to
src/test/java/org/apache/commons/xml/secure/FallbackIgnoreURIResolverTest.java
index 34a3287..b479d7f 100644
--- a/src/test/java/org/apache/commons/xml/FallbackIgnoreURIResolverTest.java
+++
b/src/test/java/org/apache/commons/xml/secure/FallbackIgnoreURIResolverTest.java
@@ -15,7 +15,7 @@
* limitations under the License.
*/
-package org.apache.commons.xml;
+package org.apache.commons.xml.secure;
import static org.junit.jupiter.api.Assertions.assertSame;
import static org.junit.jupiter.api.Assertions.assertThrows;
diff --git
a/src/test/java/org/apache/commons/xml/FallbackIgnoreXMLResolverTest.java
b/src/test/java/org/apache/commons/xml/secure/FallbackIgnoreXMLResolverTest.java
similarity index 98%
rename from
src/test/java/org/apache/commons/xml/FallbackIgnoreXMLResolverTest.java
rename to
src/test/java/org/apache/commons/xml/secure/FallbackIgnoreXMLResolverTest.java
index 4a71043..6dda8e9 100644
--- a/src/test/java/org/apache/commons/xml/FallbackIgnoreXMLResolverTest.java
+++
b/src/test/java/org/apache/commons/xml/secure/FallbackIgnoreXMLResolverTest.java
@@ -15,7 +15,7 @@
* limitations under the License.
*/
-package org.apache.commons.xml;
+package org.apache.commons.xml.secure;
import static org.junit.jupiter.api.Assertions.assertNotNull;
import static org.junit.jupiter.api.Assertions.assertSame;
diff --git a/src/test/java/org/apache/commons/xml/MethodHandleFactoryTest.java
b/src/test/java/org/apache/commons/xml/secure/MethodHandleFactoryTest.java
similarity index 98%
rename from src/test/java/org/apache/commons/xml/MethodHandleFactoryTest.java
rename to
src/test/java/org/apache/commons/xml/secure/MethodHandleFactoryTest.java
index 09379df..c3f1f58 100644
--- a/src/test/java/org/apache/commons/xml/MethodHandleFactoryTest.java
+++ b/src/test/java/org/apache/commons/xml/secure/MethodHandleFactoryTest.java
@@ -15,7 +15,7 @@
* limitations under the License.
*/
-package org.apache.commons.xml;
+package org.apache.commons.xml.secure;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertInstanceOf;
diff --git a/src/test/java/org/apache/commons/xml/NoDoctypeTest.java
b/src/test/java/org/apache/commons/xml/secure/NoDoctypeTest.java
similarity index 98%
rename from src/test/java/org/apache/commons/xml/NoDoctypeTest.java
rename to src/test/java/org/apache/commons/xml/secure/NoDoctypeTest.java
index abf3656..3042bef 100644
--- a/src/test/java/org/apache/commons/xml/NoDoctypeTest.java
+++ b/src/test/java/org/apache/commons/xml/secure/NoDoctypeTest.java
@@ -15,7 +15,7 @@
* limitations under the License.
*/
-package org.apache.commons.xml;
+package org.apache.commons.xml.secure;
import org.junit.jupiter.api.Tag;
import org.junit.jupiter.api.Test;
diff --git
a/src/test/java/org/apache/commons/xml/OverrideDefaultParserTest.java
b/src/test/java/org/apache/commons/xml/secure/OverrideDefaultParserTest.java
similarity index 99%
rename from src/test/java/org/apache/commons/xml/OverrideDefaultParserTest.java
rename to
src/test/java/org/apache/commons/xml/secure/OverrideDefaultParserTest.java
index 95af0d8..1ada79b 100644
--- a/src/test/java/org/apache/commons/xml/OverrideDefaultParserTest.java
+++ b/src/test/java/org/apache/commons/xml/secure/OverrideDefaultParserTest.java
@@ -15,7 +15,7 @@
* limitations under the License.
*/
-package org.apache.commons.xml;
+package org.apache.commons.xml.secure;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertFalse;
diff --git a/src/test/java/org/apache/commons/xml/ResetSecureTest.java
b/src/test/java/org/apache/commons/xml/secure/ResetSecureTest.java
similarity index 99%
rename from src/test/java/org/apache/commons/xml/ResetSecureTest.java
rename to src/test/java/org/apache/commons/xml/secure/ResetSecureTest.java
index a0ce73e..5bf3ebe 100644
--- a/src/test/java/org/apache/commons/xml/ResetSecureTest.java
+++ b/src/test/java/org/apache/commons/xml/secure/ResetSecureTest.java
@@ -15,7 +15,7 @@
* limitations under the License.
*/
-package org.apache.commons.xml;
+package org.apache.commons.xml.secure;
import static org.junit.jupiter.api.Assertions.assertFalse;
diff --git a/src/test/java/org/apache/commons/xml/SaxSurfaceTestSupport.java
b/src/test/java/org/apache/commons/xml/secure/SaxSurfaceTestSupport.java
similarity index 98%
rename from src/test/java/org/apache/commons/xml/SaxSurfaceTestSupport.java
rename to src/test/java/org/apache/commons/xml/secure/SaxSurfaceTestSupport.java
index 4d7b7f5..8af7911 100644
--- a/src/test/java/org/apache/commons/xml/SaxSurfaceTestSupport.java
+++ b/src/test/java/org/apache/commons/xml/secure/SaxSurfaceTestSupport.java
@@ -15,7 +15,7 @@
* limitations under the License.
*/
-package org.apache.commons.xml;
+package org.apache.commons.xml.secure;
import java.io.IOException;
import java.io.StringReader;
diff --git
a/src/test/java/org/apache/commons/xml/SaxonAlternateFactoryTest.java
b/src/test/java/org/apache/commons/xml/secure/SaxonAlternateFactoryTest.java
similarity index 99%
rename from src/test/java/org/apache/commons/xml/SaxonAlternateFactoryTest.java
rename to
src/test/java/org/apache/commons/xml/secure/SaxonAlternateFactoryTest.java
index 96630bf..72ed845 100644
--- a/src/test/java/org/apache/commons/xml/SaxonAlternateFactoryTest.java
+++ b/src/test/java/org/apache/commons/xml/secure/SaxonAlternateFactoryTest.java
@@ -15,7 +15,7 @@
* limitations under the License.
*/
-package org.apache.commons.xml;
+package org.apache.commons.xml.secure;
import static org.junit.jupiter.api.Assertions.assertFalse;
import static org.junit.jupiter.api.Assertions.assertTrue;
diff --git a/src/test/java/org/apache/commons/xml/SaxonProviderTest.java
b/src/test/java/org/apache/commons/xml/secure/SaxonProviderTest.java
similarity index 99%
rename from src/test/java/org/apache/commons/xml/SaxonProviderTest.java
rename to src/test/java/org/apache/commons/xml/secure/SaxonProviderTest.java
index bbe275c..e8f1b91 100644
--- a/src/test/java/org/apache/commons/xml/SaxonProviderTest.java
+++ b/src/test/java/org/apache/commons/xml/secure/SaxonProviderTest.java
@@ -15,7 +15,7 @@
* limitations under the License.
*/
-package org.apache.commons.xml;
+package org.apache.commons.xml.secure;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertFalse;
diff --git
a/src/test/java/org/apache/commons/xml/SaxonXPathExternalCallsTest.java
b/src/test/java/org/apache/commons/xml/secure/SaxonXPathExternalCallsTest.java
similarity index 99%
rename from
src/test/java/org/apache/commons/xml/SaxonXPathExternalCallsTest.java
rename to
src/test/java/org/apache/commons/xml/secure/SaxonXPathExternalCallsTest.java
index a6e6043..ddd8fc0 100644
--- a/src/test/java/org/apache/commons/xml/SaxonXPathExternalCallsTest.java
+++
b/src/test/java/org/apache/commons/xml/secure/SaxonXPathExternalCallsTest.java
@@ -15,7 +15,7 @@
* limitations under the License.
*/
-package org.apache.commons.xml;
+package org.apache.commons.xml.secure;
import static org.junit.jupiter.api.Assertions.assertFalse;
import static org.junit.jupiter.api.Assertions.assertTrue;
diff --git
a/src/test/java/org/apache/commons/xml/SchemaFactoryLanguageTest.java
b/src/test/java/org/apache/commons/xml/secure/SchemaFactoryLanguageTest.java
similarity index 97%
rename from src/test/java/org/apache/commons/xml/SchemaFactoryLanguageTest.java
rename to
src/test/java/org/apache/commons/xml/secure/SchemaFactoryLanguageTest.java
index 8fd04bb..8420f21 100644
--- a/src/test/java/org/apache/commons/xml/SchemaFactoryLanguageTest.java
+++ b/src/test/java/org/apache/commons/xml/secure/SchemaFactoryLanguageTest.java
@@ -15,7 +15,7 @@
* limitations under the License.
*/
-package org.apache.commons.xml;
+package org.apache.commons.xml.secure;
import static org.junit.jupiter.api.Assertions.assertThrows;
diff --git a/src/test/java/org/apache/commons/xml/SchemaImportTest.java
b/src/test/java/org/apache/commons/xml/secure/SchemaImportTest.java
similarity index 97%
rename from src/test/java/org/apache/commons/xml/SchemaImportTest.java
rename to src/test/java/org/apache/commons/xml/secure/SchemaImportTest.java
index 5312c4c..69d9726 100644
--- a/src/test/java/org/apache/commons/xml/SchemaImportTest.java
+++ b/src/test/java/org/apache/commons/xml/secure/SchemaImportTest.java
@@ -15,7 +15,7 @@
* limitations under the License.
*/
-package org.apache.commons.xml;
+package org.apache.commons.xml.secure;
import org.junit.jupiter.api.Tag;
import org.junit.jupiter.api.Test;
diff --git a/src/test/java/org/apache/commons/xml/SchemaIncludeTest.java
b/src/test/java/org/apache/commons/xml/secure/SchemaIncludeTest.java
similarity index 97%
rename from src/test/java/org/apache/commons/xml/SchemaIncludeTest.java
rename to src/test/java/org/apache/commons/xml/secure/SchemaIncludeTest.java
index ad8be5d..f436319 100644
--- a/src/test/java/org/apache/commons/xml/SchemaIncludeTest.java
+++ b/src/test/java/org/apache/commons/xml/secure/SchemaIncludeTest.java
@@ -15,7 +15,7 @@
* limitations under the License.
*/
-package org.apache.commons.xml;
+package org.apache.commons.xml.secure;
import org.junit.jupiter.api.Tag;
import org.junit.jupiter.api.Test;
diff --git a/src/test/java/org/apache/commons/xml/SchemaLocationDomTest.java
b/src/test/java/org/apache/commons/xml/secure/SchemaLocationDomTest.java
similarity index 96%
rename from src/test/java/org/apache/commons/xml/SchemaLocationDomTest.java
rename to src/test/java/org/apache/commons/xml/secure/SchemaLocationDomTest.java
index 47d76c5..a7dd0f3 100644
--- a/src/test/java/org/apache/commons/xml/SchemaLocationDomTest.java
+++ b/src/test/java/org/apache/commons/xml/secure/SchemaLocationDomTest.java
@@ -15,10 +15,10 @@
* limitations under the License.
*/
-package org.apache.commons.xml;
+package org.apache.commons.xml.secure;
-import static org.apache.commons.xml.AttackTestSupport.LEAKED_MARKER;
-import static org.apache.commons.xml.AttackTestSupport.resourceUrl;
+import static org.apache.commons.xml.secure.AttackTestSupport.LEAKED_MARKER;
+import static org.apache.commons.xml.secure.AttackTestSupport.resourceUrl;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertNotEquals;
import static org.junit.jupiter.api.Assumptions.assumeTrue;
diff --git
a/src/test/java/org/apache/commons/xml/SchemaLocationPropertyTest.java
b/src/test/java/org/apache/commons/xml/secure/SchemaLocationPropertyTest.java
similarity index 94%
rename from src/test/java/org/apache/commons/xml/SchemaLocationPropertyTest.java
rename to
src/test/java/org/apache/commons/xml/secure/SchemaLocationPropertyTest.java
index 2e18693..5af657b 100644
--- a/src/test/java/org/apache/commons/xml/SchemaLocationPropertyTest.java
+++
b/src/test/java/org/apache/commons/xml/secure/SchemaLocationPropertyTest.java
@@ -15,14 +15,14 @@
* limitations under the License.
*/
-package org.apache.commons.xml;
-
-import static org.apache.commons.xml.AttackTestSupport.assertParseFails;
-import static org.apache.commons.xml.AttackTestSupport.assertParseSucceeds;
-import static org.apache.commons.xml.AttackTestSupport.inputSource;
-import static org.apache.commons.xml.AttackTestSupport.resourceUrl;
-import static org.apache.commons.xml.AttackTestSupport.strictDocumentBuilder;
-import static org.apache.commons.xml.AttackTestSupport.strictXMLReader;
+package org.apache.commons.xml.secure;
+
+import static org.apache.commons.xml.secure.AttackTestSupport.assertParseFails;
+import static
org.apache.commons.xml.secure.AttackTestSupport.assertParseSucceeds;
+import static org.apache.commons.xml.secure.AttackTestSupport.inputSource;
+import static org.apache.commons.xml.secure.AttackTestSupport.resourceUrl;
+import static
org.apache.commons.xml.secure.AttackTestSupport.strictDocumentBuilder;
+import static org.apache.commons.xml.secure.AttackTestSupport.strictXMLReader;
import javax.xml.XMLConstants;
import javax.xml.parsers.DocumentBuilder;
diff --git a/src/test/java/org/apache/commons/xml/SchemaLocationSaxTest.java
b/src/test/java/org/apache/commons/xml/secure/SchemaLocationSaxTest.java
similarity index 97%
rename from src/test/java/org/apache/commons/xml/SchemaLocationSaxTest.java
rename to src/test/java/org/apache/commons/xml/secure/SchemaLocationSaxTest.java
index e3b87ff..ed96856 100644
--- a/src/test/java/org/apache/commons/xml/SchemaLocationSaxTest.java
+++ b/src/test/java/org/apache/commons/xml/secure/SchemaLocationSaxTest.java
@@ -15,10 +15,10 @@
* limitations under the License.
*/
-package org.apache.commons.xml;
+package org.apache.commons.xml.secure;
-import static org.apache.commons.xml.AttackTestSupport.LEAKED_MARKER;
-import static org.apache.commons.xml.AttackTestSupport.resourceUrl;
+import static org.apache.commons.xml.secure.AttackTestSupport.LEAKED_MARKER;
+import static org.apache.commons.xml.secure.AttackTestSupport.resourceUrl;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertNull;
import static org.junit.jupiter.api.Assumptions.assumeTrue;
diff --git a/src/test/java/org/apache/commons/xml/SchemaRedefineTest.java
b/src/test/java/org/apache/commons/xml/secure/SchemaRedefineTest.java
similarity index 97%
rename from src/test/java/org/apache/commons/xml/SchemaRedefineTest.java
rename to src/test/java/org/apache/commons/xml/secure/SchemaRedefineTest.java
index d656c1e..5fccfbc 100644
--- a/src/test/java/org/apache/commons/xml/SchemaRedefineTest.java
+++ b/src/test/java/org/apache/commons/xml/secure/SchemaRedefineTest.java
@@ -15,7 +15,7 @@
* limitations under the License.
*/
-package org.apache.commons.xml;
+package org.apache.commons.xml.secure;
import org.junit.jupiter.api.Tag;
import org.junit.jupiter.api.Test;
diff --git
a/src/test/java/org/apache/commons/xml/SecureDocumentBuilderFactoryTest.java
b/src/test/java/org/apache/commons/xml/secure/SecureDocumentBuilderFactoryTest.java
similarity index 99%
rename from
src/test/java/org/apache/commons/xml/SecureDocumentBuilderFactoryTest.java
rename to
src/test/java/org/apache/commons/xml/secure/SecureDocumentBuilderFactoryTest.java
index 9986723..c2f8e57 100644
--- a/src/test/java/org/apache/commons/xml/SecureDocumentBuilderFactoryTest.java
+++
b/src/test/java/org/apache/commons/xml/secure/SecureDocumentBuilderFactoryTest.java
@@ -15,7 +15,7 @@
* limitations under the License.
*/
-package org.apache.commons.xml;
+package org.apache.commons.xml.secure;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertFalse;
diff --git
a/src/test/java/org/apache/commons/xml/SecureDocumentBuilderTest.java
b/src/test/java/org/apache/commons/xml/secure/SecureDocumentBuilderTest.java
similarity index 98%
rename from src/test/java/org/apache/commons/xml/SecureDocumentBuilderTest.java
rename to
src/test/java/org/apache/commons/xml/secure/SecureDocumentBuilderTest.java
index f7def33..f17d1a5 100644
--- a/src/test/java/org/apache/commons/xml/SecureDocumentBuilderTest.java
+++ b/src/test/java/org/apache/commons/xml/secure/SecureDocumentBuilderTest.java
@@ -15,7 +15,7 @@
* limitations under the License.
*/
-package org.apache.commons.xml;
+package org.apache.commons.xml.secure;
import static org.junit.jupiter.api.Assertions.assertFalse;
import static org.junit.jupiter.api.Assertions.assertNotNull;
diff --git a/src/test/java/org/apache/commons/xml/SecureExceptionTest.java
b/src/test/java/org/apache/commons/xml/secure/SecureExceptionTest.java
similarity index 97%
rename from src/test/java/org/apache/commons/xml/SecureExceptionTest.java
rename to src/test/java/org/apache/commons/xml/secure/SecureExceptionTest.java
index b7b714c..c635870 100644
--- a/src/test/java/org/apache/commons/xml/SecureExceptionTest.java
+++ b/src/test/java/org/apache/commons/xml/secure/SecureExceptionTest.java
@@ -15,7 +15,7 @@
* limitations under the License.
*/
-package org.apache.commons.xml;
+package org.apache.commons.xml.secure;
import static org.junit.jupiter.api.Assertions.assertFalse;
import static org.junit.jupiter.api.Assertions.assertSame;
diff --git a/src/test/java/org/apache/commons/xml/SecureFactoriesSmokeTest.java
b/src/test/java/org/apache/commons/xml/secure/SecureFactoriesSmokeTest.java
similarity index 98%
rename from src/test/java/org/apache/commons/xml/SecureFactoriesSmokeTest.java
rename to
src/test/java/org/apache/commons/xml/secure/SecureFactoriesSmokeTest.java
index 43cf9c5..b19838a 100644
--- a/src/test/java/org/apache/commons/xml/SecureFactoriesSmokeTest.java
+++ b/src/test/java/org/apache/commons/xml/secure/SecureFactoriesSmokeTest.java
@@ -15,7 +15,7 @@
* limitations under the License.
*/
-package org.apache.commons.xml;
+package org.apache.commons.xml.secure;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertFalse;
@@ -45,7 +45,7 @@
import org.xml.sax.helpers.DefaultHandler;
/**
- * Public-API smoke tests for {@link org.apache.commons.xml}.
+ * Public-API smoke tests for {@link org.apache.commons.xml.secure}.
* <p>
* Attack tests live in the {@code attacks} sub-package; this file only
verifies that new factories are returned, that they report safe defaults, and
that a
* benign document still parses successfully.
@@ -133,7 +133,7 @@ void explicitClassNameXPathFactoryIsSecure() throws
Exception {
@Test
@Tag("stax")
void factoryIdXMLInputFactoryIsSecure() {
- final String factoryId = "org.apache.commons.xml.test.staxFactory";
+ final String factoryId =
"org.apache.commons.xml.secure.test.staxFactory";
// XMLInputFactory.newInstance, not newFactory: Android's StAX API
predates newFactory, and this file also compiles against android.jar.
System.setProperty(factoryId,
XMLInputFactory.newInstance().getClass().getName());
try {
diff --git
a/src/test/java/org/apache/commons/xml/SecureSAXParserFactoryTest.java
b/src/test/java/org/apache/commons/xml/secure/SecureSAXParserFactoryTest.java
similarity index 99%
rename from src/test/java/org/apache/commons/xml/SecureSAXParserFactoryTest.java
rename to
src/test/java/org/apache/commons/xml/secure/SecureSAXParserFactoryTest.java
index 6927938..3300812 100644
--- a/src/test/java/org/apache/commons/xml/SecureSAXParserFactoryTest.java
+++
b/src/test/java/org/apache/commons/xml/secure/SecureSAXParserFactoryTest.java
@@ -15,7 +15,7 @@
* limitations under the License.
*/
-package org.apache.commons.xml;
+package org.apache.commons.xml.secure;
import static org.junit.jupiter.api.Assertions.assertFalse;
import static org.junit.jupiter.api.Assertions.assertInstanceOf;
diff --git a/src/test/java/org/apache/commons/xml/SecureSAXParserTest.java
b/src/test/java/org/apache/commons/xml/secure/SecureSAXParserTest.java
similarity index 99%
rename from src/test/java/org/apache/commons/xml/SecureSAXParserTest.java
rename to src/test/java/org/apache/commons/xml/secure/SecureSAXParserTest.java
index 4f24b74..da593ae 100644
--- a/src/test/java/org/apache/commons/xml/SecureSAXParserTest.java
+++ b/src/test/java/org/apache/commons/xml/secure/SecureSAXParserTest.java
@@ -15,7 +15,7 @@
* limitations under the License.
*/
-package org.apache.commons.xml;
+package org.apache.commons.xml.secure;
import static org.junit.jupiter.api.Assertions.assertNotNull;
import static org.junit.jupiter.api.Assertions.assertNotSame;
diff --git a/src/test/java/org/apache/commons/xml/SecureSchemaFactoryTest.java
b/src/test/java/org/apache/commons/xml/secure/SecureSchemaFactoryTest.java
similarity index 99%
rename from src/test/java/org/apache/commons/xml/SecureSchemaFactoryTest.java
rename to
src/test/java/org/apache/commons/xml/secure/SecureSchemaFactoryTest.java
index 684c694..83b34d9 100644
--- a/src/test/java/org/apache/commons/xml/SecureSchemaFactoryTest.java
+++ b/src/test/java/org/apache/commons/xml/secure/SecureSchemaFactoryTest.java
@@ -15,7 +15,7 @@
* limitations under the License.
*/
-package org.apache.commons.xml;
+package org.apache.commons.xml.secure;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertInstanceOf;
diff --git a/src/test/java/org/apache/commons/xml/SecureSchemaTest.java
b/src/test/java/org/apache/commons/xml/secure/SecureSchemaTest.java
similarity index 97%
rename from src/test/java/org/apache/commons/xml/SecureSchemaTest.java
rename to src/test/java/org/apache/commons/xml/secure/SecureSchemaTest.java
index c3757f7..3ddcd98 100644
--- a/src/test/java/org/apache/commons/xml/SecureSchemaTest.java
+++ b/src/test/java/org/apache/commons/xml/secure/SecureSchemaTest.java
@@ -15,7 +15,7 @@
* limitations under the License.
*/
-package org.apache.commons.xml;
+package org.apache.commons.xml.secure;
import static org.junit.jupiter.api.Assertions.assertInstanceOf;
diff --git
a/src/test/java/org/apache/commons/xml/SecureTemplatesHandlerTest.java
b/src/test/java/org/apache/commons/xml/secure/SecureTemplatesHandlerTest.java
similarity index 99%
rename from src/test/java/org/apache/commons/xml/SecureTemplatesHandlerTest.java
rename to
src/test/java/org/apache/commons/xml/secure/SecureTemplatesHandlerTest.java
index bfcf4a6..ac5ffcd 100644
--- a/src/test/java/org/apache/commons/xml/SecureTemplatesHandlerTest.java
+++
b/src/test/java/org/apache/commons/xml/secure/SecureTemplatesHandlerTest.java
@@ -15,7 +15,7 @@
* limitations under the License.
*/
-package org.apache.commons.xml;
+package org.apache.commons.xml.secure;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertInstanceOf;
diff --git a/src/test/java/org/apache/commons/xml/SecureTemplatesTest.java
b/src/test/java/org/apache/commons/xml/secure/SecureTemplatesTest.java
similarity index 98%
rename from src/test/java/org/apache/commons/xml/SecureTemplatesTest.java
rename to src/test/java/org/apache/commons/xml/secure/SecureTemplatesTest.java
index 71e617f..957a640 100644
--- a/src/test/java/org/apache/commons/xml/SecureTemplatesTest.java
+++ b/src/test/java/org/apache/commons/xml/secure/SecureTemplatesTest.java
@@ -15,7 +15,7 @@
* limitations under the License.
*/
-package org.apache.commons.xml;
+package org.apache.commons.xml.secure;
import static org.junit.jupiter.api.Assertions.assertInstanceOf;
import static org.junit.jupiter.api.Assertions.assertNotNull;
diff --git
a/src/test/java/org/apache/commons/xml/SecureTransformerFactoryTest.java
b/src/test/java/org/apache/commons/xml/secure/SecureTransformerFactoryTest.java
similarity index 98%
rename from
src/test/java/org/apache/commons/xml/SecureTransformerFactoryTest.java
rename to
src/test/java/org/apache/commons/xml/secure/SecureTransformerFactoryTest.java
index 83a2343..1e5fbf0 100644
--- a/src/test/java/org/apache/commons/xml/SecureTransformerFactoryTest.java
+++
b/src/test/java/org/apache/commons/xml/secure/SecureTransformerFactoryTest.java
@@ -15,7 +15,7 @@
* limitations under the License.
*/
-package org.apache.commons.xml;
+package org.apache.commons.xml.secure;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertInstanceOf;
@@ -45,8 +45,6 @@
import org.junit.jupiter.api.Tag;
import org.junit.jupiter.api.Test;
-import org.junit.jupiter.api.condition.DisabledIfSystemProperties;
-import org.junit.jupiter.api.condition.DisabledIfSystemProperty;
import org.xml.sax.InputSource;
import org.xml.sax.XMLFilter;
diff --git
a/src/test/java/org/apache/commons/xml/SecureTransformerHandlerTest.java
b/src/test/java/org/apache/commons/xml/secure/SecureTransformerHandlerTest.java
similarity index 98%
rename from
src/test/java/org/apache/commons/xml/SecureTransformerHandlerTest.java
rename to
src/test/java/org/apache/commons/xml/secure/SecureTransformerHandlerTest.java
index 59348c4..d65b86d 100644
--- a/src/test/java/org/apache/commons/xml/SecureTransformerHandlerTest.java
+++
b/src/test/java/org/apache/commons/xml/secure/SecureTransformerHandlerTest.java
@@ -15,7 +15,7 @@
* limitations under the License.
*/
-package org.apache.commons.xml;
+package org.apache.commons.xml.secure;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertInstanceOf;
diff --git a/src/test/java/org/apache/commons/xml/SecureTransformerTest.java
b/src/test/java/org/apache/commons/xml/secure/SecureTransformerTest.java
similarity index 98%
rename from src/test/java/org/apache/commons/xml/SecureTransformerTest.java
rename to src/test/java/org/apache/commons/xml/secure/SecureTransformerTest.java
index 55f34c2..dbf6009 100644
--- a/src/test/java/org/apache/commons/xml/SecureTransformerTest.java
+++ b/src/test/java/org/apache/commons/xml/secure/SecureTransformerTest.java
@@ -15,7 +15,7 @@
* limitations under the License.
*/
-package org.apache.commons.xml;
+package org.apache.commons.xml.secure;
import static org.junit.jupiter.api.Assertions.assertNotNull;
diff --git
a/src/test/java/org/apache/commons/xml/SecureValidatorHandlerTest.java
b/src/test/java/org/apache/commons/xml/secure/SecureValidatorHandlerTest.java
similarity index 99%
rename from src/test/java/org/apache/commons/xml/SecureValidatorHandlerTest.java
rename to
src/test/java/org/apache/commons/xml/secure/SecureValidatorHandlerTest.java
index 9336948..6908de5 100644
--- a/src/test/java/org/apache/commons/xml/SecureValidatorHandlerTest.java
+++
b/src/test/java/org/apache/commons/xml/secure/SecureValidatorHandlerTest.java
@@ -15,7 +15,7 @@
* limitations under the License.
*/
-package org.apache.commons.xml;
+package org.apache.commons.xml.secure;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertNotNull;
diff --git a/src/test/java/org/apache/commons/xml/SecureValidatorTest.java
b/src/test/java/org/apache/commons/xml/secure/SecureValidatorTest.java
similarity index 99%
rename from src/test/java/org/apache/commons/xml/SecureValidatorTest.java
rename to src/test/java/org/apache/commons/xml/secure/SecureValidatorTest.java
index 32c06f8..8330155 100644
--- a/src/test/java/org/apache/commons/xml/SecureValidatorTest.java
+++ b/src/test/java/org/apache/commons/xml/secure/SecureValidatorTest.java
@@ -15,7 +15,7 @@
* limitations under the License.
*/
-package org.apache.commons.xml;
+package org.apache.commons.xml.secure;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertNull;
diff --git a/src/test/java/org/apache/commons/xml/SecureXMLFilterTest.java
b/src/test/java/org/apache/commons/xml/secure/SecureXMLFilterTest.java
similarity index 99%
rename from src/test/java/org/apache/commons/xml/SecureXMLFilterTest.java
rename to src/test/java/org/apache/commons/xml/secure/SecureXMLFilterTest.java
index f656ea5..8414a80 100644
--- a/src/test/java/org/apache/commons/xml/SecureXMLFilterTest.java
+++ b/src/test/java/org/apache/commons/xml/secure/SecureXMLFilterTest.java
@@ -15,10 +15,9 @@
* limitations under the License.
*/
-package org.apache.commons.xml;
+package org.apache.commons.xml.secure;
import static org.junit.jupiter.api.Assertions.assertEquals;
-import static org.junit.jupiter.api.Assertions.assertNotNull;
import static org.junit.jupiter.api.Assertions.assertSame;
import static org.junit.jupiter.api.Assertions.assertThrows;
import static org.junit.jupiter.api.Assertions.assertTrue;
diff --git
a/src/test/java/org/apache/commons/xml/SecureXMLInputFactoryTest.java
b/src/test/java/org/apache/commons/xml/secure/SecureXMLInputFactoryTest.java
similarity index 99%
rename from src/test/java/org/apache/commons/xml/SecureXMLInputFactoryTest.java
rename to
src/test/java/org/apache/commons/xml/secure/SecureXMLInputFactoryTest.java
index 82988dc..fe60637 100644
--- a/src/test/java/org/apache/commons/xml/SecureXMLInputFactoryTest.java
+++ b/src/test/java/org/apache/commons/xml/secure/SecureXMLInputFactoryTest.java
@@ -15,7 +15,7 @@
* limitations under the License.
*/
-package org.apache.commons.xml;
+package org.apache.commons.xml.secure;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertFalse;
@@ -378,7 +378,7 @@ void newFactoryParsesBenignDocument() throws Exception {
@Test
void newFactoryWithFactoryIdReturnsUsableSecureFactory() throws Exception {
- final String factoryId = "org.apache.commons.xml.test.inputFactory";
+ final String factoryId =
"org.apache.commons.xml.secure.test.inputFactory";
System.setProperty(factoryId,
XMLInputFactory.newInstance().getClass().getName());
try {
final XMLInputFactory factory =
SecureXMLInputFactory.newFactory(factoryId, getClass().getClassLoader());
diff --git a/src/test/java/org/apache/commons/xml/SecureXMLReaderTest.java
b/src/test/java/org/apache/commons/xml/secure/SecureXMLReaderTest.java
similarity index 98%
rename from src/test/java/org/apache/commons/xml/SecureXMLReaderTest.java
rename to src/test/java/org/apache/commons/xml/secure/SecureXMLReaderTest.java
index 19591cd..6ba1162 100644
--- a/src/test/java/org/apache/commons/xml/SecureXMLReaderTest.java
+++ b/src/test/java/org/apache/commons/xml/secure/SecureXMLReaderTest.java
@@ -15,7 +15,7 @@
* limitations under the License.
*/
-package org.apache.commons.xml;
+package org.apache.commons.xml.secure;
import static org.junit.jupiter.api.Assertions.assertThrows;
import static org.junit.jupiter.api.Assertions.assertTrue;
diff --git
a/src/test/java/org/apache/commons/xml/SecureXPathExpressionTest.java
b/src/test/java/org/apache/commons/xml/secure/SecureXPathExpressionTest.java
similarity index 93%
rename from src/test/java/org/apache/commons/xml/SecureXPathExpressionTest.java
rename to
src/test/java/org/apache/commons/xml/secure/SecureXPathExpressionTest.java
index 2b517da..95e0e25 100644
--- a/src/test/java/org/apache/commons/xml/SecureXPathExpressionTest.java
+++ b/src/test/java/org/apache/commons/xml/secure/SecureXPathExpressionTest.java
@@ -15,7 +15,7 @@
* limitations under the License.
*/
-package org.apache.commons.xml;
+package org.apache.commons.xml.secure;
import static org.junit.jupiter.api.Assertions.assertEquals;
@@ -37,7 +37,7 @@ void evaluatesEveryXPathExpressionOverload() throws Exception
{
final InputSource source = new InputSource(new
StringReader("<root>value</root>"));
assertEquals("value", expression.evaluate(source));
assertEquals("value", expression.evaluate(new InputSource(new
StringReader("<root>value</root>")), XPathConstants.STRING));
- assertEquals("value",
expression.evaluate(org.apache.commons.xml.SecureXPath.parse(new
InputSource(new StringReader("<root>value</root>")), false)));
+ assertEquals("value",
expression.evaluate(org.apache.commons.xml.secure.SecureXPath.parse(new
InputSource(new StringReader("<root>value</root>")), false)));
assertEquals("value",
expression.evaluate(SecureXPath.parse(new InputSource(new
StringReader("<root>value</root>")), false), XPathConstants.STRING));
}
diff --git a/src/test/java/org/apache/commons/xml/SecureXPathFactoryTest.java
b/src/test/java/org/apache/commons/xml/secure/SecureXPathFactoryTest.java
similarity index 99%
rename from src/test/java/org/apache/commons/xml/SecureXPathFactoryTest.java
rename to
src/test/java/org/apache/commons/xml/secure/SecureXPathFactoryTest.java
index 7f1c612..d6cbdc5 100644
--- a/src/test/java/org/apache/commons/xml/SecureXPathFactoryTest.java
+++ b/src/test/java/org/apache/commons/xml/secure/SecureXPathFactoryTest.java
@@ -15,7 +15,7 @@
* limitations under the License.
*/
-package org.apache.commons.xml;
+package org.apache.commons.xml.secure;
import static org.junit.jupiter.api.Assertions.assertInstanceOf;
import static org.junit.jupiter.api.Assertions.assertNull;
diff --git a/src/test/java/org/apache/commons/xml/SecureXPathTest.java
b/src/test/java/org/apache/commons/xml/secure/SecureXPathTest.java
similarity index 99%
rename from src/test/java/org/apache/commons/xml/SecureXPathTest.java
rename to src/test/java/org/apache/commons/xml/secure/SecureXPathTest.java
index 0d9349b..a73a420 100644
--- a/src/test/java/org/apache/commons/xml/SecureXPathTest.java
+++ b/src/test/java/org/apache/commons/xml/secure/SecureXPathTest.java
@@ -15,7 +15,7 @@
* limitations under the License.
*/
-package org.apache.commons.xml;
+package org.apache.commons.xml.secure;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertNotNull;
diff --git a/src/test/java/org/apache/commons/xml/ShadingFootprintTest.java
b/src/test/java/org/apache/commons/xml/secure/ShadingFootprintTest.java
similarity index 98%
rename from src/test/java/org/apache/commons/xml/ShadingFootprintTest.java
rename to src/test/java/org/apache/commons/xml/secure/ShadingFootprintTest.java
index ff5de3b..cc97680 100644
--- a/src/test/java/org/apache/commons/xml/ShadingFootprintTest.java
+++ b/src/test/java/org/apache/commons/xml/secure/ShadingFootprintTest.java
@@ -15,7 +15,7 @@
* limitations under the License.
*/
-package org.apache.commons.xml;
+package org.apache.commons.xml.secure;
import static org.junit.jupiter.api.Assertions.assertEquals;
@@ -53,7 +53,7 @@
@DisabledInNativeImage
class ShadingFootprintTest {
- private static final String PKG = "org.apache.commons.xml.";
+ private static final String PKG = "org.apache.commons.xml.secure.";
// @formatter:off
private static final Set<String> DOCUMENT_BUILDER_FACTORY = set(
@@ -194,7 +194,7 @@ private static long bytesOf(final Set<String> simpleNames) {
long total = 0;
for (final String name : simpleNames) {
try {
- total +=
Files.size(classesDir.resolve("org/apache/commons/xml/" + name + ".class"));
+ total +=
Files.size(classesDir.resolve("org/apache/commons/xml/secure/" + name +
".class"));
} catch (final IOException e) {
throw new UncheckedIOException(e);
}
diff --git a/src/test/java/org/apache/commons/xml/TemplatesHandlerTest.java
b/src/test/java/org/apache/commons/xml/secure/TemplatesHandlerTest.java
similarity index 98%
rename from src/test/java/org/apache/commons/xml/TemplatesHandlerTest.java
rename to src/test/java/org/apache/commons/xml/secure/TemplatesHandlerTest.java
index 6c6ac7a..2a82674 100644
--- a/src/test/java/org/apache/commons/xml/TemplatesHandlerTest.java
+++ b/src/test/java/org/apache/commons/xml/secure/TemplatesHandlerTest.java
@@ -15,7 +15,7 @@
* limitations under the License.
*/
-package org.apache.commons.xml;
+package org.apache.commons.xml.secure;
import static org.junit.jupiter.api.Assertions.assertFalse;
import static org.junit.jupiter.api.Assertions.assertNotNull;
diff --git a/src/test/java/org/apache/commons/xml/TemplatesImportTest.java
b/src/test/java/org/apache/commons/xml/secure/TemplatesImportTest.java
similarity index 97%
rename from src/test/java/org/apache/commons/xml/TemplatesImportTest.java
rename to src/test/java/org/apache/commons/xml/secure/TemplatesImportTest.java
index c715e66..eed6d7d 100644
--- a/src/test/java/org/apache/commons/xml/TemplatesImportTest.java
+++ b/src/test/java/org/apache/commons/xml/secure/TemplatesImportTest.java
@@ -15,7 +15,7 @@
* limitations under the License.
*/
-package org.apache.commons.xml;
+package org.apache.commons.xml.secure;
import org.junit.jupiter.api.Tag;
import org.junit.jupiter.api.Test;
diff --git a/src/test/java/org/apache/commons/xml/TemplatesIncludeTest.java
b/src/test/java/org/apache/commons/xml/secure/TemplatesIncludeTest.java
similarity index 97%
rename from src/test/java/org/apache/commons/xml/TemplatesIncludeTest.java
rename to src/test/java/org/apache/commons/xml/secure/TemplatesIncludeTest.java
index 7a2c46e..0a015fb 100644
--- a/src/test/java/org/apache/commons/xml/TemplatesIncludeTest.java
+++ b/src/test/java/org/apache/commons/xml/secure/TemplatesIncludeTest.java
@@ -15,7 +15,7 @@
* limitations under the License.
*/
-package org.apache.commons.xml;
+package org.apache.commons.xml.secure;
import org.junit.jupiter.api.Tag;
import org.junit.jupiter.api.Test;
diff --git a/src/test/java/org/apache/commons/xml/TestConstants.java
b/src/test/java/org/apache/commons/xml/secure/TestConstants.java
similarity index 98%
rename from src/test/java/org/apache/commons/xml/TestConstants.java
rename to src/test/java/org/apache/commons/xml/secure/TestConstants.java
index d16e262..2d87c39 100644
--- a/src/test/java/org/apache/commons/xml/TestConstants.java
+++ b/src/test/java/org/apache/commons/xml/secure/TestConstants.java
@@ -15,7 +15,7 @@
* limitations under the License.
*/
-package org.apache.commons.xml;
+package org.apache.commons.xml.secure;
class TestConstants {
diff --git a/src/test/java/org/apache/commons/xml/TransformerDocumentTest.java
b/src/test/java/org/apache/commons/xml/secure/TransformerDocumentTest.java
similarity index 97%
rename from src/test/java/org/apache/commons/xml/TransformerDocumentTest.java
rename to
src/test/java/org/apache/commons/xml/secure/TransformerDocumentTest.java
index 2490682..2bedd0c 100644
--- a/src/test/java/org/apache/commons/xml/TransformerDocumentTest.java
+++ b/src/test/java/org/apache/commons/xml/secure/TransformerDocumentTest.java
@@ -15,7 +15,7 @@
* limitations under the License.
*/
-package org.apache.commons.xml;
+package org.apache.commons.xml.secure;
import org.junit.jupiter.api.Tag;
import org.junit.jupiter.api.Test;
diff --git a/src/test/java/org/apache/commons/xml/TransformerHandlerTest.java
b/src/test/java/org/apache/commons/xml/secure/TransformerHandlerTest.java
similarity index 99%
rename from src/test/java/org/apache/commons/xml/TransformerHandlerTest.java
rename to
src/test/java/org/apache/commons/xml/secure/TransformerHandlerTest.java
index 091d05a..5ac1a9a 100644
--- a/src/test/java/org/apache/commons/xml/TransformerHandlerTest.java
+++ b/src/test/java/org/apache/commons/xml/secure/TransformerHandlerTest.java
@@ -15,7 +15,7 @@
* limitations under the License.
*/
-package org.apache.commons.xml;
+package org.apache.commons.xml.secure;
import static org.junit.jupiter.api.Assertions.assertFalse;
import static org.junit.jupiter.api.Assertions.assertNotNull;
diff --git
a/src/test/java/org/apache/commons/xml/UnsupportedXmlImplementationTest.java
b/src/test/java/org/apache/commons/xml/secure/UnsupportedXmlImplementationTest.java
similarity index 99%
rename from
src/test/java/org/apache/commons/xml/UnsupportedXmlImplementationTest.java
rename to
src/test/java/org/apache/commons/xml/secure/UnsupportedXmlImplementationTest.java
index c7e7749..e157679 100644
--- a/src/test/java/org/apache/commons/xml/UnsupportedXmlImplementationTest.java
+++
b/src/test/java/org/apache/commons/xml/secure/UnsupportedXmlImplementationTest.java
@@ -15,7 +15,7 @@
* limitations under the License.
*/
-package org.apache.commons.xml;
+package org.apache.commons.xml.secure;
import static org.junit.jupiter.api.Assertions.assertNotNull;
import static org.junit.jupiter.api.Assertions.assertThrows;
diff --git a/src/test/java/org/apache/commons/xml/XIncludeTest.java
b/src/test/java/org/apache/commons/xml/secure/XIncludeTest.java
similarity index 97%
rename from src/test/java/org/apache/commons/xml/XIncludeTest.java
rename to src/test/java/org/apache/commons/xml/secure/XIncludeTest.java
index 23529bc..fc8aee0 100644
--- a/src/test/java/org/apache/commons/xml/XIncludeTest.java
+++ b/src/test/java/org/apache/commons/xml/secure/XIncludeTest.java
@@ -16,12 +16,12 @@
* limitations under the License.
*/
-package org.apache.commons.xml;
+package org.apache.commons.xml.secure;
-import static org.apache.commons.xml.AttackTestSupport.LEAKED_MARKER;
-import static org.apache.commons.xml.AttackTestSupport.captureCharacters;
-import static org.apache.commons.xml.AttackTestSupport.inputSource;
-import static org.apache.commons.xml.AttackTestSupport.resourceUrl;
+import static org.apache.commons.xml.secure.AttackTestSupport.LEAKED_MARKER;
+import static
org.apache.commons.xml.secure.AttackTestSupport.captureCharacters;
+import static org.apache.commons.xml.secure.AttackTestSupport.inputSource;
+import static org.apache.commons.xml.secure.AttackTestSupport.resourceUrl;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertFalse;
import static org.junit.jupiter.api.Assertions.assertThrows;
@@ -43,7 +43,7 @@
import org.xml.sax.XMLReader;
/**
- * Tests that XInclude resolution is blocked by default on factories from
{@link org.apache.commons.xml}, and that callers can
+ * Tests that XInclude resolution is blocked by default on factories from
{@link org.apache.commons.xml.secure}, and that callers can
* allow-list specific resources via an {@link EntityResolver}.
*
* <p>Each case is exercised in both {@code parse="xml"} and {@code
parse="text"} modes, and for both DOM and SAX
diff --git a/src/test/java/org/apache/commons/xml/XMLFilterParseStringTest.java
b/src/test/java/org/apache/commons/xml/secure/XMLFilterParseStringTest.java
similarity index 98%
rename from src/test/java/org/apache/commons/xml/XMLFilterParseStringTest.java
rename to
src/test/java/org/apache/commons/xml/secure/XMLFilterParseStringTest.java
index 45244de..a06cf18 100644
--- a/src/test/java/org/apache/commons/xml/XMLFilterParseStringTest.java
+++ b/src/test/java/org/apache/commons/xml/secure/XMLFilterParseStringTest.java
@@ -15,7 +15,7 @@
* limitations under the License.
*/
-package org.apache.commons.xml;
+package org.apache.commons.xml.secure;
import static org.junit.jupiter.api.Assertions.assertFalse;
diff --git a/src/test/java/org/apache/commons/xml/XMLFilterTest.java
b/src/test/java/org/apache/commons/xml/secure/XMLFilterTest.java
similarity index 99%
rename from src/test/java/org/apache/commons/xml/XMLFilterTest.java
rename to src/test/java/org/apache/commons/xml/secure/XMLFilterTest.java
index cee17de..9cc55c8 100644
--- a/src/test/java/org/apache/commons/xml/XMLFilterTest.java
+++ b/src/test/java/org/apache/commons/xml/secure/XMLFilterTest.java
@@ -15,7 +15,7 @@
* limitations under the License.
*/
-package org.apache.commons.xml;
+package org.apache.commons.xml.secure;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertFalse;
diff --git a/src/test/java/org/apache/commons/xml/XPathInputSourceTest.java
b/src/test/java/org/apache/commons/xml/secure/XPathInputSourceTest.java
similarity index 99%
rename from src/test/java/org/apache/commons/xml/XPathInputSourceTest.java
rename to src/test/java/org/apache/commons/xml/secure/XPathInputSourceTest.java
index d276434..152d393 100644
--- a/src/test/java/org/apache/commons/xml/XPathInputSourceTest.java
+++ b/src/test/java/org/apache/commons/xml/secure/XPathInputSourceTest.java
@@ -15,7 +15,7 @@
* limitations under the License.
*/
-package org.apache.commons.xml;
+package org.apache.commons.xml.secure;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertFalse;
diff --git a/src/test/java11/org/apache/commons/xml/DescriptorIT.java
b/src/test/java11/org/apache/commons/xml/DescriptorIT.java
index 28a1c96..27c67a4 100644
--- a/src/test/java11/org/apache/commons/xml/DescriptorIT.java
+++ b/src/test/java11/org/apache/commons/xml/DescriptorIT.java
@@ -15,7 +15,7 @@
* limitations under the License.
*/
-package org.apache.commons.xml;
+package org.apache.commons.xml.secure;
import static org.junit.jupiter.api.Assertions.assertNotNull;
import static org.junit.jupiter.api.Assertions.assertTrue;