From bd106f97615d3da23bba2cbb5b5e38a69304a046 Mon Sep 17 00:00:00 2001 From: "Andy Miller (IMS)" <48326098+amiller-ims@users.noreply.github.com> Date: Wed, 16 Nov 2022 11:24:42 -0800 Subject: [PATCH] Fix ob3 tests - Update context URL (imsglobal.github.io no longer exists) - Update simple* resources with updated ob3 spec example json --- .../vc/probe/ContextPropertyProbe.java | 4 +-- .../inspect/vc/probe/EmbeddedProofProbe.java | 2 +- .../vc/util/CachingDocumentLoader.java | 2 +- .../src/test/resources/ob30/complete.json | 12 +++---- .../resources/ob30/simple-err-context.json | 2 +- .../resources/ob30/simple-err-expired.json | 31 +++++++++++------ .../resources/ob30/simple-err-issued.json | 2 +- .../resources/ob30/simple-err-issuer.json | 2 +- .../test/resources/ob30/simple-err-type.json | 2 +- .../src/test/resources/ob30/simple-json.png | Bin 84080 -> 84163 bytes .../src/test/resources/ob30/simple-json.svg | 32 ++++++++---------- .../test/resources/ob30/simple-noproof.json | 2 +- .../src/test/resources/ob30/simple.json | 32 ++++++++---------- 13 files changed, 66 insertions(+), 59 deletions(-) diff --git a/inspector-vc/src/main/java/org/oneedtech/inspect/vc/probe/ContextPropertyProbe.java b/inspector-vc/src/main/java/org/oneedtech/inspect/vc/probe/ContextPropertyProbe.java index 5747336..87a1999 100644 --- a/inspector-vc/src/main/java/org/oneedtech/inspect/vc/probe/ContextPropertyProbe.java +++ b/inspector-vc/src/main/java/org/oneedtech/inspect/vc/probe/ContextPropertyProbe.java @@ -61,12 +61,12 @@ public class ContextPropertyProbe extends Probe { private final static Map, List> values = new ImmutableMap.Builder, List>() .put(Set.of(OpenBadgeCredential, AchievementCredential, EndorsementCredential), List.of("https://www.w3.org/2018/credentials/v1", - //"https://imsglobal.github.io/openbadges-specification/context.json")) //dev legacy + //"https://purl.imsglobal.org/spec/ob/v3p0/context.json")) //dev legacy "https://purl.imsglobal.org/spec/ob/v3p0/context.json")) .put(Set.of(ClrCredential), List.of("https://www.w3.org/2018/credentials/v1", // "https://dc.imsglobal.org/draft/clr/v2p0/context", //dev legacy -// "https://imsglobal.github.io/openbadges-specification/context.json")) //dev legacy +// "https://purl.imsglobal.org/spec/ob/v3p0/context.json")) //dev legacy "https://purl.imsglobal.org/spec/clr/v2p0/context.json", "https://purl.imsglobal.org/spec/ob/v3p0/context.json")) diff --git a/inspector-vc/src/main/java/org/oneedtech/inspect/vc/probe/EmbeddedProofProbe.java b/inspector-vc/src/main/java/org/oneedtech/inspect/vc/probe/EmbeddedProofProbe.java index 6b98ab9..8baeb9e 100644 --- a/inspector-vc/src/main/java/org/oneedtech/inspect/vc/probe/EmbeddedProofProbe.java +++ b/inspector-vc/src/main/java/org/oneedtech/inspect/vc/probe/EmbeddedProofProbe.java @@ -128,7 +128,7 @@ public class EmbeddedProofProbe extends Probe { return error("Verification method does not contain an Ed25519 public key", ctx); } } catch (Exception e) { - return fatal("Invalid public key: " + e.getMessage(), ctx); + return error("Invalid public key: " + e.getMessage(), ctx); } if (controller != null) { diff --git a/inspector-vc/src/main/java/org/oneedtech/inspect/vc/util/CachingDocumentLoader.java b/inspector-vc/src/main/java/org/oneedtech/inspect/vc/util/CachingDocumentLoader.java index 66b97fe..aec0cbf 100644 --- a/inspector-vc/src/main/java/org/oneedtech/inspect/vc/util/CachingDocumentLoader.java +++ b/inspector-vc/src/main/java/org/oneedtech/inspect/vc/util/CachingDocumentLoader.java @@ -43,7 +43,7 @@ public class CachingDocumentLoader implements DocumentLoader { .put("https://purl.imsglobal.org/spec/clr/v2p0/context.json",Resources.getResource("contexts/clr-v2p0.json")) .put("https://purl.imsglobal.org/spec/ob/v3p0/context.json",Resources.getResource("contexts/ob-v3p0.json")) .put("https://purl.imsglobal.org/spec/ob/v3p0/extensions.json",Resources.getResource("contexts/ob-v3p0-extensions.json")) - .put("https://imsglobal.github.io/openbadges-specification/context.json",Resources.getResource("contexts/obv3x.jsonld")) + .put("https://purl.imsglobal.org/spec/ob/v3p0/context.json",Resources.getResource("contexts/obv3x.jsonld")) .put("https://www.w3.org/ns/did/v1", Resources.getResource("contexts/did-v1.jsonld")) .put("https://www.w3.org/ns/odrl.jsonld", Resources.getResource("contexts/odrl.jsonld")) .put("https://w3id.org/security/suites/ed25519-2020/v1",Resources.getResource("contexts/security-suites-ed25519-2020-v1.jsonld")) diff --git a/inspector-vc/src/test/resources/ob30/complete.json b/inspector-vc/src/test/resources/ob30/complete.json index 92a16e8..f8d196b 100644 --- a/inspector-vc/src/test/resources/ob30/complete.json +++ b/inspector-vc/src/test/resources/ob30/complete.json @@ -1,7 +1,7 @@ { "@context": [ "https://www.w3.org/2018/credentials/v1", - "https://imsglobal.github.io/openbadges-specification/context.json", + "https://purl.imsglobal.org/spec/ob/v3p0/context.json", "https://w3id.org/security/suites/ed25519-2020/v1" ], "id": "http://1edtech.edu/credentials/3732", @@ -93,7 +93,7 @@ { "@context": [ "https://www.w3.org/2018/credentials/v1", - "https://imsglobal.github.io/openbadges-specification/context.json", + "https://purl.imsglobal.org/spec/ob/v3p0/context.json", "https://w3id.org/security/suites/ed25519-2020/v1" ], "type": [ @@ -147,7 +147,7 @@ { "@context": [ "https://www.w3.org/2018/credentials/v1", - "https://imsglobal.github.io/openbadges-specification/context.json", + "https://purl.imsglobal.org/spec/ob/v3p0/context.json", "https://w3id.org/security/suites/ed25519-2020/v1" ], "type": [ @@ -253,7 +253,7 @@ { "@context": [ "https://www.w3.org/2018/credentials/v1", - "https://imsglobal.github.io/openbadges-specification/context.json", + "https://purl.imsglobal.org/spec/ob/v3p0/context.json", "https://w3id.org/security/suites/ed25519-2020/v1" ], "type": [ @@ -500,7 +500,7 @@ { "@context": [ "https://www.w3.org/2018/credentials/v1", - "https://imsglobal.github.io/openbadges-specification/context.json", + "https://purl.imsglobal.org/spec/ob/v3p0/context.json", "https://w3id.org/security/suites/ed25519-2020/v1" ], "type": [ @@ -588,7 +588,7 @@ { "@context": [ "https://www.w3.org/2018/credentials/v1", - "https://imsglobal.github.io/openbadges-specification/context.json", + "https://purl.imsglobal.org/spec/ob/v3p0/context.json", "https://w3id.org/security/suites/ed25519-2020/v1" ], "type": [ diff --git a/inspector-vc/src/test/resources/ob30/simple-err-context.json b/inspector-vc/src/test/resources/ob30/simple-err-context.json index 5258f76..be960df 100644 --- a/inspector-vc/src/test/resources/ob30/simple-err-context.json +++ b/inspector-vc/src/test/resources/ob30/simple-err-context.json @@ -1,6 +1,6 @@ { "@context": [ - "https://imsglobal.github.io/openbadges-specification/context.json", + "https://purl.imsglobal.org/spec/ob/v3p0/context.json", "https://w3id.org/security/suites/ed25519-2020/v1" ], "id": "http://example.edu/credentials/3732", diff --git a/inspector-vc/src/test/resources/ob30/simple-err-expired.json b/inspector-vc/src/test/resources/ob30/simple-err-expired.json index 80c6959..3127b92 100644 --- a/inspector-vc/src/test/resources/ob30/simple-err-expired.json +++ b/inspector-vc/src/test/resources/ob30/simple-err-expired.json @@ -1,37 +1,48 @@ { "@context": [ "https://www.w3.org/2018/credentials/v1", - "https://imsglobal.github.io/openbadges-specification/context.json", + "https://purl.imsglobal.org/spec/ob/v3p0/context.json", "https://w3id.org/security/suites/ed25519-2020/v1" ], - "id": "http://example.edu/credentials/3732", + "id": "http://example.com/credentials/3527", "type": [ "VerifiableCredential", "OpenBadgeCredential" ], "issuer": { - "id": "https://example.edu/issuers/565049", + "id": "https://example.com/issuers/876543", "type": [ "Profile" ], - "name": "Example University" + "name": "Example Corp" }, "issuanceDate": "2010-01-01T00:00:00Z", - "expirationDate": "2020-01-20T00:00:00Z", - "name": "Example University Degree", + "expirationDate": "2010-01-01T00:00:00Z", + "name": "Teamwork Badge", "credentialSubject": { "id": "did:example:ebfeb1f712ebc6f1c276e12ec21", "type": [ "AchievementSubject" - ] + ], + "achievement": { + "id": "https://example.com/achievements/21st-century-skills/teamwork", + "type": [ + "Achievement" + ], + "criteria": { + "narrative": "Team members are nominated for this badge by their peers and recognized upon review by Example Corp management." + }, + "description": "This badge recognizes the development of the capacity to collaborate within a group environment.", + "name": "Teamwork" + } }, "proof": [ { "type": "Ed25519Signature2020", - "created": "2022-06-28T16:28:36Z", - "verificationMethod": "did:key:z6MkkUD3J14nkYzn46QeuaVSnp7dF85QJKwKvJvfsjx79aXj", + "created": "2022-11-16T18:54:22Z", + "verificationMethod": "https://example.com/issuers/876543#z6MknNHHrBzPytzu6CUBP9Lg7fg4KSBjzimc2Frh693YbMiv", "proofPurpose": "assertionMethod", - "proofValue": "z3MUt2ZuU8Byqivxh6GphEM65AFYyNaGYibm97xLTafM7uGufZQLKvJR8itZwxKskvtFM3CUty46v26DZidMNoQnM" + "proofValue": "z5gJZKchSJEYPGeq6bsqiLKuxT6mXqAovPbqYX66CB7u9CSNFdV41vHtysjHFiitvoyhfPxsaZnWftrZZZW2txPQK" } ] } \ No newline at end of file diff --git a/inspector-vc/src/test/resources/ob30/simple-err-issued.json b/inspector-vc/src/test/resources/ob30/simple-err-issued.json index e129e3d..471a3df 100644 --- a/inspector-vc/src/test/resources/ob30/simple-err-issued.json +++ b/inspector-vc/src/test/resources/ob30/simple-err-issued.json @@ -1,7 +1,7 @@ { "@context": [ "https://www.w3.org/2018/credentials/v1", - "https://imsglobal.github.io/openbadges-specification/context.json", + "https://purl.imsglobal.org/spec/ob/v3p0/context.json", "https://w3id.org/security/suites/ed25519-2020/v1" ], "id": "http://example.edu/credentials/3732", diff --git a/inspector-vc/src/test/resources/ob30/simple-err-issuer.json b/inspector-vc/src/test/resources/ob30/simple-err-issuer.json index 2e988ea..5735768 100644 --- a/inspector-vc/src/test/resources/ob30/simple-err-issuer.json +++ b/inspector-vc/src/test/resources/ob30/simple-err-issuer.json @@ -1,7 +1,7 @@ { "@context": [ "https://www.w3.org/2018/credentials/v1", - "https://imsglobal.github.io/openbadges-specification/context.json", + "https://purl.imsglobal.org/spec/ob/v3p0/context.json", "https://w3id.org/security/suites/ed25519-2020/v1" ], "id": "http://example.edu/credentials/3732", diff --git a/inspector-vc/src/test/resources/ob30/simple-err-type.json b/inspector-vc/src/test/resources/ob30/simple-err-type.json index a54f5c1..cf146d2 100644 --- a/inspector-vc/src/test/resources/ob30/simple-err-type.json +++ b/inspector-vc/src/test/resources/ob30/simple-err-type.json @@ -1,7 +1,7 @@ { "@context": [ "https://www.w3.org/2018/credentials/v1", - "https://imsglobal.github.io/openbadges-specification/context.json", + "https://purl.imsglobal.org/spec/ob/v3p0/context.json", "https://w3id.org/security/suites/ed25519-2020/v1" ], "id": "http://example.edu/credentials/3732", diff --git a/inspector-vc/src/test/resources/ob30/simple-json.png b/inspector-vc/src/test/resources/ob30/simple-json.png index f1b1f70c634d666b2c7f404ca473aea7cf38928f..4ae4fb318f199334c592ff32524c7068cb779bf1 100644 GIT binary patch delta 880 zcma)4O>fgM7$%1um^g9bf@Ecr#(}L()~0L44x}F|>o$tkeH9_iah$|kVyBLiwUwqK zB+iUeegRib+>p3%=Lp>S1N;Jnolbxd2Q167t>^Xg@%sDK!pGMO&);dEZS8CR#n#^B z@0;4jQXoX!D3$OSMsbMO5Q|EPV;56FV3?HFt7a_+Evag3=AT_5L9TiWtH;_3~c ztLo&ha*`w|=1FOzW>qWe`BhuHlfP_VN@Un7)BS2pM$xa2W@R-#U*az+Cu|79(D|`W|-JPmS-TdW?^|i zrlHgvZ2n6%L;=AWj->IVWEzQBMRJ?+$!c;=LYaiPX3cMRw0i!bqb<+m4Tx~$NVfoT z3@D2Tl{Q@9F%CpP65y!BfHRRNOgM;ffu%0s7%`ucsRXAnqw<^)e4&tk#snfrp5G72V)B{L#zv!BX_)4`X9YOJoOlF5 zC36>xfc@v!S(;kA=X9^z<@U5c5!2La9@zc*j$iZqN^jpjo015b9UfTq^%G~8WO{zK zrJ1vsGv*z_FfD$|wCZmUdnnl7ZlCnG@W^tK5!vabVH#mi6aZ!d4i@u2o_OUl4hF%-$NkQm^qJNwRm5-N$EG!1ptR7uoUAoUzyY`2M>IChj& zia<#0Fx`Nd5GxZa69XembY){@W5o%Gl#Oq=>AUxPp7-O+wI46mp1ucPE8w}ftbn)T zfeoY*pJqHBM@c*ufel=kr?Hjik#8vm>SEK=ps5)M5~k|VV+Mg-H9X7+C)6O~(gtX~ z+zlf>;R7CL;)Vlm3*P~7w;cO3skSA#QNPbq`CdsXMvi>hlH|Wfw4TCMl~brQ#e@V? z3Jro7q$V*`k70y0B3?US^RA*mj3GuXq+6bh2#dinXS&97D zjYkf+DcmZ!zxt^Q$Q=7r4T()`1>FQ2a!vs>MF-c?SY F{Q|uf&C>t? diff --git a/inspector-vc/src/test/resources/ob30/simple-json.svg b/inspector-vc/src/test/resources/ob30/simple-json.svg index 9b83371..78ae99c 100644 --- a/inspector-vc/src/test/resources/ob30/simple-json.svg +++ b/inspector-vc/src/test/resources/ob30/simple-json.svg @@ -7,48 +7,46 @@ "@context": [ "https://www.w3.org/2018/credentials/v1", "https://purl.imsglobal.org/spec/ob/v3p0/context.json", - "https://purl.imsglobal.org/spec/ob/v3p0/extensions.json", "https://w3id.org/security/suites/ed25519-2020/v1" ], - "id": "urn:uuid:280c19b6-9680-4a37-ba84-e38b1a4e4584", + "id": "http://example.com/credentials/3527", "type": [ "VerifiableCredential", - "AchievementCredential" + "OpenBadgeCredential" ], "issuer": { + "id": "https://example.com/issuers/876543", "type": [ "Profile" ], - "name": "Andy F. Miller", - "id": "urn:uuid:6f2e33e5-7a29-4155-840a-59483ba10164" + "name": "Example Corp" }, - "issuanceDate": "2022-11-10T07:38:00-08:00", - "name": "test 1", + "issuanceDate": "2010-01-01T00:00:00Z", + "name": "Teamwork Badge", "credentialSubject": { - "id": "urn:uuid:6f2e33e5-7a29-4155-840a-59483ba10164", + "id": "did:example:ebfeb1f712ebc6f1c276e12ec21", "type": [ "AchievementSubject" ], "achievement": { - "id": "urn:uuid:35258e6f-4c05-4215-8ada-38a5a5b80510", + "id": "https://example.com/achievements/21st-century-skills/teamwork", "type": [ "Achievement" ], - "achievementType": "Achievement", - "name": "test 1", - "description": "This is a test achievement", "criteria": { - "narrative": "There is no criteria" - } + "narrative": "Team members are nominated for this badge by their peers and recognized upon review by Example Corp management." + }, + "description": "This badge recognizes the development of the capacity to collaborate within a group environment.", + "name": "Teamwork" } }, "proof": [ { "type": "Ed25519Signature2020", - "created": "2022-11-10T19:36:07Z", + "created": "2022-11-16T18:54:22Z", + "verificationMethod": "https://example.com/issuers/876543#z6MknNHHrBzPytzu6CUBP9Lg7fg4KSBjzimc2Frh693YbMiv", "proofPurpose": "assertionMethod", - "verificationMethod": "z6Mkt5PKegVQUpjQjoeiqkFa1HqpvMvehiLJuPMJcqX9hxM5", - "proofValue": "z4xh7M5Xpo4hU2bDU6dtQZgnuJCtJUhYCsMPBbCnhAvdnugDidH8anMJ6ayt7vR74iL5mhgJgTDQnNHoYrCnhARVD" + "proofValue": "z5gJZKchSJEYPGeq6bsqiLKuxT6mXqAovPbqYX66CB7u9CSNFdV41vHtysjHFiitvoyhfPxsaZnWftrZZZW2txPQK" } ] } diff --git a/inspector-vc/src/test/resources/ob30/simple-noproof.json b/inspector-vc/src/test/resources/ob30/simple-noproof.json index 0496844..9c9b233 100644 --- a/inspector-vc/src/test/resources/ob30/simple-noproof.json +++ b/inspector-vc/src/test/resources/ob30/simple-noproof.json @@ -1,7 +1,7 @@ { "@context": [ "https://www.w3.org/2018/credentials/v1", - "https://imsglobal.github.io/openbadges-specification/context.json", + "https://purl.imsglobal.org/spec/ob/v3p0/context.json", "https://w3id.org/security/suites/ed25519-2020/v1" ], "id": "http://example.edu/credentials/3732", diff --git a/inspector-vc/src/test/resources/ob30/simple.json b/inspector-vc/src/test/resources/ob30/simple.json index 92fa200..c97b383 100644 --- a/inspector-vc/src/test/resources/ob30/simple.json +++ b/inspector-vc/src/test/resources/ob30/simple.json @@ -2,48 +2,46 @@ "@context": [ "https://www.w3.org/2018/credentials/v1", "https://purl.imsglobal.org/spec/ob/v3p0/context.json", - "https://purl.imsglobal.org/spec/ob/v3p0/extensions.json", "https://w3id.org/security/suites/ed25519-2020/v1" ], - "id": "urn:uuid:280c19b6-9680-4a37-ba84-e38b1a4e4584", + "id": "http://example.com/credentials/3527", "type": [ "VerifiableCredential", - "AchievementCredential" + "OpenBadgeCredential" ], "issuer": { + "id": "https://example.com/issuers/876543", "type": [ "Profile" ], - "name": "Andy F. Miller", - "id": "urn:uuid:6f2e33e5-7a29-4155-840a-59483ba10164" + "name": "Example Corp" }, - "issuanceDate": "2022-11-10T07:38:00-08:00", - "name": "test 1", + "issuanceDate": "2010-01-01T00:00:00Z", + "name": "Teamwork Badge", "credentialSubject": { - "id": "urn:uuid:6f2e33e5-7a29-4155-840a-59483ba10164", + "id": "did:example:ebfeb1f712ebc6f1c276e12ec21", "type": [ "AchievementSubject" ], "achievement": { - "id": "urn:uuid:35258e6f-4c05-4215-8ada-38a5a5b80510", + "id": "https://example.com/achievements/21st-century-skills/teamwork", "type": [ "Achievement" ], - "achievementType": "Achievement", - "name": "test 1", - "description": "This is a test achievement", "criteria": { - "narrative": "There is no criteria" - } + "narrative": "Team members are nominated for this badge by their peers and recognized upon review by Example Corp management." + }, + "description": "This badge recognizes the development of the capacity to collaborate within a group environment.", + "name": "Teamwork" } }, "proof": [ { "type": "Ed25519Signature2020", - "created": "2022-11-10T19:36:07Z", + "created": "2022-11-16T18:54:22Z", + "verificationMethod": "https://example.com/issuers/876543#z6MknNHHrBzPytzu6CUBP9Lg7fg4KSBjzimc2Frh693YbMiv", "proofPurpose": "assertionMethod", - "verificationMethod": "z6Mkt5PKegVQUpjQjoeiqkFa1HqpvMvehiLJuPMJcqX9hxM5", - "proofValue": "z4xh7M5Xpo4hU2bDU6dtQZgnuJCtJUhYCsMPBbCnhAvdnugDidH8anMJ6ayt7vR74iL5mhgJgTDQnNHoYrCnhARVD" + "proofValue": "z5gJZKchSJEYPGeq6bsqiLKuxT6mXqAovPbqYX66CB7u9CSNFdV41vHtysjHFiitvoyhfPxsaZnWftrZZZW2txPQK" } ] } \ No newline at end of file