From 6959228c5c557df0204a2902807b35d90063b600 Mon Sep 17 00:00:00 2001 From: Christof Rabensteiner Date: Wed, 15 May 2019 14:55:09 +0200 Subject: Handle Config Related Edge Cases in Augmenter & ProfileGenerator ConfigProfileGenerator: - Cancel startup if default Config profile is incomplete. - Add property flag 'verify-completeness-of-default-delivery-request-configuration', which allows admin to disable completeness check. In that case, just log a warning if the default profile is incomplete. Augmenter: - Ensure that after merging the config is complete (or throw an exception otherwise). - Refactor: Move ConfigProfileValidator from ConfigProfileGenerator to dedicated "ConfigProfileValidator" class; Reason: Augmenter needs to check completness of at-runtime-compiled configuration. - Refactor: Rewrote code for better readability. Others - NPE Fix in ConfigProfileMerger: If FallbackConfigProfile/Server is empty, use PrimaryProfile/Server. --- .../egiz/moazs/preprocess/ConfigProfileValidator.java | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 src/main/java/at/gv/egiz/moazs/preprocess/ConfigProfileValidator.java (limited to 'src/main/java/at/gv/egiz/moazs/preprocess/ConfigProfileValidator.java') diff --git a/src/main/java/at/gv/egiz/moazs/preprocess/ConfigProfileValidator.java b/src/main/java/at/gv/egiz/moazs/preprocess/ConfigProfileValidator.java new file mode 100644 index 0000000..08d8aea --- /dev/null +++ b/src/main/java/at/gv/egiz/moazs/preprocess/ConfigProfileValidator.java @@ -0,0 +1,17 @@ +package at.gv.egiz.moazs.preprocess; + +import at.gv.zustellung.app2mzs.xsd.ConfigType; +import org.springframework.stereotype.Component; + +@Component +public class ConfigProfileValidator { + + public boolean isComplete(ConfigType profile) { + //TODO: add check fo x509 certificate + return profile != null + && profile.isPerformQueryPersonRequest() != null + && profile.getServer() != null + && profile.getServer().getZUSEUrlID() != null; + } + +} -- cgit v1.2.3