openwallet-foundation / acapy

ACA-Py is a foundation for building decentralized identity applications and services running in non-mobile environments.
https://aca-py.org
Apache License 2.0
412 stars 512 forks source link

Anoncreds issuer - parameter mismatch issuer_id vs issuer_did #2657

Closed ianco closed 9 months ago

ianco commented 10 months ago

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

Should the anoncreds method in aca-py be updated to accept issuer_did or should the AATH backchannel be updated?

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'
swcurran commented 10 months ago

Sorry — wrong comment previously — deleted.

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.

ianco commented 10 months ago

OK I'll take a look at AATH, I expect we'll need to leave issuer_did when running with askar tho (askar-non-anoncreds) ...

... actually I'll log an issue in AATH. This affects all the backchannels, depending on if we change the test cases, or we require each backchannel to understand what to do with issuer_did vs issuer_id ...

ianco commented 10 months ago

AATH issue https://github.com/hyperledger/aries-agent-test-harness/issues/747

jamshale commented 9 months ago

I'm working on this in tandem with hyperledger/aries-agent-test-harness/issues/748 . They are both required to get the tests working.

jamshale commented 9 months ago

Closing this ticket. The discrepancy it handled correctly internally and the only change that was needed in the test harness for this was to send a correct filters payload with "filters": { "indy": {"cred_def_id": "replace_me"}}.