Add support for revocable credentials in vc_di handler
This line is incorrect: https://github.com/hyperledger/aries-cloudagent-python/pull/2967/files#diff-f7d9c8d89f2442a02ac7a5924be4046e195d411791e4cbfd0fd9e7e2ecb987adL557
if cred["proof"][0].get("rev_reg_id"):
You can fetch these attributes from the credential, see for example:
https://github.com/ianco/aries-cloudagent-python/commit/1903eb6d45000ff57b65a2470bcf747adc8e5a39
(Not the most elegant approach but you can use it as an example)
FYI the SonarCloud errors (if you don't have access to the details) are:
Failed conditions
[42.2% Coverage on New Code](https://sonarcloud.io/component_measures?id=hyperledger_aries-cloudagent-python&pullRequest=2967&metric=new_coverage&view=list) (required ≥ 80%)
[24.7% Duplication on New Code](https://sonarcloud.io/component_measures?id=hyperledger_aries-cloudagent-python&pullRequest=2967&metric=new_duplicated_lines_density&view=list) (required ≤ 3%)
The coverage is just related to the unit tests. The duplication is on the new create_credential_w3c() method which duplicates a lot of the existing create_credential() code (mostly the blocks around the revocation registry handling, which could be re-factored into helper methods).
Thanks for reviewing, im editing it and i will push asap
@EmadAnwer the coverage test is still failing on the VCDICredFormatHandler class (in formats/vc_di/handler.py).
There are a couple of unit tests already that are marked as "skipped" (since they were added before revocation was implemented, I suspect just copied form the indy version of the unit test) - async def test_issue_credential_revocable(self): and async def test_issue_credential_non_revocable(self): - can you take a look at those and see what it would take to make these work with your updated revocation support?
Otherwise everything in the PR looks good to me.
@EmadAnwer the coverage test is still failing on the
VCDICredFormatHandlerclass (informats/vc_di/handler.py).There are a couple of unit tests already that are marked as "skipped" (since they were added before revocation was implemented, I suspect just copied form the
indyversion of the unit test) -async def test_issue_credential_revocable(self):andasync def test_issue_credential_non_revocable(self):- can you take a look at those and see what it would take to make these work with your updated revocation support?Otherwise everything in the PR looks good to me.
@ianco Thanks for the review and suggestions, sure I will take a look into it and update the PR
@EmadAnwer it looks like the most recent commit (removing the dup code) is missing the DCO signoff
Quality Gate passed
Issues
2 New issues
0 Accepted issues
Measures
0 Security Hotspots
87.5% Coverage on New Code
0.0% Duplication on New Code
@jamshale I've merged the PR, I'll look at updating the tags on the integration tests later ...