From e8dd2c28ff520a3abaa728743a49e05188ce59a5 Mon Sep 17 00:00:00 2001 From: Mario Date: Sat, 13 Jan 2024 08:50:57 +0000 Subject: make our jsonld parser happy --- Zotlabs/Lib/Activity.php | 6 +- library/w3org/did-v1.jsonld | 4 - library/w3org/security-data-integrity-v1.jsonld | 110 ++++++++++-------------- library/w3org/security-multikey-v1.jsonld | 44 ++++------ 4 files changed, 67 insertions(+), 97 deletions(-) diff --git a/Zotlabs/Lib/Activity.php b/Zotlabs/Lib/Activity.php index 766b4ed91..8cc359f44 100644 --- a/Zotlabs/Lib/Activity.php +++ b/Zotlabs/Lib/Activity.php @@ -4229,7 +4229,7 @@ class Activity { return [ 'zot' => z_root() . '/apschema#', - 'schema' => 'http://schema.org#', + 'schema' => 'http://schema.org/', 'ostatus' => 'http://ostatus.org#', 'diaspora' => 'https://diasporafoundation.org/ns/', @@ -4272,8 +4272,8 @@ class Activity { $arr = array_merge(Activity::ap_context(), $obj); if ($channel) { - // $proof = (new JcsEddsa2022)->sign($arr, $channel); - // $arr['proof'] = $proof; + $proof = (new JcsEddsa2022)->sign($arr, $channel); + $arr['proof'] = $proof; $signature = LDSignatures::sign($arr, $channel); $arr['signature'] = $signature; diff --git a/library/w3org/did-v1.jsonld b/library/w3org/did-v1.jsonld index b447d0108..ea65773c1 100644 --- a/library/w3org/did-v1.jsonld +++ b/library/w3org/did-v1.jsonld @@ -1,9 +1,5 @@ { "@context": { - "@protected": true, - "id": "@id", - "type": "@type", - "alsoKnownAs": { "@id": "https://www.w3.org/ns/activitystreams#alsoKnownAs", "@type": "@id" diff --git a/library/w3org/security-data-integrity-v1.jsonld b/library/w3org/security-data-integrity-v1.jsonld index d8a50543e..5d277c9f3 100644 --- a/library/w3org/security-data-integrity-v1.jsonld +++ b/library/w3org/security-data-integrity-v1.jsonld @@ -2,73 +2,57 @@ "@context": { "id": "@id", "type": "@type", - "@protected": true, "proof": { "@id": "https://w3id.org/security#proof", "@type": "@id", - "@container": "@graph" }, "DataIntegrityProof": { - "@id": "https://w3id.org/security#DataIntegrityProof", - "@context": { - "@protected": true, - "id": "@id", - "type": "@type", - "challenge": "https://w3id.org/security#challenge", - "created": { - "@id": "http://purl.org/dc/terms/created", - "@type": "http://www.w3.org/2001/XMLSchema#dateTime" - }, - "domain": "https://w3id.org/security#domain", - "expires": { - "@id": "https://w3id.org/security#expiration", - "@type": "http://www.w3.org/2001/XMLSchema#dateTime" - }, - "nonce": "https://w3id.org/security#nonce", - "proofPurpose": { - "@id": "https://w3id.org/security#proofPurpose", - "@type": "@vocab", - "@context": { - "@protected": true, - "id": "@id", - "type": "@type", - "assertionMethod": { - "@id": "https://w3id.org/security#assertionMethod", - "@type": "@id", - "@container": "@set" - }, - "authentication": { - "@id": "https://w3id.org/security#authenticationMethod", - "@type": "@id", - "@container": "@set" - }, - "capabilityInvocation": { - "@id": "https://w3id.org/security#capabilityInvocationMethod", - "@type": "@id", - "@container": "@set" - }, - "capabilityDelegation": { - "@id": "https://w3id.org/security#capabilityDelegationMethod", - "@type": "@id", - "@container": "@set" - }, - "keyAgreement": { - "@id": "https://w3id.org/security#keyAgreementMethod", - "@type": "@id", - "@container": "@set" - } - } - }, - "cryptosuite": "https://w3id.org/security#cryptosuite", - "proofValue": { - "@id": "https://w3id.org/security#proofValue", - "@type": "https://w3id.org/security#multibase" - }, - "verificationMethod": { - "@id": "https://w3id.org/security#verificationMethod", - "@type": "@id" - } - } + "@id": "https://w3id.org/security#DataIntegrityProof" + }, + "challenge": "https://w3id.org/security#challenge", + "created": { + "@id": "http://purl.org/dc/terms/created", + "@type": "http://www.w3.org/2001/XMLSchema#dateTime" + }, + "domain": "https://w3id.org/security#domain", + "expires": { + "@id": "https://w3id.org/security#expiration", + "@type": "http://www.w3.org/2001/XMLSchema#dateTime" + }, + "nonce": "https://w3id.org/security#nonce", + "cryptosuite": "https://w3id.org/security#cryptosuite", + "proofValue": { + "@id": "https://w3id.org/security#proofValue", + "@type": "https://w3id.org/security#multibase" + }, + "verificationMethod": { + "@id": "https://w3id.org/security#verificationMethod", + "@type": "@id" + }, + "proofPurpose": { + "@id": "https://w3id.org/security#proofPurpose", + "@type": "@vocab" + }, + "assertionMethod": { + "@id": "https://w3id.org/security#assertionMethod", + "@type": "@id", + }, + "authentication": { + "@id": "https://w3id.org/security#authenticationMethod", + "@type": "@id", + }, + "capabilityInvocation": { + "@id": "https://w3id.org/security#capabilityInvocationMethod", + "@type": "@id", + }, + "capabilityDelegation": { + "@id": "https://w3id.org/security#capabilityDelegationMethod", + "@type": "@id", + }, + "keyAgreement": { + "@id": "https://w3id.org/security#keyAgreementMethod", + "@type": "@id", + "@container": "@set" } } -} \ No newline at end of file +} diff --git a/library/w3org/security-multikey-v1.jsonld b/library/w3org/security-multikey-v1.jsonld index 43ac7f0cb..e5e94bc9f 100644 --- a/library/w3org/security-multikey-v1.jsonld +++ b/library/w3org/security-multikey-v1.jsonld @@ -2,34 +2,24 @@ "@context": { "id": "@id", "type": "@type", - "@protected": true, "Multikey": { - "@id": "https://w3id.org/security#Multikey", - "@context": { - "@protected": true, - "id": "@id", - "type": "@type", - "controller": { - "@id": "https://w3id.org/security#controller", - "@type": "@id" - }, - "revoked": { - "@id": "https://w3id.org/security#revoked", - "@type": "http://www.w3.org/2001/XMLSchema#dateTime" - }, - "expires": { - "@id": "https://w3id.org/security#expiration", - "@type": "http://www.w3.org/2001/XMLSchema#dateTime" - }, - "publicKeyMultibase": { - "@id": "https://w3id.org/security#publicKeyMultibase", - "@type": "https://w3id.org/security#multibase" - }, - "secretKeyMultibase": { - "@id": "https://w3id.org/security#secretKeyMultibase", - "@type": "https://w3id.org/security#multibase" - } - } + "@id": "https://w3id.org/security#Multikey" + }, + "controller": { + "@id": "https://w3id.org/security#controller", + "@type": "@id" + }, + "revoked": { + "@id": "https://w3id.org/security#revoked", + "@type": "http://www.w3.org/2001/XMLSchema#dateTime" + }, + "publicKeyMultibase": { + "@id": "https://w3id.org/security#publicKeyMultibase", + "@type": "https://w3id.org/security#multibase" + }, + "secretKeyMultibase": { + "@id": "https://w3id.org/security#secretKeyMultibase", + "@type": "https://w3id.org/security#multibase" } } } -- cgit v1.2.3