add context probe
This commit is contained in:
parent
e574c51faf
commit
ccdcd6b0a5
@ -24,6 +24,7 @@ import org.oneedtech.inspect.util.resource.Resource;
|
|||||||
import org.oneedtech.inspect.util.resource.UriResource;
|
import org.oneedtech.inspect.util.resource.UriResource;
|
||||||
import org.oneedtech.inspect.util.resource.context.ResourceContext;
|
import org.oneedtech.inspect.util.resource.context.ResourceContext;
|
||||||
import org.oneedtech.inspect.vc.Credential.Type;
|
import org.oneedtech.inspect.vc.Credential.Type;
|
||||||
|
import org.oneedtech.inspect.vc.probe.ContextPropertyProbe;
|
||||||
import org.oneedtech.inspect.vc.probe.ExpirationVerifierProbe;
|
import org.oneedtech.inspect.vc.probe.ExpirationVerifierProbe;
|
||||||
import org.oneedtech.inspect.vc.probe.InlineJsonSchemaProbe;
|
import org.oneedtech.inspect.vc.probe.InlineJsonSchemaProbe;
|
||||||
import org.oneedtech.inspect.vc.probe.IssuanceVerifierProbe;
|
import org.oneedtech.inspect.vc.probe.IssuanceVerifierProbe;
|
||||||
@ -72,10 +73,13 @@ public class EndorsementInspector extends VCInspector implements SubInspector {
|
|||||||
int probeCount = 0;
|
int probeCount = 0;
|
||||||
try {
|
try {
|
||||||
|
|
||||||
//type property
|
//context and type properties
|
||||||
probeCount++;
|
Credential.Type type = Type.EndorsementCredential;
|
||||||
accumulator.add(new TypePropertyProbe(Type.EndorsementCredential).run(endorsement.getJson(), ctx));
|
for(Probe<JsonNode> probe : List.of(new ContextPropertyProbe(type), new TypePropertyProbe(type))) {
|
||||||
if(broken(accumulator)) return abort(ctx, accumulator, probeCount);
|
probeCount++;
|
||||||
|
accumulator.add(probe.run(endorsement.getJson(), ctx));
|
||||||
|
if(broken(accumulator)) return abort(ctx, accumulator, probeCount);
|
||||||
|
}
|
||||||
|
|
||||||
//inline schema (parent inspector has already validated against canonical)
|
//inline schema (parent inspector has already validated against canonical)
|
||||||
accumulator.add(new InlineJsonSchemaProbe().run(endorsement.getJson(), ctx));
|
accumulator.add(new InlineJsonSchemaProbe().run(endorsement.getJson(), ctx));
|
||||||
|
Loading…
Reference in New Issue
Block a user