Added issuedon and expiration probes

This commit is contained in:
Xavi Aracil 2022-12-01 12:38:20 +01:00
parent d334c0f143
commit d286347294

View File

@ -29,6 +29,8 @@ import org.oneedtech.inspect.vc.payload.PngParser;
import org.oneedtech.inspect.vc.payload.SvgParser; import org.oneedtech.inspect.vc.payload.SvgParser;
import org.oneedtech.inspect.vc.probe.ContextPropertyProbe; import org.oneedtech.inspect.vc.probe.ContextPropertyProbe;
import org.oneedtech.inspect.vc.probe.CredentialParseProbe; import org.oneedtech.inspect.vc.probe.CredentialParseProbe;
import org.oneedtech.inspect.vc.probe.ExpirationProbe;
import org.oneedtech.inspect.vc.probe.IssuanceProbe;
import org.oneedtech.inspect.vc.probe.TypePropertyProbe; import org.oneedtech.inspect.vc.probe.TypePropertyProbe;
import org.oneedtech.inspect.vc.probe.validation.ValidationPropertyProbe; import org.oneedtech.inspect.vc.probe.validation.ValidationPropertyProbe;
import org.oneedtech.inspect.vc.probe.validation.ValidationPropertyProbeFactory; import org.oneedtech.inspect.vc.probe.validation.ValidationPropertyProbeFactory;
@ -129,6 +131,14 @@ public class OB20Inspector extends Inspector {
if(broken(accumulator)) return abort(ctx, accumulator, probeCount); if(broken(accumulator)) return abort(ctx, accumulator, probeCount);
} }
//expiration and issuance
for(Probe<Credential> probe : List.of(
new ExpirationProbe(), new IssuanceProbe())) {
probeCount++;
accumulator.add(probe.run(assertion, ctx));
if(broken(accumulator)) return abort(ctx, accumulator, probeCount);
}
// Each Badge Object contains all required properties for its class // Each Badge Object contains all required properties for its class
// This could be done validating with the schema, but seems that there are some error on that file // This could be done validating with the schema, but seems that there are some error on that file
// So, we do a manual Probe for the nodes // So, we do a manual Probe for the nodes