decentralized-identity / veramo

A JavaScript Framework for Verifiable Data
https://veramo.io
Apache License 2.0
417 stars 129 forks source link

[BUG] Remove automatic link between IMessage and VCs/VPs #834

Open mirceanis opened 2 years ago

mirceanis commented 2 years ago

There is an assumption in a few of the current Veramo plugins, that an IMessage lists the credentials and presentations it contains.

This assumption is wrong, because messages are not just for sending credentials or presentations, but can also contain other data. Also, messages can be encrypted and be in transit on an agent, so it would not be able to determine if the message contains VCs/VPs.

The automatic parsing of messages to extract VPs/VCs should be removed, along with the @veramo/data-store SQL cascading.

mirceanis commented 2 years ago

While working on this I realize that there is more to this than simply removing the link. A bigger restructuring of the message handling architecture is required and should probably be performed in the following major release.

This automatic linking is assumed by the W3CMessageHandler when parsing messages that are plain credentials or presentations. This means that such objects would no longer be stored in the data store when automatic message saving is enabled.