hyperledger / aries-cloudagent-python

Hyperledger Aries Cloud Agent Python (ACA-Py) is a foundation for building decentralized identity applications and services running in non-mobile environments.
https://wiki.hyperledger.org/display/aries
Apache License 2.0
403 stars 510 forks source link

recipientKeys and routingKeys format don't match RFCs #1106

Closed Moopli closed 3 weeks ago

Moopli commented 3 years ago

The DIDComm/DID doc conventions for services state that recipientKeys and routingKeys are arrays of DID key references, rather than arrays of raw key values.

swcurran commented 3 years ago

@shaangill025 -- can you take this?

Must make sure that on receipt, ACA-Py handles both forms, so existing connections still work. I would think we would want to handle this by using the "AIP 2.0" config flag to use the new DID Key references, and when not active, continue to send what is being sent today.

Does that make sense?

@andrewwhitehead -- thoughts?

andrewwhitehead commented 3 years ago

This needs to be looked at as part of the new peer DID document handling. We simply need to construct the document according to one of the peer DID methods (probably method 1) prior to sending a did-exchange request or response, and be able to receive and handle DID documents in this format. The connections protocol will keep using the old DID document format. The new pydid dependency may be able to help with this.

domwoe commented 3 years ago

Hey @andrewwhitehead, this does not only relate to peer DID document handling, but also if ACA-Py supports receiving a DIDX Request containing a public DID (see my comment in #1104). This is currently not supported, but is described in the RFC.

Currently, resolution of public DIDs is only handled in invitations using the DID resolver with the following method: https://github.com/hyperledger/aries-cloudagent-python/blob/52960be1ca87fbb3b48eef9a737e297c8eb5cff9/aries_cloudagent/connections/base_manager.py#L210 which returns only the information needed in https://github.com/hyperledger/aries-cloudagent-python/blob/52960be1ca87fbb3b48eef9a737e297c8eb5cff9/aries_cloudagent/connections/base_manager.py#L267 and no did document record is created.

Of course, when receiving a DIDX with a public DID, there is not only the question in which format we persist and use the did doc, but also what would be the strategy to keep the local did doc up to date.