diff --git a/.settings/org.eclipse.jdt.core.prefs b/.settings/org.eclipse.jdt.core.prefs
index 6a0da41..450760f 100644
--- a/.settings/org.eclipse.jdt.core.prefs
+++ b/.settings/org.eclipse.jdt.core.prefs
@@ -10,6 +10,15 @@ org.eclipse.jdt.core.codeComplete.staticFieldPrefixes=
org.eclipse.jdt.core.codeComplete.staticFieldSuffixes=
org.eclipse.jdt.core.codeComplete.staticFinalFieldPrefixes=
org.eclipse.jdt.core.codeComplete.staticFinalFieldSuffixes=
+org.eclipse.jdt.core.compiler.annotation.inheritNullAnnotations=disabled
+org.eclipse.jdt.core.compiler.annotation.missingNonNullByDefaultAnnotation=ignore
+org.eclipse.jdt.core.compiler.annotation.nonnull=org.eclipse.jdt.annotation.NonNull
+org.eclipse.jdt.core.compiler.annotation.nonnull.secondary=
+org.eclipse.jdt.core.compiler.annotation.nonnullbydefault=org.eclipse.jdt.annotation.NonNullByDefault
+org.eclipse.jdt.core.compiler.annotation.nonnullbydefault.secondary=
+org.eclipse.jdt.core.compiler.annotation.nullable=org.eclipse.jdt.annotation.Nullable
+org.eclipse.jdt.core.compiler.annotation.nullable.secondary=
+org.eclipse.jdt.core.compiler.annotation.nullanalysis=disabled
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8
org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
@@ -17,15 +26,19 @@ org.eclipse.jdt.core.compiler.compliance=1.8
org.eclipse.jdt.core.compiler.debug.lineNumber=generate
org.eclipse.jdt.core.compiler.debug.localVariable=generate
org.eclipse.jdt.core.compiler.debug.sourceFile=generate
+org.eclipse.jdt.core.compiler.problem.APILeak=warning
org.eclipse.jdt.core.compiler.problem.annotationSuperInterface=warning
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
org.eclipse.jdt.core.compiler.problem.autoboxing=ignore
+org.eclipse.jdt.core.compiler.problem.comparingIdentical=warning
+org.eclipse.jdt.core.compiler.problem.deadCode=warning
org.eclipse.jdt.core.compiler.problem.deprecation=warning
org.eclipse.jdt.core.compiler.problem.deprecationInDeprecatedCode=disabled
org.eclipse.jdt.core.compiler.problem.deprecationWhenOverridingDeprecatedMethod=disabled
org.eclipse.jdt.core.compiler.problem.discouragedReference=warning
org.eclipse.jdt.core.compiler.problem.emptyStatement=ignore
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
+org.eclipse.jdt.core.compiler.problem.explicitlyClosedAutoCloseable=ignore
org.eclipse.jdt.core.compiler.problem.fallthroughCase=ignore
org.eclipse.jdt.core.compiler.problem.fatalOptionalError=enabled
org.eclipse.jdt.core.compiler.problem.fieldHiding=ignore
@@ -33,45 +46,77 @@ org.eclipse.jdt.core.compiler.problem.finalParameterBound=warning
org.eclipse.jdt.core.compiler.problem.finallyBlockNotCompletingNormally=warning
org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning
org.eclipse.jdt.core.compiler.problem.hiddenCatchBlock=warning
+org.eclipse.jdt.core.compiler.problem.includeNullInfoFromAsserts=disabled
org.eclipse.jdt.core.compiler.problem.incompatibleNonInheritedInterfaceMethod=warning
org.eclipse.jdt.core.compiler.problem.incompleteEnumSwitch=ignore
org.eclipse.jdt.core.compiler.problem.indirectStaticAccess=ignore
org.eclipse.jdt.core.compiler.problem.localVariableHiding=ignore
org.eclipse.jdt.core.compiler.problem.methodWithConstructorName=warning
+org.eclipse.jdt.core.compiler.problem.missingDefaultCase=ignore
org.eclipse.jdt.core.compiler.problem.missingDeprecatedAnnotation=ignore
+org.eclipse.jdt.core.compiler.problem.missingEnumCaseDespiteDefault=disabled
+org.eclipse.jdt.core.compiler.problem.missingHashCodeMethod=ignore
org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotation=ignore
+org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotationForInterfaceMethodImplementation=enabled
org.eclipse.jdt.core.compiler.problem.missingSerialVersion=warning
+org.eclipse.jdt.core.compiler.problem.missingSynchronizedOnInheritedMethod=ignore
org.eclipse.jdt.core.compiler.problem.noEffectAssignment=warning
org.eclipse.jdt.core.compiler.problem.noImplicitStringConversion=warning
org.eclipse.jdt.core.compiler.problem.nonExternalizedStringLiteral=ignore
+org.eclipse.jdt.core.compiler.problem.nonnullParameterAnnotationDropped=warning
+org.eclipse.jdt.core.compiler.problem.nonnullTypeVariableFromLegacyInvocation=warning
+org.eclipse.jdt.core.compiler.problem.nullAnnotationInferenceConflict=error
org.eclipse.jdt.core.compiler.problem.nullReference=ignore
+org.eclipse.jdt.core.compiler.problem.nullSpecViolation=error
+org.eclipse.jdt.core.compiler.problem.nullUncheckedConversion=warning
org.eclipse.jdt.core.compiler.problem.overridingPackageDefaultMethod=warning
org.eclipse.jdt.core.compiler.problem.parameterAssignment=ignore
+org.eclipse.jdt.core.compiler.problem.pessimisticNullAnalysisForFreeTypeVariables=warning
org.eclipse.jdt.core.compiler.problem.possibleAccidentalBooleanAssignment=ignore
org.eclipse.jdt.core.compiler.problem.potentialNullReference=ignore
-org.eclipse.jdt.core.compiler.problem.rawTypeReference=ignore
+org.eclipse.jdt.core.compiler.problem.potentiallyUnclosedCloseable=ignore
+org.eclipse.jdt.core.compiler.problem.rawTypeReference=warning
+org.eclipse.jdt.core.compiler.problem.redundantNullAnnotation=warning
org.eclipse.jdt.core.compiler.problem.redundantNullCheck=ignore
+org.eclipse.jdt.core.compiler.problem.redundantSpecificationOfTypeArguments=warning
+org.eclipse.jdt.core.compiler.problem.redundantSuperinterface=ignore
+org.eclipse.jdt.core.compiler.problem.reportMethodCanBePotentiallyStatic=ignore
+org.eclipse.jdt.core.compiler.problem.reportMethodCanBeStatic=ignore
org.eclipse.jdt.core.compiler.problem.specialParameterHidingField=disabled
org.eclipse.jdt.core.compiler.problem.staticAccessReceiver=warning
+org.eclipse.jdt.core.compiler.problem.suppressOptionalErrors=disabled
org.eclipse.jdt.core.compiler.problem.suppressWarnings=enabled
+org.eclipse.jdt.core.compiler.problem.syntacticNullAnalysisForFields=disabled
org.eclipse.jdt.core.compiler.problem.syntheticAccessEmulation=ignore
+org.eclipse.jdt.core.compiler.problem.terminalDeprecation=warning
org.eclipse.jdt.core.compiler.problem.typeParameterHiding=warning
-org.eclipse.jdt.core.compiler.problem.uncheckedTypeOperation=ignore
+org.eclipse.jdt.core.compiler.problem.unavoidableGenericTypeProblems=enabled
+org.eclipse.jdt.core.compiler.problem.uncheckedTypeOperation=warning
+org.eclipse.jdt.core.compiler.problem.unclosedCloseable=warning
org.eclipse.jdt.core.compiler.problem.undocumentedEmptyBlock=ignore
org.eclipse.jdt.core.compiler.problem.unhandledWarningToken=warning
+org.eclipse.jdt.core.compiler.problem.unlikelyCollectionMethodArgumentType=warning
+org.eclipse.jdt.core.compiler.problem.unlikelyCollectionMethodArgumentTypeStrict=disabled
+org.eclipse.jdt.core.compiler.problem.unlikelyEqualsArgumentType=info
org.eclipse.jdt.core.compiler.problem.unnecessaryElse=ignore
org.eclipse.jdt.core.compiler.problem.unnecessaryTypeCheck=ignore
org.eclipse.jdt.core.compiler.problem.unqualifiedFieldAccess=ignore
org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownException=ignore
+org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionExemptExceptionAndThrowable=enabled
+org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionIncludeDocCommentReference=enabled
org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionWhenOverriding=disabled
+org.eclipse.jdt.core.compiler.problem.unusedExceptionParameter=ignore
org.eclipse.jdt.core.compiler.problem.unusedImport=warning
org.eclipse.jdt.core.compiler.problem.unusedLabel=warning
org.eclipse.jdt.core.compiler.problem.unusedLocal=warning
+org.eclipse.jdt.core.compiler.problem.unusedObjectAllocation=ignore
org.eclipse.jdt.core.compiler.problem.unusedParameter=ignore
org.eclipse.jdt.core.compiler.problem.unusedParameterIncludeDocCommentReference=enabled
org.eclipse.jdt.core.compiler.problem.unusedParameterWhenImplementingAbstract=disabled
org.eclipse.jdt.core.compiler.problem.unusedParameterWhenOverridingConcrete=disabled
org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=warning
+org.eclipse.jdt.core.compiler.problem.unusedTypeParameter=ignore
+org.eclipse.jdt.core.compiler.problem.unusedWarningToken=warning
org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=warning
org.eclipse.jdt.core.compiler.source=1.8
org.eclipse.jdt.core.formatter.align_fields_grouping_blank_lines=2147483647
diff --git a/pom.xml b/pom.xml
index 3999a73..9e2f348 100644
--- a/pom.xml
+++ b/pom.xml
@@ -30,10 +30,29 @@
${java.version}
${java.version}
+ 0.9.2
+ 7.3.0
+ 5.3.0
+
2.7.0
+
+
+
+ net.shibboleth.metadata
+ aggregator-pipeline
+ ${mda.version}
+
+
+
org.springframework.boot
spring-boot-starter-web
@@ -62,6 +81,16 @@
javax.validation
validation-api
+
+
+
+
+ net.shibboleth.ext
+ spring-extensions
+ ${spring-extensions.version}
+ runtime
+
+
@@ -196,6 +225,16 @@
+
+
+ shib-release
+ https://build.shibboleth.net/nexus/content/groups/public
+
+ false
+
+
+
+
iay
diff --git a/src/main/java/uk/org/iay/incommon/validator/api/ValidatorsApiController.java b/src/main/java/uk/org/iay/incommon/validator/api/ValidatorsApiController.java
index 3f747e0..1379180 100644
--- a/src/main/java/uk/org/iay/incommon/validator/api/ValidatorsApiController.java
+++ b/src/main/java/uk/org/iay/incommon/validator/api/ValidatorsApiController.java
@@ -30,8 +30,12 @@
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
+import org.w3c.dom.Element;
import io.swagger.annotations.ApiParam;
+import net.shibboleth.metadata.Item;
+import net.shibboleth.metadata.pipeline.Pipeline;
+import net.shibboleth.metadata.pipeline.PipelineProcessingException;
import uk.org.iay.incommon.validator.context.ValidatorCollection;
import uk.org.iay.incommon.validator.models.Status;
import uk.org.iay.incommon.validator.models.Status.StatusEnum;
@@ -68,7 +72,7 @@ public ResponseEntity> getValidators() {
v.setDescription(entry.getDescription());
validators.add(v);
}
- return new ResponseEntity>(validators, HttpStatus.OK);
+ return new ResponseEntity<>(validators, HttpStatus.OK);
}
/**
@@ -82,6 +86,8 @@ public ResponseEntity> getValidators() {
private Status makeStatus(final StatusEnum status, final String componentId, final String message) {
final Status s = new Status();
s.setStatus(status);
+ s.setComponentId(componentId);
+ s.setMessage(message);
return s;
}
@@ -99,10 +105,19 @@ public ResponseEntity> validate(
throw new NotFoundException("unknown validator identifier '" + validatorId + "'");
}
+ // Run the validator.
+ final List- > items = new ArrayList<>();
+ final Pipeline pipeline = entry.getPipeline();
+ try {
+ pipeline.execute(items);
+ } catch (final PipelineProcessingException e) {
+ e.printStackTrace();
+ }
+
final List statuses = new ArrayList<>();
statuses.add(makeStatus(StatusEnum.ERROR, "component", "message"));
statuses.add(makeStatus(StatusEnum.WARNING, "component/sub", "another message"));
- return new ResponseEntity
>(statuses, HttpStatus.NOT_IMPLEMENTED);
+ return new ResponseEntity<>(statuses, HttpStatus.OK);
}
/**
diff --git a/src/main/java/uk/org/iay/incommon/validator/context/ValidatorCollection.java b/src/main/java/uk/org/iay/incommon/validator/context/ValidatorCollection.java
index 310a302..ee9048e 100644
--- a/src/main/java/uk/org/iay/incommon/validator/context/ValidatorCollection.java
+++ b/src/main/java/uk/org/iay/incommon/validator/context/ValidatorCollection.java
@@ -23,6 +23,9 @@
import org.slf4j.LoggerFactory;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;
+import org.w3c.dom.Element;
+
+import net.shibboleth.metadata.pipeline.Pipeline;
/**
* Represents a collection of validators.
@@ -40,6 +43,9 @@ public static class Entry {
/** Description for the validator. */
private final String description;
+ /** Pipeline for the validator. */
+ private final Pipeline pipeline;
+
/**
* Constructor.
*
@@ -48,6 +54,10 @@ public static class Entry {
public Entry(final ApplicationContext ctx) {
id = ctx.getBean("id", String.class);
description = ctx.getBean("description", String.class);
+
+ @SuppressWarnings("unchecked")
+ final Pipeline pipe = ctx.getBean("pipeline", Pipeline.class);
+ pipeline = pipe;
}
/**
@@ -68,6 +78,14 @@ public String getDescription() {
return description;
}
+ /**
+ * Gets the validator's pipeline.
+ *
+ * @return the validator's pipeline
+ */
+ public Pipeline getPipeline() {
+ return pipeline;
+ }
}
/** Class logger. */
diff --git a/src/main/resources/common-beans.xml b/src/main/resources/common-beans.xml
index 327989f..3d1c297 100644
--- a/src/main/resources/common-beans.xml
+++ b/src/main/resources/common-beans.xml
@@ -14,4 +14,27 @@
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd
http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util.xsd">
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/main/resources/default-validator.xml b/src/main/resources/default-validator.xml
index 5a85ecd..ecd9c94 100644
--- a/src/main/resources/default-validator.xml
+++ b/src/main/resources/default-validator.xml
@@ -9,7 +9,13 @@
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util.xsd">
-
-
+
+
+
+
+
+
+
+
diff --git a/src/main/resources/mda-beans.xml b/src/main/resources/mda-beans.xml
new file mode 100644
index 0000000..ea59208
--- /dev/null
+++ b/src/main/resources/mda-beans.xml
@@ -0,0 +1,272 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/main/resources/second-validator.xml b/src/main/resources/second-validator.xml
index 2efb5e9..ce9b313 100644
--- a/src/main/resources/second-validator.xml
+++ b/src/main/resources/second-validator.xml
@@ -9,7 +9,13 @@
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util.xsd">
-
-
+
+
+
+
+
+
+
+
diff --git a/src/main/resources/test-validator.xml b/src/main/resources/test-validator.xml
index 569bdab..9711a43 100644
--- a/src/main/resources/test-validator.xml
+++ b/src/main/resources/test-validator.xml
@@ -9,7 +9,13 @@
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util.xsd">
-
-
+
+
+
+
+
+
+
+