[java-support] branch maint-8 updated: IDP-2050 - Support auto-throwing EntityResolver in default ParserPool
Scott Cantor
cantor.2 at osu.edu
Thu Dec 8 19:19:42 UTC 2022
This is an automated email from the git hooks/post-receive script.
scantor pushed a commit to branch maint-8
in repository java-support.
View the commit online:
http://git.shibboleth.net/view/?p=java-support.git;a=commit;h=0d3dee6e3b4888dde569b29f108561a4e011a457
The following commit(s) were added to refs/heads/maint-8 by this push:
new 0d3dee6 IDP-2050 - Support auto-throwing EntityResolver in default ParserPool
0d3dee6 is described below
commit 0d3dee6e3b4888dde569b29f108561a4e011a457
Author: Scott Cantor <cantor.2 at osu.edu>
AuthorDate: Thu Dec 8 14:19:40 2022 -0500
IDP-2050 - Support auto-throwing EntityResolver in default ParserPool
https://shibboleth.atlassian.net/browse/IDP-2050
Add a dummy EntityResolver to install.
---
.../java/support/xml/ThrowingEntityResolver.java | 39 ++++++++++++++++++++++
1 file changed, 39 insertions(+)
diff --git a/src/main/java/net/shibboleth/utilities/java/support/xml/ThrowingEntityResolver.java b/src/main/java/net/shibboleth/utilities/java/support/xml/ThrowingEntityResolver.java
new file mode 100644
index 0000000..0f0d236
--- /dev/null
+++ b/src/main/java/net/shibboleth/utilities/java/support/xml/ThrowingEntityResolver.java
@@ -0,0 +1,39 @@
+/*
+ * Licensed to the University Corporation for Advanced Internet Development,
+ * Inc. (UCAID) under one or more contributor license agreements. See the
+ * NOTICE file distributed with this work for additional information regarding
+ * copyright ownership. The UCAID licenses this file to You under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file except in
+ * compliance with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package net.shibboleth.utilities.java.support.xml;
+
+import java.io.IOException;
+
+import javax.annotation.Nullable;
+
+import org.xml.sax.EntityResolver;
+import org.xml.sax.InputSource;
+import org.xml.sax.SAXException;
+
+/**
+ * An implementation of {@link EntityResolver} that always throws an exception.
+ */
+public class ThrowingEntityResolver implements EntityResolver {
+
+ /** {@inheritDoc} */
+ @Nullable public InputSource resolveEntity(@Nullable final String publicId, @Nullable final String systemId)
+ throws SAXException, IOException {
+ throw new IOException("Blocked access to external entity: " + (systemId != null ? systemId : "(null)"));
+ }
+
+}
\ No newline at end of file
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
More information about the commits
mailing list