diff options
author | Andreas Eriksen <andreer@yahooinc.com> | 2022-08-06 01:46:36 +0200 |
---|---|---|
committer | Andreas Eriksen <andreer@yahooinc.com> | 2022-08-06 01:46:36 +0200 |
commit | 71cd46f8c46adbb86bb837c154afa982e9ec2a29 (patch) | |
tree | 78da9ae71e5c36339807400b188f4e1b125fee4f /configserver | |
parent | 866cc9b345768d238f1790b60e052a004e6740bc (diff) |
validate _all_ xml files only in public
Diffstat (limited to 'configserver')
-rw-r--r-- | configserver/src/main/java/com/yahoo/vespa/config/server/session/SessionPreparer.java | 28 |
1 files changed, 15 insertions, 13 deletions
diff --git a/configserver/src/main/java/com/yahoo/vespa/config/server/session/SessionPreparer.java b/configserver/src/main/java/com/yahoo/vespa/config/server/session/SessionPreparer.java index a90c3b958d7..63ba8197960 100644 --- a/configserver/src/main/java/com/yahoo/vespa/config/server/session/SessionPreparer.java +++ b/configserver/src/main/java/com/yahoo/vespa/config/server/session/SessionPreparer.java @@ -279,19 +279,21 @@ public class SessionPreparer { vespaPreprocess(applicationPackageDir.getAbsoluteFile(), hostsXml, applicationPackage.getMetaData()); } - // Validate all other XML files - try (var paths = Files.find(applicationPackageDir.getAbsoluteFile().toPath(), Integer.MAX_VALUE, - (path, attr) -> attr.isRegularFile() && path.getFileName().toString().matches(".*\\.[Xx][Mm][Ll]"))) { - paths.filter(p -> !(p.equals(servicesXml.getAbsoluteFile().toPath()) || p.equals(hostsXml.getAbsoluteFile().toPath()))) - .forEach(xmlPath -> { - try { - new ValidationProcessor().process(XML.getDocument(xmlPath.toFile())); - } catch (IOException | TransformerException e) { - throw new RuntimeException(e); - } - }); - } catch (IOException e) { - throw new RuntimeException(e); + if (zone.system().isPublic()) { + // Validate all other XML files + try (var paths = Files.find(applicationPackageDir.getAbsoluteFile().toPath(), Integer.MAX_VALUE, + (path, attr) -> attr.isRegularFile() && path.getFileName().toString().matches(".*\\.[Xx][Mm][Ll]"))) { + paths.filter(p -> !(p.equals(servicesXml.getAbsoluteFile().toPath()) || p.equals(hostsXml.getAbsoluteFile().toPath()))) + .forEach(xmlPath -> { + try { + new ValidationProcessor().process(XML.getDocument(xmlPath.toFile())); + } catch (IOException | TransformerException e) { + throw new RuntimeException(e); + } + }); + } catch (IOException e) { + throw new RuntimeException(e); + } } // Validate pom.xml files in OSGi bundles |