commit
2c3f639f62
@ -12,16 +12,6 @@
|
|||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.1edtech</groupId>
|
<groupId>org.1edtech</groupId>
|
||||||
<artifactId>inspector-core</artifactId>
|
<artifactId>inspector-core</artifactId>
|
||||||
<exclusions>
|
|
||||||
<exclusion>
|
|
||||||
<groupId>com.fasterxml.jackson.core</groupId>
|
|
||||||
<artifactId>jackson-databind</artifactId>
|
|
||||||
</exclusion>
|
|
||||||
<exclusion>
|
|
||||||
<groupId>com.networknt</groupId>
|
|
||||||
<artifactId>json-schema-validator</artifactId>
|
|
||||||
</exclusion>
|
|
||||||
</exclusions>
|
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.auth0</groupId>
|
<groupId>com.auth0</groupId>
|
||||||
|
@ -70,6 +70,8 @@ public class Credential extends GeneratedObject {
|
|||||||
return Optional.of(Catalog.OB_30_VERIFIABLEPRESENTATION_JSON);
|
return Optional.of(Catalog.OB_30_VERIFIABLEPRESENTATION_JSON);
|
||||||
} else if(credentialType == Credential.Type.EndorsementCredential) {
|
} else if(credentialType == Credential.Type.EndorsementCredential) {
|
||||||
return Optional.of(Catalog.OB_30_ENDORSEMENTCREDENTIAL_JSON);
|
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();
|
return Optional.empty();
|
||||||
}
|
}
|
||||||
@ -77,6 +79,7 @@ public class Credential extends GeneratedObject {
|
|||||||
public enum Type {
|
public enum Type {
|
||||||
AchievementCredential,
|
AchievementCredential,
|
||||||
OpenBadgeCredential, //treated as an alias of 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,
|
EndorsementCredential,
|
||||||
VerifiablePresentation,
|
VerifiablePresentation,
|
||||||
VerifiableCredential, //this is an underspecifier in our context
|
VerifiableCredential, //this is an underspecifier in our context
|
||||||
@ -89,6 +92,8 @@ public class Credential extends GeneratedObject {
|
|||||||
String value = iter.next().asText();
|
String value = iter.next().asText();
|
||||||
if(value.equals("AchievementCredential") || value.equals("OpenBadgeCredential")) {
|
if(value.equals("AchievementCredential") || value.equals("OpenBadgeCredential")) {
|
||||||
return AchievementCredential;
|
return AchievementCredential;
|
||||||
|
} else if(value.equals("ClrCredential")) {
|
||||||
|
return ClrCredential;
|
||||||
} else if(value.equals("VerifiablePresentation")) {
|
} else if(value.equals("VerifiablePresentation")) {
|
||||||
return VerifiablePresentation;
|
return VerifiablePresentation;
|
||||||
} else if(value.equals("EndorsementCredential")) {
|
} else if(value.equals("EndorsementCredential")) {
|
||||||
|
@ -0,0 +1,13 @@
|
|||||||
|
package org.oneedtech.inspect.vc;
|
||||||
|
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
import org.oneedtech.inspect.core.SubInspector;
|
||||||
|
import org.oneedtech.inspect.core.report.Report;
|
||||||
|
import org.oneedtech.inspect.util.resource.Resource;
|
||||||
|
|
||||||
|
public class EmbeddedVCInspector {
|
||||||
|
//TODO: @Miles Need to confirm with Markus, but this feels like an embedded inspector with some different rules (type, etc..) like endorsements
|
||||||
|
|
||||||
|
|
||||||
|
}
|
@ -8,6 +8,7 @@ import org.oneedtech.inspect.core.probe.Probe;
|
|||||||
import org.oneedtech.inspect.core.probe.RunContext;
|
import org.oneedtech.inspect.core.probe.RunContext;
|
||||||
import org.oneedtech.inspect.core.report.ReportItems;
|
import org.oneedtech.inspect.core.report.ReportItems;
|
||||||
import org.oneedtech.inspect.vc.Credential;
|
import org.oneedtech.inspect.vc.Credential;
|
||||||
|
import org.oneedtech.inspect.vc.Credential.Type;
|
||||||
import org.oneedtech.inspect.vc.util.JsonNodeUtil;
|
import org.oneedtech.inspect.vc.util.JsonNodeUtil;
|
||||||
|
|
||||||
import com.fasterxml.jackson.databind.JsonNode;
|
import com.fasterxml.jackson.databind.JsonNode;
|
||||||
@ -42,7 +43,14 @@ public class TypePropertyProbe extends Probe<JsonNode> {
|
|||||||
return fatal(
|
return fatal(
|
||||||
"The type property does not contain one of 'OpenBadgeCredential' or 'AchievementCredential'",
|
"The type property does not contain one of 'OpenBadgeCredential' or 'AchievementCredential'",
|
||||||
ctx);
|
ctx);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
if(expected == Credential.Type.ClrCredential){
|
||||||
|
if(!values.contains("ClrCredential")) {
|
||||||
|
return fatal(
|
||||||
|
"The type property does not contain the entry 'ClrCredential'",
|
||||||
|
ctx);
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
//TODO implement
|
//TODO implement
|
||||||
throw new IllegalStateException();
|
throw new IllegalStateException();
|
||||||
|
@ -29,6 +29,7 @@ public class Samples {
|
|||||||
public static final class CLR20 {
|
public static final class CLR20 {
|
||||||
public static final class JSON {
|
public static final class JSON {
|
||||||
public final static Sample SIMPLE_JSON = new Sample("clr20/simple.json", true);
|
public final static Sample SIMPLE_JSON = new Sample("clr20/simple.json", true);
|
||||||
|
public final static Sample SIMPLE_JWT = new Sample("clr20/simple.jwt", true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user