diff --git a/inspector-vc/src/main/java/org/oneedtech/inspect/vc/Credential.java b/inspector-vc/src/main/java/org/oneedtech/inspect/vc/Credential.java index e64ac98..e88ab1b 100644 --- a/inspector-vc/src/main/java/org/oneedtech/inspect/vc/Credential.java +++ b/inspector-vc/src/main/java/org/oneedtech/inspect/vc/Credential.java @@ -70,6 +70,8 @@ public class Credential extends GeneratedObject { return Optional.of(Catalog.OB_30_VERIFIABLEPRESENTATION_JSON); } else if(credentialType == Credential.Type.EndorsementCredential) { return Optional.of(Catalog.OB_30_ENDORSEMENTCREDENTIAL_JSON); + } else if(credentialType == Credential.Type.ClrCredential) { + return Optional.of(Catalog.CLR_20_CLRCREDENTIAL_JSON); } return Optional.empty(); } @@ -77,6 +79,7 @@ public class Credential extends GeneratedObject { public enum Type { AchievementCredential, OpenBadgeCredential, //treated as an alias of AchievementCredential + ClrCredential, //NOT a duplicate of OB this does not use an alias and we ONLY use 'ClrCredential' as the base type EndorsementCredential, VerifiablePresentation, VerifiableCredential, //this is an underspecifier in our context @@ -89,6 +92,8 @@ public class Credential extends GeneratedObject { String value = iter.next().asText(); if(value.equals("AchievementCredential") || value.equals("OpenBadgeCredential")) { return AchievementCredential; + } else if(value.equals("ClrCredential")) { + return ClrCredential; } else if(value.equals("VerifiablePresentation")) { return VerifiablePresentation; } else if(value.equals("EndorsementCredential")) { diff --git a/inspector-vc/src/main/java/org/oneedtech/inspect/vc/probe/TypePropertyProbe.java b/inspector-vc/src/main/java/org/oneedtech/inspect/vc/probe/TypePropertyProbe.java index b079ac2..078817b 100644 --- a/inspector-vc/src/main/java/org/oneedtech/inspect/vc/probe/TypePropertyProbe.java +++ b/inspector-vc/src/main/java/org/oneedtech/inspect/vc/probe/TypePropertyProbe.java @@ -8,6 +8,7 @@ import org.oneedtech.inspect.core.probe.Probe; import org.oneedtech.inspect.core.probe.RunContext; import org.oneedtech.inspect.core.report.ReportItems; import org.oneedtech.inspect.vc.Credential; +import org.oneedtech.inspect.vc.Credential.Type; import org.oneedtech.inspect.vc.util.JsonNodeUtil; import com.fasterxml.jackson.databind.JsonNode; @@ -42,7 +43,14 @@ public class TypePropertyProbe extends Probe { return fatal( "The type property does not contain one of 'OpenBadgeCredential' or 'AchievementCredential'", ctx); - } + } + } + if(expected == Credential.Type.ClrCredential){ + if(!values.contains("ClrCredential")) { + return fatal( + "The type property does not contain the entry 'ClrCredential'", + ctx); + } } else { //TODO implement throw new IllegalStateException();