diff --git a/inspector-vc/src/test/java/org/oneedtech/inspect/vc/Samples.java b/inspector-vc/src/test/java/org/oneedtech/inspect/vc/Samples.java index 35b7bf6..3fd3811 100644 --- a/inspector-vc/src/test/java/org/oneedtech/inspect/vc/Samples.java +++ b/inspector-vc/src/test/java/org/oneedtech/inspect/vc/Samples.java @@ -44,8 +44,8 @@ public class Samples { public static final class OB20 { public static final class JSON { public final static Sample SIMPLE_ASSERTION_JSON = new Sample("ob20/basic-assertion.json", true); - public final static Sample SIMPLE_BADGECLASS_JSON = new Sample("ob20/basic-badgeclass.json", true); - public final static Sample SIMPLE_ISSUER_JSON = new Sample("ob20/basic-issuer.json", true); + // public final static Sample SIMPLE_BADGECLASS_JSON = new Sample("ob20/basic-badgeclass.json", true); + // public final static Sample SIMPLE_ISSUER_JSON = new Sample("ob20/basic-issuer.json", true); } } } diff --git a/inspector-vc/src/test/resources/ob20/assets/altbadgeurl.json b/inspector-vc/src/test/resources/ob20/assets/altbadgeurl.json new file mode 100644 index 0000000..3554627 --- /dev/null +++ b/inspector-vc/src/test/resources/ob20/assets/altbadgeurl.json @@ -0,0 +1,10 @@ +{ + "@context": "https://w3id.org/openbadges/v2", + "type": "BadgeClass", + "id": "https://example.org/robotics-badge.json", + "name": "Awesome Robotics Badge", + "description": "For doing awesome things with robots that people think is pretty great.", + "image": "https://example.org/robotics-badge.png", + "criteria": "https://example.org/robotics-badge.html", + "issuer": "https://example.org/organization.json" +} \ No newline at end of file diff --git a/inspector-vc/src/test/resources/ob20/assets/beths-robot-badge.png b/inspector-vc/src/test/resources/ob20/assets/beths-robot-badge.png new file mode 100644 index 0000000..abdc4b6 Binary files /dev/null and b/inspector-vc/src/test/resources/ob20/assets/beths-robot-badge.png differ diff --git a/inspector-vc/src/test/resources/ob20/assets/openbadges_context.json b/inspector-vc/src/test/resources/ob20/assets/openbadges_context.json new file mode 100644 index 0000000..7c1caf1 --- /dev/null +++ b/inspector-vc/src/test/resources/ob20/assets/openbadges_context.json @@ -0,0 +1,203 @@ +https://w3id.org/openbadges/v2 + +{ + "@context": { + "issuedOn": { + "@id": "obi:issueDate", + "@type": "xsd:dateTime" + }, + "AlignmentObject": "schema:AlignmentObject", + "uid": { + "@id": "obi:uid" + }, + "claim": { + "@id": "cred:claim", + "@type": "@id" + }, + "targetCode": { + "@id": "obi:targetCode" + }, + "image": { + "@id": "schema:image", + "@type": "@id" + }, + "Endorsement": "cred:Credential", + "Assertion": "obi:Assertion", + "related": { + "@id": "dc:relation", + "@type": "@id" + }, + "evidence": { + "@id": "obi:evidence", + "@type": "@id" + }, + "sec": "https://w3id.org/security#", + "Criteria": "obi:Criteria", + "owner": { + "@id": "sec:owner", + "@type": "@id" + }, + "revocationList": { + "@id": "obi:revocationList", + "@type": "@id" + }, + "targetName": { + "@id": "schema:targetName" + }, + "id": "@id", + "alignment": { + "@id": "obi:alignment", + "@type": "@id" + }, + "allowedOrigins": { + "@id": "obi:allowedOrigins" + }, + "Profile": "obi:Profile", + "startsWith": { + "@id": "http://purl.org/dqm-vocabulary/v1/dqm#startsWith" + }, + "author": { + "@id": "schema:author", + "@type": "@id" + }, + "FrameValidation": "obi:FrameValidation", + "validationFrame": "obi:validationFrame", + "creator": { + "@id": "dc:creator", + "@type": "@id" + }, + "validationSchema": "obi:validationSchema", + "validatesType": "obi:validatesType", + "version": { + "@id": "schema:version" + }, + "BadgeClass": "obi:BadgeClass", + "endorsement": { + "@id": "cred:credential", + "@type": "@id" + }, + "revocationReason": { + "@id": "obi:revocationReason" + }, + "RevocationList": "obi:RevocationList", + "issuer": { + "@id": "obi:issuer", + "@type": "@id" + }, + "type": "@type", + "email": { + "@id": "schema:email" + }, + "targetDescription": { + "@id": "schema:targetDescription" + }, + "schema": "http://schema.org/", + "targetUrl": { + "@id": "schema:targetUrl" + }, + "criteria": { + "@id": "obi:criteria", + "@type": "@id" + }, + "verificationProperty": { + "@id": "obi:verificationProperty" + }, + "description": { + "@id": "schema:description" + }, + "Extension": "obi:Extension", + "tags": { + "@id": "schema:keywords" + }, + "CryptographicKey": "sec:Key", + "expires": { + "@id": "sec:expiration", + "@type": "xsd:dateTime" + }, + "hosted": "obi:HostedBadge", + "dc": "http://purl.org/dc/terms/", + "telephone": { + "@id": "schema:telephone" + }, + "publicKey": { + "@id": "sec:publicKey", + "@type": "@id" + }, + "badge": { + "@id": "obi:badge", + "@type": "@id" + }, + "endorsementComment": { + "@id": "obi:endorsementComment" + }, + "genre": { + "@id": "schema:genre" + }, + "hashed": { + "@id": "obi:hashed", + "@type": "xsd:boolean" + }, + "recipient": { + "@id": "obi:recipient", + "@type": "@id" + }, + "HostedBadge": "obi:HostedBadge", + "identity": { + "@id": "obi:identityHash" + }, + "revoked": { + "@id": "obi:revoked", + "@type": "xsd:boolean" + }, + "verify": "verification", + "VerificationObject": "obi:VerificationObject", + "name": { + "@id": "schema:name" + }, + "publicKeyPem": { + "@id": "sec:publicKeyPem" + }, + "obi": "https://w3id.org/openbadges#", + "url": { + "@id": "schema:url", + "@type": "@id" + }, + "cred": "https://w3id.org/credentials#", + "Image": "obi:Image", + "created": { + "@id": "dc:created", + "@type": "xsd:dateTime" + }, + "IdentityObject": "obi:IdentityObject", + "signed": "obi:SignedBadge", + "Evidence": "obi:Evidence", + "narrative": { + "@id": "obi:narrative" + }, + "caption": { + "@id": "schema:caption" + }, + "audience": { + "@id": "obi:audience" + }, + "extensions": "https://w3id.org/openbadges/extensions#", + "verification": { + "@id": "obi:verify", + "@type": "@id" + }, + "xsd": "http://www.w3.org/2001/XMLSchema#", + "TypeValidation": "obi:TypeValidation", + "revokedAssertions": { + "@id": "obi:revoked" + }, + "SignedBadge": "obi:SignedBadge", + "validation": "obi:validation", + "salt": { + "@id": "obi:salt" + }, + "targetFramework": { + "@id": "schema:targetFramework" + }, + "Issuer": "obi:Issuer" + } +} \ No newline at end of file diff --git a/inspector-vc/src/test/resources/ob20/assets/organization.json b/inspector-vc/src/test/resources/ob20/assets/organization.json new file mode 100644 index 0000000..559a120 --- /dev/null +++ b/inspector-vc/src/test/resources/ob20/assets/organization.json @@ -0,0 +1,8 @@ +{ + "@context": "https://w3id.org/openbadges/v2", + "type": "Issuer", + "id": "https://example.org/organization.json", + "name": "An Example Badge Issuer", + "url": "https://example.org", + "email": "contact@example.org" +} \ No newline at end of file diff --git a/inspector-vc/src/test/resources/ob20/assets/robotics-badge.json b/inspector-vc/src/test/resources/ob20/assets/robotics-badge.json new file mode 100644 index 0000000..3554627 --- /dev/null +++ b/inspector-vc/src/test/resources/ob20/assets/robotics-badge.json @@ -0,0 +1,10 @@ +{ + "@context": "https://w3id.org/openbadges/v2", + "type": "BadgeClass", + "id": "https://example.org/robotics-badge.json", + "name": "Awesome Robotics Badge", + "description": "For doing awesome things with robots that people think is pretty great.", + "image": "https://example.org/robotics-badge.png", + "criteria": "https://example.org/robotics-badge.html", + "issuer": "https://example.org/organization.json" +} \ No newline at end of file diff --git a/inspector-vc/src/test/resources/ob20/assets/robotics-badge.png b/inspector-vc/src/test/resources/ob20/assets/robotics-badge.png new file mode 100644 index 0000000..abdc4b6 Binary files /dev/null and b/inspector-vc/src/test/resources/ob20/assets/robotics-badge.png differ diff --git a/inspector-vc/src/test/resources/ob20/basic-assertion.json b/inspector-vc/src/test/resources/ob20/basic-assertion.json index 4bc982b..69963d6 100644 --- a/inspector-vc/src/test/resources/ob20/basic-assertion.json +++ b/inspector-vc/src/test/resources/ob20/basic-assertion.json @@ -1,18 +1,18 @@ { - "@context": "https://w3id.org/openbadges/v2", - "type": "Assertion", - "id": "https://example.org/beths-robotics-badge.json", - "recipient": { - "type": "email", - "hashed": true, - "salt": "deadsea", - "identity": "sha256$ecf5409f3f4b91ab60cc5ef4c02aef7032354375e70cf4d8e43f6a1d29891942" - }, - "image": "https://example.org/beths-robot-badge.png", - "evidence": "https://example.org/beths-robot-work.html", - "issuedOn": "2016-12-31T23:59:59Z", - "badge": "https://example.org/robotics-badge.json", - "verification": { - "type": "hosted" - } - } \ No newline at end of file + "@context": "https://w3id.org/openbadges/v2", + "type": "Assertion", + "id": "https://example.org/beths-robotics-badge.json", + "recipient": { + "type": "email", + "hashed": true, + "salt": "deadsea", + "identity": "sha256$ecf5409f3f4b91ab60cc5ef4c02aef7032354375e70cf4d8e43f6a1d29891942" + }, + "image": "https://example.org/beths-robot-badge.png", + "evidence": "https://example.org/beths-robot-work.html", + "issuedOn": "2016-12-31T23:59:59Z", + "badge": "https://example.org/robotics-badge.json", + "verification": { + "type": "hosted" + } +} \ No newline at end of file diff --git a/inspector-vc/src/test/resources/ob20/basic-badgeclass.json b/inspector-vc/src/test/resources/ob20/basic-badgeclass.json deleted file mode 100644 index b53f3cc..0000000 --- a/inspector-vc/src/test/resources/ob20/basic-badgeclass.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "@context": "https://w3id.org/openbadges/v2", - "type": "BadgeClass", - "id": "https://example.org/robotics-badge.json", - "name": "Awesome Robotics Badge", - "description": "For doing awesome things with robots that people think is pretty great.", - "image": "https://example.org/robotics-badge.png", - "criteria": "https://example.org/robotics-badge.html", - "issuer": "https://example.org/organization.json" -} \ No newline at end of file diff --git a/inspector-vc/src/test/resources/ob20/basic-issuer.json b/inspector-vc/src/test/resources/ob20/basic-issuer.json deleted file mode 100644 index 151dcc5..0000000 --- a/inspector-vc/src/test/resources/ob20/basic-issuer.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "@context": "https://w3id.org/openbadges/v2", - "type": "Issuer", - "id": "https://example.org/organization.json", - "name": "An Example Badge Issuer", - "url": "https://example.org", - "email": "contact@example.org" -} \ No newline at end of file diff --git a/inspector-vc/src/test/resources/ob20/redirected-validation-subject.json b/inspector-vc/src/test/resources/ob20/redirected-validation-subject.json new file mode 100644 index 0000000..924a704 --- /dev/null +++ b/inspector-vc/src/test/resources/ob20/redirected-validation-subject.json @@ -0,0 +1,18 @@ +{ // both http://example.org/altbadgeurl and https://example.org/beths-robotics-badge.json return this json + "@context": "https://w3id.org/openbadges/v2", // openbadges_context.json + "type": "Assertion", + "id": "http://example.org/altbadgeurl", + "recipient": { + "type": "email", + "hashed": true, + "salt": "deadsea", + "identity": "sha256$ecf5409f3f4b91ab60cc5ef4c02aef7032354375e70cf4d8e43f6a1d29891942" + }, + "image": "https://example.org/beths-robot-badge.png", // image + "evidence": "https://example.org/beths-robot-work.html", + "issuedOn": "2016-12-31T23:59:59Z", + "badge": "https://example.org/robotics-badge.json", + "verification": { + "type": "hosted" + } + } \ No newline at end of file diff --git a/inspector-vc/src/test/resources/ob20/warning-with-redirection.json b/inspector-vc/src/test/resources/ob20/warning-with-redirection.json new file mode 100644 index 0000000..a350449 --- /dev/null +++ b/inspector-vc/src/test/resources/ob20/warning-with-redirection.json @@ -0,0 +1,18 @@ +{ // test_graph:test_verify_with_redirection + "@context": "https://w3id.org/openbadges/v2", // openbadges_context.json + "type": "Assertion", + "id": "https://example.org/beths-robotics-badge.json", // robotics-badge.json + "recipient": { + "type": "email", + "hashed": true, + "salt": "deadsea", + "identity": "sha256$ecf5409f3f4b91ab60cc5ef4c02aef7032354375e70cf4d8e43f6a1d29891942" + }, + "image": "https://example.org/beths-robot-badge.png", // image + "evidence": "https://example.org/beths-robot-work.html", + "issuedOn": "2016-12-31T23:59:59Z", + "badge": "http://example.org/altbadgeurl", // altbadgeurl.json + "verification": { + "type": "hosted" + } +} \ No newline at end of file