veramo icon indicating copy to clipboard operation
veramo copied to clipboard

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

Open mirceanis opened this issue 2 years ago • 1 comments

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.

  • [x] remove credentials and presentations properties from IMessage interface
  • [x] remove credentials and presentations parsing from handleMessage, if any.
  • [x] remove credential and presentation processing from Message entity in @veramo/data-store
  • [x] remove VC/VP foreign keys from the respective @veramo/data-store#Entities
  • [x] add migration to remove cascading for credentials and presentations from messages
  • [ ] add test to check migration from earlier database version
  • [ ] add test to ensure that messages do not get deleted along with a VC entry

mirceanis avatar Mar 17 '22 14:03 mirceanis

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.

mirceanis avatar Jun 21 '22 12:06 mirceanis