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 receive connectionless out-of-band invitation #1636

Closed
TimoGlastra opened this issue Feb 21, 2022 · 7 comments · Fixed by #1710
Closed

Unable to receive connectionless out-of-band invitation #1636

TimoGlastra opened this issue Feb 21, 2022 · 7 comments · Fixed by #1710
Assignees

Comments

@TimoGlastra
Copy link
Contributor

When receiving an out-of-band invitation containing a proof-request without any handshake_protocols I get an error No existing connection exists and handshake_protocol is missing. This leads me to believe connectionless out of band invitations are not supported in ACA-Py.

Also looking at the code it seems to only process the attached message if there is a connection record:

        # Request Attach
        if len(invitation.requests_attach) >= 1 and conn_rec is not None

Are connectionless exchanges initiated through out of band not supported yet? Am I using it incorectly?

Here is the full error:

2022-02-21 13:40:13,192 aries_cloudagent.admin.server DEBUG Body: {
    "@type": "did:sov:BzCbsNYhMrjHiqZDTUASHg;spec/out-of-band/1.0/invitation",
    "@id": "dc81a186-908a-449a-a2b5-d8ed1a0c6a88",
    "label": "Aries Cloud Agent",
    "services": [
      {
        "id": "#inline",
        "type": "did-communication",
        "recipientKeys": [
          "did:key:z6MkrBLdrjur8fgA9TGSCXaKNoU8zi3hiu1hozfbgLALfXty"
        ],
        "serviceEndpoint": "ws://localhost:4000"
      }
    ],
    "requests~attach": [
      {
        "@id": "request-0",
        "mime-type": "application/json",
        "data": {
          "json": {
            "@type": "did:sov:BzCbsNYhMrjHiqZDTUASHg;spec/present-proof/2.0/request-presentation",
            "@id": "9203ebcc-e54c-4a61-9a4a-6ede677a3b6d",
            "request_presentations~attach": [
              {
                "@id": "indy",
                "mime-type": "application/json",
                "data": {
                  "base64": "eyJuYW1lIjogIlByb29mIHJlcXVlc3QiLCAicmVxdWVzdGVkX2F0dHJpYnV0ZXMiOiB7ImFkZGl0aW9uYWxQcm9wMSI6IHsibmFtZSI6ICJmYXZvdXJpdGVEcmluayIsICJyZXN0cmljdGlvbnMiOiBbXX19LCAicmVxdWVzdGVkX3ByZWRpY2F0ZXMiOiB7fSwgInZlcnNpb24iOiAiMS4wIiwgIm5vbmNlIjogIjEwNzI2NDI0ODkxMTI2OTA4OTAyMTk0NyJ9"
                }
              }
            ],
            "will_confirm": true,
            "formats": [
              {
                "attach_id": "indy",
                "format": "hlindy/[email protected]"
              }
            ]
          }
        }
      }
    ]
  }
2022-02-21 13:40:13,199 aries_cloudagent.core.dispatcher ERROR Handler error: invitation_receive
Traceback (most recent call last):
  File "/Users/timo/Developer/Work/Projects/AFJ/aries-cloudagent-python/aries_cloudagent/protocols/out_of_band/v1_0/routes.py", line 221, in invitation_receive
    result = await oob_mgr.receive_invitation(
  File "/Users/timo/Developer/Work/Projects/AFJ/aries-cloudagent-python/aries_cloudagent/protocols/out_of_band/v1_0/manager.py", line 563, in receive_invitation
    raise OutOfBandManagerError(
aries_cloudagent.protocols.out_of_band.v1_0.manager.OutOfBandManagerError: No existing connection exists and handshake_protocol is missing
2022-02-21 13:40:13,203 aries_cloudagent.admin.server ERROR Handler error with exception: No existing connection exists and handshake_protocol is missing

=================

Here's the endpoints I'm calling (doesn't need any setup):

POST /present-proof-2.0/create-request

{
  "presentation_request": {
    "indy": {
      "name": "Proof request",
      "requested_attributes": {
        "additionalProp1": {
          "name": "favouriteDrink",
          "restrictions": []
        }
      },
      "requested_predicates": {},
      "version": "1.0"
    }
  }
}

POST /out-of-band/create-invitation

Replace id with the pres_ex_id from previous step

{
  "attachments": [
    {
      "id": "8aa67942-7d92-444b-984b-215782cbc3aa",
      "type": "present-proof"
    }
  ]
}

POST /out-of-band/receive-invitation

Replace body with invitation from previous step

{
    "@type": "did:sov:BzCbsNYhMrjHiqZDTUASHg;spec/out-of-band/1.0/invitation",
    "@id": "dc81a186-908a-449a-a2b5-d8ed1a0c6a88",
    "label": "Aries Cloud Agent",
    "services": [
      {
        "id": "#inline",
        "type": "did-communication",
        "recipientKeys": [
          "did:key:z6MkrBLdrjur8fgA9TGSCXaKNoU8zi3hiu1hozfbgLALfXty"
        ],
        "serviceEndpoint": "ws://localhost:4000"
      }
    ],
    "requests~attach": [
      {
        "@id": "request-0",
        "mime-type": "application/json",
        "data": {
          "json": {
            "@type": "did:sov:BzCbsNYhMrjHiqZDTUASHg;spec/present-proof/2.0/request-presentation",
            "@id": "9203ebcc-e54c-4a61-9a4a-6ede677a3b6d",
            "request_presentations~attach": [
              {
                "@id": "indy",
                "mime-type": "application/json",
                "data": {
                  "base64": "eyJuYW1lIjogIlByb29mIHJlcXVlc3QiLCAicmVxdWVzdGVkX2F0dHJpYnV0ZXMiOiB7ImFkZGl0aW9uYWxQcm9wMSI6IHsibmFtZSI6ICJmYXZvdXJpdGVEcmluayIsICJyZXN0cmljdGlvbnMiOiBbXX19LCAicmVxdWVzdGVkX3ByZWRpY2F0ZXMiOiB7fSwgInZlcnNpb24iOiAiMS4wIiwgIm5vbmNlIjogIjEwNzI2NDI0ODkxMTI2OTA4OTAyMTk0NyJ9"
                }
              }
            ],
            "will_confirm": true,
            "formats": [
              {
                "attach_id": "indy",
                "format": "hlindy/[email protected]"
              }
            ]
          }
        }
      }
    ]
  }
@swcurran
Copy link
Contributor

@shaangill025, @andrewwhitehead -- we need to get this going. Anything related to OOB support and DID Exchange needs to be ready in ACA-Py as soon as possible, as we do the Community Transition from Connections.

@TimoGlastra
Copy link
Contributor Author

@shaangill025 or @andrewwhitehead is one of you already working on this? If not, I can take a look at this.

@swcurran
Copy link
Contributor

@TimoGlastra -- I would say go ahead. I don't think this is high on the list.

@swcurran
Copy link
Contributor

But as I read my previous statement and think about it -- it needs to be higher. :-(

@TimoGlastra TimoGlastra self-assigned this Mar 14, 2022
@shaangill025
Copy link
Contributor

@TimoGlastra I can take this on today if you haven't already started working on this?

@TimoGlastra
Copy link
Contributor Author

TimoGlastra commented Mar 16, 2022

I already started the work. It's more work than I initially thought, so I may hand it off if I run out of time :)

But I'll try to finish it first. Thanks!

@shaangill025
Copy link
Contributor

With #1676 , I have fixed an issue where unused connections were not deleted when OOB invitation contains request attachments. This might relate to your current work.

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 a pull request may close this issue.

3 participants