openwallet-foundation / owl-agent-test-harness

Aries agent test framework, with agent backchannel support
https://aries-interop.info
Apache License 2.0
60 stars 66 forks source link

Anoncreds issuer_did vs issuer_id #747

Closed ianco closed 10 months ago

ianco commented 12 months ago

This issue came up when testing with aca-py, with the new anoncreds-code. @swcurran provides the following background:

It should be updated in AATH. In the AnonCreds spec, we neutralized the ID from explicitly being a DID to simply being being an ID.

In this method, the anoncreds issuer expects an issuer_id, however the AATH tests are passing in an issuer_did:

https://github.com/hyperledger/aries-cloudagent-python/blob/main/aries_cloudagent/anoncreds/issuer.py#L452

AATH:

BACKCHANNEL_EXTRA_acapy_main="{\"wallet-type\":\"askar-anoncreds\"}" ./manage run -d acapy-main -t @T001-RFC0454 -t @CredFormat_Indy

Stack trace:

2023-12-07 17:36:11,815 aries_cloudagent.admin.server DEBUG Incoming request: POST /issue-credential-2.0/records/de842a99-9eda-4469-af01-720c4e23c833/send-offer
2023-12-07 17:36:11,816 aries_cloudagent.admin.server DEBUG Match info: <MatchInfo {'cred_ex_id': 'de842a99-9eda-4469-af01-720c4e23c833'}: <ResourceRoute [POST] <DynamicResource  /issue-credential-2.0/records/{cred_ex_id}/send-offer> -> <function credential_exchange_send_bound_offer at 0x7fa88aa46d30>>
2023-12-07 17:36:11,816 aries_cloudagent.admin.server DEBUG Body: None
2023-12-07 17:36:11,823 aries_cloudagent.core.dispatcher ERROR Handler error: credential_exchange_send_bound_offer
Traceback (most recent call last):
  File "/usr/local/lib/python3.9/asyncio/tasks.py", line 256, in __step
    result = coro.send(None)
  File "/usr/local/lib/python3.9/site-packages/aries_cloudagent/protocols/issue_credential/v2_0/routes.py", line 1116, in credential_exchange_send_bound_offer
    (cred_ex_record, cred_offer_message) = await cred_manager.create_offer(
  File "/usr/local/lib/python3.9/site-packages/aries_cloudagent/protocols/issue_credential/v2_0/manager.py", line 230, in create_offer
    await cred_format.handler(self.profile).create_offer(
  File "/usr/local/lib/python3.9/site-packages/aries_cloudagent/protocols/issue_credential/v2_0/formats/indy/handler.py", line 225, in create_offer
    return await self.anoncreds_handler.create_offer(cred_proposal_message)
  File "/usr/local/lib/python3.9/site-packages/aries_cloudagent/protocols/issue_credential/v2_0/formats/anoncreds/handler.py", line 198, in create_offer
    cred_def_id = await issuer.match_created_credential_definitions(
TypeError: match_created_credential_definitions() got an unexpected keyword argument 'issuer_did'
2023-12-07 17:36:11,824 aries_cloudagent.admin.server ERROR Handler error with exception: match_created_credential_definitions() got an unexpected keyword argument 'issuer_did'

issuer_did is referenced in the test harness code as well as many backchannels, how should this be updated in AATH to support the new anoncreds spec? Should each backchannel need to understand issuer_did vs issuer_id?

ianco commented 12 months ago

See aca-py issue https://github.com/hyperledger/aries-cloudagent-python/issues/2657

jamshale commented 10 months ago

Closing this as we have tests working that handle this scenario. The discrepancy was actually handled internally by acapy but the tests needed to be updated to avoid using issuer_did in the filters payload when creating presentations and proofs. Anoncreds expects to just have a filter like {"filters": {"indy": {"cred_def_id": "replace_me"}}