-
Notifications
You must be signed in to change notification settings - Fork 15
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
URDNA2015Canonicalizer: Custom loader not being assigned to LdProof's object #13
Comments
@vitorpamplona I'd like to follow up on the issues you opened.. I'm not sure I understand this one here.. When the Is this still an issue after we merged decentralized-identity/jsonld-common-java#6? If yes, could you maybe propose some change to address this issue? |
The idea is to NEVER use the default loader. It looks like |
I just can't see why the custom loader is used in one but not in the other. |
Well the idea is that
I.e. only the proof, and without the actual proof value. This should only need standard contexts using the standard document loader (see here). |
And that is the loader I am trying to avoid at all costs :) |
But why? Didn't we fix the HttpClient dependency problem when we merged decentralized-identity/jsonld-common-java#6 ? |
Because in the end, we don't want all those JSONs in memory (we still use them in memory as of now, but it is not a good solution). |
And remember, the way Android manages resources is different than Java applications. I'd expect any serious use of this library to have its own preference for resource loading/caching mechanisms. Especially, JSON files which are still quite slow to parse in Java. |
I see, makes sense. Not sure though if I just want to use the same document loader as for How about we make this configurable, e.g. by having a member variable in the class URDNA2015Canonicalizer that can be changed, or a getter method that can be overridden by subclasses? |
Why would you want to use two loaders? That's the part I am not understanding. |
I'm not sure if I have a good answer to that. We're basically talking about this algorithm here: https://w3c-ccg.github.io/data-integrity-spec/#create-verify-hash-algorithm. I guess I want to make sure that the "canonicalized options document" (step 4.1) is guaranteed to be calculated from a JSON-LD context that correctly defines the relevant security terms such as But since the proof eventually becomes a part of the overall JSON-LD document, I suppose it also makes sense to just use the same document loader, which (in theory) should always define the security terms correctly. |
hum.. that doesn't seem to be protecting much. I would be more concerned about making sure all JSON fields were included (in any way) into the canonicalization string. I am finding several implementations that simply skip JSON fields that don't follow the spec (say, when the ID is not a URI). Since developers don't manually check if all fields were part of the canonicalization, we have seen instances of VCs that can be changed entirely and would still be verifiable (credentialSubject wasn't included in the canonicalization due to a given field failing to meet the spec). |
Okay I guess I would also be fine with using the same document loader as for the main document, as you suggested. Do you want to create a PR? BTW I think some time next week we'll do 1.0 releases of both jsonld-common-java and ld-signatures-java... It would be great if you could do PRs for the issues we discussed here and in jsonld-common-java, perhaps in the next few days? |
Here a custom loader is correctly assigned to
jsonLdObjectWithoutProof
but not toldProofWithoutProofValues
. I am not sure why. But I think it is prudent to assign to both objects.This has to do with not instantiating default DocumentLoaders to avoid the need for
java.net.http.HttpClient
on runtime (Android's don't have it)The text was updated successfully, but these errors were encountered: