Added verification dependencies validation

This commit is contained in:
Xavi Aracil
2022-12-12 14:30:15 +01:00
parent 747a93e670
commit e8a6b33813
19 changed files with 2221 additions and 3 deletions
@@ -335,7 +335,7 @@ public class Assertion extends Credential {
.put(Type.VerificationObjectIssuer, List.of(
new Validation.Builder().name("type").type(ValueType.RDF_TYPE).many(true).defaultType(Type.VerificationObject).build(),
new Validation.Builder().name("verificationProperty").type(ValueType.COMPACT_IRI).build(),
new Validation.Builder().name("startsWith").type(ValueType.URL).build(),
new Validation.Builder().name("startsWith").type(ValueType.URL).many(true).build(),
new Validation.Builder().name("allowedOrigins").type(ValueType.URL_AUTHORITY).many(true).build()
))
.put(Type.External, Collections.emptyList())
@@ -153,8 +153,8 @@ public class OB20Inspector extends Inspector {
// verification and revocation
if (assertion.getCredentialType() == Type.Assertion) {
for(Probe<JsonLdGeneratedObject> probe : List.of(new VerificationDependenciesProbe(assertion.getId()),
new AssertionRevocationListProbe(assertion.getId()))) {
for(Probe<JsonLdGeneratedObject> probe : List.of(new VerificationDependenciesProbe(assertionNode.get("id").asText()),
new AssertionRevocationListProbe(assertionNode.get("id").asText()))) {
probeCount++;
accumulator.add(probe.run(jsonLdGeneratedObject, ctx));
if(broken(accumulator)) return abort(ctx, accumulator, probeCount);