From 677caf6f219c65b7f4c7dd287b6b26a9cc2637b1 Mon Sep 17 00:00:00 2001 From: Xavi Aracil Date: Thu, 24 Nov 2022 11:15:53 +0100 Subject: [PATCH] Updated samples --- .../org/oneedtech/inspect/vc/Samples.java | 4 +- .../resources/ob20/assets/altbadgeurl.json | 10 + .../ob20/assets/beths-robot-badge.png | Bin 0 -> 789 bytes .../ob20/assets/openbadges_context.json | 203 ++++++++++++++++++ .../resources/ob20/assets/organization.json | 8 + .../resources/ob20/assets/robotics-badge.json | 10 + .../resources/ob20/assets/robotics-badge.png | Bin 0 -> 789 bytes .../test/resources/ob20/basic-assertion.json | 34 +-- .../test/resources/ob20/basic-badgeclass.json | 10 - .../src/test/resources/ob20/basic-issuer.json | 8 - .../ob20/redirected-validation-subject.json | 18 ++ .../ob20/warning-with-redirection.json | 18 ++ 12 files changed, 286 insertions(+), 37 deletions(-) create mode 100644 inspector-vc/src/test/resources/ob20/assets/altbadgeurl.json create mode 100644 inspector-vc/src/test/resources/ob20/assets/beths-robot-badge.png create mode 100644 inspector-vc/src/test/resources/ob20/assets/openbadges_context.json create mode 100644 inspector-vc/src/test/resources/ob20/assets/organization.json create mode 100644 inspector-vc/src/test/resources/ob20/assets/robotics-badge.json create mode 100644 inspector-vc/src/test/resources/ob20/assets/robotics-badge.png delete mode 100644 inspector-vc/src/test/resources/ob20/basic-badgeclass.json delete mode 100644 inspector-vc/src/test/resources/ob20/basic-issuer.json create mode 100644 inspector-vc/src/test/resources/ob20/redirected-validation-subject.json create mode 100644 inspector-vc/src/test/resources/ob20/warning-with-redirection.json 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 0000000000000000000000000000000000000000..abdc4b64511d3d13762695ed85169c2ed5e4015d GIT binary patch literal 789 zcmV+w1M2*VP)O? z4TavM^geB8=D3g=z*dp|SCct!e(%W)!G>6`zv-gd_pV-PX zpL&jcC5qJO>h8*Zn+TYUZOutnI^rkyhZo8-r2G)TU`OT8#;MHDtXZOAAGv+H6FQ0xDkppkeUd`QPZrbEif^pO;Q}omM2) zGBLR%*~`l~fe$Ms$y{&OUl)tapGxQaOjer9=al1qSliuJ#cYJjX1d1p-x(qRFxt6a z@isbG?0Z-OAfR%~02-^D$<8A_Dm$!bx_Ot9*FN7f0ptw8W*Be)J4~h3gk0Snu0ny$ z(VQ&xXb54ofB+!nMOSGx2}#B6r6tBxwO|`lBn8D-oKl%cB~g|L0Hs!w5(>x+v;mqM zaVX#j3DzQN>&-b%E%oS&gvmvw;$HD1oLII%b!@_RH zFs7ySIe?Y_(FhQ>Ta07W<(Th0e(1vbyI(PYOt-fW=y`sZD9gPJaBjnl*er(8Vlubt z4g~rLPy_(FVI%9Dn;Qrh#T9|$h5>5% T+OyS`00000NkvXXu0mjf?b2Oz literal 0 HcmV?d00001 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 0000000000000000000000000000000000000000..abdc4b64511d3d13762695ed85169c2ed5e4015d GIT binary patch literal 789 zcmV+w1M2*VP)O? z4TavM^geB8=D3g=z*dp|SCct!e(%W)!G>6`zv-gd_pV-PX zpL&jcC5qJO>h8*Zn+TYUZOutnI^rkyhZo8-r2G)TU`OT8#;MHDtXZOAAGv+H6FQ0xDkppkeUd`QPZrbEif^pO;Q}omM2) zGBLR%*~`l~fe$Ms$y{&OUl)tapGxQaOjer9=al1qSliuJ#cYJjX1d1p-x(qRFxt6a z@isbG?0Z-OAfR%~02-^D$<8A_Dm$!bx_Ot9*FN7f0ptw8W*Be)J4~h3gk0Snu0ny$ z(VQ&xXb54ofB+!nMOSGx2}#B6r6tBxwO|`lBn8D-oKl%cB~g|L0Hs!w5(>x+v;mqM zaVX#j3DzQN>&-b%E%oS&gvmvw;$HD1oLII%b!@_RH zFs7ySIe?Y_(FhQ>Ta07W<(Th0e(1vbyI(PYOt-fW=y`sZD9gPJaBjnl*er(8Vlubt z4g~rLPy_(FVI%9Dn;Qrh#T9|$h5>5% T+OyS`00000NkvXXu0mjf?b2Oz literal 0 HcmV?d00001 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