openwallet-foundation / credo-ts

Typescript framework for building decentralized identity and verifiable credential solutions
https://credo.js.org
Apache License 2.0
277 stars 202 forks source link

Issue Credential v2 issue tracker #747

Closed TimoGlastra closed 2 years ago

TimoGlastra commented 2 years ago

This issue tracks all outstanding tasks for ICv2:

// do the action that will trigger the event aliceProofRecord = await aliceAgent.proofs.acceptRequest(acceptPresentationOptions)

// wait for the event proofRecord = await faberProofRecordPromise

- [ ] accepting a proposal should take the credential definition id from the proposal to send a credential offer (if availalbe on the proposal). This functionality was there for v1 (and still is: https://github.com/hyperledger/aries-framework-javascript/blob/main/packages/core/src/modules/credentials/protocol/v1/V1CredentialService.ts#L204-L205), but itsn't present in v2. We should probably extract this from the proposal in the indy credential format service so we can reuse it across the v1 and v2 implementation. Currently throws an error that it is missing the credential definition id. It also means the user has to retrieve the message and extract the credential definition from the proposal themselves.
- [ ] Same for the attributes, it shouldn't be required to pass the attributes when accepting a proposal as we can take them from the proposal (but should be optional for the case where there was no proposal preview and thus no attributes)
- [ ] The proposal data attachment for indy is put in the message as follows:
```ts
{
    schemaIssuerDid: '3msFQcrmEPJz5XetTn8bJB',
    issuerDid: '3msFQcrmEPJz5XetTn8bJB',
    schemaName: 'Schema_DriversLicense_v2',
    credentialDefinitionId: '3msFQcrmEPJz5XetTn8bJB:3:CL:130369:8129',
    schemaVersion: '1.0.1',
    schemaId: '3msFQcrmEPJz5XetTn8bJB:2:Schema_DriversLicense_v2:1.0.1'
  }

while the actual fields should be snake_case. I think this is related to the comment I made here: https://github.com/hyperledger/aries-framework-javascript/pull/649#discussion_r864594747. We should make sure to transform the class instance to json before putting it inside the attachment. This is quite important and completely breaks interop with ACA-Py

TimoGlastra commented 2 years ago

@NB-MikeRichardson using this to track everything related to issue credential v2. Please make a separate PR per item so the code review will be easier to do.

TimoGlastra commented 2 years ago

Branch I'm working on to integrate ICv2 into AATH: https://github.com/TimoGlastra/aries-agent-test-harness/tree/feat/afj-icv2

I've got it working between AFJ <-> AFJ, but as listed in the items above there are some issues with interop.

I've also created a PR that integrates the breaking changes introduced by the v2 merge and it seems we're still fully interoperable with ACA-Py for ICv1. Nice!