fix(anoncreds): unqualified revocation registry processing #1833
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I ran into issues issues while receiving legacy Indy credentials with revocation support, e.g. receiving the following error when using BC Digital Trust Showcase:
I found that record metadata was populated with
revocationRegistryId
from the W3C credential object, which in this case would be an unqualified identifier. AsgetUnQualifiedDidIndyDid
expected a qualified identifier, this fails. In addition, the utility methodgetQualifiedDidIndyDid
was not taking into account credentialDefinitionTag while generating the identifier, resulting also in an error.In this PR this is fixed by explicitly specifying the
revocationRegistryId
when callingAnonCredsRsHolderService.storeW3cCredential
rather than taking it from the W3C credential. I'm not sure if this is the most elegant solution though, so any suggestion on that will be more than appreciated.Another a bit controversial thing I changed here is to delay the
w3cCredentialService.storeCredential()
call to the last minute, in order to prevent any possible error to be thrown that could leave aW3cCredentialRecord
without tags and metadata.