Skip to content
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

Unable to Retrieve Invitation Object After Creation #3536

Open
MonolithicMonk opened this issue Feb 19, 2025 · 2 comments
Open

Unable to Retrieve Invitation Object After Creation #3536

MonolithicMonk opened this issue Feb 19, 2025 · 2 comments

Comments

@MonolithicMonk
Copy link
Contributor

Feature Request: Reliable Invitation Object Retrieval

Description

Currently, ACA-Py lacks a consistent and reliable method to retrieve invitation objects after creation, especially when using did:peer:2 or did:peer:4 DID methods. While invitation URLs are returned upon creation, there is no standard endpoint to fetch the full invitation object later if not initially stored.

Current Behavior

  • Inconsistent /connections/{conn_id}/invitation endpoint: Traction ACA-Py's endpoint fails with AttributeError: 'InvitationMessage' object has no attribute 'endpoint' when using did:peer:2 or did:peer:4.
  • Missing Generic Retrieval: ACA-Py lacks a standard endpoint or method to retrieve invitation objects based on connection ID or invitation ID.

Expected Behavior

Provide a reliable mechanism to retrieve the full invitation object (including the invitation URL and properties like accepted, imageUrl, label) for any connection, regardless of the DID method used.

Steps to Reproduce

  1. Create an OOB or legacy connection invitation.
  2. Do not store the returned invitation object.
  3. Attempt to retrieve the invitation object.

Environment

  • ACA-Py Version: All
  • Traction Deployment: 1.1
  • DID Method: All (especially did:peer:2, did:peer:4 in Traction)

Proposed Solutions

  1. Standardize /connections/{conn_id}/invitation: Make this endpoint a standard ACA-Py feature and ensure compatibility across all DID methods.
  2. Dedicated /invitations/{invitation_id} Endpoint: Introduce a new endpoint to retrieve invitations by their unique ID.
  3. Embed Invitation in Connection Object: Include the invitation object as a property within the existing connection object for easy access.

Workaround

Manual reconstruction of the invitation object from the connection object is possible but incomplete, as key properties like accepted, imageUrl, and label may be missing.

@MonolithicMonk
Copy link
Contributor Author

I have created a fix within the Traction plugin (traction_innkeeper) for the /connections/{conn_id}/invitation endpoint.

The issue was that the endpoint was failing to generate the correct invitation URL for peer DIDs, leading to an AttributeError and incomplete URLs.

Fix Details:

A pull request has been created in the Traction repository to address this: PR #1510.

This resolves the immediate problem in ACA-PY deployments with Traction plugin. Unanswered question is should core ACA-PY provide a way for users to retrieve old invitation urls?

@loneil
Copy link
Contributor

loneil commented Feb 21, 2025

For Traction, we indeed added the /connections/{conn_id}/invitation endpoint in the Traction plugin, mostly for the need of regenerating URL/QR Code for a previously created connection/OOB invitation, as there wasn't a way of re-fetching that in ACA-Py.

I've merged the PR that fixes the exception for the did:peer types over in Traction.

The relevant Traction implementation of this fetch is at:
https://github.com/bcgov/traction/blob/a50e9ec5667474d16d4954b2c697559b0363f950/plugins/traction_innkeeper/traction_innkeeper/v1_0/connections/routes.py#L20

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

No branches or pull requests

2 participants