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

Add format specific issue credential set up endpoint / step #197

Open TimoGlastra opened 3 years ago

TimoGlastra commented 3 years ago

I had some trouble to make the issue concise, but the TLDR is that I suggest to add format specific issuance set up endpoints.


I'm adding tests for the new Linked data proofs format to the test harness and have some ideas on how we could make it easier for the test harness to be a bit more did / credential format agnostic.

The main problem I'm running into is that only one public did is supported that is used for all tests and Indy specific calls are made.

I think with changing some API endpoints we can make it a lot easier for non-indy agents to integrate, and also make it future proof that when a new format is added this doesn't require breaking changes to current endpoints.

Format specific prepare step

So instead of:

Given "Acme" has a public did
And "Acme" is ready to issue a credential

That does the following:

We add a format specific API call that handles everything related to it. e.g. /agent/command/issue-credential/setup/{format}

Looking at this comment, this is already the way you wanted to go:

# TODO remove these references to schema and cred def, move them to one call to the API and let the Backchannel take care of what to do to be ready to issue a credential

Indy

Given "alice" is ready to issue an "indy" credential

Request

Data to create schema / cred def / etc...

{
  "schema": {
      "attributes": []
  },
  "credential_definition": {
      "supports_revocation": true
  }
}

Response

{
  "schema": {
      // or whatever structure we need
      "schema_id": "aaaa"
  },
  "credential_definition": {
      "credential_definition_id": ""
  }
  "issuer_did": "issuer_did"
}

This data can then be used to issue indy specific credentials. The public endpoint did is removed, as the did to be used is specific for the test / format / credential being issued.

For backwards compat we can keep the current flow for the indy credential flow, but use the new flow for ld proofs, and then later move indy. But it should be "trivial" to move as the endpoints already exist separately, just need to merge them.

LD Proof

Given "alice" is ready to issue a "json-ld" credential

This could contain necessary information for the json-ld format.

Request

{
  "method": "key" # or sov or ethr ...
}

Response

{
  "issuer_did": "did:key:zXXXXXXX"
}

We can then store the cred format specific data in context to be used. Public DIDs are now associated with schema's that are not for json-ld credentials.

swcurran commented 3 years ago

I agree.