aries-cloudagent-python icon indicating copy to clipboard operation
aries-cloudagent-python copied to clipboard

feat: add new format and implement VCDICredFormatHandler

Open gvelez17 opened this issue 1 year ago • 7 comments

  • add VC_DI in CredFormat.Format
  • lay out VCDICredFormatHandler
  • add new schema classes for cred offer and request
  • implement CredExRecordVCDI
  • fix schemas on cred_abstract and cred_request, improve on vc_di support on alice-faber demo

next step

fix unittests issues

Note: this is a rebased version of @tra371 's pr #2759

gvelez17 avatar Mar 08 '24 10:03 gvelez17

Overall this looks good to me, but do we also want to add some readme/markdown about what VC_DI is and how to get the verifiable credential out or how it can interoperate with other wallets? we could also do that separtely from the repo or later, but i'd like to make sure new folks have an idea why, when and how to use them?

gvelez17 avatar Mar 08 '24 12:03 gvelez17

@dhh1128 would greatly appreciate (and recognize) your guideance here to get this over the line nicely, if you have any suggestions.

gvelez17 avatar Mar 08 '24 12:03 gvelez17

@ianco do we care that we don't have codecov? should we worry if we actually covered all the new stuff?

ha i will stop being noisy now - thanks all for feedbacks!!!

gvelez17 avatar Mar 08 '24 12:03 gvelez17

@ianco do we care that we don't have codecov? should we worry if we actually covered all the new stuff?

Personally I'm not too concerned about the level of code coverage as long as we have good integration tests. However we do need a minimal set of unit tests to confirm that the code works. I did a quick review of the code and it doesn't look like there are any new tests (?) in this PR yet.

Regarding the broken tests, many are throwing a "StopAsyncIteration" error - for example:

./scripts/run_tests aries_cloudagent/protocols/issue_credential/v2_0/tests/test_routes.py::TestV20CredRoutes::test_credential_exchange_issue

... raises this error. I'm not sure the cause (it's raised during a "mock" call) but I suggest we focus on getting the demo working (see my comments about the credential proposal format), and once we confirm the demo is working properly we can revisit the tests.

ianco avatar Mar 08 '24 16:03 ianco

@ianco do we care that we don't have codecov? should we worry if we actually covered all the new stuff?

Personally I'm not too concerned about the level of code coverage as long as we have good integration tests. However we do need a minimal set of unit tests to confirm that the code works.

mmm yeah usually I am lazy and start by looking at the codecov report, to make sure those unit tests are added. @tra371 if you are back on do you want to try to just add some tests, or maybe run a quick local codecov and see where we are at - we need to make sure new code has tests; @supersonicwisd1 if you can focus on getting the demo working manually that might be good since you have it going

We did pass the integration tests which run alice-faber so we should be close now...just need the real presentation format maybe

gvelez17 avatar Mar 08 '24 16:03 gvelez17

We did pass the integration tests which run alice-faber so we should be close now...just need the real presentation format maybe

There aren't any integration tests for the new VC_DI format tho ...

ianco avatar Mar 08 '24 23:03 ianco

Declaring some of my assumptions as preamble to a question:

  • VCDI format supports many credential formats
  • First target format to support is AnonCreds in W3C format

As currently structured, this strictly supports only AnonCreds format, right? In the future, what will be required to add support for issuing, say, DIP-VC or JWT-VC? Is there anything we can or should do now to make that easier for us later?

dbluhm avatar Mar 14 '24 14:03 dbluhm

As currently structured, this strictly supports only AnonCreds format, right? In the future, what will be required to add support for issuing, say, DIP-VC or JWT-VC? Is there anything we can or should do now to make that easier for us later?

Keeping in mind that this initial work is being done under a Code With Us (https://marketplace.digital.gov.bc.ca/opportunities/code-with-us/7afcbd7c-2bbc-41ed-bf27-b6ba6e2903c5) we need to be mindful of scope creep. @swcurran what do you think? My preference would be to keep the initial use case as simple as possible.

ianco avatar Mar 14 '24 15:03 ianco

As currently structured, this strictly supports only AnonCreds format, right? In the future, what will be required to add support for issuing, say, DIP-VC or JWT-VC? Is there anything we can or should do now to make that easier for us later?

Keeping in mind that this initial work is being done under a Code With Us (https://marketplace.digital.gov.bc.ca/opportunities/code-with-us/7afcbd7c-2bbc-41ed-bf27-b6ba6e2903c5) we need to be mindful of scope creep. @swcurran what do you think? My preference would be to keep the initial use case as simple as possible.

We're more than happy to structure for future extensibility, not concerned with scope creep if we can possibly complete after the formal approvals (once we get to there!)

do you guys have specific suggestions about structuring this for extensibility?

gvelez17 avatar Mar 14 '24 19:03 gvelez17

Agree that we will need future extensibility with this, so if there are some things that are obvious and easy, let’s do them. But highest priority is delivery the AnonCreds in W3C VCDM, so that’s the current focus. I can’t answer Golda’s question about specifics to do, but if others have suggestions, please add them. Thanks!!!

swcurran avatar Mar 14 '24 20:03 swcurran

I should add that the goal would be to transition from the existing 0592 and 0593 Credential Attachment RFCs for both legacy AnonCreds and JSON-LD VCs (and 0771 AnonCreds) to the VC-DI attachments. It will take some time, but that is the goal.

swcurran avatar Mar 14 '24 21:03 swcurran

, DIP-VC or JWT-VC

hey @dbluhm we are definitely interested in this after we get the first stage working, if we can plan a sync to understand your thoughts on it. @tra371 @clehner

gvelez17 avatar Mar 18 '24 16:03 gvelez17

@gvelez17 I was hoping you might have recommendations for where the right points in the implementation would be to extend later to support other credential formats and signature types.

dbluhm avatar Mar 18 '24 19:03 dbluhm

@gvelez17 I was hoping you might have recommendations for where the right points in the implementation would be to extend later to support other credential formats and signature types.

hey Daniel is this still relevent based on the conversation in Anoncreds working group today that V2 will always default to a W3C compliant format? Are we moving more towards a consensus format rather than ability to plug in many? Happy to still look at this however will give some suggestions

gvelez17 avatar Mar 25 '24 14:03 gvelez17

Quality Gate Passed Quality Gate passed

Issues
0 New issues
0 Accepted issues

Measures
0 Security Hotspots
No data about Coverage
No data about Duplication

See analysis details on SonarCloud

sonarqubecloud[bot] avatar Mar 25 '24 16:03 sonarqubecloud[bot]

@gvelez17 I was hoping you might have recommendations for where the right points in the implementation would be to extend later to support other credential formats and signature types.

hey Daniel is this still relevent based on the conversation in Anoncreds working group today that V2 will always default to a W3C compliant format? Are we moving more towards a consensus format rather than ability to plug in many? Happy to still look at this however will give some suggestions

Yes; the VCDI credential attachment format is explicitly capable of issuing credentials with multiple cryptosuites, of which, AnonCreds is just one variety. We will want to be able to support signing credentials with other cryptosuites besides just AnonCreds.

dbluhm avatar Mar 25 '24 18:03 dbluhm

New PR: https://github.com/hyperledger/aries-cloudagent-python/pull/2861

sarthakvijayvergiya avatar Mar 31 '24 23:03 sarthakvijayvergiya

Closed in favor of https://github.com/hyperledger/aries-cloudagent-python/pull/2861

gvelez17 avatar Apr 01 '24 13:04 gvelez17