Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(contexts): add linked-vp #548

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions contexts/linked-vp-v1.jsonld
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"@context": [
{
"@version": 1.1,
"@protected": true,
"LinkedVerifiablePresentation": "https://identity.foundation/linked-vp/contexts/v1#LinkedVerifiablePresentation"
}
]
}
1 change: 1 addition & 0 deletions contexts/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand Down
1 change: 1 addition & 0 deletions contexts/update.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
6 changes: 6 additions & 0 deletions ssi-json-ld/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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 {
Expand Down Expand Up @@ -325,6 +330,7 @@ impl Loader<IriBuf, Span> 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))
}
}
Expand Down