From 6df806849e733dc11eaefcb89d56468d2ecea331 Mon Sep 17 00:00:00 2001 From: Jan Christoph Ebersbach Date: Fri, 17 May 2024 09:44:08 +0200 Subject: [PATCH] feat(contexts): add linked-vp --- contexts/linked-vp-v1.jsonld | 9 +++++++++ contexts/src/lib.rs | 1 + contexts/update.sh | 1 + ssi-json-ld/src/lib.rs | 6 ++++++ 4 files changed, 17 insertions(+) create mode 100644 contexts/linked-vp-v1.jsonld diff --git a/contexts/linked-vp-v1.jsonld b/contexts/linked-vp-v1.jsonld new file mode 100644 index 000000000..0adf8237d --- /dev/null +++ b/contexts/linked-vp-v1.jsonld @@ -0,0 +1,9 @@ +{ + "@context": [ + { + "@version": 1.1, + "@protected": true, + "LinkedVerifiablePresentation": "https://identity.foundation/linked-vp/contexts/v1#LinkedVerifiablePresentation" + } + ] +} diff --git a/contexts/src/lib.rs b/contexts/src/lib.rs index 0abf1ea48..72a24153b 100644 --- a/contexts/src/lib.rs +++ b/contexts/src/lib.rs @@ -69,6 +69,7 @@ pub const CACAO_ZCAP_V1: &str = include_str!("../cacao-zcap-v1.jsonld"); pub const JFF_VC_EDU_PLUGFEST_2022: &str = include_str!("../jff-vc-edu-plugfest-1-context.json"); pub const DID_CONFIGURATION_V0_0: &str = include_str!("../did-configuration-v0.0.jsonld"); pub const JFF_VC_EDU_PLUGFEST_2022_2: &str = include_str!("../jff-vc-edu-plugfest-2-context.json"); +pub const LINKED_VP_V1: &str = include_str!("../linked-vp-v1.jsonld"); pub const TZ_V2: &str = include_str!("../tz-2021-v2.jsonld"); pub const TZVM_V1: &str = include_str!("../tzvm-2021-v1.jsonld"); diff --git a/contexts/update.sh b/contexts/update.sh index 730bfda2f..acdb27024 100755 --- a/contexts/update.sh +++ b/contexts/update.sh @@ -28,4 +28,5 @@ exec curl \ https://w3id.org/vc/status-list/2021/v1 -o w3id-vc-status-list-2021-v1.jsonld \ https://demo.didkit.dev/2022/cacao-zcap/contexts/v1.json -o cacao-zcap-v1.jsonld \ https://w3c-ccg.github.io/vc-ed/plugfest-1-2022/jff-vc-edu-plugfest-1-context.json -o jff-vc-edu-plugfest-1-context.json \ + https://identity.foundation/linked-vp/contexts/v1 -o linked-vp-v1.jsonld \ -L diff --git a/ssi-json-ld/src/lib.rs b/ssi-json-ld/src/lib.rs index fb9f5660c..4ca8651d8 100644 --- a/ssi-json-ld/src/lib.rs +++ b/ssi-json-ld/src/lib.rs @@ -80,6 +80,7 @@ pub const DID_CONFIGURATION_V0_0_CONTEXT: Iri = iri!("https://identity.foundation/.well-known/contexts/did-configuration-v0.0.jsonld"); pub const JFF_VC_EDU_PLUGFEST_2022_2_CONTEXT: Iri = iri!("https://purl.imsglobal.org/spec/ob/v3p0/context.json"); +pub const LINKED_VP_V1_CONTEXT: Iri = iri!("https://identity.foundation/linked-vp/contexts/v1"); /// Load a remote context from its static definition. fn load_static_context(iri: Iri, content: &str) -> RemoteDocument { @@ -237,6 +238,10 @@ lazy_static::lazy_static! { JFF_VC_EDU_PLUGFEST_2022_2_CONTEXT, ssi_contexts::JFF_VC_EDU_PLUGFEST_2022_2 ); + pub static ref LINKED_VP_V1_CONTEXT_DOCUMENT: RemoteDocument = load_static_context( + LINKED_VP_V1_CONTEXT, + ssi_contexts::LINKED_VP_V1 + ); } macro_rules! iri_match { @@ -325,6 +330,7 @@ impl Loader for StaticLoader { JFF_VC_EDU_PLUGFEST_2022_2_CONTEXT => { Ok(JFF_VC_EDU_PLUGFEST_2022_2_CONTEXT_DOCUMENT.clone()) }, + LINKED_VP_V1_CONTEXT => { Ok(LINKED_VP_V1_CONTEXT_DOCUMENT.clone()) }, _ as iri => Err(UnknownContext(iri)) } }