Skip to content
This repository has been archived by the owner on Mar 27, 2024. It is now read-only.

feat: added data integrity jsonld context #3624

Conversation

mishasizov-SK
Copy link
Contributor

@mishasizov-SK mishasizov-SK commented Aug 23, 2023

Title:
Added data integrity JSON-LD context

Description:
Because of the missed DI JSON LD context (and disabled strict validation), Aries on issuance stage generated invalid canonicalProofConfig considering only type field.
Example:

_:c14n0 <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <DataIntegrityProof> .

Verification part was successful because Aries considered same type field. And because of that, Unit tests did not catch the typo that on verification stage field created was empty.

According to Spec, another fields must be also included in canonicalProofConfig.

After this PR, Aries generates the following canonicalProofConfig:

_:c14n0 <http://purl.org/dc/terms/created> "2023-08-23T16:57:33+03:00"^^<http://www.w3.org/2001/XMLSchema#dateTime> .
_:c14n0 <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <https://w3id.org/security#DataIntegrityProof> .
_:c14n0 <https://w3id.org/security#cryptosuite> "ecdsa-2019" .
_:c14n0 <https://w3id.org/security#proofPurpose> <https://w3id.org/security#assertionMethod> .
_:c14n0 <https://w3id.org/security#verificationMethod> <did:foo:bar#key-1> .

@codecov
Copy link

codecov bot commented Aug 23, 2023

Codecov Report

Merging #3624 (a5a2153) into main (6911901) will decrease coverage by 0.01%.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##             main    #3624      +/-   ##
==========================================
- Coverage   86.93%   86.92%   -0.01%     
==========================================
  Files         367      367              
  Lines       50024    50033       +9     
==========================================
+ Hits        43487    43493       +6     
- Misses       4951     4953       +2     
- Partials     1586     1587       +1     
Files Changed Coverage Δ
component/models/ld/testutil/document_loader.go 82.14% <ø> (ø)
.../models/dataintegrity/suite/ecdsa2019/ecdsa2019.go 92.00% <100.00%> (+0.04%) ⬆️
component/models/dataintegrity/verifier.go 89.88% <100.00%> (-2.71%) ⬇️

@fqutishat fqutishat merged commit 917ccf5 into hyperledger-archives:main Aug 23, 2023
12 of 13 checks passed
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants