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

Add feature to throw error when unmapped elements are dropped during processing #199

Open
dlongley opened this issue Sep 12, 2017 · 5 comments
Assignees

Comments

@dlongley
Copy link
Member

When certain elements in a document cannot be mapped to absolute URLs (via @context or a base URL), then are silently dropped during expansion per the spec. There should be a feature in this processor that, instead, causes an error to be raised. This is particularly important when this library is used in conjunction with digital signing libraries.

Related to #178.

@dlongley
Copy link
Member Author

Partially supported with expansionMap and compactionMap here: bcae961

Still need something for toRDF.

@dlongley
Copy link
Member Author

Specifically, when converting to RDF, relative URIs are dropped and this should be handled by another map or similar mechanism.

sudeshrshetty added a commit to sudeshrshetty/aries-framework-go that referenced this issue Apr 10, 2020
Previously: we weren't dropping undefined terms from RDFs.

Fix: changed normalization aproach through json-gold library so that it
returns parsing error whenever invalid data found in dataset.

Added error handling logic for invalid RDF data errors where aries json
ld processor is going to remove the invalid data from dataset and try
again recursively. (Following
digitalbazaar/jsonld.js#199)

closes hyperledger-archives#1592

Signed-off-by: sudesh.shetty <sudesh.shetty@securekey.com>
sudeshrshetty added a commit to sudeshrshetty/aries-framework-go that referenced this issue Apr 10, 2020
Previously: we weren't dropping undefined terms from RDFs.

Fix: changed normalization aproach through json-gold library so that it
returns parsing error whenever invalid data found in dataset.

Added error handling logic for invalid RDF data errors where aries json
ld processor is going to remove the invalid data from dataset and try
again recursively. (Following
digitalbazaar/jsonld.js#199)

closes hyperledger-archives#1592

Signed-off-by: sudesh.shetty <sudesh.shetty@securekey.com>
sudeshrshetty added a commit to sudeshrshetty/aries-framework-go that referenced this issue Apr 10, 2020
Previously: we weren't dropping undefined terms from RDFs.

Fix: changed normalization aproach through json-gold library so that it
returns parsing error whenever invalid data found in dataset.

Added error handling logic for invalid RDF data errors where aries json
ld processor is going to remove the invalid data from dataset and try
again recursively. (Following
digitalbazaar/jsonld.js#199)

closes hyperledger-archives#1592

Signed-off-by: sudesh.shetty <sudesh.shetty@securekey.com>
sudeshrshetty added a commit to sudeshrshetty/aries-framework-go that referenced this issue Apr 10, 2020
Previously: we weren't dropping undefined terms from RDFs.

Fix: changed normalization aproach through json-gold library so that it
returns parsing error whenever invalid data found in dataset.

Added error handling logic for invalid RDF data errors where aries json
ld processor is going to remove the invalid data from dataset and try
again recursively. (Following
digitalbazaar/jsonld.js#199)

closes hyperledger-archives#1592

Signed-off-by: sudesh.shetty <sudesh.shetty@securekey.com>
sudeshrshetty added a commit to sudeshrshetty/aries-framework-go that referenced this issue Apr 11, 2020
Previously: we weren't dropping undefined terms from RDFs.

Fix: changed normalization aproach through json-gold library so that it
returns parsing error whenever invalid data found in dataset.

Added error handling logic for invalid RDF data errors where aries json
ld processor is going to remove the invalid data from dataset and try
again recursively. (Following
digitalbazaar/jsonld.js#199)

closes hyperledger-archives#1592

Signed-off-by: sudesh.shetty <sudesh.shetty@securekey.com>
@OR13
Copy link

OR13 commented Nov 9, 2020

@dlongley I want to make this explode, whats the easiest way to do that?

I have this PR with a failing test: transmute-industries/vc.js#26

@dlongley
Copy link
Member Author

dlongley commented Dec 9, 2020

@OR13,

I want to make this explode, whats the easiest way to do that?

Sorry, just seeing this now, a month later. Using an undefined type with no base set or -- as it says in the issue I just linked to -- a non-URI for an id will cause silent droppage. Not sure if that's "exploding" though. :)

@OR13
Copy link

OR13 commented Dec 11, 2020

explode means that when someone hands json that has been mutated after being signed, a verifier will throw an error on it, not return "verified".

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants