-
Notifications
You must be signed in to change notification settings - Fork 231
fix: unqualified anoncreds revocation notification support #2240
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
base: main
Are you sure you want to change the base?
fix: unqualified anoncreds revocation notification support #2240
Conversation
|
Signed-off-by: Ariel Gentile <[email protected]> fix: data type Signed-off-by: Ariel Gentile <[email protected]>
39598b8
to
c7bbdd4
Compare
Signed-off-by: Ariel Gentile <[email protected]>
This is how the changes look like right now for a 0.5.13 credo: https://github.com/openwallet-foundation/credo-ts/compare/v0.5.x...genaris:fix/v0.5x-unqualified-anoncreds-revocation-support?expand=1 |
Signed-off-by: Ariel Gentile <[email protected]>
|
||
// Find credential exchange record associated with this credential | ||
credentialExchangeRecord = | ||
(await this.credentialRepository.getAll(agentContext)).find((record) => |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there no way to find the credential exchange record associated with a credential record?
This seems inefficient to run for every query ... :/
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, that's why I tried to avoid running it in cases not affected by this problem (e.g. using qualified identifiers).
Probably we have some other tricks to do, but I don't think in practice it will be so critical, since this code runs on holder side and I don't expect users to hold thousands of credentials using unqualified identifiers.
Something not done in this PR (at the moment) are changes on AnonCredsCredentialFormatService
: we can also add the anonCredsUnqualified*
tags to CredentialExchangeRecords. This would at least prevent this code from running in 0.5.14 agents.
@bryce-mcmath Were you able to test this? I was wondering if this could still get merged into the patch as it is the last thing allowing this scenario to work and do our migrations incrementally. I don't have a good understanding of credo storage, but, I agree that the performance doesn't seem to be much of an issue if it only does this when unqualified id's are present and is only on the holder side. |
It's already in our patches in the Testflight BC Wallet if you want to double check anything in particular. Seems to be working well so far |
OK, great. Thank you. |
@TimoGlastra since this fix can be useful for some users and appearently works well for their use case, do you think we can re-target this PR to 0.5.x branch so it can be included in the next patch release for them? I can create a different one for |
credentialExchangeRecord = | ||
(await this.credentialRepository.getAll(agentContext)).find((record) => |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we should limit the calling of this to:
- filter by state (credential received and completed)
- only if the incoming revocation id is unqualified
This is a fix focused mainly for 0.5.x deployments to address the issue #2206.
The proposed solution here is to search for W3C Credential Records matching the revocation notification only in case we don't find any matching Credential Exchange record. The opposite (search first for W3C Credential records) would work, but force us to get all Credential Exchange records and filter them (i.e. no optimized query using tags), since
RevocationNotificationReceivedEvent
requires to send the associated CredentialExchangeRecord.I think for 0.6 we could aim to update this API to focus on W3CCredentialRecord directly, meaning that we will need to do some updates to the data model (e.g. W3CCredentialRecord will need to hold revocation info and connectionId).
@JoLuPuma @jamshale @barnabef @zoblazo I didn't test it deeply yet but, if you have the chance of patching your 0.5.13 with this and test it, please let me know to make sure this does the trick.