Skip to content

Conversation

@jamshale
Copy link
Contributor

@jamshale jamshale commented Oct 20, 2025

Add a plugin for issuance v1 protocols.

Adds the protocols via the definition.py file and copies all the unit tests over.

2 things to get full functionality:

  • Monkey patches the oob inivitation issuance attachment.
  • Adds the new revocation event handler in the routes.py file.

For more information see the original PR #1056

One thing about doing the present-proof protocol next is that this is overriding the oob create invitation endpoint with the monkey patched function. The present-proof will need to do this as well. I think the way to do this is have a dependency with each other where each plugin both has the same monkey patch.

Signed-off-by: jamshale <jamiehalebc@gmail.com>
Signed-off-by: jamshale <jamiehalebc@gmail.com>
Signed-off-by: jamshale <jamiehalebc@gmail.com>
Signed-off-by: jamshale <jamiehalebc@gmail.com>
Signed-off-by: jamshale <jamiehalebc@gmail.com>
Signed-off-by: jamshale <jamiehalebc@gmail.com>
Signed-off-by: jamshale <jamiehalebc@gmail.com>
Signed-off-by: jamshale <jamiehalebc@gmail.com>
Signed-off-by: jamshale <jamiehalebc@gmail.com>
Signed-off-by: jamshale <jamiehalebc@gmail.com>
Signed-off-by: jamshale <jamiehalebc@gmail.com>
Signed-off-by: jamshale <jamiehalebc@gmail.com>
@jamshale jamshale requested a review from Copilot November 25, 2025 00:08
Copilot finished reviewing on behalf of jamshale November 25, 2025 00:09
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds an issue-credential v1.0 plugin to support the legacy v1 credential issuance protocol. The implementation includes a monkey patch for OOB invitation credential offer attachments and a new revocation event handler to update credential exchange record states when credentials are revoked.

Key changes:

  • Complete plugin structure with models, messages, handlers, routes, and comprehensive test coverage
  • Monkey patch to InvitationCreator.create_attachment for v1 credential offer support in OOB invitations
  • Event handler registration to handle credential revocation events and update v1 exchange records

Reviewed changes

Copilot reviewed 54 out of 63 changed files in this pull request and generated 16 comments.

Show a summary per file
File Description
pyproject.toml Poetry configuration with dependencies and dev tools
routes.py Admin API routes with monkey patch and revocation event handler
models/credential_exchange.py V10CredentialExchange record model and schema
messages/*.py Message classes for v1 protocol (proposal, offer, request, issue, ack)
handlers/tests/*.py Comprehensive handler unit tests
v1_0/tests/*.py Unit tests for routes and manager

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Signed-off-by: jamshale <jamiehalebc@gmail.com>
Signed-off-by: jamshale <jamiehalebc@gmail.com>
Signed-off-by: jamshale <jamiehalebc@gmail.com>
Signed-off-by: jamshale <jamiehalebc@gmail.com>
@jamshale jamshale changed the title feat: issue-credential v1 plugin - Initial Commit feat: issue-credential v1 plugin Nov 26, 2025
Signed-off-by: jamshale <jamiehalebc@gmail.com>
@jamshale jamshale requested review from PatStLouis and esune November 26, 2025 22:49
_original_create_attachment = InvitationCreator.create_attachment


async def _patched_create_attachment(self, attachment: Mapping, pthid: str, session):
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the monkey patch which does the V1 attachment handling or falls back to the the default from acapy.

bus.subscribe(re.compile(r"^acapy::cred-revoked$"), cred_revoked)


async def cred_revoked(profile: Profile, event: EventWithMetadata):
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the cred_ex revocation for v1 part. Aca-py has the same thing targeting the IssuerV2CredRevRecord's.

)

# OOB backwards compatibility. This is needed for adding v1 attachments.
for r in app.router.routes():
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is where the endpoint gets overridden with the patched class/function. It's not ideal to override the private handler but there's no other way I can think of.

multitenant_provider does the same thing for overriding endpoints.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant