aries-cloudagent-python icon indicating copy to clipboard operation
aries-cloudagent-python copied to clipboard

Support for `did:web` in out-of band invitations

Open FilipRazek-archipels opened this issue 1 year ago • 0 comments

The PR #1866 added support for a universal resolver flag, which allows Acapy to resolve more did methods. However, when receiving an out-of-band invitation, the agent currently expects one of two options in the service field:

  • Either a service block, which contains an endpoint, recipientKeys...
  • Or a string, which is interpreted as a did:peer or a did:sov DID, extracting the public DID from the field to construct the service block
# acapy_agent/protocols/out_of_band/v1_0/manager.py:1048
service = invitation.services[0]
public_did = None
if isinstance(service, str):
    # If it's in the did format, we need to convert to a full service block
    # An existing connection can only be reused based on a public DID
    # in an out-of-band message (RFC 0434).
    # OR did:peer:2 or did:peer:4.

    if service.startswith("did:peer"):
        public_did = service
        if public_did.startswith("did:peer:4"):
            public_did = self.long_did_peer_to_short(public_did)
    else:
        public_did = service.split(":")[-1]

However, this does not work for did:web, which are interpreted as public DIDs (which they aren't), and not as URLs. Is this a bug or am I misunderstanding something about the format of DIDs expected by Acapy? Thanks

FilipRazek-archipels avatar Dec 04 '24 14:12 FilipRazek-archipels